Show
Ignore:
Timestamp:
01/06/06 17:31:33 (3 years ago)
Author:
piotras
Message:

$GLOBALSmidgard? removed in favour of $_MIDGARD
correct class names
created topic correctly assigned

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/php-libs/webdav2/Server.php

    r8413 r9135  
    8484    if (!$this->_repository_metadata_object) { 
    8585      $this->add_to_log("Repository metadata object not found, trying to create"); 
    86       $topic = new NewMidgardTopic(); 
     86      $topic = new midgard_topic(); 
    8787      $topic->up = 0; 
    8888      $topic->name = "__MidgardDAV"; 
    8989      $topic->extra = "Midgard WebDAV Server Metadata repository"; 
    90       $stat = $topic->create(); 
    91       if ($stat) { 
    92         $this->_repository_metadata_object = mgd_get_topic($stat); 
     90      if ($topic->create()) { 
     91        $this->_repository_metadata_object = $topic; 
    9392      } else { 
    9493        $this->add_to_log("Repository metadata object creation failed, reason ".mgd_errstr()); 
     
    112111  */ 
    113112  function check_auth($type, $user, $pass) { 
    114     if ($GLOBALS["midgard"]->user) { 
     113    if ($_MIDGARD['user']) { 
    115114      return true; 
    116115    } else { 
     
    147146                $this->add_to_log("mapping '$path'  " ); 
    148147            $current_object = false; 
    149             $local_path = str_replace($GLOBALS["midgard"]->self,"",$path); 
     148            $local_path = str_replace($_MIDGARD['self'],"",$path); 
    150149            // to get extension etc. 
    151150            // now the filename is $pathinfo['basename']! 
     
    381380        $path =  $options["path"]  ; 
    382381     
    383         $local_path = str_replace($GLOBALS["midgard"]->self,"",$path); 
     382        $local_path = str_replace($_MIDGARD['self'],"",$path); 
    384383            
    385384                // prepare property array 
     
    533532 
    534533    // get document path 
    535     $local_path = str_replace($GLOBALS["midgard"]->self,"",$options['path']); 
     534    $local_path = str_replace($_MIDGARD['self'],"",$options['path']); 
    536535 
    537536    $current_object =&$this->_map_path_to_object($local_path); 
     
    632631                $snippet = mgd_get_snippet(); 
    633632                $snippet->up = $this->_current_directory->id; 
    634                 $user = mgd_get_person($GLOBALS["midgard"]->user); 
     633                $user = mgd_get_person($_MIDGARD['user']); 
    635634                $snippet->author = $user->name; 
    636635                $snippet->name = str_replace(".php","",urldecode(basename($options["path"]))); 
     
    657656                $snippet = mgd_get_element(); 
    658657                $snippet->style = $this->_current_directory->id; 
    659                 $user = mgd_get_person($GLOBALS["midgard"]->user); 
     658                $user = mgd_get_person($_MIDGARD['user']); 
    660659                $snippet->author = $user->name; 
    661660                $snippet->name = str_replace(".php","",urldecode(basename($options["path"]))); 
     
    706705    // get document path 
    707706    $path = $options["path"]; 
    708     $local_path = str_replace($GLOBALS["midgard"]->self,"",$path); 
     707    $local_path = str_replace($_MIDGARD['self'],"",$path); 
    709708    $this->add_to_log("MKCOL for ".$path); 
    710709    $new_folder = urldecode(basename($local_path)); 
     
    10881087    // get topic/document path 
    10891088    $path = $options["path"]; 
    1090     $local_path = str_replace($GLOBALS["midgard"]->self,"",$path); 
     1089    $local_path = str_replace($_MIDGARD['self'],"",$path); 
    10911090    $this->add_to_log("PROPPATCH for ".$path); 
    10921091    $current_object =& $this->_map_path_to_object($local_path); 
     
    11191118    // get topic/document path 
    11201119    $path = $options["path"]; 
    1121     $local_path = str_replace($GLOBALS["midgard"]->self,"",$path); 
     1120    $local_path = str_replace($_MIDGARD['self'],"",$path); 
    11221121    $this->add_to_log("LOCK for ".$path); 
    11231122    $current_object = &$this->_map_path_to_object($local_path); 
     
    11661165    // get topic/document path 
    11671166    $path = $options["path"]; 
    1168     $local_path = str_replace($GLOBALS["midgard"]->self,"",$path); 
     1167    $local_path = str_replace($_MIDGARD['self'],"",$path); 
    11691168    $this->add_to_log("UNLOCK for ".$path); 
    11701169    $current_object = &$this->_map_path_to_object($local_path); 
     
    11971196 
    11981197    // get document path 
    1199     $local_path = str_replace($GLOBALS["midgard"]->self,"",$path); 
     1198    $local_path = str_replace($_MIDGARD['self'],"",$path); 
    12001199   // $this->add_to_log("checkLock for ".$path); 
    12011200    $current_object = &$this->_map_path_to_object($local_path); 
     
    12591258        function get_content(&$obj) { 
    12601259                switch (get_class($obj)) { 
    1261                         case "NewMidgardArticle": 
     1260                        case "midgard_article": 
    12621261                        case "MidgardArticle": 
    12631262                                return  $obj->content; 
    12641263                        break; 
    1265                         case "NewMidgardPage": 
     1264                        case "midgard_page": 
    12661265                        case "MidgardPage": 
    12671266                                return $obj->content; 
    12681267                        break; 
    1269                         case "NewMidgardElement": 
     1268                        case "midgard_element": 
    12701269                        case "MidgardElement": 
    12711270                                return $obj->value; 
    12721271                        break;                   
    12731272                         
    1274                         case "NewMidgardSnippet": 
     1273                        case "midgard_snippet": 
    12751274                        case "MidgardSnippet": 
    12761275                                return $obj->code; 
    12771276                        break; 
    1278                         case "NewMidgardTopic": 
     1277                        case "midgard_topic": 
    12791278                        case "MidgardTopic": 
    12801279                                return $obj->description; 
    12811280                        break; 
    1282                         case "NewMidgardPageElement": 
     1281                        case "midgard_pageelement": 
    12831282                        case "MidgardPageElement": 
    12841283                                return $obj->value; 
    12851284                        break; 
    1286                         case "NewMidgardGroup": 
     1285                        case "midgard_group": 
    12871286                        case "MidgardGroup": 
    12881287                        return  $obj->name; 
    12891288                        break; 
    1290                         case "NewMidgardParameter": 
     1289                        case "midgard_parameter": 
    12911290                        case "MidgardParameter": 
    12921291                                return $obj->value; 
    12931292                        break; 
    1294                         case "NewMidgardPagelink": 
     1293                        case "midgard_pagelink": 
    12951294                        case "MidgardPagelink": 
    12961295                                return $obj->target; 
    12971296                        break; 
    1298                         case "NewMidgardPerson": 
     1297                        case "midgard_person": 
    12991298                        case "MidgardPerson": 
    13001299                                return $obj->name; 
    13011300                        break; 
    1302                         case "NewMidgardEvent": 
     1301                        case "midgard_event": 
    13031302                        case "MidgardEvent": 
    13041303                                return $obj->name; 
    13051304                        break; 
    1306                         case "NewMidgardSnippetdir": 
     1305                        case "midgard_snippetdir": 
    13071306                        case "MidgardSnippetdir": 
    13081307                                return $obj->name; 
    13091308                        break; 
    1310                         case "NewMidgardStyle": 
     1309                        case "midgard_style": 
    13111310                        case "MidgardStyle": 
    13121311                                return $obj->name; 
    13131312                        break; 
    1314                         case "NewMidgardAttachment": 
     1313                        case "midgard_attachment": 
    13151314                        case "MidgardAttachment": 
    13161315                                return $obj->name; 
    13171316                        break; 
    13181317                         
    1319                         case "NewMidgardMember": 
     1318                        case "midgard_member": 
    13201319                        case "MidgardMember": 
    13211320                                return $obj->name; 
    13221321                        break; 
    13231322 
    1324                         case "NewMidgardHost": 
     1323                        case "midgard_host": 
    13251324                        case "MidgardHost": 
    13261325                                return $obj->name . $obj->prefix; 
    13271326                        break; 
    1328                         case "NewMidgardEventMember": 
     1327                        case "midgard_eventmember": 
    13291328                        case "MidgardEventMember": 
    13301329                                return $obj->name;