root element, just have one or more fields in the view
+containing the text 'email'.
+
+The FOAF and vCard renderers are most useful with view based on user profiles
+where you can create profile fields corresponding to properties defined in the
+FOAF (http://xmlns.com/foaf/spec/) or hCard
+(http://microformats.org/wiki/hcard-cheatsheet) spec. However any node type
+(like those created with nodeprofile or Bio or Advanced Profile or Content
+Profile) can be used in the view. It doesn't matter what data table the view
+is base on, only what fields are exposed. See http://soc2008.hotdrupal.com for
+ways to use the plugins, and http://groups.drupal.org/node/11387 for more
+docs.
About
-----
@@ -33,4 +55,15 @@
1)views_xml - Output as raw XML, OPML, and Atom;
2)views_json - Output as Simile/Exhibit JSON, canonical JSON, JSONP;
3)views_rdf - Output as FOAF, SIOC and DOAP;
- 4)views_xhtml - Output as hCard, hCalendar, and Geo.
\ No newline at end of file
+ 4)views_xhtml - Output as hCard, hCalendar, and Geo.
+
+To use these plugins you should:
+1) Enable all four modules;
+2) Set the row style plugin for your view to Unformatted;
+3) In the Unformatted row style plugin options set the separator to "|" (it is
+ set to this by default.)
+4) Set the view style plugin to one of:
+ i) JSON data document
+ ii) XML data document
+ iii) RDF data document
+ iv) XHTML data document
\ No newline at end of file
Index: json_plugin_style.inc
===================================================================
RCS file: json_plugin_style.inc
diff -N json_plugin_style.inc
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ json_plugin_style.inc 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,32 @@
+ 'radios',
+ '#title' => t('JSON data format'),
+ '#options' => array('Simple' => t('Simple'), 'Exhibit' => t('MIT Simile/Exhibit')),
+ '#default_value' => $this->options['format'],
+ );
+ }
+
+}
Index: views-view-xml.tpl.php
===================================================================
RCS file: views-view-xml.tpl.php
diff -N views-view-xml.tpl.php
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ views-view-xml.tpl.php 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,110 @@
+style_plugin->row_plugin) !== 'unformatted_plugin_row') {
+ print ('
The row plugin is not of type Unformatted.');
+ return;
+}
+else if (($view->style_plugin->row_plugin->options['separator']) !== '|') {
+ print ('
The row plugin separator is not "|" (you can set this in the options for the row style plugin.)');
+ return;
+}
+
+$nodes = array();
+foreach($rows as $row) {
+ $nodes[] = explode("|", trim($row));
+
+}
+
+if ($options['schema'] == 'raw') xml_raw_render($nodes, $view);
+if ($options['schema'] == 'opml') xml_opml_render($nodes, $view);
+
+function xml_raw_render($nodes, $view) {
+ $xml .= ''."\n";
+ $xml .= ''."\n";
+ $xml .='
'."\n";
+
+ foreach ($nodes as $node) {
+ $xml .= ' '."\n";
+ foreach($node as $nodefield) {
+ $nodefieldarray = explode(":", $nodefield);
+
+ /*replace escaped colons with actual colon*/
+ $nodefieldarray[0] = str_replace('#colon#', ':', $nodefieldarray[0]);
+ $nodefieldarray[1] = str_replace('#colon#', ':', $nodefieldarray[1]);
+
+ $label = views_xml_strip_illegal_chars($nodefieldarray[0]);
+ $value = views_xml_strip_illegal_chars(views_xml_is_date($nodefieldarray[1]));
+ if (strtotime($value))
+ $value = date(DATE_ISO8601, strtotime($value));
+ $label = str_replace('_value', '', str_replace("profile_values_profile_", '', $label)); //strip out Profile: from profile fields
+ if (is_null($value) || ($value === '')) continue;
+ $xml .= " <$label>$value$label>\n";
+ }
+ $xml .= ' '."\n";
+ }
+ $xml .=''."\n";
+ if ($view->override_path) //inside live preview
+ print htmlspecialchars($xml);
+ else {
+ drupal_set_header('Content-Type: text/xml');
+ print $xml;
+ module_invoke_all('exit');
+ exit;
+ }
+}
+
+function xml_opml_render($nodes, $view) {
+ //var_dump($view);
+ //return;
+ global $user;
+ $xml .= ''."\n";
+ $xml .= ''."\n";
+ $xml .='
'."\n";
+ $xml .=''."\n";
+ $xml .=' '.variable_get('site_name', 'drupal').'-'.$view->name.''."\n";
+ $xml .=' '.$user->name.''."\n";
+ $xml .=' '.$user->mail.''."\n";
+ $xml .=' '.date(DATE_ISO8601, time()).''."\n";
+ $xml .=''."\n";
+ $xml .=''."\n";
+ foreach ($nodes as $node) {
+ $xml .= ' override_path) //inside live preview
+ print htmlspecialchars($xml);
+ else {
+ drupal_set_header('Content-Type: text/xml');
+ print $xml;
+ module_invoke_all('exit');
+ exit;
+ }
+}
Index: views-view-xhtml.tpl.php
===================================================================
RCS file: views-view-xhtml.tpl.php
diff -N views-view-xhtml.tpl.php
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ views-view-xhtml.tpl.php 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,258 @@
+style_plugin->row_plugin) !== 'unformatted_plugin_row') {
+ print ('The row plugin is not of type Unformatted.');
+ return;
+}
+else if (($view->style_plugin->row_plugin->options['separator']) !== '|') {
+ print ('The row plugin separator is not "|" (you can set this in the options for the row style plugin.)');
+ return;
+}
+
+$nodes = array();
+foreach($rows as $row) {
+ $nodes[] = explode("|", trim($row));
+
+}
+if (count($nodes) != count($rows)) {
+ print ("Did not get all rows (is the field separator '|' ?)");
+ return;
+}
+
+if ($options['format'] == 'hcard') xhtml_hcard_render($nodes, $view);
+
+function xhtml_hcard_render($nodes, $view) {
+ $xhtml .= ''."\n";
+ $xhtml .= '\r\n";
+ $xhtml .= ''."\r\n";
+ $xhtml .= ' '."\r\n";
+ $xhtml .= ' '."\r\n";
+ $xhtml .= ' hCards'."\r\n";
+ $xhtml .= ''."\r\n";
+ $xhtml .= ''."\r\n";
+ foreach ($nodes as $node) {
+ $hcard = array('adr'=> array(
+ 'type' => '',
+ 'post-office-box' => '',
+ 'street-address' => array(),
+ 'extended-address' => '',
+ 'region' => '',
+ 'locality' => '',
+ 'postal-code' => '',
+ 'country-name' => ''
+ ),
+ 'agent' => array(),
+ 'bday' => '',
+ 'class' => '',
+ 'category' => array(),
+ 'email' => array(),
+ 'fn' => '',
+ 'n' => array(
+ 'honorific-prefix' => '',
+ 'given-name' => '',
+ 'additional-name' => '',
+ 'family-name' => '',
+ 'honorific-suffix' => ''
+ ),
+ 'nickname' => '',
+ 'org' => array (
+ 'organization-name' => '',
+ 'organization-unit' => array()
+ ),
+ 'photo' => '',
+ 'tel'=> array()
+ );
+ foreach($node as $nodefield) {
+ $nodefieldarray = explode(":", $nodefield);
+
+ /*replace escaped colons with actual colon*/
+ $nodefieldarray[0] = str_replace('#colon#', ':', $nodefieldarray[0]);
+ $nodefieldarray[1] = str_replace('#colon#', ':', $nodefieldarray[1]);
+
+ $label = views_xhtml_strip_illegal_chars($nodefieldarray[0]);
+ $value = views_xhtml_strip_illegal_chars(views_xhtml_is_date($nodefieldarray[1]));
+ if (strtotime($value))
+ $value = date(DATE_ISO8601, strtotime($value));
+ $label = str_replace('_value', '', str_replace("profile_values_profile_", '', $label)); //strip out Profile: from profile fields
+ if (is_null($value) || ($value === '')) continue;
+
+ if (stripos($label, 'address-type') !== FALSE) {
+ $hcard['adr']['type'] = $value;
+ }
+ if (stripos($label, 'post-office-box') !== FALSE) {
+ $hcard['adr']['post-office-box'] = $value;
+ }
+ if (stripos($label, 'street-address') !== FALSE) {
+ $hcard['adr']['street-address'][] = $value;
+ }
+ if (stripos($label, 'extended-address') !== FALSE) {
+ $hcard['adr']['extended-address'] = $value;
+ }
+ if (stripos($label, 'region') !== FALSE) {
+ $hcard['adr']['region'] = $value;
+ }
+ if (stripos($label, 'locality') !== FALSE) {
+ $hcard['adr']['locality'] = $value;
+ }
+ if (stripos($label, 'postal-code') !== FALSE) {
+ $hcard['adr']['postal-code'] = $value;
+ }
+ if (stripos($label, 'country-name') !== FALSE) {
+ $hcard['adr']['country-name'] = $value;
+ }
+ if (stripos($label, 'agent') !== FALSE) {
+ $hcard['agent'][] = $value;
+ }
+ if (stripos($label, 'bday') !== FALSE) {
+ $hcard['bday'] = $value;
+ }
+ if (stripos($label, 'class') !== FALSE) {
+ $hcard['class'] = $value;
+ }
+ if (stripos($label, 'category') !== FALSE) {
+ $hcard['category'][] = $value;
+ }
+ if (stripos($label, 'email') !== FALSE) {
+ $hcard['email'][$label] = $value;
+ }
+ if (stripos($label, 'honorific-prefix') !== FALSE) {
+ $hcard['n']['honorific-prefix'] = $value;
+ }
+ if (stripos($label, 'given-name') !== FALSE) {
+ $hcard['n']['given-name'] = $value;
+ }
+ if (stripos($label, 'additional-name') !== FALSE) {
+ $hcard['n']['additional-name'] = $value;
+ }
+ if (stripos($label, 'family-name') !== FALSE) {
+ $hcard['n']['family-name'] = $value;
+ }
+ if (stripos($label, 'honorific-suffix') !== FALSE) {
+ $hcard['n']['honorific-suffix'] = $value;
+ }
+ if (stripos($label, 'fn') !== FALSE) {
+ $hcard['fn'] = $value;
+ }
+ if (stripos($label, 'nickname') !== FALSE) {
+ $hcard['nickname'] = $value;
+ }
+ if (stripos($label, 'organization-name') !== FALSE) {
+ $hcard['org']['organization-name'] = $value;
+ }
+ if (stripos($label, 'organization-unit') !== FALSE) {
+ $hcard['org']['organization-unit'][] = $value;
+ }
+ if (stripos($label, 'photo') !== FALSE) {
+ $hcard['photo'] = $value;
+ }
+ if (stripos($label, 'tel') === 0) {
+ $hcard['tel'][$label] = $value;
+ }
+ }
+ $xhtml .= ''."\r\n";
+ if ($hcard['photo'] != '')
+ $xhtml .='

'."
\r\n";
+ if ($hcard['fn'])
+ $xhtml .='
'.$hcard['fn'].''."
\r\n";
+ if ($hcard['nickname'])
+ $xhtml .='
'.$hcard['nickname'].''."
\r\n";
+ $name = $hcard['n'];
+ if ($hcard['fn'])
+ $xhtml .= '
'."\r\n";
+ else
+ $xhtml .= ' '."\r\n";
+ if ($name['honorific-prefix'] !== '')
+ $xhtml .=' '.$name['honorific-prefix'].''."\r\n";
+ if ($name['given-name'] !== '')
+ $xhtml .=' '.$name['given-name'].''."\r\n";
+ if ($name['additional-name'] !== '')
+ $xhtml .=' '.$name['additional-name'].''."\r\n";
+ if ($name['family-name'] !== '')
+ $xhtml .=' '.$name['family-name'].''."\r\n";
+ if ($name['honorific-suffix'] !== '')
+ $xhtml .=' '.$name['honorific-suffix'].''."\r\n";
+ $xhtml .= '
'."\r\n";
+ if ($hcard['nickname'] !== '')
+ $xhtml .= ' '.$hcard['nickname'].'
'."\r\n";
+ $org = $hcard['org'];
+ $xhtml .= ' '."\r\n";
+ if ($org['organization-name'] !== '')
+ $xhtml.= ' '.$org['organization-name'].'
'."\r\n";
+ $org_units = $org['organization-unit'];
+ foreach ($org_units as $org_unit)
+ $xhtml .=' '.$org_unit.''."
\r\n";
+ $xhtml .= ' '."\r\n";
+ $address = $hcard['adr'];
+ $xhtml .= ' '."\r\n";
+ if ($address['type'] !== '')
+ $xhtml .=' '.$address['type'].''."
\r\n";
+ if ($address['post-office-box'] !== '')
+ $xhtml .=' '.$address['post-office-box'].''."
\r\n";
+ $street_addresses = $address['street-address'];
+ foreach ($street_addresses as $street_address)
+ $xhtml .=' '.$street_address.''."
\r\n";
+ if ($address['extended-address'] !== '')
+ $xhtml .=' '.$address['extended-address'].''."
\r\n";
+ if ($address['region'] !== '')
+ $xhtml .=' '.$address['region'].''."
\r\n";
+ if ($address['locality'] !== '')
+ $xhtml .=' '.$address['locality'].''."
\r\n";
+ if ($address['postal-code'] !== '')
+ $xhtml .=' '.$address['postal-code'].''."
\r\n";
+ if ($address['country-name'] !== '')
+ $xhtml .=' '.$address['country-name'].''."\r\n";
+ $xhtml .= '
'."\r\n";
+ $agents = $hcard['agent'];
+ foreach ($agents as $agent)
+ $xhtml .=' '.$agent.''."
\r\n";
+ $birthday = $hcard['bday'];
+ if ($birthday !== '')
+ $xhtml .=' '.$birthday.''."
\r\n";
+ $class = $hcard['class'];
+ if ($class !== '')
+ $xhtml .=' '.$class.''."
\r\n";
+ $categories = $hcard['category'];
+ foreach ($categories as $category)
+ $xhtml .=' '.$category.''."
\r\n";
+ if ($hcard['email']) {
+ $email_addrs = $hcard['email'];
+ foreach ($email_addrs as $email_type => $email_addr)
+ $xhtml .=' '."\r\n".
+ ' '.$email_type.': '."\r\n".
+ ' '.$email_addr.''."\r\n".
+ ' '."
\r\n";
+
+ }
+ if ($hcard['tel']) {
+ $tel_nos = $hcard['tel'];
+ foreach ($tel_nos as $tel_no_type => $tel_no)
+ $xhtml .=' '.
+ ''.$tel_no_type.': '.
+ ''.$tel_no.''.
+ ''."
\r\n";
+ }
+ $xhtml .= ' '."\r\n";
+ }
+
+ $xhtml.=''."\r\n";
+ $xhtml.=''."\r\n";
+ if ($view->override_path) //inside live preview
+ print htmlspecialchars($xhtml);
+ else {
+ print $xhtml;
+ module_invoke_all('exit');
+ exit;
+ }
+}
Index: views_xhtml.info
===================================================================
RCS file: views_xhtml.info
diff -N views_xhtml.info
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ views_xhtml.info 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,6 @@
+name = Views XHTML
+description = "Views style plugin to render node content as XHTML microformats."
+package = Views Datasource
+dependencies[] = views_datasource
+core = 6.x
+
Index: views_rdf.module
===================================================================
RCS file: views_rdf.module
diff -N views_rdf.module
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ views_rdf.module 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,58 @@
+ 2,
+ );
+}
+
+/**
+ * Strips illegal Unicode characters and encodes entities in string
+ *
+ * @param string $input
+ * @return string
+ */
+function views_rdf_strip_illegal_chars($input) {
+ $output = preg_replace('/[\x{80}-\x{A0}'. // Non-printable ISO-8859-1 + NBSP
+ '\x{01}-\x{1F}'. //Non-printable ASCII characters
+ '\x{AD}'. // Soft-hyphen
+ '\x{2000}-\x{200F}'. // Various space characters
+ '\x{2028}-\x{202F}'. // Bidirectional text overrides
+ '\x{205F}-\x{206F}'. // Various text hinting characters
+ '\x{FEFF}'. // Byte order mark
+ '\x{FF01}-\x{FF60}'. // Full-width latin
+ '\x{FFF9}-\x{FFFD}'. // Replacement characters
+ '\x{0}]/u', // NULL byte
+ '', $input);
+ $output = str_replace('"', '"', $output); //encode quote
+ $output = str_replace('&', '&', $output); //encode ampersand
+ $output = str_replace("'", '&pos;', $output); //encode apostrophe
+ $output = str_replace('<', '<', $output); //encode left-angled bracket
+ $output = str_replace('>', '&rt;', $output); //encode right-angled bracket
+ return $output;
+}
+
+/**
+ * If input is a serialized date array, return a date string
+ *
+ * @param unknown_type $input
+ * @return unknown
+ */
+function views_rdf_is_date ($input) {
+ if (strpos($input, 'a:3:{s:5:"month"') !== 0) return $input;
+ else { //serialized date array
+ $date = unserialize($input);
+ return date(DATE_ISO8601, mktime(0, 0, 0, $date['month'], $date['day'], $date['year']));
+ }
+}
Index: rdf_plugin_style.inc
===================================================================
RCS file: rdf_plugin_style.inc
diff -N rdf_plugin_style.inc
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ rdf_plugin_style.inc 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,27 @@
+ 'radios',
+ '#title' => t('RDF vocabulary'),
+ '#options' => array('FOAF' => t('FOAF')),
+ '#default_value' => $this->options['format'],
+ );
+ }
+
+}
Index: views_xml.module
===================================================================
RCS file: views_xml.module
diff -N views_xml.module
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ views_xml.module 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,52 @@
+ 2,
+ );
+}
+
+/**
+ * Strips illegal Unicode characters and encodes entities in string
+ *
+ * @param string $input
+ * @return string
+ */
+function views_xml_strip_illegal_chars($input) {
+ $output = preg_replace('/[\x{80}-\x{A0}'. // Non-printable ISO-8859-1 + NBSP
+ '\x{01}-\x{1F}'. //Non-printable ASCII characters
+ '\x{AD}'. // Soft-hyphen
+ '\x{2000}-\x{200F}'. // Various space characters
+ '\x{2028}-\x{202F}'. // Bidirectional text overrides
+ '\x{205F}-\x{206F}'. // Various text hinting characters
+ '\x{FEFF}'. // Byte order mark
+ '\x{FF01}-\x{FF60}'. // Full-width latin
+ '\x{FFF9}-\x{FFFD}'. // Replacement characters
+ '\x{0}]/u', // NULL byte
+ '', $input);
+ $output = str_replace('"', '"', $output); //encode quote
+ $output = str_replace('&', '&', $output); //encode ampersand
+ $output = str_replace("'", '&pos;', $output); //encode apostrophe
+ $output = str_replace('<', '<', $output); //encode left-angled bracket
+ $output = str_replace('>', '&rt;', $output); //encode right-angled bracket
+ return $output;
+}
+
+function views_xml_is_date ($input) {
+ if (strpos($input, 'a:3:{s:5:"month"') !== 0) return $input;
+ else { //serialized date array
+ $date = unserialize($input);
+ return date(DATE_ISO8601, mktime(0, 0, 0, $date['month'], $date['day'], $date['year']));
+ }
+}
Index: views_xhtml.module
===================================================================
RCS file: views_xhtml.module
diff -N views_xhtml.module
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ views_xhtml.module 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,52 @@
+ 2,
+ );
+}
+
+/**
+ * Strips illegal Unicode characters and encodes entities in string
+ *
+ * @param string $input
+ * @return string
+ */
+function views_xhtml_strip_illegal_chars($input) {
+ $output = preg_replace('/[\x{80}-\x{A0}'. // Non-printable ISO-8859-1 + NBSP
+ '\x{01}-\x{1F}'. //Non-printable ASCII characters
+ '\x{AD}'. // Soft-hyphen
+ '\x{2000}-\x{200F}'. // Various space characters
+ '\x{2028}-\x{202F}'. // Bidirectional text overrides
+ '\x{205F}-\x{206F}'. // Various text hinting characters
+ '\x{FEFF}'. // Byte order mark
+ '\x{FF01}-\x{FF60}'. // Full-width latin
+ '\x{FFF9}-\x{FFFD}'. // Replacement characters
+ '\x{0}]/u', // NULL byte
+ '', $input);
+ $output = str_replace('"', '"', $output); //encode quote
+ $output = str_replace('&', '&', $output); //encode ampersand
+ $output = str_replace("'", '&pos;', $output); //encode apostrophe
+ $output = str_replace('<', '<', $output); //encode left-angled bracket
+ $output = str_replace('>', '&rt;', $output); //encode right-angled bracket
+ return $output;
+}
+
+function views_xhtml_is_date ($input) {
+ if (strpos($input, 'a:3:{s:5:"month"') !== 0) return $input;
+ else { //serialized date array
+ $date = unserialize($input);
+ return date(DATE_ISO8601, mktime(0, 0, 0, $date['month'], $date['day'], $date['year']));
+ }
+}
Index: views-view-rdf.tpl.php
===================================================================
RCS file: views-view-rdf.tpl.php
diff -N views-view-rdf.tpl.php
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ views-view-rdf.tpl.php 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,147 @@
+style_plugin->row_plugin) !== 'unformatted_plugin_row') {
+ print ('The row plugin is not of type Unformatted.');
+ return;
+}
+else if (($view->style_plugin->row_plugin->options['separator']) !== '|') {
+ print ('The row plugin separator is not "|" (you can set this in the options for the row style plugin.)');
+ return;
+}
+
+$nodes = array();
+foreach($rows as $row) {
+ $nodes[] = explode("|", trim($row));
+
+}
+
+if ($options['vocabulary'] == 'FOAF') rdf_foaf_xml_render($nodes, $view);
+
+/**
+ * Render nodes as FOAF in XML
+ *
+ * @param array $nodes
+ * @return none
+ */
+function rdf_foaf_xml_render($nodes, $view) {
+ $xml .= ''."\n";
+ $xml .= ''."\n";
+ $xml .= '\n";
+ foreach($node as $nodefield) {
+ $nodefieldarray = explode(":", $nodefield);
+
+ /*replace escaped colons with actual colon*/
+ $nodefieldarray[0] = str_replace('#colon#', ':', $nodefieldarray[0]);
+ $nodefieldarray[1] = str_replace('#colon#', ':', $nodefieldarray[1]);
+
+ $label = views_rdf_strip_illegal_chars($nodefieldarray[0]);
+ $value = views_rdf_strip_illegal_chars(views_rdf_is_date($nodefieldarray[1]));
+ if (strtotime($value))
+ $value = date(DATE_ISO8601, strtotime($value));
+ if (is_null($value) || ($value === '')) continue;
+ if (stripos($label, 'firstname') !== false) {
+ $xml.=" $value\n";
+ continue;
+ }
+ if (stripos($label, 'surname') !== false) {
+ $xml.=" $value\n";
+ continue;
+ }
+ if ((stripos($label, 'name') !== false) && !((stripos($label, 'surname') !== false) || (stripos($label, 'firstname') !== false))) {
+ if (stripos($xml, "") == false)
+ $xml.=" $value\n";
+ continue;
+ }
+ if (stripos($label, 'title') !== false) {
+ $xml.=" $value\n";
+ continue;
+ }
+ if (stripos($label, 'nick') !== false) {
+ $xml.=" $value\n";
+ continue;
+ }
+ if (stripos($label, 'mbox_sha1sum') !== false) {
+ $xml.=" $value\n";
+ continue;
+ }
+ if ((stripos($label, 'mbox') !== false) && !(stripos($label, 'mbox_sha1sum') !== false)) {
+ $xml.=" $value\n";
+ continue;
+ }
+ if (stripos($label, 'openid') !== false) {
+ $xml.=" $value\n";
+ continue;
+ }
+ if (strpos($label, 'workplaceHomepage') !== false) {
+ $xml.=' '."\n";
+ continue;
+ }
+ if (strpos($label, 'homepage') !== false) {
+ $xml.=' '."\n";
+ continue;
+ }
+ if (stripos($label, 'weblog') !== false) {
+ $xml.=' '."\n";
+ continue;
+ }
+ if (strpos($label, 'img') !== false) {
+ $xml.=' '."\n";
+ $xml.=' '."\n";
+ continue;
+ }
+ if (stripos($label, 'member') !== false) {
+ $xml.=" $value\n";
+ continue;
+ }
+ if (stripos($label, 'phone') !== false) {
+ $xml.=" $value\n";
+ continue;
+ }
+ if (stripos($label, 'jabberID') !== false) {
+ $xml.=" $value\n";
+ continue;
+ }
+ if (stripos($label, 'msnChatID') !== false) {
+ $xml.=" $value\n";
+ continue;
+ }
+ if (stripos($label, 'aimChatID') !== false) {
+ $xml.=" $value\n";
+ continue;
+ }
+ if (stripos($label, 'yahooChatID') !== false) {
+ $xml.=" $value\n";
+ continue;
+ }
+ }
+ $xml.="\n";
+ }
+ $xml.="\n";
+ if ($view->override_path) //inside live preview
+ print htmlspecialchars($xml);
+ else {
+ print $xml;
+ module_invoke_all('exit');
+ exit;
+ }
+
+}
+
Index: views_xml.views.inc
===================================================================
RCS file: views_xml.views.inc
diff -N views_xml.views.inc
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ views_xml.views.inc 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,41 @@
+ array( //declare the views_xml_* style plugins
+ 'views_xml' => array(
+ 'title' => t('XML data document'),
+ 'theme' => 'views_view_xml',
+ 'help' => t('Displays nodes as XML.'),
+ 'handler' => 'xml_plugin_style',
+ 'uses row plugin' => TRUE,
+ 'uses fields' => TRUE,
+ 'uses options' => TRUE,
+ 'type' => 'normal',
+ ),
+ ),
+ );
+}
+
+/**
+ * Theme preprocess function for views-view-xml.tpl.php
+ *
+ * @param array $vars
+ */
+function template_preprocess_views_view_xml(&$vars) {
+ $view = &$vars['view'];
+ $options = $view->style_handler->options;
+ $handler = $view->style_handler;
+}
+
Index: views_datasource.module
===================================================================
RCS file: views_datasource.module
diff -N views_datasource.module
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ views_datasource.module 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,12 @@
+ 2,
+ );
+}
Index: views_datasource.views.inc
===================================================================
RCS file: views_datasource.views.inc
diff -N views_datasource.views.inc
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ views_datasource.views.inc 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,58 @@
+ array( //declare the unformatted row plugin
+ 'unformatted' => array(
+ 'title' => t('Unformatted'),
+ 'help' => t('(Displays the unformatted data for each row from the views query with each row on a new line. Set as | for views_json.'),
+ 'handler' => 'unformatted_plugin_row',
+ 'theme' => 'views_view_row_unformatted',
+ 'uses fields' => TRUE,
+ 'uses options' => TRUE,
+ 'type' => 'normal',
+ )
+ )
+ );
+}
+
+/**
+ * Theme preprocess function for views-view-row-unformatted.tpl.php
+ */
+function template_preprocess_views_view_row_unformatted(&$vars) {
+ $view = $vars['view'];
+ //print('preprocess');
+ // Loop through the fields for this view.
+ foreach ($view->field as $id => $field) {
+ if (!empty($field->handler) && is_object($field->handler)) {
+ $object = new stdClass();
+ $object->content = $field['handler']->theme($vars['row']);
+ if (isset($field['handler']->field_alias) && isset($vars['row']->{$field['handler']->field_alias})) {
+ $object->raw = $vars['row']->{$field['handler']->field_alias};
+ }
+ else {
+ $object->raw = NULL; // make sure it exists to reduce NOTICE
+ }
+ if (!empty($vars['options']['separator']) && $object->content) {
+ $object->separator = filter_xss($vars['options']['separator']);
+ }
+
+ $object->handler = $field['handler'];
+ $object->class = views_css_safe($id);
+ $object->label = check_plain($field['handler']->label());
+ $vars['fields'][$id] = $object;
+ }
+ }
+
+}
Index: views_rdf.info
===================================================================
RCS file: views_rdf.info
diff -N views_rdf.info
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ views_rdf.info 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,6 @@
+name = Views RDF
+description = "Views style plugin to render node content as RDF."
+package = Views Datasource
+dependencies[] = views_datasource
+core = 6.x
+
Index: views_rdf.views.inc
===================================================================
RCS file: views_rdf.views.inc
diff -N views_rdf.views.inc
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ views_rdf.views.inc 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,41 @@
+ array( //declare the views_rdf style plugin
+ 'views_rdf' => array(
+ 'title' => t('RDF data document'),
+ 'theme' => 'views_view_rdf',
+ 'help' => t('Displays nodes in the RDF data format.'),
+ 'handler' => 'rdf_plugin_style',
+ 'uses row plugin' => TRUE,
+ 'uses fields' => TRUE,
+ 'uses options' => TRUE,
+ 'type' => 'normal',
+ ),
+ ),
+ );
+}
+
+
+/**
+ * Theme preprocess function for views-view-rdf.tpl.php
+ *
+ * @param array $vars
+ */
+function template_preprocess_views_view_rdf(&$vars) {
+ $view = &$vars['view'];
+ $options = $view->style_handler->options;
+ $handler = $view->style_handler;
+}
Index: xml_plugin_style.inc
===================================================================
RCS file: xml_plugin_style.inc
diff -N xml_plugin_style.inc
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ xml_plugin_style.inc 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,27 @@
+ 'radios',
+ '#title' => t('Schema'),
+ '#options' => array('raw' => t('raw'),'opml'=> t('opml')),
+ '#default_value' => $this->options['schema'],
+ );
+ }
+
+}
Index: xhtml_plugin_style.inc
===================================================================
RCS file: xhtml_plugin_style.inc
diff -N xhtml_plugin_style.inc
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ xhtml_plugin_style.inc 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,27 @@
+ 'radios',
+ '#title' => t('Microformat'),
+ '#options' => array('hcard' => t('hCard')),
+ '#default_value' => $this->options['format'],
+ );
+ }
+
+}
Index: unformatted_plugin_row.inc
===================================================================
RCS file: unformatted_plugin_row.inc
diff -N unformatted_plugin_row.inc
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ unformatted_plugin_row.inc 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,42 @@
+'|');
+ return $options;
+ }
+
+ /**
+ * Provide a form for setting options.
+ */
+ function options_form(&$form, &$form_state) {
+ $fields = $this->display->handler->get_option('fields');
+ $options = array();
+ foreach ($fields as $field => $info) {
+ $handler = views_get_handler($info['table'], $info['field'], 'field');
+ if ($handler) {
+ $options[$field] = $handler->ui_name();
+ }
+ }
+
+ $form['separator'] = array(
+ '#title' => t('Separator'),
+ '#type' => 'textfield',
+ '#size' => 10,
+ '#default_value' => isset($this->options['separator']) ? $this->options['separator'] : ',',
+ '#description' => t('The separator is placed between fields.'),
+ );
+ }
+
+}
Index: views_xhtml.views.inc
===================================================================
RCS file: views_xhtml.views.inc
diff -N views_xhtml.views.inc
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ views_xhtml.views.inc 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,40 @@
+ array( //declare the views_xhtml style plugin
+ 'views_xhtml' => array(
+ 'title' => t('XHTML data document'),
+ 'theme' => 'views_view_xhtml',
+ 'help' => t('Displays nodes as XHTML microformats.'),
+ 'handler' => 'xhtml_plugin_style',
+ 'uses row plugin' => TRUE,
+ 'uses fields' => TRUE,
+ 'uses options' => TRUE,
+ 'type' => 'normal',
+ ),
+ ),
+ );
+}
+
+/**
+ * Theme preprocess function for views-view-xhtml.tpl.php
+ *
+ * @param array $vars
+ */
+function template_preprocess_views_view_xhtml(&$vars) {
+ $view = &$vars['view'];
+ $options = $view->style_handler->options;
+ $handler = $view->style_handler;
+}
Index: views_xml.info
===================================================================
RCS file: views_xml.info
diff -N views_xml.info
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ views_xml.info 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,6 @@
+name = Views XML
+description = "Views style plugin to render node content as XML"
+package = Views Datasource
+dependencies[] = views_datasource
+core = 6.x
+
Index: views_datasource.info
===================================================================
RCS file: views_datasource.info
diff -N views_datasource.info
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ views_datasource.info 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,5 @@
+name = Views Datasource
+description = "Views style plugin to render node content as different data types."
+package = Views Datasource
+dependencies[] = views
+core = 6.x