php8
[web.mtrack] / MTrackWeb / Wiki.php
index 54551bc..5d18bd1 100644 (file)
@@ -27,6 +27,8 @@ class MTrackWeb_Wiki extends MTrackWeb
     var $conflicted = 0;
     var $message = false;
     var $hasHistory = false;
+    var $title;
+    var $authUserArray;
     
     function getAuth()
     {
@@ -36,27 +38,34 @@ class MTrackWeb_Wiki extends MTrackWeb
     function get($pi='')
     {
         // non 'json' request...
+      
         if (!isset($_REQUEST['ajax_body'])) {
             $this->title = "Browse: " . $pi;
             return;
         }
-        //DB_DataObject::debugLevel(1);
+        
         $p = DB_DataObject::Factory('Mtrack_wiki');
         $p->project_id =  $this->currentProject();
+         
 
         $p->path = $pi;
-        
+       
         // we add stuff on the end..
         if (empty($pi)) {
             $px = DB_DataObject::Factory('Mtrack_wiki');
             $px->project_id =  $this->currentProject();
             $px->orderBy('path');
             
+            $pr = DB_DataObject::factory('core_project');
+            $pr->get($px->project_id);
+            
             $ar = $px->fetchAll('path');
+            $wikidata = "## Index of pages in Wiki - {$pr->name} \n\n";
             foreach($ar as $pp) {
-                
-                
+                $wikidata .= " * [$pp](wiki:$pp)\n";
             }
+            $p->wikidata = $wikidata;
+            $this->jdata($p->toArray());
             
             
             
@@ -82,9 +91,10 @@ class MTrackWeb_Wiki extends MTrackWeb
         
     }
  
-    function post()
+    function post($request)
     {
-        
+        //DB_DataObject::debugLevel(1);
+  
         $au = $this->getAuthUser();
         if (!$au) {
             // autherr?