1 <?php # vim:ts=2:sw=2:et:
2 /* For licensing and copyright terms, see the file named LICENSE */
5 * This is alot simpler now...
7 * In our horrifically simple version...
9 * We could just use a database, and go from there.
10 * ... that looses the diff feature... although we can use the mtrack_change stuff....
12 * ... That sounds alot better in our context as we can show data on the changelog..
13 * -----> It will mean that the change log will have to honour our privacy settings..
16 * oK - uses new mtrack_wiki table..
21 require_once 'MTrack/Attachment.php';
22 require_once 'MTrackWeb.php';
24 class MTrackWeb_Wiki extends MTrackWeb
29 var $hasHistory = false;
33 return parent::getAuth();
38 // non 'json' request...
39 if (!isset($_REQUEST['ajax_body'])) {
40 $this->title = "Browse: " . $pi;
43 DB_DataObject::debugLevel(1);
44 $p = DB_DataObject::Factory('mtrack_wiki');
45 $p->project_id = $this->currentProject();
48 if (!$p->find(true)) {
49 $this->returnNotFound($pi);
51 $this->jdata($p->toArray());
53 //echo '<PRE>';print_r($this);echo '</PRE>';
57 function returnNotFound($pi) {
72 $p = DB_DataObject::factory('mtrack_wiki');
73 $p->project_id = $this->currentProject();
75 if (empty($_REQUEST['id']) && !$p->get($_REQUEST['id'])) {
77 $this->jerr('invalid id');
81 $this->setFrom($_POST);
82 if ($o->project_id != $p->project_id) {
83 $this->jerr("changing project id not permitted");
85 call_user_method($o->id ? 'update' : 'insert', $p, $o);
87 $this->jok($p->toArray());