Indefero

Indefero Commit Details


Date:2009-01-02 06:58:55 (15 years 11 months ago)
Author:Loic d'Anterroches
Branch:dev, 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:60bc06f5c3aa33163ad2ebf2691692dc07108f86
Parents: a36e89ac2edb097c7e3e900da808e0a3e76fd812
Message:Added ticket 90, propose to create a new documentation page when it doesn't exists.

Changes:

File differences

src/IDF/Form/WikiCreate.php
5454
5555
5656
57
5758
5859
5960
60
61
6162
6263
6364
or $this->user->hasPerm('IDF.project-member', $this->project)) {
$this->show_full = true;
}
$initname = (!empty($extra['name'])) ? $extra['name'] : __('PageName');
$this->fields['title'] = new Pluf_Form_Field_Varchar(
array('required' => true,
'label' => __('Page title'),
'initial' => __('PageName'),
'initial' => $initname,
'widget_attrs' => array(
'maxlength' => 200,
'size' => 67,
src/IDF/Template/Markdown.php
5353
5454
5555
56
56
5757
5858
59
60
61
62
5963
6064
6165
$sql = new Pluf_SQL('project=%s AND title=%s',
array($this->project->id, $m[1]));
$pages = Pluf::factory('IDF_WikiPage')->getList(array('filter'=>$sql->gen()));
if ($pages->count() != 1) {
if ($pages->count() != 1 and !$this->request->rights['hasWikiAccess']) {
return $m[0];
}
if ($pages->count() != 1 and $this->request->rights['hasWikiAccess']
and !$this->request->user->isAnonymous()) {
return '<img style="vertical-align: text-bottom;" alt=" " src="'.Pluf::f('url_media').'/idf/img/add.png" /><a href="'.Pluf_HTTP_URL_urlForView('IDF_Views_Wiki::create', array($this->project->shortname), array('name'=>$m[1])).'" title="'.__('Create this documentation page').'">'.$m[1].'</a>';
}
if (!$this->request->rights['hasWikiAccess']) {
return $m[1];
}
src/IDF/Template/MarkdownPrefilter.php
9090
9191
9292
93
93
9494
9595
9696
......
9898
9999
100100
101
102
103
101104
102105
103106
);
public $allowed = array(
'img' => array('src', 'class', 'alt', 'height', 'width'),
'img' => array('src', 'class', 'alt', 'height', 'width', 'style'),
'strong' => array(),
'em' => array(),
'b' => array(),
'ul' => array(),
'ol' => array(),
'li' => array(),
'dl' => array(),
'dt' => array(),
'dd' => array(),
'p' => array('align', 'class'),
'div' => array('align', 'class'),
'br' => array(),
src/IDF/Views/Wiki.php
5656
5757
5858
59
5960
6061
6162
......
102103
103104
104105
106
105107
106108
107109
......
190192
191193
192194
195
196
193197
194
195
198
199
200
196201
197202
198203
$sql .= ' AND id NOT IN ('.implode(',', $ids).')';
}
$pag->forced_where = new Pluf_SQL($sql, array($prj->id));
$pag->extra_classes = array('right', '', 'a-c');
$list_display = array(
'title' => __('Page Title'),
array('summary', 'IDF_Views_Wiki_SummaryAndLabels', __('Summary')),
$pag->summary = __('This table shows the pages found.');
$pag->action = array('IDF_Views_Wiki::search', array($prj->shortname), array('q'=> $q));
$pag->edit_action = array('IDF_Views_Wiki::view', 'shortname', 'title');
$pag->extra_classes = array('right', '', 'a-c');
$list_display = array(
'title' => __('Page Title'),
array('summary', 'IDF_Views_Wiki_SummaryAndLabels', __('Summary')),
$preview = $request->POST['content'];
}
} else {
$pagename = (isset($request->GET['name'])) ?
$request->GET['name'] : '';
$form = new IDF_Form_WikiCreate(null,
array('project' => $prj,
'user' => $request->user));
array('name' => $pagename,
'project' => $prj,
'user' => $request->user));
}
return Pluf_Shortcuts_RenderToResponse('idf/wiki/create.html',
array(

Archive Download the corresponding diff file

Page rendered in 0.08989s using 14 queries.