Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

ezarticle/admin/medialist.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: medialist.php 6279 2001-07-25 12:32:20Z ce $
5 //
6 // Created on: <25-Jul-2001 11:02:48 ce>
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/INIFile.php" );
28 // include_once( "classes/eztemplate.php" );
29 // include_once( "classes/ezlocale.php" );
30 // include_once( "classes/ezcurrency.php" );
31
32 $ini =& eZINI::instance( 'site.ini' );
33 $Language = $ini->variable( "eZArticleMain", "Language" );
34
35 // include_once( "ezarticle/classes/ezarticlecategory.php" );
36 // include_once( "ezarticle/classes/ezarticle.php" );
37 // include_once( "ezmediacatalogue/classes/ezmedia.php" );
38
39
40 $t = new eZTemplate( "kernel/ezarticle/admin/" . $ini->variable( "eZArticleMain", "AdminTemplateDir" ),
41 "kernel/ezarticle/admin/intl/", $Language, "medialist.php" );
42
43 $t->setAllStrings();
44
45 $t->set_file( array(
46 "media_list_page_tpl" => "medialist.tpl"
47 ) );
48
49 $t->set_block( "media_list_page_tpl", "no_media_tpl", "no_media" );
50 $t->set_block( "media_list_page_tpl", "media_list_tpl", "media_list" );
51 $t->set_block( "media_list_tpl", "media_tpl", "media" );
52
53 $article = new eZArticle( $ArticleID );
54
55 $session =& eZSession::globalSession();
56 $session->setVariable( "MediaListReturnTo", $_SERVER['REQUEST_URI'] );
57 $session->setVariable( "SelectMedia", "multi" );
58 $session->setVariable( "NameInBrowse", $article->name() );
59
60 $t->set_var( "article_name", $article->name() );
61
62 $t->set_var( "site_style", $SiteDesign );
63
64 if ( isset ( $AddMedia ) )
65 {
66 if ( count ( $MediaArrayID ) > 0 )
67 {
68 foreach( $MediaArrayID as $mediaID )
69 {
70 $media = new eZMedia( $mediaID );
71 $article->addMedia( $media );
72 }
73 }
74 }
75
76 $media = $article->media();
77 if ( count( $media ) == 0 )
78 {
79 $t->set_var( "media_list", "" );
80 $t->parse( "no_media", "no_media_tpl", true );
81 }
82 else
83 {
84 $t->set_var( "no_media", "" );
85
86 $i=0;
87 foreach ( $media as $media )
88 {
89 if ( ( $i % 2 ) == 0 )
90 {
91 $t->set_var( "td_class", "bglight" );
92 }
93 else
94 {
95 $t->set_var( "td_class", "bgdark" );
96 }
97
98 $t->set_var( "media_number", $i + 1 );
99
100 if ( $media->caption() == "" )
101 $t->set_var( "media_name", "&nbsp;" );
102 else
103 $t->set_var( "media_caption", $media->caption() );
104
105 $t->set_var( "media_name", $media->name() );
106 $t->set_var( "media_description", $media->description() );
107 $t->set_var( "media_id", $media->id() );
108 $t->set_var( "article_id", $ArticleID );
109
110 $t->set_var( "media_url", $media->mediaPath() );
111 $t->parse( "media", "media_tpl", true );
112
113 $i++;
114 }
115
116 $t->parse( "media_list", "media_list_tpl", true );
117 }
118
119
120 $t->set_var( "article_id", $article->id() );
121
122 $t->pparse( "output", "media_list_page_tpl" );
123
124 ?>
eZArticle
Definition: ezarticle.php:82
eZMedia
Definition: ezmedia.php:65
eZSession\globalSession
static & globalSession( $id="", $fetch=true)
Definition: kernel/ezsession/classes/ezsession.php:614
eZTemplate
Definition: eztemplate.php:107
$ArticleID
$ArticleID
Definition: export.php:48
$t
$t
Definition: ezarticle/admin/medialist.php:40
$article
$article
Definition: ezarticle/admin/medialist.php:53
$i
$i
Definition: ezarticle/admin/medialist.php:86
$Language
$Language
Definition: ezarticle/admin/medialist.php:33
$ini
$ini
Definition: ezarticle/admin/medialist.php:32
$media
if(isset( $AddMedia)) $media
Definition: ezarticle/admin/medialist.php:76
$session
$session
Definition: ezarticle/admin/medialist.php:55
$SiteDesign
$SiteDesign
Definition: ezbulkmail/user/datasupplier.php:31
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.