function gallery_assist_set_item_to_cover in Gallery Assist 6
Set the gallery cover directly from the gallery page view.
@global <type> $user
Parameters
<type> $node:
<type> $pid:
1 string reference to 'gallery_assist_set_item_to_cover'
- gallery_assist_menu in ./
gallery_assist.module - Implementation of hook_menu().
File
- ./
gallery_assist.module, line 527 - Drupal content type with gallery functionality.
Code
function gallery_assist_set_item_to_cover($node, $pid) {
global $user;
if ($node->gallitems[$pid]->cover == 0) {
gallery_assist_cover_updater($node, $pid);
db_query("DELETE FROM {cache_gallery_assist_data} WHERE cid = %d", $node->nid);
}
$url = $_SERVER['HTTP_REFERER'];
drupal_goto($url);
}