Skip to content

Commit

Permalink
#1 Patch files for PHP5.6
Browse files Browse the repository at this point in the history
  • Loading branch information
andystiller committed Jul 30, 2015
1 parent e8c9b53 commit d458a43
Showing 1 changed file with 171 additions and 0 deletions.
171 changes: 171 additions & 0 deletions patches/php5-6.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
From e8c9b53fd1db361ad487b4a7dc166f8adde59997 Mon Sep 17 00:00:00 2001
From: Andy Stiller <[email protected]>
Date: Thu, 30 Jul 2015 14:12:35 +0100
Subject: [PATCH] Patch files for PHP5.6

---
.../theme/views_views_json_style.theme.inc | 43 ++++++++++----------
.../all/modules/views_snippet/views_snippet.module | 14 +------
2 files changed, 23 insertions(+), 34 deletions(-)

diff --git a/htdocs/sites/all/modules/views_datasource/theme/views_views_json_style.theme.inc b/htdocs/sites/all/modules/views_datasource/theme/views_views_json_style.theme.inc
index d9a8d80..53418ef 100644
--- a/htdocs/sites/all/modules/views_datasource/theme/views_views_json_style.theme.inc
+++ b/htdocs/sites/all/modules/views_datasource/theme/views_views_json_style.theme.inc
@@ -6,16 +6,16 @@
* Views theme to render view fields as JSON.
*
* - $view: The view in use.
- * - $rows: Array of row objects as rendered by _views_json_render_fields
+ * - $rows: Array of row objects as rendered by _views_json_render_fields
* - $attachment: Not used currently
* - $options: The options for the style passed in from the UI.
*
* @ingroup views_templates
* @see views_json.views.inc
- */
+ */

-function template_preprocess_views_views_json_style_simple($vars) {
- template_preprocess_views_view_fields(&$vars);
+function template_preprocess_views_views_json_style_simple($vars) {
+ template_preprocess_views_view_fields($vars);

$view = $vars["view"];
$rows = $vars["rows"];
@@ -23,16 +23,16 @@ function template_preprocess_views_views_json_style_simple($vars) {
$base = $view->base_table;
$root_object = $options["root_object"];
$top_child_object_raw = $options["top_child_object"];
- $plaintext_output = $options["plaintext_output"];
+ $plaintext_output = $options["plaintext_output"];
$objects = array();
-
+
foreach($rows as $row) {
if (isset($row['field_attribute_id_value'])) {
$top_child_object = array_pop(explode('.', $row['field_attribute_id_value']->content));
} else {
$top_child_object = $top_child_object_raw;
}
-
+
//$field_type = isset($row['field_attribute_type_nid']) ? $row['field_attribute_type_nid']->content : '';

$object = array($top_child_object => array());
@@ -41,8 +41,8 @@ function template_preprocess_views_views_json_style_simple($vars) {
if ($options["field_output"] == "normal") {
if ($field->label)
$label = $plaintext_output ? strip_tags($field->label) : $field->label;
- else $label = $plaintext_output ? strip_tags($field->id) : $field->id;
- if (!$field->is_multiple) {
+ else $label = $plaintext_output ? strip_tags($field->id) : $field->id;
+ if (!$field->is_multiple) {
$content = $plaintext_output ? strip_tags($field->content) : $field->content;
//watchdog(__FILE__, 'field '.$top_child_object.' has type ' . $field_type);
}
@@ -56,30 +56,30 @@ function template_preprocess_views_views_json_style_simple($vars) {
}
elseif ($options["field_output"] == "raw") {
$label = $plaintext_output ? strip_tags($field->id) : $field->id;
- if (!$field->is_multiple) {
+ if (!$field->is_multiple) {
$content = $plaintext_output ? strip_tags($field->raw) : $field->raw;
}
else {
$content = array();
foreach($field->raw as $n=>$oc) $content[$n] = $plaintext_output ? strip_tags($oc) : $oc;
}
- }
+ }
$object[$top_child_object][$label] = $content;
}
$objects[] = $object;
- }
-
+ }
+
$vars["rows"] = array($root_object => $objects);
}

-function template_preprocess_views_views_json_style_exhibit($vars) {
+function template_preprocess_views_views_json_style_exhibit($vars) {
$view = $vars["view"];
$rows = $vars["rows"];
$options = $vars["options"];
$base = $view->base_table;
$root_object = "Items";
$top_child_object = $options["top_child_object"];
- $plaintext_output = $options["plaintext_output"];
+ $plaintext_output = $options["plaintext_output"];
$objects = array();
foreach($rows as $row) {
$object = array($top_child_object => array());
@@ -88,8 +88,8 @@ function template_preprocess_views_views_json_style_exhibit($vars) {
if ($options["field_output"] == "normal") {
if ($field->label)
$label = $plaintext_output ? strip_tags($field->label) : $field->label;
- else $label = $plaintext_output ? strip_tags($field->id) : $field->id;
- if (!$field->is_multiple) {
+ else $label = $plaintext_output ? strip_tags($field->id) : $field->id;
+ if (!$field->is_multiple) {
$content = $plaintext_output ? strip_tags($field->content) : $field->content;
}
else {
@@ -99,20 +99,19 @@ function template_preprocess_views_views_json_style_exhibit($vars) {
}
elseif ($options["field_output"] == "raw") {
$label = $plaintext_output ? strip_tags($field->id) : $field->id;
- if (!$field->is_multiple) {
+ if (!$field->is_multiple) {
$content = $plaintext_output ? strip_tags($field->raw) : $field->raw;
}
else {
$content = array();
foreach($field->raw as $n=>$oc) $content[$n] = $plaintext_output ? strip_tags($oc) : $oc;
}
- }
+ }
$object[$top_child_object][$label] = $content;
}
if (!array_key_exists("label", $object)) $object["label"] = "Item";
if (!array_key_exists("type", $object)) $object["type"] = $top_child_object;
$objects[] = $object;
- }
- $vars["rows"] = array($root_object => $objects);
+ }
+ $vars["rows"] = array($root_object => $objects);
}
-
diff --git a/htdocs/sites/all/modules/views_snippet/views_snippet.module b/htdocs/sites/all/modules/views_snippet/views_snippet.module
index 2e28bf9..d8940f9 100644
--- a/htdocs/sites/all/modules/views_snippet/views_snippet.module
+++ b/htdocs/sites/all/modules/views_snippet/views_snippet.module
@@ -26,8 +26,8 @@ function template_preprocess_views_view_snippet(&$vars) {
/**
* Preprocess the row output vars before they go to the template:
*/
-function template_preprocess_views_view_row_snippet(&$vars) {
- template_preprocess_views_view_fields(&$vars);
+function template_preprocess_views_view_row_snippet($vars) {
+ template_preprocess_views_view_fields($vars);
$keys = array();
$vals = array();
foreach (array_keys((array)$vars['fields']) as $key) {
@@ -36,13 +36,3 @@ function template_preprocess_views_view_row_snippet(&$vars) {
}
$vars['rendered_row'] = filter_xss_admin(str_replace($keys, $vals, $vars['options']['pattern']));
}
-
-
-
-
-
-
-
-
-
-
--
1.7.9.5

0 comments on commit d458a43

Please sign in to comment.