示例#1
0
 /**
  * preprocessing
  *
  * @return xxx
  */
 function preprocessing()
 {
     if ($this->cache_uptodate) {
         return true;
     }
     if (!$this->hotpot->source->get_filecontents()) {
         // empty source file - shouldn't happen !!
         return false;
     }
     if ($pos = strpos($this->hotpot->source->filecontents, '<title>')) {
         $insert = '<base href="' . $this->hotpot->source->baseurl . '/' . $this->hotpot->source->filepath . '">' . "\n";
         $this->hotpot->source->filecontents = substr_replace($this->hotpot->source->filecontents, $insert, $pos, 0);
     }
     // replace external javascript with modified inline javascript
     $search = '/<script[^>]*src\\s*=\\s*"([^"]*)"[^>]*>\\s*<\\/script>/';
     $callback = array($this, 'preprocessing_xerte_js');
     $this->hotpot->source->filecontents = preg_replace_callback($search, $callback, $this->hotpot->source->filecontents);
     parent::preprocessing();
 }
示例#2
0
 /**
  * preprocessing
  *
  * @return xxx
  */
 function preprocessing()
 {
     if ($this->cache_uptodate) {
         return true;
     }
     if (!$this->hotpot->source->get_filecontents()) {
         // empty source file - shouldn't happen !!
         return false;
     }
     // remove doctype
     $search = '/\\s*(?:<!--\\s*)?<!DOCTYPE[^>]*>\\s*(?:-->\\s*)?/s';
     $this->hotpot->source->filecontents = preg_replace($search, '', $this->hotpot->source->filecontents);
     // replace <object> with link and force through filters
     $search = '/<object id="presentation"[^>]*>.*?<param name="movie" value="([^">]*)"[^>]*>.*?<\\/object>/is';
     $replace = '<a href="$1?d=800x600">$1</a>';
     $this->hotpot->source->filecontents = preg_replace($search, $replace, $this->hotpot->source->filecontents);
     // remove fixprompt.js
     $search = '/<script[^>]*src="[^">]*fixprompt.js"[^>]*(?:(?:\\/>)|(?:<\\/script>))\\s*/s';
     $this->hotpot->source->filecontents = preg_replace($search, '', $this->hotpot->source->filecontents);
     parent::preprocessing();
 }