r44749 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r44748‎ | r44749 | r44750 >
Date:01:20, 18 December 2008
Author:yaron
Status:deferred
Tags:
Comment:
Shortened parameters to just 'title' and 'description', with old values still
supported for backward compatibility
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/includes/SMW_QP_RSSlink.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/includes/SMW_QP_iCalendar.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/includes/SMW_QP_iCalendar.php
@@ -17,10 +17,16 @@
1818
1919 protected function readParameters($params,$outputmode) {
2020 SMWResultPrinter::readParameters($params,$outputmode);
21 - if (array_key_exists('icalendartitle', $this->m_params)) {
 21+ if (array_key_exists('title', $this->m_params)) {
 22+ $this->m_title = trim($this->m_params['title']);
 23+ // for backward compatibility
 24+ } elseif (array_key_exists('icalendartitle', $this->m_params)) {
2225 $this->m_title = trim($this->m_params['icalendartitle']);
2326 }
24 - if (array_key_exists('icalendardescription', $this->m_params)) {
 27+ if (array_key_exists('description', $this->m_params)) {
 28+ $this->m_description = trim($this->m_params['description']);
 29+ // for backward compatibility
 30+ } elseif (array_key_exists('icalendardescription', $this->m_params)) {
2531 $this->m_description = trim($this->m_params['icalendardescription']);
2632 }
2733 }
@@ -113,10 +119,10 @@
114120 $link = $res->getQueryLink($label);
115121 $link->setParameter('icalendar','format');
116122 if ($this->m_title !== '') {
117 - $link->setParameter($this->m_title,'icalendartitle');
 123+ $link->setParameter($this->m_title,'title');
118124 }
119125 if ($this->m_description !== '') {
120 - $link->setParameter($this->m_description,'icalendardescription');
 126+ $link->setParameter($this->m_description,'description');
121127 }
122128 if (array_key_exists('limit', $this->m_params)) {
123129 $link->setParameter($this->m_params['limit'],'limit');
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_QP_RSSlink.php
@@ -18,10 +18,16 @@
1919
2020 protected function readParameters($params,$outputmode) {
2121 SMWResultPrinter::readParameters($params,$outputmode);
22 - if (array_key_exists('rsstitle', $this->m_params)) {
 22+ if (array_key_exists('title', $this->m_params)) {
 23+ $this->m_title = trim($this->m_params['title']);
 24+ // for backward compatibiliy
 25+ } elseif (array_key_exists('rsstitle', $this->m_params)) {
2326 $this->m_title = trim($this->m_params['rsstitle']);
2427 }
25 - if (array_key_exists('rssdescription', $this->m_params)) {
 28+ if (array_key_exists('description', $this->m_params)) {
 29+ $this->m_description = trim($this->m_params['description']);
 30+ // for backward compatibiliy
 31+ } elseif (array_key_exists('rssdescription', $this->m_params)) {
2632 $this->m_description = trim($this->m_params['rssdescription']);
2733 }
2834 }
@@ -104,10 +110,10 @@
105111 $link = $res->getQueryLink($label);
106112 $link->setParameter('rss','format');
107113 if ($this->m_title !== '') {
108 - $link->setParameter($this->m_title,'rsstitle');
 114+ $link->setParameter($this->m_title,'title');
109115 }
110116 if ($this->m_description !== '') {
111 - $link->setParameter($this->m_description,'rssdescription');
 117+ $link->setParameter($this->m_description,'description');
112118 }
113119 if (array_key_exists('limit', $this->m_params)) {
114120 $link->setParameter($this->m_params['limit'],'limit');

Status & tagging log