Indefero

Indefero Commit Details


Date:2009-10-09 02:22:36 (15 years 2 months ago)
Author:Loic d'Anterroches
Branch:develop, feature-issue_links, feature.better-home, feature.content-md5, feature.diff-whitespace, feature.download-md5, feature.issue-links, feature.issue-of-others, feature.issue-summary, feature.search-filter, feature.webrepos, feature.wiki-default-page, master, release-1.1, release-1.2, release-1.3
Commit:f3cadfe013cba3501ccb2c82edd412fc88bb732e
Parents: e5934e0a3a43fe2aacda39740117f0606ea82235
Message:Fixed issue 268, atom feed corrupt.

Changes:

File differences

src/IDF/Commit.php
1313
1414
1515
16
16
1717
1818
1919
......
235235
236236
237237
238
239
240
241
242
243
244
245
246238
247
248
249
250
251
252
253
254
255
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
256254
257255
258256
# InDefero is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
n# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
.Pluf_HTTP_URL_urlForView('IDF_Views_Source::commit',
array($request->project->shortname,
$this->scm_id));
$tag = new IDF_Template_IssueComment();
$summary = '<content type="xhtml">'."\n"
.'<div xmlns="http://www.w3.org/1999/xhtml">'
.$tag->start($this->summary, $request, false, false, false);
if ($this->fullmessage) {
$summary .= '<br /><br />'
.$tag->start($this->fullmessage, $request, false, false, false);
}
$date = Pluf_Date::gmDateToGmString($this->creation_dtime);
$summary .= '</div></content>';
$out = '<entry>
<title>'.Pluf_esc($request->project->name).': '.__('Commit').' '.$this->scm_id.'</title>
<link href="'.$url.'"/>
<id>'.$url.'</id>
<updated>'.$date.'</updated>'.$summary.'
</entry>
';
return $out;
$author = ($this->get_author()) ?
$this->get_author() : $this->origauthor;
$cproject = $this->get_project();
$context = new Pluf_Template_Context_Request(
$request,
array(
'c' => $this,
'cproject' => $cproject,
'url' => $url,
'date' => $date,
'author' => $author,
)
);
$tmpl = new Pluf_Template('idf/source/feedfragment.xml');
return $tmpl->render($context);
}
/**
src/IDF/Issue.php
199199
200200
201201
202
203
204
205
206
207
208
209
210
211202
212203
213204
214205
215206
216
217
218
207
208
219209
220210
221
222
223211
224
225
226
227
228
212
213
214
215
216
217
218
219
220
221
222
229223
230224
231225
public function feedFragment($request)
{
$base = '<entry>
<title>%%title%%</title>
<link href="%%url%%"/>
<id>%%url%%</id>
<updated>%%date%%</updated>
<content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">
<pre>%%content%%</pre>
</div></content>
</entry>';
$url = Pluf::f('url_base')
.Pluf_HTTP_URL_urlForView('IDF_Views_Issue::view',
array($request->project->shortname,
$this->id));
$title = sprintf(__('%s: Issue %d created - %s'),
Pluf_esc($request->project->name),
$this->id, Pluf_esc($this->summary));
// Get the first comment of this issue.
$request->project->name,
$this->id, $this->summary);
$cts = $this->get_comments_list(array('order' => 'id ASC',
'nb' => 1));
$tag = new IDF_Template_IssueComment();
$content = $tag->start($cts[0]->content, $request, false);
$date = Pluf_Date::gmDateToGmString($this->creation_dtime);
return Pluf_Translation::sprintf($base,
array('url' => $url,
'title' => $title,
'content' => $content,
'date' => $date));
$context = new Pluf_Template_Context_Request(
$request,
array('url' => $url,
'author' => $this->get_submitter(),
'title' => $title,
'c' => $cts[0],
'issue' => $this,
'date' => $date)
);
$tmpl = new Pluf_Template('idf/issues/feedfragment.xml');
return $tmpl->render($context);
}
/**
src/IDF/IssueComment.php
167167
168168
169169
170
171
172170
173171
174
175172
176173
177174
178175
179176
180
181
182
183
184
185
186
187
188
189177
190178
191179
192180
193181
194
195182
196183
197184
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
185
225186
226
227
228
229
230
187
188
189
190
191
192
193
194
195
196
197
231198
232199
$out .= '</div>';
}
$out .= '</td></tr>';
$out .= "\n".'<tr class="extra"><td colspan="2">
<div class="helptext right">'.sprintf(__('Comment on <a href="%s" class="%s">issue&nbsp;%d</a>, by %s'), $url, $ic, $issue->id, $user).'</div></td></tr>';
return Pluf_Template::markSafe($out);
}
public function feedFragment($request)
{
$base = '<entry>
<title>%%title%%</title>
<link href="%%url%%"/>
<id>%%url%%</id>
<updated>%%date%%</updated>
<content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">
%%content%%
</div></content>
</entry>';
$issue = $this->get_issue();
$url = Pluf::f('url_base')
.Pluf_HTTP_URL_urlForView('IDF_Views_Issue::view',
array($request->project->shortname,
$issue->id));
$url .= '#ic'.$this->id;
$title = sprintf(__('%s: Comment on issue %d - %s'),
Pluf_esc($request->project->name),
$issue->id, Pluf_esc($issue->summary));
$submitter = $this->get_submitter();
$tag = new IDF_Template_IssueComment();
$content = '<p><pre>'.$tag->start($this->content, $request, false).'</pre></p>';
if ($this->changedIssue()) {
$content .= '<p>';
foreach ($this->changes as $w => $v) {
$content .= '<strong>';
switch ($w) {
case 'su':
$content .= __('Summary:'); break;
case 'st':
$content .= __('Status:'); break;
case 'ow':
$content .= __('Owner:'); break;
case 'lb':
$content .= __('Labels:'); break;
}
$content .= '</strong> ';
if ($w == 'lb') {
$content .= Pluf_esc(implode(', ', $v));
} else {
$content .= Pluf_esc($v);
}
$content .= ' ';
}
$content .= '</p>';
}
$url .= '#ic'.$this->id;
$date = Pluf_Date::gmDateToGmString($this->creation_dtime);
return Pluf_Translation::sprintf($base,
array('url' => $url,
'title' => $title,
'content' => $content,
'date' => $date));
$context = new Pluf_Template_Context_Request(
$request,
array('url' => $url,
'author' => $issue->get_submitter(),
'title' => $title,
'c' => $this,
'issue' => $issue,
'date' => $date)
);
$tmpl = new Pluf_Template('idf/issues/feedfragment.xml');
return $tmpl->render($context);
}
}
src/IDF/Upload.php
195195
196196
197197
198
199
200
201
202
203
204
205
206
207
208
209
198
199
200
201
210202
211
212
213
203
204
214205
215
216
217
218
219
206
207
208
209
210
211
212
213
214
220215
221216
222217
public function feedFragment($request)
{
$base = '<entry>
<title>%%title%%</title>
<link href="%%url%%"/>
<id>%%url%%</id>
<updated>%%date%%</updated>
<content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">
%%content%%
</div></content>
</entry>';
$url = Pluf_HTTP_URL_urlForView('IDF_Views_Download::view',
array($request->project->shortname,
$this->id));
$url = Pluf::f('url_base')
.Pluf_HTTP_URL_urlForView('IDF_Views_Download::view',
array($request->project->shortname,
$this->id));
$title = sprintf(__('%s: Download %d added - %s'),
Pluf_esc($request->project->name),
$this->id, Pluf_esc($this->summary));
$content = Pluf_esc($this->summary);
$request->project->name,
$this->id, $this->summary);
$date = Pluf_Date::gmDateToGmString($this->creation_dtime);
return Pluf_Translation::sprintf($base,
array('url' => $url,
'title' => $title,
'content' => $content,
'date' => $date));
$context = new Pluf_Template_Context_Request(
$request,
array('url' => $url,
'title' => $title,
'file' => $this,
'date' => $date)
);
$tmpl = new Pluf_Template('idf/downloads/feedfragment.xml');
return $tmpl->render($context);
}
/**
src/IDF/Views/Project.php
177177
178178
179179
180
180
181181
182182
183183
184184
185185
186186
187
187
188
189
190
191
192
193
194
188195
189196
190197
......
194201
195202
196203
204
197205
198206
199207
$params = array(
'filter' => $sql->gen(),
'order' => 'creation_dtime DESC',
'nb' => 50,
'nb' => 20,
);
$items = Pluf::factory('IDF_Timeline')->getList($params);
$set = new Pluf_Model_Set($items,
array('public_dtime' => 'public_dtime'));
$out = array();
foreach ($set as $item) {
$out[] = $item->feedFragment($request);
if ($item->id) {
$out[] = $item->feedFragment($request);
}
}
if ($items->count() > 0) {
$date = Pluf_Date::gmDateToGmString($items[0]->creation_dtime);
} else {
$date = gmdate('c');
}
$out = Pluf_Template::markSafe(implode("\n", $out));
$tmpl = new Pluf_Template('idf/index.atom');
array($prj->shortname));
$context = new Pluf_Template_Context_Request($request,
array('body' => $out,
'date' => $date,
'title' => $title,
'feedurl' => $feedurl,
'viewurl' => $viewurl));
src/IDF/WikiPage.php
201201
202202
203203
204
205
206
207
208
209
210
211
212
213204
214205
215206
216207
217208
218
219
220
209
210
221211
222
223
224
225
226
212
213
214
215
216
217
218
219
220
221
222
227223
228
229224
public function feedFragment($request)
{
$base = '<entry>
<title>%%title%%</title>
<link href="%%url%%"/>
<id>%%url%%</id>
<updated>%%date%%</updated>
<content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">
%%content%%
</div></content>
</entry>';
$url = Pluf::f('url_base')
.Pluf_HTTP_URL_urlForView('IDF_Views_Wiki::view',
array($request->project->shortname,
$this->title));
$title = sprintf(__('%s: Documentation page %s added - %s'),
Pluf_esc($request->project->name),
Pluf_esc($this->title), Pluf_esc($this->summary));
$content = Pluf_esc($this->summary);
$request->project->name,
$this->title, $this->summary);
$date = Pluf_Date::gmDateToGmString($this->creation_dtime);
return Pluf_Translation::sprintf($base,
array('url' => $url,
'title' => $title,
'content' => $content,
'date' => $date));
$context = new Pluf_Template_Context_Request(
$request,
array('url' => $url,
'title' => $title,
'page' => $this,
'rev' => $this->get_current_revision(),
'create' => true,
'date' => $date)
);
$tmpl = new Pluf_Template('idf/wiki/feedfragment.xml');
return $tmpl->render($context);
}
}
src/IDF/WikiRevision.php
192192
193193
194194
195
196
197
198
199
200
201
202
203
204195
205196
206197
207198
208
199
200
209201
210
211
212
202
203
213204
214
215
216
217
218
205
206
207
208
209
210
211
212
213
214
215
219216
220217
221218
219
222220
223221
224222
public function feedFragment($request)
{
$base = '<entry>
<title>%%title%%</title>
<link href="%%url%%"/>
<id>%%url%%</id>
<updated>%%date%%</updated>
<content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">
%%content%%
</div></content>
</entry>';
$page = $this->get_wikipage();
$url = Pluf::f('url_base')
.Pluf_HTTP_URL_urlForView('IDF_Views_Wiki::view',
array($request->project->shortname,
$page->title));
$page->title),
array('rev' => $this->id));
$title = sprintf(__('%s: Documentation page %s updated - %s'),
Pluf_esc($request->project->name),
Pluf_esc($page->title), Pluf_esc($page->summary));
$content = Pluf_esc($this->summary);
$request->project->name,
$page->title, $page->summary);
$date = Pluf_Date::gmDateToGmString($this->creation_dtime);
return Pluf_Translation::sprintf($base,
array('url' => $url,
'title' => $title,
'content' => $content,
'date' => $date));
$context = new Pluf_Template_Context_Request(
$request,
array('url' => $url,
'title' => $title,
'page' => $page,
'rev' => $this,
'create' => false,
'date' => $date)
);
$tmpl = new Pluf_Template('idf/wiki/feedfragment.xml');
return $tmpl->render($context);
}
/**
* Notification of change of a WikiPage.
*
src/IDF/templates/idf/downloads/feedfragment.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<entry>
<title>{$title}</title>
<link href="{$url}"/>
<id>{$url}</id>
<updated>{$date}</updated>
<author>{$file.get_submitter()}</author>
<content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">
<p>{$file} - {$file.filesize|ssize}</p>
{if $file.changelog}
<h2>{trans 'Details'}</h2>
{markdown $file.changelog, $request}
{/if}
</div></content>
</entry>
src/IDF/templates/idf/index.atom
44
55
66
7
78
89
<link href="{$feedurl}" rel="self"/>
<link href="{$viewurl}"/>
<id>{$feedurl}</id>
<updated>{$date}</updated>
{$body}
</feed>
src/IDF/templates/idf/issues/feedfragment.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<entry>
<title>{$title} - {$issue.get_status}</title>
<link href="{$url}"/>
<id>{$url}</id>
<updated>{$date}</updated>
<author>{$author}</author>
<content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">
<pre>{issuetext $c.content, $request}</pre>
{assign $attachments = $c.get_attachment_list()}
{if $attachments.count() > 0}
<hr align="left" class="attach" />
<ul>
{foreach $attachments as $a}<li><a href="{url 'IDF_Views_Issue::viewAttachment', array($project.shortname, $a.id, $a.filename)}">{$a.filename}</a> - {$a.filesize|ssize}</li>{/foreach}
</ul>{/if}
{if $c.changes}
{foreach $c.changes as $w => $v}
<strong>{if $w == 'su'}{trans 'Summary:'}{/if}{if $w == 'st'}{trans 'Status:'}{/if}{if $w == 'ow'}{trans 'Owner:'}{/if}{if $w == 'lb'}{trans 'Labels:'}{/if}</strong> {if $w == 'lb'}{assign $l = implode(', ', $v)}{$l}{else}{$v}{/if}<br />
{/foreach}
{/if}
</div></content>
</entry>
src/IDF/templates/idf/source/feedfragment.xml
1
2
3
4
5
6
7
8
9
10
11
<entry>
<title>{blocktrans}{$cproject.name}: Commit {$c.scm_id}{/blocktrans}</title>
<link href="{$url}"/>
<author>{$author}</author>
<id>{$url}</id>
<updated>{$date}</updated>
<content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">
{issuetext $c.summary, $request}{if $c.fullmessage}<br /><br />
{issuetext $c.fullmessage, $request, true, false, true, true, true}{/if}
</div></content>
</entry>
src/IDF/templates/idf/wiki/feedfragment.xml
1
2
3
4
5
6
7
8
9
10
11
<entry>
<title>{$title}</title>
<link href="{$url}"/>
<id>{$url}:{$rev.id}</id>
<updated>{$date}</updated>
<author>{$rev.get_submitter()}</author>
<content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">
{if !$create}<p><strong>{trans 'Changes:'}</strong> {$rev.summary}:</p>{/if}
{markdown $rev.content, $request}
</div></content>
</entry>

Archive Download the corresponding diff file

Page rendered in 0.15099s using 14 queries.