Lines Matching refs:this

22     $controller->register_hook('ACTION_ACT_PREPROCESS', 'BEFORE', $this, '_parser', array());
25 $controller->register_hook('TPL_ACT_RENDER', 'BEFORE', $this, '_render', array());
28 $controller->register_hook('MENU_ITEMS_ASSEMBLY', 'AFTER', $this, '_addsvgbutton', array());
54 if ( strpos( $this->getConf('formDisplayRule'), $event->data) === false ) return;
63 …if ( page_exists( $ID ) ) echo p_render('xhtml',p_get_instructions( $this->getLang( 'formPageExist…
66 echo $this->_createForm();
84 $message = $this->getConf('formIntroMessage');
85 if ( $message == 'default' ) $message = $this->getLang('formIntroMessage');
96 $legend->attr('value',$this->getLang('formLegend'));
99 $form->setHiddenField('MAX_FILE_SIZE',$this->getConf('formMaxFileSize'));
109 $submitInputElement->attr('value',$this->getLang('import_button'));
132 $this->logLevel = $this->getConf( 'logLevel' );
133 $this->debugShowInfo = $this->getConf( 'debugShowInfo' );
135 if ( $this->logLevel > 0 ) {
136 $this->logFile = $this->getConf( 'logFile' );
137 if ( isset( $this->logFile ) ) {
138 if ( file_exists( dirname( $this->logFile ) ) || mkdir( dirname( $this->logFile ) ) ) {
139 if ( ! ( $this->logFileHandle = @fopen( $this->logFile, 'a' ) ) ) {
140 unset( $this->logFileHandle, $this->logFile );
143 unset( $this->logFile );
146 if ( ! isset( $this->logFileHandle ) ) {
147 $this->_msg('er_logFile');
154 $this->_msg( array('ok_info','userFile found: '.$_FILES['userFile']['name']) );
156 $retorno = $this->_file2dw();
158 $this->_purge_env();
171 if ( isset( $this->logFileHandle ) ) {
172 @fclose( $this->logFileHandle );
189 if ( ! $this->pageName = $ID ) return $this->_msg('er_id');
190 $this->nsName = getNS($this->pageName);
193 if ( auth_quickaclcheck($ID) < AUTH_EDIT ) return $this->_msg('er_acl_edit');
195 if ( auth_quickaclcheck($ID) < AUTH_CREATE ) return $this->_msg('er_acl_create');
199 $this->_checkUploadedFile();
205 $this->workFileName = substr($this->userFileName,0);
206 $this->workFile = substr($this->userFile,0);
207 if ($this->getConf( 'parserMimeTypeSOffice' ) != ''
208 … && strpos( $this->getConf( 'parserMimeTypeSOffice' ), $_FILES['userFile']['type'] ) !== false) {
209 if ( !$this->_OOConversion() ) return false;
215 $this->dwpageFileName = 'dwpage';
216 $this->dwpageFile = $this->workDir.'/'.$this->dwpageFileName;
217 $this->dwimgDir = $this->workDir.'/img';
219 $command = 'pandoc -s -w dokuwiki --extract-media="'.$this->dwimgDir;
220 $command .= '" -o "'.$this->dwpageFile.'" "'.$this->workFile.'"';
223 $this->_msg(array('ok_info','Executed command: '.$command));
225 if ( !file_exists($this->dwpageFile) ) {
226 $message = '<br>Missing file: ' . $this->dwpageFile;
230 return $this->_msg( array('er_pandoc',$message) );
233 $this->_msg(array('ok_info','pandoc conversion done'));
237 $this->result = '====== '.basename($this->userFileName).' ======
239 if ( $this->getConf('parserLinkToOriginalFile') && auth_quickaclcheck($ID) >= AUTH_UPLOAD ) {
240 … $this->result .= '<sub>{{'.$this->userFileName.'|'.$this->getLang('parserOriginalFile').'}}</sub>
245 $this->result .= file_get_contents ($this->dwpageFile);
248 if (is_dir($this->dwimgDir)) {
249 $this->_msg(array('ok_info','Start processing dir '.$this->dwimgDir));
251 $this->now = date('Y-m-d_H-i-s');
253 $this->importedImages = array();
254 if ( !$this->_processImgDir($this->dwimgDir) ) {
256 foreach ($this->importedImages as $imgId) {
260 return $this->_msg('er_img_dir');
264 $this->_msg(array('ok_info','Resultado: '.$this->result));
268 $destFile = mediaFN( $this->nsName.':'.$this->userFileName );
269 list( $ext, $mime ) = mimetype($this->userFile);
270 …if ( media_upload_finish($this->userFile, $destFile, $this->nsName, $mime, @file_exists($destFile)…
271 return $this->_msg( array( 'er_apply_file' ) );
275 return $this->_msg('er_acl_upload');
279 …saveWikiText( $this->pageName, $this->result, $this->getLang( 'parserSummary' ).$this->userFileNam…
280 if ( ! page_exists($this->pageName) ) return $this->_msg('er_apply_content');
296 if (!is_dir($imgDir)) return $this->_msg(array('er_img_dir',$imgDir.' is not a directory'));
303 if (!$this->_processImgDir($itemPath)) {
304 return $this->_msg(array ('er_img_dir','Error processing directory '.$itemPath) );
307 if (!$this->_processImg($itemPath)) {
308 return $this->_msg(array('er_img_dir','Error processing image '.$itemPath));
313 $this->_msg(array('ok_info','Processed image directory: '.$imgDir));
330 $userFileBasename = basename($this->userFileName);
336 …$imgBasename = $userFileBasename.'_'.$this->now.'_img'.strval( count($this->importedImages)+1 ).'.…
337 $imgId = $this->nsName.':'.$imgBasename;
343 $destDir = mediaFN( $this->nsName );
345 return $this->_msg( array( 'er_dirCreate', 'Directory: '.$destDir ) );
349 …$mediaReturn = media_upload_finish($imgPath, $destFile, $this->nsName, $mime, @file_exists($destFi…
351 if ( $mediaReturn == $this->nsName ) {
353 $this->importedImages[] = $imgId;
355 $this->result = str_replace( '{{'.$imgPath, '{{:'.$imgId, $this->result );
358 …return $this->_msg( array( 'er_img_upload', 'Image: '.$imgPath.' Return: '.print_r($mediaReturn,tr…
362 return $this->_msg('er_acl_upload');
365 $this->_msg(array('ok_info','Processed image: '.$imgPath));
380 $command = 'cd ' . $this->workDir;
381 … soffice --nofirststartwizard --headless --convert-to odt:"writer8" "' . $this->userFileName . '"';
385 $info = pathinfo($this->userFile);
386 $this->workFileName = $info['filename'] . '.odt';
387 $this->workFile = $this->workDir.'/'. $this->workFileName;
389 if ( !file_exists($this->workFile) ) {
390 $message = '<br>Missing file: ' . $this->workFile;
393 return $this->_msg( array('er_soffice',$message) );
396 $this->_msg(array('ok_info','Open Office conversion done'));
413 if ( ! $_FILES['userFile'] ) return $this->_msg('er_file_miss');
417 return $this->_msg( array( 'er_file_upload', $_FILES['userFile']['error'] ) );
425 $confUploadDir = $this->getConf('parserUploadDir');
429 $this->workDir = $this->tempdir($confUploadDir, 'file2dw_', 0777);
430 if ($this->workDir == false) {
431 return $this->_msg('er_file_tmpDir');
433 chmod( $this->workDir, 0777 );
436 $this->userFileName = $_FILES['userFile']['name'];
437 $this->userFile = $this->workDir.'/'.$this->userFileName;
438 if ( ! move_uploaded_file( $_FILES['userFile']['tmp_name'], $this->userFile ) ) {
439 return $this->_msg('er_file_getFromDownload');
442 $this->_msg( array('ok_info','userFile moved to '.$this->userFile) );
486 if ( ! $output ) die( $this->getLang( 'er_msg_nomessage' ) );
507 …$content = $output.' : '.$this->getLang( $output ).( is_array( $message ) ? ' : '.$message[1] : ''…
510 if ( $force || $this->debugShowInfo == 1 || $err == -1 ) {
515 if ( $this->logLevel > 0 && isset( $this->logFileHandle ) ) {
516 fwrite( $this->logFileHandle, date(DATE_ATOM).':'.$_SERVER['REMOTE_USER'].':'.$content.' ' );
530 if ( file_exists($this->workDir) ) {
531 return $this->_delTree($this->workDir);
606 (is_dir("$dir/$file")) ? $this->_delTree("$dir/$file") : unlink("$dir/$file");