function subscriptions_arg in Subscriptions 2.0.x
Same name and namespace in other branches
- 6 subscriptions.module \subscriptions_arg()
- 7 subscriptions.module \subscriptions_arg()
Returns arg($index) in the proper way.
Parameters
int $index:
bool $member_name:
Return value
mixed
9 calls to subscriptions_arg()
- old_subscriptions_ui_can_subscribe in subscriptions_ui/
subscriptions_ui.module - Returns TRUE on node/NID pages if the NID is not blocked and no other module wants to provide the UI.
- old_subscriptions_ui_node_view in subscriptions_ui/
subscriptions_ui.module - Implements hook_node_view().
- subscriptions_form_user_profile_form_alter in ./
subscriptions.module.old.php - Implements hook_form_alter().
- subscriptions_init in ./
subscriptions.module.old.php - Implements hook_init().
- subscriptions_page_form in ./
subscriptions.admin.old.php - Display subscribed content data on the user and site subscriptions pages. @ TODO clean up all of these parts
File
- ./
subscriptions.module.old.php, line 1063 - Subscriptions module.
Code
function subscriptions_arg($index, $member_name = FALSE) {
if (($mgi = menu_get_item()) && isset($mgi['map'][$index])) {
$path_exploded = $mgi['map'];
}
else {
$path_exploded = explode('/', current_path());
}
$arg = NULL;
if (!empty($path_exploded[$index])) {
$arg = $path_exploded[$index];
if ($member_name) {
if (is_object($arg) && isset($arg->{$member_name})) {
$arg = $arg->{$member_name};
}
else {
$arg = NULL;
}
}
}
return $arg;
}