Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

export.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: export.php 7455 2001-09-25 13:48:56Z bf $
5 //
6 // Created on: <23-Sep-2001 16:55:39 bf>
7 //
8 // This source file is part of Exponential Basic, publishing software.
9 //
10 // Copyright (C) 1999-2001 eZ Systems. All rights reserved.
11 //
12 // This program is free software; you can redistribute it and/or
13 // modify it under the terms of the GNU General Public License
14 // as published by the Free Software Foundation; either version 2
15 // of the License, or (at your option) any later version.
16 //
17 // This program is distributed in the hope that it will be useful,
18 // but WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 // GNU General Public License for more details.
21 //
22 // You should have received a copy of the GNU General Public License
23 // along with this program; if not, write to the Free Software
24 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, US
25 //
26
27 // include_once( "classes/ezhttptool.php" );
28 // include_once( "classes/INIFile.php" );
29 // include_once( "classes/eztemplate.php" );
30 // include_once( "classes/ezlocale.php" );
31
32 // include_once( "ezarticle/classes/ezarticlecategory.php" );
33 // include_once( "ezarticle/classes/ezarticle.php" );
34 // include_once( "ezarticle/classes/ezarticlerenderer.php" );
35
36
37 $Language = $ini->variable( "eZArticleMain", "Language" );
38 $TemplateDir = $ini->variable( "eZArticleMain", "TemplateDir" );
39
40 $t = new eZTemplate( "kernel/ezarticle/user/" . $TemplateDir,
41 "kernel/ezarticle/user/intl/", $Language, "articleview.php" );
42
43
44 $t->set_file( "article_view_tex_tpl", "tex.tpl" );
45
46 $t->setAllStrings();
47
48 $ArticleID = 590;
49
50 $article = new eZArticle( );
51
52 if ( $article->get( $ArticleID ) )
53 {
54 if ( $article->isPublished() )
55 {
56 // published article.
57 }
58 else
59 {
60 eZHTTPTool::header( "Location: /error/404" );
61 exit();
62 }
63
64 // convert images to eps
65
66 $images =& $article->images();
67
68 foreach ( $images as $image )
69 {
70 $image = $image["Image"];
71 $fileName = $image->fileName();
72
73 print( system( "convert ezimagecatalogue/catalogue/$fileName ezimagecatalogue/catalogue/" . $fileName . ".eps " ) );
74
75
76 print( $image->fileName() . "<br>" );
77 }
78
79 $template = "tex";
80 $renderer = new eZArticleRenderer( $article, $template );
81
82 $articleContents = $renderer->renderPage( -1 );
83
84 $t->set_var( "article_name", $article->name() );
85 $t->set_var( "author_name", $article->authorText() );
86
87 $t->set_var( "article_intro", $articleContents[0] );
88 $t->set_var( "article_body", $articleContents[1] );
89
90 }
91
92 print( "<pre>" );
93 $doc =& $t->parse( "output", "article_view_tex_tpl" );
94
95 $outputFile = "ezarticle/cache/article.tex";
96
97 $fp = eZPBFile::fopen( $outputFile, "w+");
98
99 fwrite ( $fp, $doc );
100 fclose( $fp );
101
102 // convert to dvi
103 //print( system( "cd ezarticle/cache/ && latex -interaction=batchmode $outputFile && cd .." ) );
104
105 print( htmlspecialchars( $doc ) );
106 print( "</pre>" );
107
108 ?>
$articleContents
$articleContents
Definition: articlepreview.php:81
$images
$images
Definition: articlepreview.php:146
$renderer
if(! $article->get( $ArticleID)) $renderer
Definition: articlepreview.php:76
eZArticleRenderer
Definition: ezarticlerenderer.php:36
eZArticle
Definition: ezarticle.php:82
eZHTTPTool\header
static header( $string)
Definition: ezhttptool.php:96
eZPBFile\fopen
static fopen( $filename, $options)
Definition: ezpbfile.php:326
eZTemplate
Definition: eztemplate.php:107
$ini
$ini
Definition: classes/admin/linklist.php:64
$fp
$fp
Definition: export.php:97
$t
$t
Definition: export.php:40
$TemplateDir
$TemplateDir
Definition: export.php:38
$article
$article
Definition: export.php:50
$ArticleID
$ArticleID
Definition: export.php:48
$Language
$Language
Definition: export.php:37
$outputFile
$outputFile
Definition: export.php:95
$doc
$doc
Definition: export.php:93
$fileName
if(eZObjectPermission::hasPermission( $file->id(), "filemanager_file", "r", $user)==false) $fileName
Definition: ezfilemanager/user/filedownload.php:43
exit
exit
Definition: folder.php:81
$image
$image
Definition: user/articlelist.php:242
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.