t('Gallery page settings'), ); } /** * Embed the gallery term view above the normal rendering of this view. */ function render() { // Check the current gallery view has a tid argument. if (isset($this->view->argument['tid'])) { $args = $this->view->argument['tid']->value; // No argument means we are at the top-level gallery. // We need to pass an argument of 0 to the gallery terms view so it // shows only the top level. if (count($args) == 0) { // Have to pass as string, otherwise it gets eaten by views validation. $args = array(0 => '0'); } $this->gallery_terms_view = views_get_view('image_gallery_terms'); // Tack THIS view onto the gallery terms view. We don't do anything with // this yet, but other handlers might need it. $this->gallery_terms_view->embedding_view = &$this->view; $output = $this->gallery_terms_view->preview('default', $args); } // Render this view as normal. $output .= parent::render(); return $output; } /** * There are two special cases here: * - An empty view might have subgalleries. If that is the case we don't show * the empty text. * - Force the view title when no arguments are present. */ function render_empty() { drupal_set_title(filter_xss_admin($this->view->get_title())); if (count($this->gallery_terms_view->result) == 0) { return $this->render_textarea('empty'); } } }