␊ |
function postSave($create=false)␊ |
{␊ |
$prj = $this->get_wikipage()->get_project();␊ |
$page = $this->get_wikipage();␊ |
␊ |
if ($create) {␊ |
// Check if more than one revision for this page. We do␊ |
|
$sql = new Pluf_SQL('wikipage=%s', array($this->wikipage));␊ |
$rev = Pluf::factory('IDF_Wiki_PageRevision')->getList(array('filter'=>$sql->gen()));␊ |
if ($rev->count() > 1) {␊ |
IDF_Timeline::insert($this, $prj, $this->get_submitter());␊ |
IDF_Timeline::insert($this, $page->get_project(), $this->get_submitter());␊ |
foreach ($rev as $r) {␊ |
if ($r->id != $this->id and $r->is_head) {␊ |
$r->is_head = false;␊ |
|
}␊ |
}␊ |
}␊ |
$page = $this->get_wikipage();␊ |
$page->update(); // Will update the modification timestamp.␊ |
IDF_Search::index($page);␊ |
}␊ |
␊ |
IDF_Search::index($page);␊ |
$page->update(); // Will update the modification timestamp.␊ |
␊ |
// remember the resource revisions used in this page revision␊ |
if ($this->is_head) {␊ |
preg_match_all('#\[\[!([A-Za-z0-9\-]+)[^\]]*\]\]#im', $this->content, $matches, PREG_PATTERN_ORDER);␊ |
|
public function timelineFragment($request)␊ |
{␊ |
$page = $this->get_wikipage();␊ |
$url = Pluf_HTTP_URL_urlForView('IDF_Views_Wiki::viewPage',␊ |
array($request->project->shortname,␊ |
$page->title));␊ |
$url = Pluf::f('url_base')␊ |
.Pluf_HTTP_URL_urlForView('IDF_Views_Wiki::viewPage',␊ |
array($request->project->shortname,␊ |
$page->title),␊ |
array('rev' => $this->id));␊ |
$out = "\n".'<tr class="log"><td><a href="'.$url.'">'.␊ |
Pluf_esc(Pluf_Template_dateAgo($this->creation_dtime, 'without')).␊ |
'</a></td><td>';␊ |
|
public function feedFragment($request)␊ |
{␊ |
$page = $this->get_wikipage();␊ |
if (!$this->is_head) {␊ |
$url = Pluf::f('url_base')␊ |
.Pluf_HTTP_URL_urlForView('IDF_Views_Wiki::viewPage',␊ |
array($request->project->shortname,␊ |
$page->title),␊ |
array('rev' => $this->id));␊ |
} else {␊ |
$url = Pluf::f('url_base')␊ |
.Pluf_HTTP_URL_urlForView('IDF_Views_Wiki::viewPage',␊ |
array($request->project->shortname,␊ |
$page->title));␊ |
}␊ |
$url = Pluf::f('url_base')␊ |
.Pluf_HTTP_URL_urlForView('IDF_Views_Wiki::viewPage',␊ |
array($request->project->shortname,␊ |
$page->title),␊ |
array('rev' => $this->id));␊ |
␊ |
$title = sprintf(__('%1$s: Documentation page %2$s updated - %3$s'),␊ |
$request->project->name,␊ |
$page->title, $page->summary);␊ |
|
'create' => false,␊ |
'date' => $date)␊ |
);␊ |
$tmpl = new Pluf_Template('idf/wiki/feedfragment.xml');␊ |
$tmpl = new Pluf_Template('idf/wiki/feedfragment-page.xml');␊ |
return $tmpl->render($context);␊ |
}␊ |
␊ |