? .cache ? .settings ? views_datasource_alpha3_001.patch Index: views-view-json.tpl.php =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/views_datasource/views-view-json.tpl.php,v retrieving revision 1.1.2.7 diff -u -p -r1.1.2.7 views-view-json.tpl.php --- views-view-json.tpl.php 8 Sep 2009 16:45:08 -0000 1.1.2.7 +++ views-view-json.tpl.php 21 Oct 2009 20:02:34 -0000 @@ -1,8 +1,9 @@ result)); //cast the result object to an array so we can count how many properties in itt; - $view_result_count = 0; - foreach ($view->result as $node) { - $json.= str_repeat(" ", 6)."{\n"; - $total_field_count = count((array)$node); //cast the node object to an array so we can count how many properties in itt - $field_count = 0; - foreach($node as $field_label => $field_value) { - $label = trim(views_json_strip_illegal_chars(views_json_encode_special_chars($field_label))); - $value = views_json_encode_special_chars(trim(views_json_is_date($field_value))); - if ((is_null($value)) || ($value == '')) continue; -// if (preg_match('/\d/', $value)) { -// if (strtotime($value)) -// $value = gmstrftime(EXHIBIT_DATE_FORMAT, strtotime($value)); -// } - $label = str_replace('_value', '', str_replace("profile_values_profile_", '', $label)); //strip out Profile: from profile fields - $json.=str_repeat(" ", 8).'"'.$label.'"'. " ".": ".'"'.$value.'"'.((++$field_count == $total_field_count) ? "":",")."\n"; - } - $json.=str_repeat(" ", 6)."}".((++$view_result_count == $total_view_result_count) ? "":",")."\n"; - } - $json.=str_repeat(" ", 4)."]\n}"; - - if ($view->override_path) { //inside a live preview so just output the text - print $json; + define('EXHIBIT_DATE_FORMAT', '%Y-%m-%d %H:%M:%S'); + $json = "{\n".' "nodes":'."\n". str_repeat(" ", 4) ."[\n"; + $total_view_result_count = count((array)($view->result)); // cast the result object to an array so we can count how many properties in itt; + $view_result_count = 0; + foreach ($view->result as $node) { + $json .= str_repeat(" ", 6) ."{\n"; + $total_field_count = count((array)$node); // cast the node object to an array so we can count how many properties in itt + $field_count = 0; + foreach ($node as $field_label => $field_value) { + $label = trim(views_json_strip_illegal_chars(views_json_encode_special_chars($field_label))); + $value = views_json_encode_special_chars(trim(views_json_is_date($field_value))); + if ((is_null($value)) || ($value == '')) continue; +// if (preg_match('/\d/', $value)) { +// if (strtotime($value)) { +// $value = gmstrftime(EXHIBIT_DATE_FORMAT, strtotime($value)); +// } +// } + $label = str_replace('_value', '', str_replace("profile_values_profile_", '', $label)); // strip out Profile: from profile fields + $json .= str_repeat(" ", 8) . '"' . $label . '"' . " ".": ".'"'. $value .'"'. ((++$field_count == $total_field_count) ? "" : ",") ."\n"; + } + $json .= str_repeat(" ", 6) ."}". ((++$view_result_count == $total_view_result_count) ? "" : ",") ."\n"; } - else { //real deal so switch the content type and stop further processing of the page + $json .= str_repeat(" ", 4) ."]\n}"; + + if ($view->override_path) { // inside a live preview so just output the text + print $json; + } + else { // real deal so switch the content type and stop further processing of the page drupal_set_header('Content-Type: text/javascript'); print $json; module_invoke_all('exit'); exit; - } - + } } function json_exhibit_render($view) { define('EXHIBIT_DATE_FORMAT', '%Y-%m-%d %H:%M:%S'); - $json = "{\n".' "items":'."\n".str_repeat(" ", 4)."[\n"; - $total_view_result_count = count((array)($view->result)); //cast the result object to an array so we can count how many properties in itt; + $json = "{\n".' "items":'."\n". str_repeat(" ", 4) ."[\n"; + $total_view_result_count = count((array)($view->result)); // cast the result object to an array so we can count how many properties in itt; $view_result_count = 0; - foreach ($view->result as $node) { - $json.=str_repeat(" ", 6)."{\n"; - $json.=str_repeat(" ", 8).'"type" '. " ".": ".'"'.'##type##'.'",'."\n"; - $json.=str_repeat(" ", 8).'"label" '. " "." : ".'"'.'##label##'.'",'."\n"; - $total_field_count = count((array)$node); //cast the node object to an array so we can count how many properties in itt - $field_count = 0; - foreach($node as $field_label => $field_value) { + foreach ($view->result as $node) { + $json .= str_repeat(" ", 6) ."{\n"; + $json .= str_repeat(" ", 8) .'"type" '. " ".": ".'"'.'##type##'.'",'."\n"; + $json .= str_repeat(" ", 8) .'"label" '. " "." : ".'"'.'##label##'.'",'."\n"; + $total_field_count = count((array)$node); // cast the node object to an array so we can count how many properties in itt + $field_count = 0; + foreach ($node as $field_label => $field_value) { $label = trim(views_json_strip_illegal_chars(views_json_encode_special_chars($field_label))); $value = views_json_encode_special_chars(trim(views_json_is_date($field_value))); if ((is_null($value)) || ($value == '')) continue; // if (preg_match('/\d/', $value)) { -// if (strtotime($value)) +// if (strtotime($value)) { // $value = gmstrftime(EXHIBIT_DATE_FORMAT, strtotime($value)); +// } // } - $label = str_replace('_value', '', str_replace("profile_values_profile_", '', $label)); //strip out Profile: from profile fields + $label = str_replace('_value', '', str_replace("profile_values_profile_", '', $label)); // strip out Profile: from profile fields if ($label == 'type') $json = str_replace('##type##', $value, $json); elseif ($label == 'label') $json = str_replace('##label##', $value, $json); - else $json.=str_repeat(" ", 8).'"'.$label.'"'. " ".": ".'"'.$value.'"'.((++$field_count == $total_field_count) ? "":",")."\n"; - } - if (strpos($json, '##type##') !== false) - $json = str_replace('##type##', (isset($node->type) ? $node->type : 'Item'), $json); - if (strpos($json, '##label##') !== false) - $json = str_replace('##label##', (isset($node->title) ? $node->title : 'none'), $json); - $json.=str_repeat(" ", 6)."}".((++$view_result_count == $total_view_result_count) ? "":",")."\n"; - } - $json.=str_repeat(" ", 4)."]\n}"; - - if ($view->override_path) { //inside a live preview so just output the text - print $json; + else $json .= str_repeat(" ", 8) .'"'. $label .'"'. " ".": ".'"'. $value .'"'. ((++$field_count == $total_field_count) ? "" : ",") ."\n"; + } + if (strpos($json, '##type##') !== FALSE) { + $json = str_replace('##type##', (isset($node->type) ? $node->type : 'Item'), $json); + } + if (strpos($json, '##label##') !== FALSE) { + $json = str_replace('##label##', (isset($node->title) ? $node->title : 'none'), $json); + } + $json .= str_repeat(" ", 6) ."}". ((++$view_result_count == $total_view_result_count) ? "" : ",") ."\n"; } - else { //real deal so switch the content type and stop further processing of the page + $json .= str_repeat(" ", 4) ."]\n}"; + + if ($view->override_path) { // inside a live preview so just output the text + print $json; + } + else { // real deal so switch the content type and stop further processing of the page drupal_set_header('Content-Type: text/javascript'); print $json; module_invoke_all('exit'); exit; - } - + } } Index: views-view-rdf.tpl.php =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/views_datasource/Attic/views-view-rdf.tpl.php,v retrieving revision 1.1.2.8 diff -u -p -r1.1.2.8 views-view-rdf.tpl.php --- views-view-rdf.tpl.php 22 May 2009 01:25:41 -0000 1.1.2.8 +++ views-view-rdf.tpl.php 21 Oct 2009 20:02:34 -0000 @@ -1,7 +1,7 @@ '."\n"; $xml .= ''."\n"; $xml .= 'result as $node) { - $xml.=""; - foreach($node as $field_label => $field_value) { + $xml .= ""; + foreach ($node as $field_label => $field_value) { $label = views_rdf_strip_illegal_chars($field_label); $value = views_xml_strip_illegal_chars(views_xml_is_date($field_value)); if (is_null($value) || ($value === '')) continue; // if (strtotime($value)) // $value = date(DATE_ISO8601, strtotime($value)); - if (stripos($label, 'firstname') !== false) { - $xml.=" $value\n"; + if (stripos($label, 'firstname') !== FALSE) { + $xml .= " $value\n"; continue; - } - if (stripos($label, 'surname') !== false) { - $xml.=" $value\n"; + } + if (stripos($label, 'surname') !== FALSE) { + $xml .= " $value\n"; continue; - } - if ((stripos($label, 'name') == true) && ((stripos($label, 'surname') === false) && (stripos($label, 'firstname') === false))) { - //if (stripos($xml, "") === false) - $xml.=" $value\n"; + } + if ((stripos($label, 'name') == TRUE) && ((stripos($label, 'surname') === FALSE) && (stripos($label, 'firstname') === FALSE))) { + // if (stripos($xml, "") === FALSE) + $xml .= " $value\n"; continue; } - if (stripos($label, 'title') !== false) { - $xml.=" $value\n"; + if (stripos($label, 'title') !== FALSE) { + $xml .= " $value\n"; continue; } - if (stripos($label, 'nick') !== false) { - $xml.=" $value\n"; + if (stripos($label, 'nick') !== FALSE) { + $xml .= " $value\n"; continue; } - if ((stripos($label, 'mbox') !== false) && !(stripos($label, 'mbox_sha1sum') !== false)) { - $xml.=" $value\n"; + if ((stripos($label, 'mbox') !== FALSE) && !(stripos($label, 'mbox_sha1sum') !== FALSE)) { + $xml .= " $value\n"; continue; } - if ((stripos($label, 'mail') == true) && (stripos($xml, '') == false)) { - $xml.=" $value\n"; - $xml.=" ".md5("mailto:".$value)."\n"; + if ((stripos($label, 'mail') == TRUE) && (stripos($xml, '') == FALSE)) { + $xml .= " $value\n"; + $xml .= " ". md5("mailto:". $value) ."\n"; continue; } - if (stripos($label, 'mbox_sha1sum') !== false) { - $xml.=" $value\n"; + if (stripos($label, 'mbox_sha1sum') !== FALSE) { + $xml .= " $value\n"; continue; } - if (stripos($label, 'openid') !== false) { - $xml.=" $value\n"; + if (stripos($label, 'openid') !== FALSE) { + $xml .= " $value\n"; continue; } - if (strpos($label, 'workplaceHomepage') !== false) { - $xml.=' '."\n"; + if (strpos($label, 'workplaceHomepage') !== FALSE) { + $xml .= ' '."\n"; continue; } - if (strpos($label, 'homepage') !== false) { - $xml.=' '."\n"; + if (strpos($label, 'homepage') !== FALSE) { + $xml .= ' '."\n"; continue; - } - if (stripos($label, 'weblog') !== false) { - $xml.=' '."\n"; + } + if (stripos($label, 'weblog') !== FALSE) { + $xml .= ' '."\n"; continue; } - if (strpos($label, 'img') !== false) { - $xml.=' '."\n"; - $xml.=' '."\n"; + if (strpos($label, 'img') !== FALSE) { + $xml .= ' '."\n"; + $xml .= ' '."\n"; continue; } - if (stripos($label, 'member') !== false) { - $xml.=" $value\n"; + if (stripos($label, 'member') !== FALSE) { + $xml .= " $value\n"; continue; - } - if (stripos($label, 'phone') !== false) { - $xml.=" $value\n"; + } + if (stripos($label, 'phone') !== FALSE) { + $xml .= " $value\n"; continue; } - if (stripos($label, 'jabberID') !== false) { - $xml.=" $value\n"; + if (stripos($label, 'jabberID') !== FALSE) { + $xml .= " $value\n"; continue; } - if (stripos($label, 'msnChatID') !== false) { - $xml.=" $value\n"; + if (stripos($label, 'msnChatID') !== FALSE) { + $xml .= " $value\n"; continue; } - if (stripos($label, 'aimChatID') !== false) { - $xml.=" $value\n"; + if (stripos($label, 'aimChatID') !== FALSE) { + $xml .= " $value\n"; continue; } - if (stripos($label, 'yahooChatID') !== false) { - $xml.=" $value\n"; + if (stripos($label, 'yahooChatID') !== FALSE) { + $xml .= " $value\n"; continue; - } + } } - $xml.="\n"; + $xml .= "\n"; } - $xml.="\n"; - if ($view->override_path) //inside live preview + $xml .= "\n"; + if ($view->override_path) { // inside live preview print htmlspecialchars($xml); - else { + } + else { drupal_set_header('Content-Type: application/rdf+xml'); print $xml; module_invoke_all('exit'); exit; - } - + } } /** * Render users, blog and forum posts and comments, as SIOC in XML * - * @param object $view - * @return none + * @param $view + * @return */ function rdf_sioc_xml_render($view) { - //var_dump($view); - //module_invoke_all('exit'); - //exit; - global $base_url; - $xml = "\n"; - $xml .= ''."\n"; + // var_dump($view); + // module_invoke_all('exit'); + // exit; + global $base_url; + $xml = "\n"; + $xml .= ''."\n"; $xml .= "\r\n"; if ($view->base_table == 'users') { - $has_uid = false; - $has_name = false; - $has_email = false; - foreach($view->field as $field) { - //if (($field->field_alias == 'uid') && ($field['options']['field'] == 'uid')) - if ($field->options['field'] == 'uid') - $has_uid = true; - if ($field->options['field'] == 'name') - $has_name = true; - if ($field->options['field'] == 'mail') - $has_email = true; - } - if (!$has_uid) { - if ($view->override_path) - print ('The uid field must be present.'); - else - drupal_set_message('The uid field must be present.', 'error'); - return; - } + $has_uid = FALSE; + $has_name = FALSE; + $has_email = FALSE; + foreach ($view->field as $field) { + // if (($field->field_alias == 'uid') && ($field['options']['field'] == 'uid')) + if ($field->options['field'] == 'uid') + $has_uid = TRUE; + if ($field->options['field'] == 'name') + $has_name = TRUE; + if ($field->options['field'] == 'mail') + $has_email = TRUE; + } + if (!$has_uid) { + if ($view->override_path) + print 'The uid field must be present.'; + else + drupal_set_message(t('The uid field must be present.'), 'error'); + return; + } if (!$has_name) { if ($view->override_path) - print ('The name field must be present.'); + print 'The name field must be present.'; else - drupal_set_message('The name field must be present.', 'error'); + drupal_set_message(t('The name field must be present.'), 'error'); return; } if (!$has_email) { if ($view->override_path) - print ('The email field must be present.'); + print 'The email field must be present.'; else - drupal_set_message('The email field must be present.', 'error'); + drupal_set_message(t('The email field must be present.'), 'error'); return; - } - $xml .= "name, array('absolute'=>true))."\">\n"; - $xml .= " SIOC user profiles for: ".variable_get('site_name', 'drupal')."\n"; + } + $xml .= "name, array('absolute' => TRUE)) ."\">\n"; + $xml .= " SIOC user profiles for: ". variable_get('site_name', 'drupal') ."\n"; $xml .= " \n"; - $xml .= " A User is an online account of a member of an online community. - It is connected to Items and Posts that a User creates or edits, - to Containers and Forums that it is subscribed to or moderates and - to Sites that it administers. Users can be grouped for purposes of - allowing access to certain Forums or enhanced community site features (weblogs, webmail, etc.). - A foaf:Person will normally hold a registered User account on a Site - (through the property foaf:holdsAccount), and will use this account - to create content and interact with the community. sioc:User describes - properties of an online account, and is used in combination with a - foaf:Person (using the property sioc:account_of) which describes - information about the individual itself.\n"; + $xml .= " A User is an online account of a member of an online community. "; + $xml .= "It is connected to Items and Posts that a User creates or edits, "; + $xml .= "to Containers and Forums that it is subscribed to or moderates and "; + $xml .= "to Sites that it administers. Users can be grouped for purposes of "; + $xml .= "allowing access to certain Forums or enhanced community site features (weblogs, webmail, etc.)."; + $xml .= "A foaf:Person will normally hold a registered User account on a Site "; + $xml .= "(through the property foaf:holdsAccount), and will use this account "; + $xml .= "to create content and interact with the community. sioc:User describes "; + $xml .= "properties of an online account, and is used in combination with a "; + $xml .= "foaf:Person (using the property sioc:account_of) which describes "; + $xml .= "information about the individual itself.\n"; $xml .= " \n"; $xml .= "####foaf_topics####\n"; $xml .= " \n"; $xml .= "\n"; - foreach($view->result as $node) $xml .= rdf_sioc_xml_user_render($node); + foreach ($view->result as $node) $xml .= rdf_sioc_xml_user_render($node); } if ($view->base_table == 'node') { - $has_nid = false; - $has_type = false; - $has_created = false; - $has_changed = false; - $has_last_updated = false; - $has_title = false; - $has_body = false; - $has_uid = false; - foreach($view->field as $field) { - //if (($field->field_alias == 'uid') && ($field['options']['field'] == 'uid')) - if ($field->options['field'] == 'nid') - $has_nid = true; - if ($field->options['field'] == 'type') - $has_type = true; - if ($field->options['field'] == 'created') - $has_created = true; - if ($field->options['field'] == 'changed') - $has_changed = true; - if ($field->options['field'] == 'last_updated') - $has_last_updated = true; - if ($field->options['field'] == 'title') - $has_title = true; + $has_nid = FALSE; + $has_type = FALSE; + $has_created = FALSE; + $has_changed = FALSE; + $has_last_updated = FALSE; + $has_title = FALSE; + $has_body = FALSE; + $has_uid = FALSE; + foreach ($view->field as $field) { + // if (($field->field_alias == 'uid') && ($field['options']['field'] == 'uid')) + if ($field->options['field'] == 'nid') + $has_nid = TRUE; + if ($field->options['field'] == 'type') + $has_type = TRUE; + if ($field->options['field'] == 'created') + $has_created = TRUE; + if ($field->options['field'] == 'changed') + $has_changed = TRUE; + if ($field->options['field'] == 'last_updated') + $has_last_updated = TRUE; + if ($field->options['field'] == 'title') + $has_title = TRUE; if ($field->options['field'] == 'body') - $has_body = true; - if ($field->options['field'] == 'uid') - $has_uid = true; + $has_body = TRUE; + if ($field->options['field'] == 'uid') + $has_uid = TRUE; } if (!$has_nid) { if ($view->override_path) - print ('The Node: Nid field must be present.'); + print 'The Node: Nid field must be present.'; else - drupal_set_message('The Node: Nid field must be present.', 'error'); + drupal_set_message(t('The Node: Nid field must be present.'), 'error'); return; } if (!$has_type) { if ($view->override_path) - print ('The Node: Type field must be present.'); + print 'The Node: Type field must be present.'; else - drupal_set_message('The Node: Type field must be present.', 'error'); + drupal_set_message(t('The Node: Type field must be present.'), 'error'); return; } if (!$has_created) { if ($view->override_path) - print ('The Node: Post date field must be present.'); + print 'The Node: Post date field must be present.'; else - drupal_set_message('The Node: Post date field must be present.', 'error'); + drupal_set_message(t('The Node: Post date field must be present.'), 'error'); return; } if (!$has_changed) { if ($view->override_path) - print ('The Node: Updated date field must be present.'); + print 'The Node: Updated date field must be present.'; else - drupal_set_message('The Node: Updated date field must be present.', 'error'); + drupal_set_message(t('The Node: Updated date field must be present.'), 'error'); return; } if (!$has_last_updated) { if ($view->override_path) - print ('The Node: Updated/commented date field must be present.'); + print 'The Node: Updated/commented date field must be present.'; else - drupal_set_message('The Node: Updated/commented date field must be present.', 'error'); + drupal_set_message(t('The Node: Updated/commented date field must be present.'), 'error'); return; } if (!$has_title) { if ($view->override_path) - print ('The Node: Title field must be present.'); + print 'The Node: Title field must be present.'; else - drupal_set_message('The Node: Title field must be present.', 'error'); + drupal_set_message(t('The Node: Title field must be present.'), 'error'); return; } if (!$has_body) { if ($view->override_path) - print ('The Node: Body field must be present.'); + print 'The Node: Body field must be present.'; else - drupal_set_message('The Node: Body field must be present.', 'error'); + drupal_set_message(t('The Node: Body field must be present.'), 'error'); return; - } + } if (!$has_uid) { if ($view->override_path) - print ('The User: Uid field must be present.'); + print 'The User: Uid field must be present.'; else - drupal_set_message('The User: Uid field must be present.', 'error'); + drupal_set_message(t('The User: Uid field must be present.'), 'error'); return; } $users = array(); $nodes = array(); - $xml .= "name, array('absolute'=>true))."\">\n"; - $xml .= " SIOC profile for: ".variable_get('site_name', 'drupal')."\n"; + $xml .= "name, array('absolute' => TRUE)) ."\">\n"; + $xml .= " SIOC profile for: ". variable_get('site_name', 'drupal') ."\n"; $xml .= " \n"; - $xml .= " A SIOC profile describes the structure and contents of a weblog in a machine readable form. For more information please refer to http://sioc-project.org/. - A Post is an article or message posted by a User to a Forum or Site. A series of Posts - may be threaded if they share a common subject and are connected by reply or - by date relationships. Posts will have content and may also have attached - files, which can be edited or deleted by the Moderator of the Forum or Site that - contains the Post.\n"; + $xml .= " A SIOC profile describes the structure and contents of a weblog in a machine readable form. For more information please refer to http://sioc-project.org/."; + $xml .= "A Post is an article or message posted by a User to a Forum or Site. A series of Posts "; + $xml .= "may be threaded if they share a common subject and are connected by reply or "; + $xml .= "by date relationships. Posts will have content and may also have attached "; + $xml .= "files, which can be edited or deleted by the Moderator of the Forum or Site that "; + $xml .= "contains the Post.\n"; $xml .= " \n"; - //$xml .= " \n"; + // $xml .= " \n"; $xml .= " \n"; $xml .= "\n"; - foreach($view->result as $node) rdf_sioc_xml_node_render($node, &$users, &$nodes); + foreach ($view->result as $node) rdf_sioc_xml_node_render($node, &$users, &$nodes); foreach ($users as $user_xml) $xml .= $user_xml; foreach ($nodes as $node_xml) $xml .= $node_xml; } - $xml.="\n"; - if ($view->override_path) //inside live preview + $xml .= "\n"; + if ($view->override_path) { // inside live preview print htmlspecialchars($xml); - else { + } + else { drupal_set_header('Content-Type: application/rdf+xml'); print $xml; module_invoke_all('exit'); @@ -322,116 +323,116 @@ function rdf_sioc_xml_render($view) { } } -function rdf_sioc_xml_user_render($node, $uid=null, $user_name=null, $user_email=null) { +function rdf_sioc_xml_user_render($node, $uid = NULL, $user_name = NULL, $user_email = NULL) { if (func_num_args() == 1) { - foreach($node as $field_label=>$field_value) { + foreach ($node as $field_label => $field_value) { $label = views_rdf_strip_illegal_chars($field_label); $value = views_xml_strip_illegal_chars(views_xml_is_date($field_value)); if (is_null($value) || ($value === '')) continue; // if (strtotime($value)) // $value = date(DATE_ISO8601, strtotime($value)); if ((strtolower($label) == 'id') || (strtolower($label) == 'uid')) { - $uid = $value; + $uid = $value; } if ((strtolower($label) == 'name') || (strtolower($label) == 'users_name')) { - $user_name = $value; + $user_name = $value; } if ((strtolower($label) == 'email') || (strtolower($label) == 'users_mail')) { - $user_email = $value; - } + $user_email = $value; + } } if (empty($user_name)) return; } - $xml .="true))."\">\n"; + $xml .=" TRUE)) ."\">\n"; $xml .=" $user_name\n"; - $xml .=" ".md5('mailto:'.$user_email)."\n"; + $xml .=" ". md5('mailto:'. $user_email) ."\n"; $xml .=" \n"; $xml .=" \n"; $xml .=" $user_name\n"; $xml .=" \n"; - $xml .=" ".md5('mailto:'.$user_email)."\n"; - $xml .=" true))."\" rdfs:label=\"$user_name\"/>\n"; + $xml .=" ". md5('mailto:'. $user_email) ."\n"; + $xml .=" TRUE)) ."\" rdfs:label=\"$user_name\"/>\n"; $roles = array(); $roles_query = db_query("SELECT r.name AS name, r.rid AS rid FROM {users_roles} ur, {role} r WHERE ur.uid = %d AND ur.rid = r.rid", $uid); while ($role = db_fetch_object($roles_query)) $roles[$role->rid] = $role->name; if (count($roles) > 0) { $xml .=" \n"; - foreach($roles as $rid=>$name) + foreach ($roles as $rid => $name) $xml .=" \n"; - $xml .=" \n"; - } + $xml .=" \n"; + } $xml .=" \n"; $xml .=" \n"; - $xml .="\n"; - return $xml; + $xml .="\n"; + return $xml; } -function rdf_sioc_xml_node_render($node, &$users=null, &$nodes = null) { - global $base_url; - //i - foreach($node as $field_label=>$field_value) { +function rdf_sioc_xml_node_render($node, &$users = NULL, &$nodes = NULL) { + global $base_url; + // i + foreach ($node as $field_label => $field_value) { $label = views_rdf_strip_illegal_chars($field_label); $value = views_rdf_strip_illegal_chars(views_rdf_is_date($field_value)); if (is_null($value) || ($value === '')) continue; // if (strtotime($value)) // $value = date(DATE_ISO8601, strtotime($value)); if ((strtolower($label) == 'id') || (strtolower($label) == 'nid')) { - $nid = $value; + $nid = $value; } if ((strtolower($label) == 'title') || (strtolower($label) == 'node_title')) { - $title = $value; + $title = $value; } if ((strtolower($label) == 'body') || (strtolower($label) == 'node_revisions_body')) { - $body = $value; + $body = $value; } if ((strtolower($label) == 'type') || (strtolower($label) == 'node_type')) { - $type = $value; + $type = $value; } if ((strtolower($label) == 'created') || (strtolower($label) == 'node_created')) { $created = $value; } if ((strtolower($label) == 'changed') || (strtolower($label) == 'node_changed')) { - $changed = $value; - } + $changed = $value; + } if ((strtolower($label) == 'last_updated') || (strtolower($label) == 'node_comment_statistics_last_updated')) { - $last_updated = $value; + $last_updated = $value; } if ((strtolower($label) == 'uid') || (strtolower($label) == 'users_uid')) { - $uid = $value; - } + $uid = $value; + } } - $user = user_load($uid); - if (!array_key_exists($uid, $users)) $users[$uid] = rdf_sioc_xml_user_render(null, $uid, $user->name, $user->mail); + $user = user_load($uid); + if (!array_key_exists($uid, $users)) $users[$uid] = rdf_sioc_xml_user_render(NULL, $uid, $user->name, $user->mail); if (!array_key_exists($nid, $nodes)) { - if (($type == 'page') || ($type == 'story') || ($type == 'forum') || ($type == 'blog')) $nodes[$nid] = rdf_sioc_xml_story_render($xml, $nid, $title, $type, $created, $changed, $last_updated, $uid, $body); + if (($type == 'page') || ($type == 'story') || ($type == 'forum') || ($type == 'blog')) $nodes[$nid] = rdf_sioc_xml_story_render($xml, $nid, $title, $type, $created, $changed, $last_updated, $uid, $body); } - //$xml = ''; - //var_dump($nodes); - //var_dump($users); - //module_invoke_all('exit'); + // $xml = ''; + // var_dump($nodes); + // var_dump($users); + // module_invoke_all('exit'); return; } function rdf_sioc_xml_story_render($xml, $nid, $title, $type, $created, $changed, $last_updated, $uid, $body) { - $node_url = url($nid, array('absolute'=>true)); + $node_url = url($nid, array('absolute' => TRUE)); $xml .= "\n"; $xml .= " $title\n"; $xml .= " \n "; $xml .= " \n"; $xml .= " \n"; - $xml .= " ".date(DATE_ISO8601, $created)."\n"; - $xml .= " ".date(DATE_ISO8601, $changed)."\n"; + $xml .= " ". date(DATE_ISO8601, $created) ."\n"; + $xml .= " ". date(DATE_ISO8601, $changed) ."\n"; $xml .= " \n"; $xml .= " \n"; - - /*Add taxonomy terms as SIOC topics*/ + + /* Add taxonomy terms as SIOC topics */ $query = db_query('SELECT tn.tid AS tid, td.name AS name FROM {term_node} tn, {term_data} td WHERE td.tid = tn.tid AND tn.nid = %d', $nid); while ($term = db_fetch_object($query)) { - $taxonomy_terms = " name\" rdf:resource=\"".url("taxonomy/term/$term->tid", array('absolute' => TRUE))."\" />\n"; + $taxonomy_terms = " name\" rdf:resource=\"". url("taxonomy/term/$term->tid", array('absolute' => TRUE)) ."\" />\n"; } $xml .= $taxonomy_terms; - - /*Add comments as SIOC replies*/ + + /* Add comments as SIOC replies */ $query_count = 'SELECT COUNT(*) FROM {comments} WHERE nid = %d AND status = %d'; $query = 'SELECT c.cid as cid, c.pid, c.nid, c.subject, c.comment, c.format, c.timestamp, c.name, c.mail, c.homepage, u.uid, u.name AS registered_name, u.signature, u.picture, u.data, c.thread, c.status FROM {comments} c INNER JOIN {users} u ON c.uid = u.uid WHERE c.nid = %d and c.status = %d ORDER BY SUBSTRING(c.thread, 1, (LENGTH(c.thread) - 1))'; $query_args = array($nid, COMMENT_PUBLISHED); @@ -453,8 +454,8 @@ function rdf_sioc_xml_story_render($xml, // $comment_children--; // $comments .= " \n"; // } -// } -// $comments .=" cid\">\n"; +// } +// $comments .=" cid\">\n"; // while ($comment_children-- > 0) { // $num_rows = TRUE; // $comments .=" comment]]>\n"; @@ -465,22 +466,22 @@ function rdf_sioc_xml_story_render($xml, $comments .= " \n"; $comments .= " cid\">\n"; if ($comment->subject) $comments .= " $comment->subject\n"; - if ($comment->timestamp) $comments .= " ".date(DATE_ISO8601, $comment->timestamp)."\n"; + if ($comment->timestamp) $comments .= " ". date(DATE_ISO8601, $comment->timestamp) ."\n"; if ($comment->uid) { - $comments .= " \n"; + $comments .= " \n"; $comments .= " \n"; $comments .= " $comment->registered_name\n"; $comments .= " mail\"/>\n"; - $comments .=" uid, array('absolute'=>true))."\" rdfs:label=\"$comment->registered_name\"/>\n"; - $comments .= " \n"; - $comments .= " \n"; - } + $comments .=" uid, array('absolute' => TRUE)) ."\" rdfs:label=\"$comment->registered_name\"/>\n"; + $comments .= " \n"; + $comments .= " \n"; + } $comments .= " comment]]>\n"; $comments .= " \n"; $comments .= " \n"; } - $xml.= $comments; - + $xml .= $comments; + $xml .= "\n"; - return $xml; -} \ No newline at end of file + return $xml; +} Index: views-view-row-unformatted.tpl.php =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/views_datasource/views-view-row-unformatted.tpl.php,v retrieving revision 1.1.2.1 diff -u -p -r1.1.2.1 views-view-row-unformatted.tpl.php --- views-view-row-unformatted.tpl.php 8 Jul 2008 19:43:38 -0000 1.1.2.1 +++ views-view-row-unformatted.tpl.php 21 Oct 2009 20:02:34 -0000 @@ -1,7 +1,7 @@ $field) -// print $id.":".$field->content."\n"; +// print ('template'); +// print_r($fields); +// print_r($row); +// print_r($options); +// foreach ($fields as $id => $field) +// print $id.":".$field->content."\n"; $field_separator = filter_xss($options['separator']); -foreach($row as $field_label => $field_value) { +foreach ($row as $field_label => $field_value) { $label = str_replace(':', '#colon#', $field_label); $value = filter_xss(str_replace(':', '#colon#', $field_value)); - $row_unformatted.= $label.":".(!is_null($value) ? $value : "").$field_separator; + $row_unformatted .= $label .":". (!is_null($value) ? $value : "") . $field_separator; } -print rtrim($row_unformatted, $field_separator).PHP_EOL; - - \ No newline at end of file +print rtrim($row_unformatted, $field_separator) . PHP_EOL; Index: views-view-xhtml.tpl.php =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/views_datasource/Attic/views-view-xhtml.tpl.php,v retrieving revision 1.1.2.8 diff -u -p -r1.1.2.8 views-view-xhtml.tpl.php --- views-view-xhtml.tpl.php 8 Sep 2009 16:43:07 -0000 1.1.2.8 +++ views-view-xhtml.tpl.php 21 Oct 2009 20:02:34 -0000 @@ -1,8 +1,9 @@ '."\r\n"; $xhtml .= ''."\r\n"; foreach ($view->result 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 $field_label => $field_value) { + $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 $field_label => $field_value) { $label = views_rdf_strip_illegal_chars($field_label); $value = views_xml_strip_illegal_chars(views_xml_is_date($field_value)); - $label = str_replace('_value', '', str_replace("profile_values_profile_", '', $label)); //strip out Profile: from profile fields + $label = str_replace('_value', '', str_replace("profile_values_profile_", '', $label)); // strip out Profile: from profile fields if (is_null($value) || ($value === '')) continue; - //$xhtml .= "$label:$value"; + // $xhtml .= "$label:$value"; if (stripos($label, 'address_type') !== FALSE) { - $hcard['adr']['type'] = $value; + $hcard['adr']['type'] = $value; } - if (stripos($label, 'post_office_box') !== FALSE) { - $hcard['adr']['post-office-box'] = $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; + $hcard['adr']['street-address'][] = $value; } if (stripos($label, 'extended_address') !== FALSE) { - $hcard['adr']['extended-address'] = $value; + $hcard['adr']['extended-address'] = $value; } if (stripos($label, 'region') !== FALSE) { - $hcard['adr']['region'] = $value; + $hcard['adr']['region'] = $value; } if (stripos($label, 'locality') !== FALSE) { - $hcard['adr']['locality'] = $value; + $hcard['adr']['locality'] = $value; } if (stripos($label, 'postal_code') !== FALSE) { - $hcard['adr']['postal-code'] = $value; + $hcard['adr']['postal-code'] = $value; } if (stripos($label, 'country_name') !== FALSE) { - $hcard['adr']['country-name'] = $value; + $hcard['adr']['country-name'] = $value; } if (stripos($label, 'agent') !== FALSE) { - $hcard['agent'][] = $value; + $hcard['agent'][] = $value; } if (stripos($label, 'bday') !== FALSE) { if (preg_match('/\d/', $value)) { if (strtotime($value)) $value = date(EXHIBIT_DATE_FORMAT, strtotime($value)); } - $hcard['bday'] = $value; + $hcard['bday'] = $value; } if (stripos($label, 'class') !== FALSE) { - $hcard['class'] = $value; + $hcard['class'] = $value; } if (stripos($label, 'category') !== FALSE) { - $hcard['category'][] = $value; + $hcard['category'][] = $value; } if (stripos($label, 'email') !== FALSE) { - $hcard['email'][$label] = $value; + $hcard['email'][$label] = $value; } if (stripos($label, 'honorific_prefix') !== FALSE) { - $hcard['n']['honorific-prefix'] = $value; + $hcard['n']['honorific-prefix'] = $value; } if (stripos($label, 'given_name') !== FALSE) { - $hcard['n']['given-name'] = $value; + $hcard['n']['given-name'] = $value; } if (stripos($label, 'additional_name') !== FALSE) { - $hcard['n']['additional-name'] = $value; + $hcard['n']['additional-name'] = $value; } if (stripos($label, 'family-name') !== FALSE) { - $hcard['n']['family-name'] = $value; + $hcard['n']['family-name'] = $value; } if (stripos($label, 'honorific_suffix') !== FALSE) { - $hcard['n']['honorific-suffix'] = $value; - } + $hcard['n']['honorific-suffix'] = $value; + } if (stripos($label, 'fn') !== FALSE) { - $hcard['fn'] = $value; + $hcard['fn'] = $value; } if (stripos($label, 'nickname') !== FALSE) { - $hcard['nickname'] = $value; + $hcard['nickname'] = $value; } if (stripos($label, 'organization_name') !== FALSE) { - $hcard['org']['organization-name'] = $value; + $hcard['org']['organization-name'] = $value; } if (stripos($label, 'organization_unit') !== FALSE) { - $hcard['org']['organization-unit'][] = $value; + $hcard['org']['organization-unit'][] = $value; } if (stripos($label, 'photo') !== FALSE) { - $hcard['photo'] = $value; + $hcard['photo'] = $value; } if (stripos($label, 'tel') === 0) { - $hcard['tel'][$label] = $value; - } - } + $hcard['tel'][$label] = $value; + } + } $xhtml .= '
'."\r\n"; if ($hcard['photo'] != '') - $xhtml .=' photo'."
\r\n"; + $xhtml .= ' photo'."
\r\n"; if ($hcard['fn']) - $xhtml .=' '.$hcard['fn'].''."
\r\n"; + $xhtml .= ' '. $hcard['fn'] .''."
\r\n"; if ($hcard['nickname']) - $xhtml .=' '.$hcard['nickname'].''."
\r\n"; + $xhtml .= ' '. $hcard['nickname'] .''."
\r\n"; $name = $hcard['n']; - if ($hcard['fn']) + if ($hcard['fn']) $xhtml .= ' '."\r\n"; else $xhtml .= ' '."\r\n"; if ($name['honorific-prefix'] !== '') - $xhtml .=' '.$name['honorific-prefix'].''."\r\n"; + $xhtml .= ' '. $name['honorific-prefix'] .''."\r\n"; if ($name['given-name'] !== '') - $xhtml .=' '.$name['given-name'].''."\r\n"; + $xhtml .= ' '. $name['given-name'] .''."\r\n"; if ($name['additional-name'] !== '') - $xhtml .=' '.$name['additional-name'].''."\r\n"; + $xhtml .= ' '. $name['additional-name'] .''."\r\n"; if ($name['family-name'] !== '') - $xhtml .=' '.$name['family-name'].''."\r\n"; + $xhtml .= ' '. $name['family-name'] .''."\r\n"; if ($name['honorific-suffix'] !== '') - $xhtml .=' '.$name['honorific-suffix'].''."\r\n"; + $xhtml .= ' '. $name['honorific-suffix'] .''."\r\n"; $xhtml .= '
'."\r\n"; if ($hcard['nickname'] !== '') - $xhtml .= ' '.$hcard['nickname'].'
'."\r\n"; + $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"; + $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"; + $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"; + $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"; + $xhtml .= ' '. $address['extended-address'] .''."
\r\n"; if ($address['region'] !== '') - $xhtml .=' '.$address['region'].''."
\r\n"; + $xhtml .= ' '. $address['region'] .''."
\r\n"; if ($address['locality'] !== '') - $xhtml .=' '.$address['locality'].''."
\r\n"; + $xhtml .= ' '. $address['locality'] .''."
\r\n"; if ($address['postal-code'] !== '') - $xhtml .=' '.$address['postal-code'].''."
\r\n"; + $xhtml .= ' '. $address['postal-code'] .''."
\r\n"; if ($address['country-name'] !== '') - $xhtml .=' '.$address['country-name'].''."\r\n"; - $xhtml .= '

'."\r\n"; + $xhtml .= ' '. $address['country-name'] .''."\r\n"; + $xhtml .= '
'."\r\n"; $agents = $hcard['agent']; - foreach ($agents as $agent) - $xhtml .=' '.$agent.''."
\r\n"; + foreach ($agents as $agent) + $xhtml .= ' '. $agent .''."
\r\n"; $birthday = $hcard['bday']; - if ($birthday !== '') - $xhtml .=' '.$birthday.''."
\r\n"; + 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"; + $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_addrs = $hcard['email']; + foreach ($email_addrs as $email_type => $email_addr) + $xhtml .= ' '."
\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"; - } + 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 + $xhtml .= ''."\r\n"; + $xhtml .= ''."\r\n"; + if ($view->override_path) { // inside live preview print htmlspecialchars($xhtml); - else { - drupal_set_header('Content-Type: text/html'); - print $xhtml; - //var_dump($view); - module_invoke_all('exit'); - exit; - } + } + else { + drupal_set_header('Content-Type: text/html'); + print $xhtml; + // var_dump($view); + module_invoke_all('exit'); + exit; + } } -function xhtml_hcalendar_render ($view) { +function xhtml_hcalendar_render($view) { $xhtml .= ''."\n"; $xhtml .= '\r\n"; $xhtml .= ''."\r\n"; @@ -247,141 +250,141 @@ function xhtml_hcalendar_render ($view) $xhtml .= ''."\r\n"; $xhtml .= ''."\r\n"; foreach ($view->result as $node) { - $hcalendar = array(); - foreach($node as $field_label => $field_value) { + $hcalendar = array(); + foreach ($node as $field_label => $field_value) { $label = views_rdf_strip_illegal_chars($field_label); $value = views_xml_strip_illegal_chars(views_xhtml_is_date($field_value)); - $label = str_replace('_value', '', str_replace("profile_values_profile_", '', $label)); //strip out Profile: from profile fields + $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, 'class') !== FALSE) { - $hcalendar['class'] = $value; + if (stripos($label, 'class') !== FALSE) { + $hcalendar['class'] = $value; } if (stripos($label, 'category') !== FALSE) { - $hcalendar['category'][] = $value; + $hcalendar['category'][] = $value; } if (stripos($label, 'description') !== FALSE) { - $hcalendar['description'] = $value; + $hcalendar['description'] = $value; } if (stripos($label, 'summary') !== FALSE) { - $hcalendar['summary'] = $value; + $hcalendar['summary'] = $value; } if ((stripos($label, 'dtstart') !== FALSE) || (stripos($label, 'event_start') !== FALSE) || (stripos($label, 'eventstarttime') !== FALSE)) { if (preg_match('/\d/', $value)) { if (strtotime($value)) $value = date(EXHIBIT_DATE_FORMAT, strtotime($value)); } - $hcalendar['dtstart'] = $value; + $hcalendar['dtstart'] = $value; } if ((stripos($label, 'dtend') !== FALSE) || (stripos($label, 'event_end') !== FALSE) || (stripos($label, 'eventendtime') !== FALSE)) { if (preg_match('/\d/', $value)) { if (strtotime($value)) $value = date(EXHIBIT_DATE_FORMAT, strtotime($value)); } - $hcalendar['dtend'] = $value; + $hcalendar['dtend'] = $value; } if (stripos($label, 'duration') !== FALSE) { - $hcalendar['duration'] = $value; + $hcalendar['duration'] = $value; } if (stripos($label, 'geo_latitude') !== FALSE) { - $hcalendar['geo']['latitude'] = $value; + $hcalendar['geo']['latitude'] = $value; } if (stripos($label, 'geo_longitude') !== FALSE) { - $hcalendar['geo']['longitude'] = $value; + $hcalendar['geo']['longitude'] = $value; } if (stripos($label, 'location') !== FALSE) { - $hcalendar['location'] = $value; + $hcalendar['location'] = $value; } if (stripos($label, 'status') !== FALSE) { - $hcalendar['status'] = $value; + $hcalendar['status'] = $value; } if (stripos($label, 'uid') !== FALSE) { - $hcalendar['uid'] = $value; + $hcalendar['uid'] = $value; } if (stripos($label, 'url') !== FALSE) { - $hcalendar['url'] = $value; + $hcalendar['url'] = $value; } if (stripos($label, 'last_modified') !== FALSE) { if (preg_match('/\d/', $value)) { if (strtotime($value)) $value = date(EXHIBIT_DATE_FORMAT, strtotime($value)); - } - $hcalendar['last-modified'] = $value; + } + $hcalendar['last-modified'] = $value; } if (stripos($label, 'address_type') !== FALSE) { - $hcalendar['adr']['type'] = $value; + $hcalendar['adr']['type'] = $value; } if (stripos($label, 'post_office_box') !== FALSE) { - $hcalendar['adr']['post-office-box'] = $value; + $hcalendar['adr']['post-office-box'] = $value; } if (stripos($label, 'street_address') !== FALSE) { - $hcalendar['adr']['street-address'][] = $value; + $hcalendar['adr']['street-address'][] = $value; } if (stripos($label, 'extended_address') !== FALSE) { - $hcalendar['adr']['extended-address'] = $value; + $hcalendar['adr']['extended-address'] = $value; } if (stripos($label, 'region') !== FALSE) { - $hcalendar['adr']['region'] = $value; + $hcalendar['adr']['region'] = $value; } if (stripos($label, 'locality') !== FALSE) { - $hcalendar['adr']['locality'] = $value; + $hcalendar['adr']['locality'] = $value; } if (stripos($label, 'postal_code') !== FALSE) { - $hcalendar['adr']['postal-code'] = $value; + $hcalendar['adr']['postal-code'] = $value; } if (stripos($label, 'country_name') !== FALSE) { - $hcalendar['adr']['country-name'] = $value; + $hcalendar['adr']['country-name'] = $value; } } $xhtml .= '
'."\r\n"; $class = $hcalendar['class']; - if ($class) $xhtml .=' '.$class.''."
\r\n"; + if ($class) $xhtml .= ' '. $class .''."
\r\n"; $categories = $hcalendar['category']; - if ($categories) - foreach ($categories as $category) $xhtml .=' '.$category.''."
\r\n"; + if ($categories) + foreach ($categories as $category) $xhtml .= ' '. $category .''."
\r\n"; $dtstart = $hcalendar['dtstart']; - if ($dtstart) - $xhtml .=' '.$dtstart.''."
\r\n"; + if ($dtstart) + $xhtml .= ' '. $dtstart .''."
\r\n"; $summary = $hcalendar['summary']; - if ($summary) $xhtml .=' '.$summary.''."
\r\n"; + if ($summary) $xhtml .= ' '. $summary .''."
\r\n"; $dtend = $hcalendar['dtend']; - if ($dtend) $xhtml .=' '.$dtend.''."
\r\n"; + if ($dtend) $xhtml .= ' '. $dtend .''."
\r\n"; $location = $hcalendar['location']; - if ($location) $xhtml .=' '.$location.''."
\r\n"; + if ($location) $xhtml .= ' '. $location .''."
\r\n"; $geo_latitude = $hcalendar['geo-latitude']; $geo_longitude = $hcalendar['geo-longitude']; if ($geo_latitude || $geo_longitude) { $xhtml .= "
\n"; if ($location) $xhtml .= " $location: "; if ($geo_latitude) $xhtml .= " $geo_latitude; "; - if ($geo_longitude) $xhtml .=" $geo_longitude"; + if ($geo_longitude) $xhtml .= " $geo_longitude"; $xhtml .= "
\n"; } $status = $hcalendar['status']; - if ($status) $xhtml .=' '.$status.''."
\r\n"; + if ($status) $xhtml .= ' '. $status .''."
\r\n"; $duration = $hcalendar['duration']; - if ($duration) $xhtml .=' '.$duration.''."
\r\n"; + if ($duration) $xhtml .= ' '. $duration .''."
\r\n"; $uid= $hcalendar['uid']; - if ($uid) $xhtml .=' '.$uid.''."
\r\n"; + if ($uid) $xhtml .= ' '. $uid .''."
\r\n"; $url = $hcalendar['url']; - if ($url) $xhtml .=' '.$url.''."
\r\n"; + if ($url) $xhtml .= ' '. $url .''."
\r\n"; $last_modified = $hcalendar['last-modified']; - if ($last_modified) $xhtml .=' '.$last_modified.''."
\r\n"; + if ($last_modified) $xhtml .= ' '. $last_modified .''."
\r\n"; $description = $hcalendar['description']; - if ($description) $xhtml .=' '.$description.''."
\r\n"; + if ($description) $xhtml .= ' '. $description .''."
\r\n"; $adr = $hcalendar['adr']; if ($adr) { $xhtml .= "
\n"; $adr_type = $adr['address-type']; - if ($adr_type) $xhtml .= ' '.$adr_type.''."
\r\n"; - $xhtml .="
"; + if ($adr_type) $xhtml .= ' '. $adr_type .''."
\r\n"; + $xhtml .= "
"; } - $xhtml .= ''."\r\n"; + $xhtml .= ''."\r\n"; } - $xhtml.=''."\r\n"; - $xhtml.=''."\r\n"; + $xhtml .= ''."\r\n"; + $xhtml .= ''."\r\n"; drupal_set_header('Content-Type: text/html'); - //var_dump($view); + // var_dump($view); print $xhtml; module_invoke_all('exit'); exit; -} \ No newline at end of file +} Index: views-view-xml.tpl.php =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/views_datasource/Attic/views-view-xml.tpl.php,v retrieving revision 1.1.2.10 diff -u -p -r1.1.2.10 views-view-xml.tpl.php --- views-view-xml.tpl.php 7 Oct 2009 15:12:12 -0000 1.1.2.10 +++ views-view-xml.tpl.php 21 Oct 2009 20:02:34 -0000 @@ -1,7 +1,7 @@ '."\n"; + $xml .= ''."\n"; $xml .= ''."\n"; - $xml .=''."\n"; - + $xml .=''."\n"; + foreach ($view->result as $node) { - $xml .= ' '."\n"; - foreach($node as $label => $value) { + $xml .= ' '."\n"; + foreach ($node as $label => $value) { $label = views_xml_strip_illegal_chars($label); $value = views_xml_strip_illegal_chars(views_xml_is_date($value)); if (is_null($value) || ($value === '')) continue; // if (preg_match('/\d/', $value)) { // 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 - +// } + $label = str_replace('_value', '', str_replace("profile_values_profile_", '', $label)); // strip out Profile: from profile fields + $xml .= " <$label>\n"; } $xml .= ' '."\n"; } $xml .=''."\n"; - if ($view->override_path) //inside live preview + 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; + } + else { + drupal_set_header('Content-Type: text/xml'); + print $xml; + module_invoke_all('exit'); + exit; } } function xml_opml_render($view) { - //var_dump($view); - //return; + // var_dump($view); + // return; global $user; global $base_url; - $xml .= ''."\n"; + $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 .=' '.$base_url.''; - $xml .=' '.date(DATE_ISO8601, time()).''."\n"; - $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 .=' '. $base_url .''; + $xml .=' '. date(DATE_ISO8601, time()) .''."\n"; + $xml .=''."\n"; + $xml .=''."\n"; foreach ($view->result as $node) { $xml .= ' $field_value) { + $fieldcount = 0; + foreach ($node as $field_name => $field_value) { $label = views_xml_strip_illegal_chars($field_name); $value = views_xml_strip_illegal_chars(views_xml_is_date($field_value)); if (is_null($value) || ($value === '')) continue; - $fieldcount++; - $label = str_replace('_value', '', str_replace("profile_values_profile_", '', $label)); //strip out Profile: from profile fields + $fieldcount++; + $label = str_replace('_value', '', str_replace("profile_values_profile_", '', $label)); // strip out Profile: from profile fields if (is_null($value) || ($value === '')) continue; if ((strtolower($label) == 'text') || (strtolower($label) == 'node_revisions_body')) $label = "text"; if (is_null($value) || ($value === '') || ($value === 0)) continue; if ((strtolower($label) == 'type') || (strtolower($label) == 'node_type')) - $label = "type"; - if ((strtolower($label) == 'id') || (strtolower($label) == 'nid')) { //if a nid is given construct the url attribute - //$url = $base_url.'index.php?q=node/'.$value; - $url = url("node/".$value, array('absolute'=>true)); + $label = "type"; + if ((strtolower($label) == 'id') || (strtolower($label) == 'nid')) { // if a nid is given construct the url attribute + // $url = $base_url .'index.php?q=node/'. $value; + $url = url("node/". $value, array('absolute' => TRUE)); } - + if ((strtolower($label) == 'published') || (strtolower($label) == 'node_created')) { - $label = 'created'; - if (intval($value)) //timestamp - $value = date(DATE_RFC822, intval($value)) ; - else if(getdate($value)) //string date - $value = date(DATE_RFC822, strtotime($value)); - } - $xml .= $label. '="'.preg_replace('/[^A-Za-z0-9 :\/\-_\.\?\=]/','',$value).'" '; - - //$xml .= $label. '="'.$value.'" '; - } - if ($url) $xml.=' '.'url="'.$url.'" '; - $xml .= ' />'."\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; - //var_dump($view); - module_invoke_all('exit'); - exit; - } + $label = 'created'; + if (intval($value)) // timestamp + $value = date(DATE_RFC822, intval($value)); + elseif (getdate($value)) // string date + $value = date(DATE_RFC822, strtotime($value)); + } + $xml .= $label .'="'. preg_replace('/[^A-Za-z0-9 :\/\-_\.\?\=]/', '', $value) .'" '; + + // $xml .= $label .'="'. $value .'" '; + } + if ($url) $xml .= ' '.'url="'. $url .'" '; + $xml .= ' />'."\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; + // var_dump($view); + module_invoke_all('exit'); + exit; + } } function xml_atom_render($view) { - global $base_url; - + global $base_url; + $xml .= ''."\n"; $xml .= ''."\n"; - $xml .=''."\n"; - $xml .=' '.$view->name.''."\n"; - $xml .=' '."\n"; - $xml .=' '."\n"; - $xml .=' '.$base_url.'/'.$view->display_handler->options['path'].''."\n";//use path as id - $xml .=' ###feed_updated###'."\n"; //will set later - $xml .=' Views Datasource module'."\n"; + $xml .=''."\n"; + $xml .=' '. $view->name .''."\n"; + $xml .=' '."\n"; + $xml .=' '."\n"; + $xml .=' '. $base_url .'/'. $view->display_handler->options['path'] .''."\n"; // use path as id + $xml .=' ###feed_updated###'."\n"; // will set later + $xml .=' Views Datasource module'."\n"; $feed_last_updated = 0; foreach ($view->result as $node) { - $entry = array(); - foreach($node as $field_name=>$field_value) { + $entry = array(); + foreach ($node as $field_name => $field_value) { $label = views_xml_strip_illegal_chars($field_name); $value = views_xml_strip_illegal_chars(views_xml_is_date($field_value)); if (is_null($value) || ($value === '')) continue; @@ -134,24 +136,24 @@ function xml_atom_render($view) { // 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 + $label = str_replace('_value', '', str_replace("profile_values_profile_", '', $label)); // strip out Profile: from profile fields if (strtolower($label) == 'nid') $entry['nid'] = $value; if ((strtolower($label) == 'updated') || (strtolower($label) == 'updated date') || (strtolower($label) == 'node_changed')) { - if (intval($value)) //timestamp - $entry['updated'] = intval($value) ; - else if(getdate($value)) { //string date - $entry['updated'] = strtotime($value); - } - } - if ((strtolower($label) == 'title') || (strtolower($label) == 'node_title')) + if (intval($value)) // timestamp + $entry['updated'] = intval($value) ; + elseif (getdate($value)) { // string date + $entry['updated'] = strtotime($value); + } + } + if ((strtolower($label) == 'title') || (strtolower($label) == 'node_title')) $entry['title'] = $value; if (strtolower($label) == 'link') $entry['link'] = $value; if ((strtolower($label) == 'published') || (strtolower($label) == 'node_created')) { - if (intval($value)) //timestamp + if (intval($value)) // timestamp $entry['published'] = intval($value) ; - else if(getdate($value)) { //string date - $entry['published'] = strtotime($value); - } + elseif (getdate($value)) { // string date + $entry['published'] = strtotime($value); + } } if ((strtolower($label) == 'author') || (strtolower($label) == 'users_name')) $entry['author'] = $value; if ((strtolower($label) == 'email') || (strtolower($label) == 'users_mail')) $entry['email'] = $value; @@ -159,59 +161,60 @@ function xml_atom_render($view) { if ((strtolower($label) == 'summary') || (strtolower($label) == 'node_teaser') || (strtolower($label) == 'node_revisions_teaser')) $entry['summary'] = $value; } if (isset($entry['nid']) && (isset($entry['updated'])) && (isset($entry['link'])) && (isset($entry['title'])) && (isset($entry['published']))) { - if (parse_url($entry['link'])) - $link = $entry['link']; - else { - print ('The link URL is not valid.'); + if (parse_url($entry['link'])) + $link = $entry['link']; + else { + print 'The link URL is not valid.'; return; - } + } } - elseif (isset($entry['nid']) && (isset($entry['updated'])) && (isset($entry['title'])) && (isset($entry['published']))) { //make the entry path with base_url + nid { - $entry['link'] = $base_url.'/index.php?q=node/'.$entry['nid']; + elseif (isset($entry['nid']) && (isset($entry['updated'])) && (isset($entry['title'])) && (isset($entry['published']))) { // make the entry path with base_url + nid { + $entry['link'] = $base_url .'/index.php?q=node/'. $entry['nid']; } else { - print ('The fields "nid", "title", "post date", and "updated date" must exist.'); - return; + print 'The fields "nid", "title", "post date", and "updated date" must exist.'; + return; } $link = $entry['link']; $link_url = parse_url($link); $nid = $entry['nid']; $updated = $entry['updated']; - if ($updated > $feed_last_updated) $feed_last_updated = $updated; //Overall feed updated is the most recent node updated timestamp + if ($updated > $feed_last_updated) $feed_last_updated = $updated; // Overall feed updated is the most recent node updated timestamp $title = $entry['title']; $published = $entry['published']; $author = $entry['author']; $email = $entry['email']; $content = $entry['content']; $summary = $entry['summary']; - - //Create an id for the entry using tag URIs - $id = 'tag:'.$link_url['host'].','.date('Y-m-d', $updated).':'.$link_url['path'].'?'.$link_url['query']; + + // Create an id for the entry using tag URIs + $id = 'tag:'. $link_url['host'] .','. date('Y-m-d', $updated) .':'. $link_url['path'] .'?'. $link_url['query']; $xml .= ' '."\n"; - $xml .= ' '.$id.''."\n"; - $xml .= ' '.date(DATE_ATOM, $updated).''."\n"; - $xml .= ' '.$title.''."\n"; - $xml .= ' '."\n"; - $xml .= ' '.date(DATE_ATOM, $published).''."\n"; + $xml .= ' '. $id .''."\n"; + $xml .= ' '. date(DATE_ATOM, $updated) .''."\n"; + $xml .= ' '. $title .''."\n"; + $xml .= ' '."\n"; + $xml .= ' '. date(DATE_ATOM, $published) .''."\n"; if ($author) { - if ($email) { - $xml .= ' '.$author.''.$email.''."\n"; - } - else $xml .= ' '.$author.''."\n"; + if ($email) { + $xml .= ' '. $author .''. $email .''."\n"; + } + else $xml .= ' '. $author .''."\n"; } - if ($content)$xml .= ' '."\n"; - if ($summary)$xml .= ' '."\n"; + if ($content) $xml .= ' '."\n"; + if ($summary) $xml .= ' '."\n"; $xml .= ' '."\n"; } $xml .=''."\n"; $xml = str_replace('###feed_updated###', date(DATE_ATOM, $feed_last_updated), $xml); - if ($view->override_path) //inside live preview + if ($view->override_path) { // inside live preview print htmlspecialchars($xml); - else { - drupal_set_header('Content-Type: application/atom+xml'); - print $xml; - //var_dump($label); - module_invoke_all('exit'); - exit; + } + else { + drupal_set_header('Content-Type: application/atom+xml'); + print $xml; + // var_dump($label); + module_invoke_all('exit'); + exit; } } Index: views_json.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/views_datasource/views_json.module,v retrieving revision 1.1.2.3 diff -u -p -r1.1.2.3 views_json.module --- views_json.module 8 Sep 2009 16:37:48 -0000 1.1.2.3 +++ views_json.module 21 Oct 2009 20:02:34 -0000 @@ -1,15 +1,16 @@ 2, - /*'path' => drupal_get_path('module', 'views_json'),*/ +// 'path' => drupal_get_path('module', 'views_json'), ); } @@ -17,26 +18,29 @@ function views_json_views_api() { /** * Strips illegal JSON characters in identifier string * - * @param string $input - * @return string + * @param $input + * JSON to process. + * @return + * JSON with illegal characters stripped away. */ - function views_json_strip_illegal_chars($input) { - $output = str_replace(array('{','}','[', ']', ':', ',', '"', "'", chr(47), chr(92)), '', $input); - $output = preg_replace( - '/[\x{80}-\x{A0}'. // Non-printable ISO-8859-1 + NBSP - '\x{01}-\x{1F}'. //Non-printable ASCII characters - '\x{0}]/u', // NULL byte - '', $output); + $output = str_replace(array('{', '}', '[', ']', ':', ',', '"', "'", chr(47), chr(92)), '', $input); + $output = preg_replace( + '/[\x{80}-\x{A0}'. // Non-printable ISO-8859-1 + NBSP + '\x{01}-\x{1F}'. // Non-printable ASCII characters + '\x{0}]/u', // NULL byte + '', $output); - return check_plain(strip_tags($output));; + return check_plain(strip_tags($output)); } /** * Encodes special JSON characters in string * - * @param string $input - * @return string + * @param $input + * JSON to process. + * @return + * JSON with special characters encoded. */ function views_json_encode_special_chars($input) { $output = str_replace(chr(92), '\\', $input); @@ -44,7 +48,7 @@ function views_json_encode_special_chars $output = str_replace('"', '\"', $output); $output = str_replace(chr(8), '\b', $output); $output = str_replace(chr(12), '\f', $output); - $output = str_replace(chr(13).chr(10), '\n', $output); + $output = str_replace(chr(13) . chr(10), '\n', $output); $output = str_replace(chr(10), '\n', $output); $output = str_replace(chr(13), '\r', $output); $output = str_replace(chr(9), '\t', $output); @@ -52,15 +56,19 @@ function views_json_encode_special_chars } /** - * If input is a serialized date array, return a date string + * If input is a serialized date array, return a date string * - * @param unknown_type $input - * @return unknown + * @param $input + * Input to check. + * @return + * Either the original input or a date string. */ -function views_json_is_date ($input) { - if (strpos($input, 'a:3:{s:5:"month"') !== 0) return $input; - else { //serialized date array +function views_json_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'])); } -} \ No newline at end of file +} Index: views_json.views.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/views_datasource/views_json.views.inc,v retrieving revision 1.1.2.3 diff -u -p -r1.1.2.3 views_json.views.inc --- views_json.views.inc 8 Sep 2009 16:37:48 -0000 1.1.2.3 +++ views_json.views.inc 21 Oct 2009 20:02:34 -0000 @@ -1,20 +1,21 @@ 'views_json', - 'style' => array( //declare the views_json style plugin + 'style' => array( // declare the views_json style plugin 'views_json' => array( 'title' => t('JSON data document'), 'theme' => 'views_view_json', @@ -23,7 +24,7 @@ function views_json_views_plugins() { 'uses row plugin' => TRUE, 'uses fields' => TRUE, 'uses options' => TRUE, - 'type' => 'normal', + 'type' => 'normal', ), ), ); @@ -32,7 +33,7 @@ function views_json_views_plugins() { /** * Theme preprocess function for views-view-json.tpl.php * - * @param array $vars + * @param $vars */ function template_preprocess_views_view_json(&$vars) { $view = &$vars['view']; Index: views_plugin_style_json.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/views_datasource/Attic/views_plugin_style_json.inc,v retrieving revision 1.1.2.2 diff -u -p -r1.1.2.2 views_plugin_style_json.inc --- views_plugin_style_json.inc 7 Oct 2009 15:27:38 -0000 1.1.2.2 +++ views_plugin_style_json.inc 21 Oct 2009 20:02:34 -0000 @@ -1,5 +1,6 @@ 'radios', @@ -32,5 +31,4 @@ class views_plugin_style_json extends vi '#default_value' => $this->options['format'], ); } - -} \ No newline at end of file +} Index: views_plugin_style_rdf.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/views_datasource/Attic/views_plugin_style_rdf.inc,v retrieving revision 1.1.2.3 diff -u -p -r1.1.2.3 views_plugin_style_rdf.inc --- views_plugin_style_rdf.inc 7 Oct 2009 15:27:38 -0000 1.1.2.3 +++ views_plugin_style_rdf.inc 21 Oct 2009 20:02:34 -0000 @@ -1,5 +1,6 @@ 'radios', @@ -32,5 +31,4 @@ class views_plugin_style_rdf extends vie '#default_value' => $this->options['vocabulary'], ); } - -} \ No newline at end of file +} Index: views_plugin_style_xhtml.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/views_datasource/Attic/views_plugin_style_xhtml.inc,v retrieving revision 1.1.2.2 diff -u -p -r1.1.2.2 views_plugin_style_xhtml.inc --- views_plugin_style_xhtml.inc 7 Oct 2009 15:27:38 -0000 1.1.2.2 +++ views_plugin_style_xhtml.inc 21 Oct 2009 20:02:34 -0000 @@ -1,5 +1,6 @@ 'radios', @@ -31,5 +31,4 @@ class views_plugin_style_xhtml extends v '#default_value' => $this->options['format'], ); } - -} \ No newline at end of file +} Index: views_plugin_style_xml.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/views_datasource/Attic/views_plugin_style_xml.inc,v retrieving revision 1.1.2.2 diff -u -p -r1.1.2.2 views_plugin_style_xml.inc --- views_plugin_style_xml.inc 7 Oct 2009 15:27:38 -0000 1.1.2.2 +++ views_plugin_style_xml.inc 21 Oct 2009 20:02:34 -0000 @@ -1,30 +1,28 @@ 'radios', @@ -33,5 +31,4 @@ class views_plugin_style_xml extends vie '#default_value' => $this->options['schema'], ); } - -} \ No newline at end of file +} Index: views_rdf.views.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/views_datasource/Attic/views_rdf.views.inc,v retrieving revision 1.1.2.3 diff -u -p -r1.1.2.3 views_rdf.views.inc --- views_rdf.views.inc 8 Sep 2009 16:37:48 -0000 1.1.2.3 +++ views_rdf.views.inc 21 Oct 2009 20:02:34 -0000 @@ -1,20 +1,20 @@ views_rdf, - 'style' => array( //declare the views_rdf style plugin + 'style' => array( // declare the views_rdf style plugin 'views_rdf' => array( 'title' => t('RDF data document'), 'theme' => 'views_view_rdf', @@ -23,7 +23,7 @@ function views_rdf_views_plugins() { 'uses row plugin' => TRUE, 'uses fields' => TRUE, 'uses options' => TRUE, - 'type' => 'normal', + 'type' => 'normal', ), ), ); @@ -32,10 +32,10 @@ function views_rdf_views_plugins() { /** * Theme preprocess function for views-view-rdf.tpl.php * - * @param array $vars + * @param $vars */ function template_preprocess_views_view_rdf(&$vars) { $view = &$vars['view']; $options = $view->style_handler->options; $handler = $view->style_handler; -} \ No newline at end of file +} Index: views_xhtml.views.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/views_datasource/Attic/views_xhtml.views.inc,v retrieving revision 1.1.2.3 diff -u -p -r1.1.2.3 views_xhtml.views.inc --- views_xhtml.views.inc 8 Sep 2009 16:37:48 -0000 1.1.2.3 +++ views_xhtml.views.inc 21 Oct 2009 20:02:34 -0000 @@ -1,20 +1,21 @@ views_xhtml, - 'style' => array( //declare the views_xhtml style plugin + 'style' => array( // declare the views_xhtml style plugin 'views_xhtml' => array( 'title' => t('XHTML data document'), 'theme' => 'views_view_xhtml', @@ -23,7 +24,7 @@ function views_xhtml_views_plugins() { 'uses row plugin' => TRUE, 'uses fields' => TRUE, 'uses options' => TRUE, - 'type' => 'normal', + 'type' => 'normal', ), ), ); @@ -32,10 +33,10 @@ function views_xhtml_views_plugins() { /** * Theme preprocess function for views-view-xhtml.tpl.php * - * @param array $vars + * @param $vars */ function template_preprocess_views_view_xhtml(&$vars) { $view = &$vars['view']; $options = $view->style_handler->options; $handler = $view->style_handler; -} \ No newline at end of file +} Index: views_xml.views.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/views_datasource/Attic/views_xml.views.inc,v retrieving revision 1.1.2.3 diff -u -p -r1.1.2.3 views_xml.views.inc --- views_xml.views.inc 8 Sep 2009 16:37:48 -0000 1.1.2.3 +++ views_xml.views.inc 21 Oct 2009 20:02:34 -0000 @@ -1,20 +1,21 @@ views_xml, - 'style' => array( //declare the views_xml_* style plugins + 'style' => array( // declare the views_xml_* style plugins 'views_xml' => array( 'title' => t('XML data document'), 'theme' => 'views_view_xml', @@ -23,7 +24,7 @@ function views_xml_views_plugins() { 'uses row plugin' => TRUE, 'uses fields' => TRUE, 'uses options' => TRUE, - 'type' => 'normal', + 'type' => 'normal', ), ), ); @@ -33,12 +34,11 @@ function views_xml_views_plugins() { /** * Theme preprocess function for views-view-xml.tpl.php * - * @param array $vars + * @param $vars */ function template_preprocess_views_view_xml(&$vars) { $view = &$vars['view']; $options = $view->style_handler->options; $handler = $view->style_handler; - $result = array(); + $result = array(); } -