function image_gallery_handler_field_gallery_cover::init in Image 7
Same name and namespace in other branches
- 6 contrib/image_gallery/views/image_gallery_handler_field_gallery_cover.inc \image_gallery_handler_field_gallery_cover::init()
Init the handler with necessary data.
Parameters
view $view: The $view object this handler is attached to.
array $options: The item from the database; the actual contents of this will vary based upon the type of handler.
Overrides views_handler_field::init
File
- contrib/
image_gallery/ views/ image_gallery_handler_field_gallery_cover.inc, line 28
Class
- image_gallery_handler_field_gallery_cover
- Parent class for field handlers that gives us a gallery cover.
Code
function init(&$view, $options) {
parent::init($view, $options);
// Store the image gallery vocabulary ID.
$this->vid = _image_gallery_get_vid();
// The name of a key that is safe to use in $values to stash our nid.
// This is just a dummy that should be overridden.
// Groups of handlers that use the same query (eg, latest image and last
// update time) should override this to a safe key that they can share.
// This avoids running the query/ies to get the cover nid multiple times for
// each row of the view.
// TODO: doesn't work and probably can't ever, because if the user adds more
// than one cover image, we can't reliably create a unique key here that
// another field can know to find.
/*
if ($this->definition['cover group']) {
$this->cover_stash = $this->definition['cover group'];
}
else {
$this->cover_stash = 'image_gallery_cover';
}
*/
}