new functionality for the JSON stuff + more formatting improvements + more code changes

icylace - October 15, 2009 - 23:47
Project:Views Datasource
Version:6.x-1.0-alpha3
Component:Code
Category:feature request
Priority:normal
Assigned:allisterbeharry
Status:closed
Description

This patch replaces my previous patch #605082: higher compliance with coding standards in that it updates more of views_datasource with formatting and commenting changes.

It also adds some new functionality to views_json...

#1
The first update was to pretty-print the JSON output when previewing it in the Views UI. The decorative and unnecessary whitespacing used in the preview will be absent when the output is retrieved outside of the Views UI.

#2
I wanted to be able to access a JSON'd view in code through the Views API without having the script terminating prematurely. The original style options wouldn't allow for this so I added "coder" variants of the original options to the style settings.

The style settings box for "JSON data document" now looks like this:
- Simple
- Simple (Coder)
- MIT Simile/Exhibit
- MIT Simile/Exhibit (Coder)

The original options work similarly as before. The new "coder" alternates let you access the JSON output through the Views API safely.

I hope this is as useful for other people as it has been for me !

AttachmentSize
views_datasource_alpha3_002.patch112.77 KB

#1

icylace - October 15, 2009 - 23:57

Oh, I forgot to mention that I also added a useful new function called views_json_get_json() that gets JSON from a View with the "JSON data document" style and that also has its style setting set to either "Simple (Coder)" or "MIT Simile/Exhibit (Coder)"

After applying the patch it'll be located in the views_json.module file and is documented there.

#2

allisterbeharry - November 2, 2009 - 00:03
Assigned to:Anonymous» allisterbeharry
Status:active» fixed

Committed here: http://drupal.org/node/616576

#3

System Message - November 16, 2009 - 00:10
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.