**Note** Any class attributes you input will be concatenated and rendered as the class attribute's value in the template. For example, your valid input `row node blog` as the class attribute for a `div` element will be rendered as `<div class="row node blog">`.
-### View ID attribute
-
-The View ID attribute is inserted in the outermost wrapping `<div>` of the view. This affects only the display plugins that come with Views 2--default, page, block and attachment--and any other display plugins whose theme is `views_view`.
-
### Grouping title
For Views where the results are grouped, the HTML **element** and **class attribute** can be specified for the element that wraps the title.
Author and credit
=================
-Developer:
+Developer:
Benjamin Doherty "bangpound" <http://drupal.org/user/16496>
-Documentation and Advanced Help:
+Documentation and Advanced Help:
Heather James "heather" <http://drupal.org/user/740>
<p><strong>Note</strong> Any class attributes you input will be concatenated and rendered as the class attribute's value in the template. For example, your valid input <code>row node blog</code> as the class attribute for a <code>div</code> element will be rendered as <code><div class="row node blog"></code>.</p>
-<h3>View ID attribute</h3>
-
-<p>The View ID attribute is inserted in the outermost wrapping <code><div></code> of the view. This affects only the display plugins that come with Views 2--default, page, block and attachment--and any other display plugins whose theme is <code>views_view</code>.</p>
-
<h3>Grouping title</h3>
<p>For Views where the results are grouped, the HTML <strong>element</strong> and <strong>class attribute</strong> can be specified for the element that wraps the title.</p>
+++ /dev/null
-<?php
-// $Id$
-/**
- * @file semanticviews-view.tpl.php
- * Main view template
- *
- * Variables available:
- * - $css_name: A css-safe version of the view name.
- * - $header: The view header
- * - $footer: The view footer
- * - $rows: The results of the view query, if any
- * - $empty: The empty text to display if the view is empty
- * - $pager: The pager next/prev links to display, if any
- * - $exposed: Exposed widget form/info to display
- * - $feed_icon: Feed icon to display, if any
- * - $more: A link to view more, if any
- * - $admin_links: A rendered list of administrative links
- * - $admin_links_raw: A list of administrative links suitable for theme('links')
- *
- * @ingroup views_templates
- */
-?>
-<div<?php print drupal_attributes($attributes); ?>>
- <?php if ($admin_links): ?>
- <div class="views-admin-links views-hide">
- <?php print $admin_links; ?>
- </div>
- <?php endif; ?>
- <?php if ($header): ?>
- <div class="view-header">
- <?php print $header; ?>
- </div>
- <?php endif; ?>
-
- <?php if ($exposed): ?>
- <div class="view-filters">
- <?php print $exposed; ?>
- </div>
- <?php endif; ?>
-
- <?php if ($attachment_before): ?>
- <div class="attachment attachment-before">
- <?php print $attachment_before; ?>
- </div>
- <?php endif; ?>
-
- <?php if ($rows): ?>
- <div class="view-content">
- <?php print $rows; ?>
- </div>
- <?php elseif ($empty): ?>
- <div class="view-empty">
- <?php print $empty; ?>
- </div>
- <?php endif; ?>
-
- <?php if ($pager): ?>
- <?php print $pager; ?>
- <?php endif; ?>
-
- <?php if ($attachment_after): ?>
- <div class="attachment attachment-after">
- <?php print $attachment_after; ?>
- </div>
- <?php endif; ?>
-
- <?php if ($more): ?>
- <?php print $more; ?>
- <?php endif; ?>
-
- <?php if ($footer): ?>
- <div class="view-footer">
- <?php print $footer; ?>
- </div>
- <?php endif; ?>
-
- <?php if ($feed_icon): ?>
- <div class="feed-icon">
- <?php print $feed_icon; ?>
- </div>
- <?php endif; ?>
-
-</div> <?php /* class view */ ?>
}
}
}
-
-function semanticviews_theme_registry_alter(&$theme_registry) {
- if (isset($theme_registry['views_view'])) {
-
- // Add the module's path to the theme paths.
- if (isset($theme_registry['views_view']['theme paths'])) {
- $module_path = drupal_get_path('module', 'semanticviews');
- array_push($theme_registry['views_view']['theme paths'], $module_path);
- }
-
- // Add an additional preprocess function to the theme info.
- if (isset($theme_registry['views_view']['preprocess functions'])) {
- $module_path = drupal_get_path('module', 'semanticviews');
- array_push($theme_registry['views_view']['preprocess functions'], 'template_preprocess_semanticviews_view');
- }
- }
-}
-
-/**
- * The class attributes of the outer div of a View cannot be changed when the
- * view uses AJAX. The Views ajax scripts need these classes to attach
- * behaviors.
- * - view-dom-id-%
- * OR
- * - view-id-% and view-display-id-%
- *
- * @see template_preprocess_views_view
- * @see ajax_view.js
- *
- * @param <type> $variables
- */
-function template_preprocess_semanticviews_view(&$variables) {
- if ($variables['view']->plugin_name == 'semanticviews_default') {
- $variables['template_file'] = 'semanticviews-view';
- $variables['attributes'] = array();
-
- // Container class attributes are stacked in an array.
- $classes = array();
-
- // TODO: Bring class attribute into UI for configuration.
- // Admin links require views have class attribute 'view'
- $classes[] = 'view';
- if ($variables['view']->use_ajax) {
-
- // The old way Ajax Views were selected for behaviors.
- //$classes[] = 'view-'. $variables['css_name'];
- //$classes[] = 'view-id-'. $variables['name'];
- //$classes[] = 'view-display-id-'. $variables['display_id'];
-
- // The new way.
- $classes[] = 'view-dom-id-'. $variables['dom_id'];
- }
- if (!empty($classes)) {
- $variables['attributes']['class'] = implode(' ', $classes);
- }
- if ($variables['view']->style_options['id']) {
- // TODO: Prevent ID collision. Or not?
- $variables['attributes']['id'] = $variables['view']->style_options['id'];
- }
- }
-}
function option_definition() {
$options = parent::option_definition();
- $options['id'] = array('default' => '');
-
// Group option definition.
$options['group'] = array(
'contains' => array(
*/
function options_form(&$form, &$form_state) {
parent::options_form($form, $form_state);
- $form['id'] = array(
- '#type' => 'textfield',
- '#title' => t('View ID attribute'),
- '#default_value' => $this->options['id'],
- '#description' => 'This only works with views display plugins that use the default theme views-view.tpl.php. This includes the default, page, block, and attachment displays.',
- );
// Group options.
$form['group'] = array(