Lines Matching refs:this

20     $controller->register_hook('ACTION_ACT_PREPROCESS', 'BEFORE', $this, '_parser', array());
22 $controller->register_hook('TPL_ACT_RENDER', 'BEFORE', $this, '_render', array());
23 $controller->register_hook('TEMPLATE_PAGETOOLS_DISPLAY', 'BEFORE', $this, 'addbutton', array());
35 if($this->getConf('showimportbutton') && $event->data['view'] == 'main') {
44 ….'<a href='.wl($ID, $params).' class="action import_odt" rel="nofollow" title="'.$this->getLang('…
45 .'<span>'.$this->getLang('import_odt_button').'</span>'
60 if ( strpos( $this->getConf('formDisplayRule'), $event->data) === false ) return;
63 …if ( page_exists( $ID ) ) echo p_render('xhtml',p_get_instructions( $this->getLang( 'formPageExist…
67 $message = $this->getConf('formIntroMessage');
68 if ( $message == 'default' ) $message = $this->getLang('formIntroMessage');
73 <legend>'.$this->getLang('formLegend').'</legend>
74 <input type="hidden" name="MAX_FILE_SIZE" value="'.$this->getConf('formMaxFileSize').'"/>
94 $this->debug = $this->getConf( 'debugLvl' );
96 if ( $this->debug >= 2 ) {
97 $this->logFile = $this->getConf( 'logFile' );
98 …if ( isset( $this->logFile ) ) if ( file_exists( dirname( $this->logFile ) ) || mkdir( dirname( $t…
99 …if ( ! ( $this->logFileHandle = @fopen( $this->logFile, 'a' ) ) ) unset( $this->logFileHandle, $th…
100 } else unset( $this->logFile );
101 if ( ! isset( $this->logFileHandle ) ) $this->_msg( 'er_logFile' );
109 $retour = $this->_odt2dw();
111 $this->_purge_env();
116 $event->data = $this->getConf('parserPostDisplay');
123 if ( isset( $this->logFileHandle ) ) @fclose( $this->logFileHandle );
137 $this->conversion = array(
173 $this->xmlFile = "content.xml";
178 if ( ! $this->pageName = $ID ) return $this->_msg('er_id');
179 $this->nsName = getNS($this->pageName);
182 if ( auth_quickaclcheck($ID) < AUTH_EDIT ) return $this->_msg('er_acl_edit');
184 if ( auth_quickaclcheck($ID) < AUTH_CREATE ) return $this->_msg('er_acl_create');
188 if ( ! $this->_checkUploadFile() ) return $this->_msg('er_checkUploadResult');
191 if ( ! $this->getConf( 'parserXslFile' ) ) return $this->_msg('er_xslFile_notset');
192 $this->xslFile = DOKU_PLUGIN.'odt2dw/'.$this->getConf('parserXslFile');
193 if ( ! file_exists($this->xslFile) ) return $this->_msg('er_xslFile_exists');
194 if ( ! is_file($this->xslFile) ) return $this->_msg('er_xslFile_isfile');
197 if ( ! class_exists( XSLTProcessor ) ) return $this->_msg('er_class_xsltProcessor');
198 if ( ! class_exists( ZipArchive ) ) return $this->_msg('er_class_zipArchive');
199 if ( ! class_exists( DOMDocument ) ) return $this->_msg('er_class_domDocument');
201 $this->XSLT = new XSLTProcessor;
202 $this->ZIP = new ZipArchive;
203 $this->XSL = new DOMDocument;
204 $this->XML = new DOMDocument;
207 if ( ! ($this->XSL->load( $this->xslFile ) ) ) return $this->_msg('er_loadXsl');
209 if ( ! $this->_set_xsltProcessor() ) return $this->_msg('er_xsltProc');
211 if ( ! $this->_unzip( $this->xmlFile ) ) return $this->_msg('er_odtFile_unzip');
213 if ( ! $this->XML->load($this->uploadDir.'/'.$this->xmlFile) ) return $this->_msg('er_loadXml');
214 …if ( ! $this->racine = $this->XML->getElementsByTagName('document-content')->item(0) ) return $thi…
216 …foreach ( $this->conversion as $attr => $value ) if ( $this->racine->hasAttribute($attr) ) $this->…
218 $this->result = '====== '.basename($this->odtFileName,'.odt').' ======
220 …if ( $this->getConf('parserLinkToOriginalFile') && auth_quickaclcheck($ID) >= AUTH_UPLOAD ) $this-…
228 set_time_limit( $this->getConf('parserCoreTimeOut') );
230 … ( ! $tmp = html_entity_decode($this->XSLT->transformToDoc( $this->XML )->saveHTML(), ENT_COMPAT, …
231 $this->result .= $tmp;
235 $this->_parse_image();
238 if ( ! $this->_apply_result() ) return $this->_msg('er_apply');
269 if ( ! $output ) die( $this->getLang( 'er_msg_nomessage' ) );
287 …if ( $this->debug > 3 ) echo '<p>message : '.$message.' |output : '.$output.' |val : '.$val.' |err…
290 if ( !$force && $this->debug == 0 ) return ( $err == -1 ? false : true );
293 if ( !$force && $err != -1 && $this->debug < 3 ) return true;
295 …$content = $output.' : '.$this->getLang( $output ).( is_array( $message ) ? ' : '.$message[1] : ''…
297 …if ( isset( $this->logFileHandle ) ) fwrite( $this->logFileHandle, date(DATE_ATOM).':'.$_SERVER['R…
313 if ( ! $_FILES['odtFile'] ) return $this->_msg('er_odtFile_miss');
315 …if ( $_FILES['odtFile']['error'] > 0 ) return $this->_msg( array( 'er_odtFile_upload', $_FILES['od…
317this->getConf( 'parserMimeTypeAuthorized' ) != "" && strpos( $this->getConf( 'parserMimeTypeAuthor…
319 …while ( file_exists( $this->uploadDir = $this->getConf( 'parserUploadDir' ).rand( 10000, 100000 ) …
321 if ( ! mkdir( $this->uploadDir, 0777, true ) ) return $this->_msg( 'er_odtFile_tmpDir' );
323 $this->odtFileName = $_FILES['odtFile']['name'];
324 $this->odtFile = $this->uploadDir.'/'.$this->odtFileName;
325 …if ( ! move_uploaded_file( $_FILES['odtFile']['tmp_name'], $this->odtFile ) ) return $this->_msg('…
341 …if ( file_exists( $this->odtFile ) ) if ( ! @unlink( $this->odtFile ) ) $this->_msg( array( 'er_pg…
343 …if ( $this->file_extract ) foreach ($this->file_extract as $file) if ( file_exists( $file ) ) if (…
345this->file_import ) foreach ( $this->file_import as $file ) if ( file_exists( $this->uploadDir.'/'…
347this->uploadDir.'/'.$this->pictpath) ) if ( ! @rmdir( $this->uploadDir.'/'.$this->pictpath ) ) $th…
349 …if ( file_exists( $this->uploadDir ) ) if ( ! @rmdir( $this->uploadDir ) ) $this->_msg( array( 'er…
363 if ( ! $this->XSLT->importStylesheet( $this->XSL ) ) return $this->_msg('er_xslt_invalid');
365 …if ( ! $this->XSLT->setParameter( '', $param, '1' ) ) return $this->_msg( array( 'inf_xslt_param',…
367 $this->_msg( array( 'ok_infoPlugin', $param ), 1 );
370 …_message') as $lang_elt ) if ( ! $this->XSLT->setParameter( '', $lang_elt, $this->getLang('xsl_'.$…
381 …saveWikiText( $this->pageName, $this->result, $this->getLang( 'parserSummary' ).$this->odtFileName…
382 if ( ! page_exists($this->pageName) ) return $this->_msg('er_apply_content');
386 $destDir = mediaFN( $this->nsName );
387 …if ( ! ( file_exists( $destDir ) || mkdir( $destDir, 0777, true ) ) ) return $this->_msg( array( '…
388 if ( $this->file_import ) foreach ( $this->file_import as $pict ) {
389 $destFile = mediaFN( $this->nsName.':'.$pict );
390 list( $ext, $mime ) = mimetype( $this->uploadDir.'/'.$this->pictpath.'/'.$pict );
391this->uploadDir.'/'.$this->pictpath.'/'.$pict, $destFile, $this->nsName, $mime, @file_exists($dest…
394 $destFile = mediaFN( $this->nsName.':'.$this->odtFileName );
395 list( $ext, $mime ) = mimetype( $this->uploadDir.'/'.$this->odtFileName );
396 …nish($this->uploadDir.'/'.$this->odtFileName, $destFile, $this->nsName, $mime, @file_exists($destF…
399 $this->_msg( 'inf_acl_upload', 0, true );
414 …(?:[^/}]+/)*[^/}]+)/([0-9a-zA-Z]+)(\.[a-z]+)(\?[0-9]+(?:x[0-9]+)?)?}}|', $this->result, $imgs, PRE…
415 if ( auth_quickaclcheck( $ID ) < AUTH_UPLOAD ) return $this->_msg( 'er_acl_upload' );
416 $this->err['ok'] = array();
419 $this->pictpath = $value[1];
423 if ( $this->_unzip($this->pictpath.'/'.$pict) ) {
424 $newname = noNS($this->pageName).'_Image_'.$key.$ext;
425 …if ( rename( $this->uploadDir.'/'.$this->pictpath.'/'.$pict, $this->uploadDir.'/'.$this->pictpath.…
426 …$this->result = str_replace( '{{'.$this->pictpath.'/'.$pict.$other.'}}' , '{{'.$newname.$other.'}}…
427 $this->file_import[] = $newname;
428 if ( $this->debug ) $this->err['ok'][] = $pict.' : '.$newname;
429 } else $this->err[$pict] = 'rename';
430 } else $this->err[$pict] = 'unzip';
433 if ( $this->err ) foreach ( $this->err as $key => $value ) {
436 foreach ( $value as $msg ) $this->_msg( array( 'ok_img', $msg ) );
440 $this->_msg( array( 'er_img_'.$value, $key ) );
452 if ( ! $this->ZIP ) return $this->_msg('er_unzip_object');
453 if ( ! file_exists( $this->odtFile ) ) return $this->_msg('er_unzip_nofile');
454 if ( ! ( $this->ZIP->open( $this->odtFile ) === true ) ) return $this->_msg( 'er_unzip_open' );
455 $res = $this->ZIP->extractTo( $this->uploadDir, $entrie );
456 $this->ZIP->close();
457 if ( ! $res ) return $this->_msg( array( 'er_unzip_error', $entrie ) );
458 $this->file_extract[] = $this->uploadDir.'/'.$entrie;
459 return $this->_msg( array( 'ok_unzip', $entrie ) );