Lines Matching refs:this

21     $controller->register_hook('ACTION_ACT_PREPROCESS', 'BEFORE', $this, '_parser', array());
23 $controller->register_hook('TPL_ACT_RENDER', 'BEFORE', $this, '_render', array());
24 $controller->register_hook('TEMPLATE_PAGETOOLS_DISPLAY', 'BEFORE', $this, 'addbutton', array());
26 $controller->register_hook('MENU_ITEMS_ASSEMBLY', 'AFTER', $this, 'addsvgbutton', array());
53 if($this->getConf('showimportbutton') && $event->data['view'] == 'main') {
62 ….'<a href='.wl($ID, $params).' class="action import_file" rel="nofollow" title="'.$this->getLang(…
63 .'<span>'.$this->getLang('import_button').'</span>'
77 if ( strpos( $this->getConf('formDisplayRule'), $event->data) === false ) return;
80 …if ( page_exists( $ID ) ) echo p_render('xhtml',p_get_instructions( $this->getLang( 'formPageExist…
84 $message = $this->getConf('formIntroMessage');
85 if ( $message == 'default' ) $message = $this->getLang('formIntroMessage');
90 <legend>'.$this->getLang('formLegend').'</legend>
91 … <input type="hidden" name="MAX_FILE_SIZE" value="'.$this->getConf('formMaxFileSize').'"/>
111 $this->debug = $this->getConf( 'debugLvl' );
113 if ( $this->debug >= 2 ) {
114 $this->logFile = $this->getConf( 'logFile' );
115 …if ( isset( $this->logFile ) ) if ( file_exists( dirname( $this->logFile ) ) || mkdir( dirname( $t…
116 …if ( ! ( $this->logFileHandle = @fopen( $this->logFile, 'a' ) ) ) unset( $this->logFileHandle, $th…
117 } else unset( $this->logFile );
118 if ( ! isset( $this->logFileHandle ) ) $this->_msg( 'er_logFile' );
126 $retour = $this->_odtplus2dw();
128 $this->_purge_env();
133 $event->data = $this->getConf('parserPostDisplay');
140 if ( isset( $this->logFileHandle ) ) @fclose( $this->logFileHandle );
154 $this->conversion = array(
190 $this->xmlFile = "content.xml";
195 if ( ! $this->pageName = $ID ) return $this->_msg('er_id');
196 $this->nsName = getNS($this->pageName);
199 if ( auth_quickaclcheck($ID) < AUTH_EDIT ) return $this->_msg('er_acl_edit');
201 if ( auth_quickaclcheck($ID) < AUTH_CREATE ) return $this->_msg('er_acl_create');
205 if ( ! $this->_checkUploadFile() ) return $this->_msg('er_checkUploadResult');
208 if ( ! $this->getConf( 'parserXslFile' ) ) return $this->_msg('er_xslFile_notset');
209 $this->xslFile = DOKU_PLUGIN.'odtplus2dw/'.$this->getConf('parserXslFile');
210 if ( ! file_exists($this->xslFile) ) return $this->_msg('er_xslFile_exists');
211 if ( ! is_file($this->xslFile) ) return $this->_msg('er_xslFile_isfile');
214 if ( ! class_exists( "XSLTProcessor" ) ) return $this->_msg('er_class_xsltProcessor');
215 if ( ! class_exists( "ZipArchive" ) ) return $this->_msg('er_class_zipArchive');
216 if ( ! class_exists( "DOMDocument" ) ) return $this->_msg('er_class_domDocument');
218 $this->XSLT = new XSLTProcessor;
219 $this->ZIP = new ZipArchive;
220 $this->XSL = new DOMDocument;
221 $this->XML = new DOMDocument;
224 if ( ! ($this->XSL->load( $this->xslFile ) ) ) return $this->_msg('er_loadXsl');
226 if ( ! $this->_set_xsltProcessor() ) return $this->_msg('er_xsltProc');
228 if ( ! $this->_unzip( $this->xmlFile ) ) return $this->_msg('er_file_unzip');
230 if ( ! $this->XML->load($this->uploadDir.'/'.$this->xmlFile) ) return $this->_msg('er_loadXml');
231 …if ( ! $this->racine = $this->XML->getElementsByTagName('document-content')->item(0) ) return $thi…
233 …foreach ( $this->conversion as $attr => $value ) if ( $this->racine->hasAttribute($attr) ) $this->…
235 $this->result = '====== '.basename($this->odtFileName,'.odt').' ======
237 …f ( $this->getConf('parserLinkToOriginalFile') && auth_quickaclcheck($ID) >= AUTH_UPLOAD ) $this->…
245 set_time_limit( $this->getConf('parserCoreTimeOut') );
247 … ( ! $tmp = html_entity_decode($this->XSLT->transformToDoc( $this->XML )->saveHTML(), ENT_COMPAT, …
248 $this->result .= $tmp;
252 $this->_parse_image();
255 if ( ! $this->_apply_result() ) return $this->_msg('er_apply');
286 if ( ! $output ) die( $this->getLang( 'er_msg_nomessage' ) );
304 …if ( $this->debug > 3 ) echo '<p>message : '.$message.' |output : '.$output.' |val : '.$val.' |err…
307 if ( !$force && $this->debug == 0 ) return ( $err == -1 ? false : true );
310 if ( !$force && $err != -1 && $this->debug < 3 ) return true;
312 …$content = $output.' : '.$this->getLang( $output ).( is_array( $message ) ? ' : '.$message[1] : ''…
314 …if ( isset( $this->logFileHandle ) ) fwrite( $this->logFileHandle, date(DATE_ATOM).':'.$_SERVER['R…
330 if ( ! $_FILES['userFile'] ) return $this->_msg('er_file_miss');
332 …if ( $_FILES['userFile']['error'] > 0 ) return $this->_msg( array( 'er_file_upload', $_FILES['user…
334this->getConf( 'parserMimeTypeAuthorized' ) != "" && strpos( $this->getConf( 'parserMimeTypeAuthor…
337 …while ( file_exists( $this->uploadDir = $this->getConf( 'parserUploadDir' ).rand( 10000, 100000 ) …
339 if ( ! mkdir( $this->uploadDir, 0777, true ) ) return $this->_msg( 'er_file_tmpDir' );
341 chmod( $this->uploadDir, 0777 );
343 $this->userFileName = $_FILES['userFile']['name'];
344 $this->userFile = $this->uploadDir.'/'.$this->userFileName;
345 …if ( ! move_uploaded_file( $_FILES['userFile']['tmp_name'], $this->userFile ) ) return $this->_msg…
349 $this->odtFileName = substr($this->userFileName, 0);
350 $this->odtFile = substr($this->userFile, 0);
353 …if ( $this->getConf( 'parserMimeTypePandoc' ) != "" && strpos( $this->getConf( 'parserMimeTypePand…
355 $this->_prepareOdtFileName();
359 …exec( 'pandoc -s -w odt -o "' . $this->odtFile . '" "' . $this->userFile . '"', $output, $return_v…
363 …if ( $this->getConf( 'parserMimeTypeSOffice' ) != "" && strpos( $this->getConf( 'parserMimeTypeSOf…
365 $this->_prepareOdtFileName();
369 …exec( 'cd ' . $this->uploadDir . ' && sudo soffice --nofirststartwizard --headless --convert-to od…
378 $info = pathinfo($this->userFile);
379 $this->odtFileName = $info['filename'] . '.odt';
380 $this->odtFile = $this->uploadDir.'/'. $this->odtFileName;
394 …if ( file_exists( $this->odtFile ) ) if ( ! @unlink( $this->odtFile ) ) $this->_msg( array( 'er_pg…
395 …if ( file_exists( $this->userFile ) ) if ( ! @unlink( $this->userFile ) ) $this->_msg( array( 'er_…
397 …if ( $this->file_extract ) foreach ($this->file_extract as $file) if ( file_exists( $file ) ) if (…
399this->file_import ) foreach ( $this->file_import as $file ) if ( file_exists( $this->uploadDir.'/'…
401this->uploadDir.'/'.$this->pictpath) ) if ( ! @rmdir( $this->uploadDir.'/'.$this->pictpath ) ) $th…
403 …if ( file_exists( $this->uploadDir ) ) if ( ! @rmdir( $this->uploadDir ) ) $this->_msg( array( 'er…
417 if ( ! $this->XSLT->importStylesheet( $this->XSL ) ) return $this->_msg('er_xslt_invalid');
419 …if ( ! $this->XSLT->setParameter( '', $param, '1' ) ) return $this->_msg( array( 'inf_xslt_param',…
421 $this->_msg( array( 'ok_infoPlugin', $param ), 1 );
424 …_message') as $lang_elt ) if ( ! $this->XSLT->setParameter( '', $lang_elt, $this->getLang('xsl_'.$…
435 …saveWikiText( $this->pageName, $this->result, $this->getLang( 'parserSummary' ).$this->userFileNam…
436 if ( ! page_exists($this->pageName) ) return $this->_msg('er_apply_content');
440 $destDir = mediaFN( $this->nsName );
441 …if ( ! ( file_exists( $destDir ) || mkdir( $destDir, 0777, true ) ) ) return $this->_msg( array( '…
442 if ( $this->file_import ) foreach ( $this->file_import as $pict ) {
443 $destFile = mediaFN( $this->nsName.':'.$pict );
444 list( $ext, $mime ) = mimetype( $this->uploadDir.'/'.$this->pictpath.'/'.$pict );
445this->uploadDir.'/'.$this->pictpath.'/'.$pict, $destFile, $this->nsName, $mime, @file_exists($dest…
448 $destFile = mediaFN( $this->nsName.':'.$this->userFileName );
449 list( $ext, $mime ) = mimetype( $this->uploadDir.'/'.$this->userFileName );
450 …nish($this->uploadDir.'/'.$this->userFileName, $destFile, $this->nsName, $mime, @file_exists($dest…
453 $this->_msg( 'inf_acl_upload', 0, true );
468 …(?:[^/}]+/)*[^/}]+)/([0-9a-zA-Z]+)(\.[a-z]+)(\?[0-9]+(?:x[0-9]+)?)?}}|', $this->result, $imgs, PRE…
469 if ( auth_quickaclcheck( $ID ) < AUTH_UPLOAD ) return $this->_msg( 'er_acl_upload' );
470 $this->err['ok'] = array();
473 $this->pictpath = $value[1];
477 if ( $this->_unzip($this->pictpath.'/'.$pict) ) {
480 $newFileHash = hash_file('sha512', $this->uploadDir.'/'.$this->pictpath.'/'.$pict);
483 $newFileName = noNS($this->pageName).'_image_'.$key.$ext;
484 $existingFile = mediaFN( $this->nsName.':'.$newFileName);
488 …if ( rename( $this->uploadDir.'/'.$this->pictpath.'/'.$pict, $this->uploadDir.'/'.$this->pictpath.…
489 …$this->result = str_replace( '{{'.$this->pictpath.'/'.$pict.$other.'}}' , '{{'.$newFileName.$other…
490 $this->file_import[] = $newFileName;
491 if ( $this->debug ) $this->err['ok'][] = $pict.' : '.$newFileName;
492 } else $this->err[$pict] = 'rename';
493 } else $this->err[$pict] = 'unzip';
496 if ( $this->err ) foreach ( $this->err as $key => $value ) {
499 foreach ( $value as $msg ) $this->_msg( array( 'ok_img', $msg ) );
503 $this->_msg( array( 'er_img_'.$value, $key ) );
515 if ( ! $this->ZIP ) return $this->_msg('er_unzip_object');
516 if ( ! file_exists( $this->odtFile ) ) return $this->_msg('er_unzip_nofile');
517 if ( ! ( $this->ZIP->open( $this->odtFile ) === true ) ) return $this->_msg( 'er_unzip_open' );
518 $res = $this->ZIP->extractTo( $this->uploadDir, $entrie );
519 $this->ZIP->close();
520 if ( ! $res ) return $this->_msg( array( 'er_unzip_error', $entrie ) );
521 $this->file_extract[] = $this->uploadDir.'/'.$entrie;
522 return $this->_msg( array( 'ok_unzip', $entrie ) );