Go to the documentation of this file.00001 <?php
00010 class views_plugin_row_aggregator_rss extends views_plugin_row {
00011 var $base_table = 'aggregator_item';
00012 var $base_field = 'iid';
00013
00014 function option_definition() {
00015 $options = parent::option_definition();
00016
00017 $options['item_length'] = array('default' => 'default');
00018
00019 return $options;
00020 }
00021
00022 function options_form(&$form, &$form_state) {
00023 $form['item_length'] = array(
00024 '#type' => 'select',
00025 '#title' => t('Display type'),
00026 '#options' => array(
00027 'fulltext' => t('Full text'),
00028 'teaser' => t('Title plus teaser'),
00029 'title' => t('Title only'),
00030 'default' => t('Use default RSS settings'),
00031 ),
00032 '#default_value' => $this->options['item_length'],
00033 );
00034 }
00035
00036 function render($row) {
00037 $iid = $row->{$this->field_alias};
00038 $sql = "SELECT ai.iid, ai.fid, ai.title, ai.link, ai.author, ai.description, ";
00039 $sql .= "ai.timestamp, ai.guid, af.title AS feed_title, ai.link AS feed_LINK ";
00040 $sql .= "FROM {aggregator_item} ai LEFT JOIN {aggregator_feed} af ON ai.fid = af.fid ";
00041 $sql .= "WHERE ai.iid = :iid";
00042
00043 $item = db_query($sql, array(':iid' => $iid))->fetchObject();
00044
00045 $item->elements = array(
00046 array(
00047 'key' => 'pubDate',
00048 'value' => gmdate('r', $item->timestamp),
00049 ),
00050 array(
00051 'key' => 'dc:creator',
00052 'value' => $item->author,
00053 ),
00054 array(
00055 'key' => 'guid',
00056 'value' => $item->guid,
00057 'attributes' => array('isPermaLink' => 'false')
00058 ),
00059 );
00060
00061 foreach ($item->elements as $element) {
00062 if (isset($element['namespace'])) {
00063 $this->view->style_plugin->namespaces = array_merge($this->view->style_plugin->namespaces, $element['namespace']);
00064 }
00065 }
00066
00067 return theme($this->theme_functions(), array(
00068 'view' => $this->view,
00069 'options' => $this->options,
00070 'row' => $item
00071 ));
00072 }
00073 }