You are here

views-view-sgrid.tpl.php in Sortable Grid Views Plugin 6

Same filename and directory in other branches
  1. 7 views-view-sgrid.tpl.php

views-view-list.tpl.php Default simple view template to display a list of rows.

  • $title : The title of this group of rows. May be empty.
  • $options['type'] will either be ul or ol.

File

views-view-sgrid.tpl.php
View source
<?php

/**
 * @file views-view-list.tpl.php
 * Default simple view template to display a list of rows.
 *
 * - $title : The title of this group of rows.  May be empty.
 * - $options['type'] will either be ul or ol.
 * @ingroup views_templates
 */

// Is the user allowed to sort Sortable Grids ?
drupal_add_js(array(
  'sgrid' => array(
    'sort_order' => array(),
    'row_length' => $row_length,
    'sort_allowed' => user_access('sort Sortable Grid Views'),
  ),
), 'setting');
$jq_path = drupal_get_path('module', 'jquery_ui') . '/jquery.ui/ui/';
drupal_add_js($jq_path . 'ui.core.js');
drupal_add_js($jq_path . 'ui.draggable.js');
drupal_add_js($jq_path . 'ui.sortable.js');
drupal_add_js(drupal_get_path('module', 'sgrid') . '/sgrid.js');
drupal_add_css(drupal_get_path('module', 'sgrid') . '/sgrid.css');
print $wrapper_prefix;
?>
  <?php

if (!empty($title)) {
  ?>
    <h3><?php

  print $title;
  ?></h3>
  <?php

}
?>
  <?php

print $list_type_prefix;
?>
    <?php

foreach ($rows as $id => $row) {
  ?>
<!-- Add the end of line class when necessary -->
    <?php

  if (isset($sgrid_end_of_line[$id])) {
    $classes[$id] .= $sgrid_end_of_line[$id];
  }
  ?>
       <li class="<?php

  print $classes[$id];
  ?>"><?php

  print $row;
  ?></li>
    <?php

}
?>
  <?php

print $list_type_suffix;
print $wrapper_suffix;