Added ticket 90, propose to create a new documentation page when it doesn't exists.
This commit is contained in:
@@ -53,9 +53,13 @@ class IDF_Template_Markdown extends Pluf_Template_Tag
|
||||
$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];
|
||||
}
|
||||
|
@@ -90,7 +90,7 @@ class IDF_Template_MarkdownPrefilter extends Pluf_Text_HTML_Filter
|
||||
);
|
||||
|
||||
public $allowed = array(
|
||||
'img' => array('src', 'class', 'alt', 'height', 'width'),
|
||||
'img' => array('src', 'class', 'alt', 'height', 'width', 'style'),
|
||||
'strong' => array(),
|
||||
'em' => array(),
|
||||
'b' => array(),
|
||||
@@ -98,6 +98,9 @@ class IDF_Template_MarkdownPrefilter extends Pluf_Text_HTML_Filter
|
||||
'ul' => array(),
|
||||
'ol' => array(),
|
||||
'li' => array(),
|
||||
'dl' => array(),
|
||||
'dt' => array(),
|
||||
'dd' => array(),
|
||||
'p' => array('align', 'class'),
|
||||
'div' => array('align', 'class'),
|
||||
'br' => array(),
|
||||
|
Reference in New Issue
Block a user