예제 #1
0
 /**
  * Handle the match
  */
 function handle($match, $state, $pos, &$handler)
 {
     set_media_file_revision_limit($this->getConf('media file revision limit'));
     if ($state != DOKU_LEXER_SPECIAL) {
         return NULL;
     }
     global $ID;
     $path = explode(":", $ID);
     $name = array_pop($path);
     $this->project_file = FileDefinition::parse($name, $match);
     $this->project_file->position = $pos;
     $this->project_file->end = $pos + strlen($match) - 1;
     return $this->project_file;
 }
 public function __construct($attributes)
 {
     if (!isset($attributes['linkto'])) {
         $attributes['linkto'] = "";
     } else {
         $linkto = $attributes['linkto'];
         if (strpos($linkto, "/")) {
             $linkto = "";
         } else {
             if (strpos($linkto, "\\")) {
                 $linkto = "";
             }
         }
         if ($linkto) {
             $path = explode(":", $linkto);
             if ($path[0] == '[media]') {
                 array_shift($path);
             }
             if (count($path) > 1 && $path[0] != PROJECTS_NAMESPACE) {
                 $linkto = "";
             }
         }
         $attributes['linkto'] = $linkto;
     }
     parent::__construct($attributes);
 }