diff sites/all/modules/semanticviews/semanticviews-view-fields.tpl.php @ 4:ce11bbd8f642

added modules
author danieleb <danielebarchiesi@me.com>
date Thu, 19 Sep 2013 10:38:44 +0100
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sites/all/modules/semanticviews/semanticviews-view-fields.tpl.php	Thu Sep 19 10:38:44 2013 +0100
@@ -0,0 +1,55 @@
+<?php
+/**
+ * @file semanticviews-view-fields.tpl.php
+ * Default simple view template to display all the fields as a row. The template
+ * outputs a full row by looping through the $fields array, printing the field's
+ * HTML element (as configured in the UI) and the class attributes. If a label
+ * is specified for the field, it is printed wrapped in a <label> element with
+ * the same class attributes as the field's HTML element.
+ *
+ * - $view: The view in use.
+ * - $fields: an array of $field objects. Each one contains:
+ *   - $field->content: The output of the field.
+ *   - $field->raw: The raw data for the field, if it exists. This is NOT output
+ *     safe.
+ *   - $field->element_type: The HTML element wrapping the field content and
+ *     label.
+ *   - $field->attributes: An array of attributes for the field wrapper.
+ *   - $field->handler: The Views field handler object controlling this field.
+ *     Do not use var_export to dump this object, as it can't handle the
+ *     recursion.
+ * - $row: The raw result object from the query, with all data it fetched.
+ *
+ * @see template_preprocess_semanticviews_view_fields()
+ * @ingroup views_templates
+ * @todo Justify this template. Excluding the PHP, this template outputs angle
+ * brackets, the label element, slashes and whitespace.
+ */
+?>
+<?php foreach ($fields as $id => $field): ?>
+
+  <?php if ($field->element_type): ?>
+    <<?php print $field->element_type; ?><?php print drupal_attributes($field->attributes); ?>>
+  <?php endif; ?>
+
+    <?php if ($field->label): ?>
+
+      <?php if ($field->label_element_type): ?>
+        <<?php print $field->label_element_type; ?><?php print drupal_attributes($field->label_attributes); ?>>
+      <?php endif; ?>
+
+          <?php print $field->label; ?>:
+
+      <?php if ($field->label_element_type): ?>
+        </<?php print $field->label_element_type; ?>>
+      <?php endif; ?>
+
+    <?php endif; ?>
+
+      <?php print $field->content; ?>
+
+  <?php if ($field->element_type): ?>
+    </<?php print $field->element_type; ?>>
+  <?php endif; ?>
+
+<?php endforeach; ?>