function photos_photos_access in Album Photos 7.3
Same name and namespace in other branches
- 8.5 photos.module \photos_photos_access()
- 8.4 photos.module \photos_photos_access()
- 6.2 photos.module \photos_photos_access()
- 6.0.x photos.module \photos_photos_access()
Implements hook_photos_access().
File
- ./
photos.module, line 358 - Implementation of photos.module.
Code
function photos_photos_access() {
if (variable_get('photos_access_photos', 0)) {
if (arg(0) == 'photos' && arg(1) != 'get' && is_numeric(arg(2))) {
switch (arg(1)) {
case 'album':
case 'sub-album':
case 'zoom':
case 'sub-slide':
return array(
arg(2),
);
case 'image':
$nid = db_query("SELECT pid FROM {photos_image} WHERE fid = :fid", array(
':fid' => arg(2),
))
->fetchField();
return array(
$nid,
);
}
}
if (arg(0) == 'photos' && arg(1) == 'data' && is_numeric(arg(3))) {
return array(
arg(3),
);
}
}
}