Indefero

Indefero Commit Details


Date:2011-12-05 02:52:26 (13 years 17 days ago)
Author:William MARTIN
Branch:feature.wiki-default-page
Commit:af956d01dd5110866c3f3725a99accffe23c59ed
Parents: 0002e9bd211d440034374eec55faeeee4a943619
Message:Add the auto generated wiki page as default page

Changes:

File differences

src/IDF/Form/Admin/ProjectCreate.php
339339
340340
341341
342
343342
344343
345344
......
350349
351350
352351
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
352
393353
394354
395355
$conf->setVal($prop, $tmplconf->getVal($prop, $def));
}
}
$project->created();
if ($this->cleaned_data['template'] == '--') {
IDF_Form_MembersConf::updateMemberships($project,
$tmpl->getMembershipData('string'));
}
$project->membershipsUpdated();
// Insert default wiki page
$tmpl = new Pluf_Template('idf/wiki/wiki-default-page.mdtext');
$context = new Pluf_Template_Context(array('project' => $project));
$content = $tmpl->render($context);
$page = new IDF_WikiPage();
$page->project = $project;
$page->submitter = $this->user;
$page->summary = __('This is the default page for your project Wiki.');
$page->title = 'summary-default';
$page->create();
$rev = new IDF_WikiRevision();
$rev->wikipage = $page;
$rev->content = $content;
$rev->submitter = $this->user;
$rev->summary = __('Initial page creation');
$rev->create();
$rev->notify($project->getConf());
// Insert markdown help wiki page
$tmpl = new Pluf_Template('idf/wiki/wiki-markdown-help.mdtext');
$context = new Pluf_Template_Context(array('project' => $project));
$content = $tmpl->render($context);
$page = new IDF_WikiPage();
$page->project = $project;
$page->submitter = $this->user;
$page->summary = __('Help about Markdown syntax.');
$page->title = 'markdown-help';
$page->create();
$rev = new IDF_WikiRevision();
$rev->wikipage = $page;
$rev->content = $content;
$rev->submitter = $this->user;
$rev->summary = __('Initial page creation');
$rev->create();
$rev->notify($project->getConf());
// To review :
// $conf->setVal('wiki_default_page', 'summary-default');
$project->created();
return $project;
}
src/IDF/WikiPage.php
221221
222222
223223
224
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
$tmpl = new Pluf_Template('idf/wiki/feedfragment.xml');
return $tmpl->render($context);
}
}
function projectCreated($signal, &$params)
{
$project = $params['project'];
$users = $project->getMembershipData();
$user = $users['owners'][0];
$conf = $project->getConf();
// Insert default wiki page
$tmpl = new Pluf_Template('idf/wiki/wiki-default-page.mdtext');
$context = new Pluf_Template_Context(array('project' => $project));
$content = $tmpl->render($context);
$page = new IDF_WikiPage();
$page->project = $project;
$page->submitter = $user;
$page->summary = __('Default page for your project Wiki.');
$page->title = 'IndeferoSummaryDefault';
$page->create();
$rev = new IDF_WikiRevision();
$rev->wikipage = $page;
$rev->content = $content;
$rev->submitter = $user;
$rev->summary = __('Initial page creation');
$rev->create();
$rev->notify($project->getConf());
// Insert markdown help wiki page
$tmpl = new Pluf_Template('idf/wiki/wiki-markdown-help.mdtext');
$context = new Pluf_Template_Context(array('project' => $project));
$content = $tmpl->render($context);
$page = new IDF_WikiPage();
$page->project = $project;
$page->submitter = $user;
$page->summary = __('Help about Markdown syntax.');
$page->title = 'IndeferoMarkdownHelp';
$page->create();
$rev = new IDF_WikiRevision();
$rev->wikipage = $page;
$rev->content = $content;
$rev->submitter = $user;
$rev->summary = __('Initial page creation');
$rev->create();
$rev->notify($project->getConf());
$conf->setVal('wiki_default_page', 'IndeferoSummaryDefault');
$conf->setVal('labels_wiki_predefined', IDF_Form_WikiConf::init_predefined);
}
}
src/IDF/relations.php
115115
116116
117117
118
119
120
121
122
123
118124
Pluf_Signal::connect('IDF_Queue::processItem',
Pluf::f('idf_hook_process_item',
array('IDF_Webhook', 'process')));
#
# Wiki init
Pluf_Signal::connect('IDF_Project::created',
array('IDF_WikiPage', 'projectCreated'));
return $m;
src/IDF/templates/idf/wiki/base.html
22
33
44
5
5
66
77
88
{block tabwiki} class="active"{/block}
{block subtabs}
<div id="sub-tabs">
<a {if $inWiki}class="active" {/if}href="{url 'IDF_Views_Wiki::index', array($project.shortname)}">{trans 'List Pages'}</a>
<a {if $inWiki}class="active" {/if}href="{url 'IDF_Views_Wiki::listing', array($project.shortname)}">{trans 'List Pages'}</a>
{if !$user.isAnonymous()} | <a {if $inCreate}class="active" {/if}href="{url 'IDF_Views_Wiki::create', array($project.shortname)}">{trans 'New Page'}</a> {/if}
{if !$user.isAnonymous() and $inView} | <a href="{url 'IDF_Views_Wiki::update', array($project.shortname, $page.title)}">{trans 'Update This Page'}</a> {/if}
|

Archive Download the corresponding diff file

Page rendered in 0.08724s using 13 queries.