function gallery_assist_check_public_status in Gallery Assist 6
Check the gallery public status.
Parameters
object $node:
object $user:
Return value
boolean
6 calls to gallery_assist_check_public_status()
- gallery_assist_display_item_default in ./
gallery_assist.module - Build the output to display each gallery image. Call the own pager and the theme.
- gallery_assist_nodeapi in ./
gallery_assist.module - Implementation of hook_nodeapi().
- _gallery_assist_block_display in ./
gallery_assist.module - Display the GA-Block Galleries (0).
- _gallery_assist_block_display_1 in ./
gallery_assist.module - Display the GA-Block My Galleries (1).
- _gallery_assist_block_display_2 in ./
gallery_assist.module - Display the GA-Block Gallery Block (2).
File
- ./
gallery_assist.module, line 3606 - Drupal content type with gallery functionality.
Code
function gallery_assist_check_public_status($node, $u, $op = 'default') {
if (empty($user)) {
global $user;
}
else {
$user = $u;
}
// switch ($op) {
// case 'default':
// $ga_public_status = $node->gallconf[$node->type]['ga_public_status'];
// break;
// case 'block':
// $ga_public_status = $node->ga_public_status;
// break;
// }
switch ($node->ga_public_status) {
case 'ur':
return TRUE;
case 2:
return TRUE;
case 1:
if ($user->uid == 1 || $node->uid == $user->uid) {
return TRUE;
}
else {
return FALSE;
}
case 0:
if ($user->uid != 0) {
return TRUE;
}
else {
return FALSE;
}
}
}