Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

unpublishedlist.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: unpublishedlist.php 6617 2001-08-24 12:38:08Z th $
5 //
6 // Created on: <18-Oct-2000 14:41:37 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/INIFile.php" );
28 // include_once( "classes/eztemplate.php" );
29 // include_once( "classes/ezlocale.php" );
30
31 // include_once( "ezarticle/classes/ezarticlecategory.php" );
32 // include_once( "ezarticle/classes/ezarticle.php" );
33 // include_once( "ezarticle/classes/ezarticletool.php" );
34 // include_once( "ezuser/classes/ezobjectpermission.php" );
35 // include_once( "classes/ezcachefile.php" );
36 // include_once( "classes/ezlist.php" );
37
38 $ini =& eZINI::instance( 'site.ini' );
39
40 $Language = $ini->variable( "eZArticleMain", "Language" );
41 $Locale = new eZLocale( $Language );
42 $AdminListLimit = $ini->variable( "eZArticleMain", "AdminListLimit" );
43 $languageIni = new eZINI( "kernel/ezarticle/admin/intl/" . $Language . "/unpublishedlist.php.ini", false );
44
45
46
47 if( isset( $DeleteArticles ) )
48 {
49 if ( count ( $ArticleArrayID ) != 0 )
50 {
51 foreach( $ArticleArrayID as $TArticleID )
52 {
53 if( eZObjectPermission::hasPermission( $TArticleID, "article_article", 'w' )
54 || eZArticle::isAuthor( eZUser::currentUser(), $TArticleID ) )
55 {
56 $article = new eZArticle( $TArticleID );
57
58 // get the category to redirect to
59 $articleID = $article->id();
60
61 $categoryArray = $article->categories();
62 $categoryIDArray = array();
63 foreach ( $categoryArray as $cat )
64 {
65 $categoryIDArray[] = $cat->id();
66 }
67 $categoryID = $article->categoryDefinition();
68 $categoryID = $categoryID->id();
69
70 // clear the cache files.
71 eZArticleTool::deleteCache( $TArticleID, $categoryID, $categoryIDArray );
72 $article->delete();
73 }
74 }
75 }
76 }
77
78 $t = new eZTemplate( "kernel/ezarticle/admin/" . $ini->variable( "eZArticleMain", "AdminTemplateDir" ),
79 "kernel/ezarticle/admin/intl/", $Language, "unpublishedlist.php" );
80
81 $t->setAllStrings();
82
83 $t->set_file( array(
84 "unpublished_list_page_tpl" => "unpublishedlist.tpl"
85 ) );
86
87
88 // article
89 $t->set_block( "unpublished_list_page_tpl", "article_list_tpl", "article_list" );
90 $t->set_block( "article_list_tpl", "article_item_tpl", "article_item" );
91
92 $t->set_block( "article_item_tpl", "article_is_published_tpl", "article_is_published" );
93 $t->set_block( "article_item_tpl", "article_not_published_tpl", "article_not_published" );
94 $t->set_block( "article_item_tpl", "article_edit_tpl", "article_edit" );
95
96
97 // prev/next
98 $t->set_block( "unpublished_list_page_tpl", "previous_tpl", "previous" );
99 $t->set_block( "unpublished_list_page_tpl", "next_tpl", "next" );
100
101 $t->set_var( "site_style", $SiteDesign );
102
103
104 // set the offset/limit
105 if ( !isset( $Offset ) )
106 $Offset = 0;
107
108 if ( !isset( $Limit ) )
109 $Limit = $AdminListLimit;
110
111 // articles
112 $article = new eZArticle();
113
114 $articleList =& $article->articles( "time", "only", $Offset, $Limit );
115 $articleCount = $article->articleCount( "only" );
116
117 $i=0;
118 $t->set_var( "article_list", "" );
119
120
121 foreach ( $articleList as $article )
122 {
123 if( eZObjectPermission::hasPermission( $article->id(), "article_article", 'r') ||
124 eZArticle::isAuthor( eZUser::currentUser(), $article->id() ) )
125 {
126 if ( $article->name() == "" )
127 $t->set_var( "article_name", "&nbsp;" );
128 else
129 $t->set_var( "article_name", $article->name() );
130
131 $t->set_var( "article_id", $article->id() );
132
133 if ( $article->isPublished() == true )
134 {
135 $t->parse( "article_is_published", "article_is_published_tpl" );
136 $t->set_var( "article_not_published", "" );
137 }
138 else
139 {
140 $t->set_var( "article_is_published", "" );
141 $t->parse( "article_not_published", "article_not_published_tpl" );
142 }
143
144 if ( ( $i % 2 ) == 0 )
145 {
146 $t->set_var( "td_class", "bglight" );
147 }
148 else
149 {
150 $t->set_var( "td_class", "bgdark" );
151 }
152
153
154 if( eZObjectPermission::hasPermission( $article->id(), "article_article", 'w') ||
155 eZArticle::isAuthor( eZUser::currentUser(), $article->id() ) )
156 {
157 $t->parse( "article_edit", "article_edit_tpl", false );
158 }
159 else
160 $t->set_var( "article_edit", "" );
161
162
163 $t->parse( "article_item", "article_item_tpl", true );
164 $i++;
165 }
166 }
167
168 eZList::drawNavigator( $t, $articleCount, $AdminListLimit, $Offset, "unpublished_list_page_tpl" );
169
170
171 if ( count( $articleList ) > 0 )
172 $t->parse( "article_list", "article_list_tpl" );
173 else
174 $t->set_var( "article_list", "" );
175
176
177 $t->pparse( "output", "unpublished_list_page_tpl" );
178
179
180 ?>
$categoryArray
$categoryArray
Definition: adedit.php:379
eZArticleTool\deleteCache
static deleteCache( $ArticleID, $CategoryID, $CategoryArray)
Definition: ezarticletool.php:52
eZArticle
Definition: ezarticle.php:82
eZArticle\isAuthor
static isAuthor( $user, $articleID)
Definition: ezarticle.php:2672
eZINI
Reads and writes .ini style configuration files.
eZList\drawNavigator
static drawNavigator(&$t, $total_types, $max_types, $index, $parent=false, $variables=false)
Definition: ezlist.php:401
eZLocale
Definition: ezlocale.php:119
eZObjectPermission\hasPermission
static hasPermission( $objectID, $moduleTable, $permission, $user=false)
Definition: ezobjectpermission.php:76
eZTemplate
Definition: eztemplate.php:107
eZUser\currentUser
static & currentUser()
Definition: ezuser.php:896
$Limit
$Limit
Definition: ezarticle/admin/categorylist.php:66
$Offset
$Offset
Definition: ezarticle/user/search.php:110
$SiteDesign
$SiteDesign
Definition: ezbulkmail/user/datasupplier.php:31
$cat
if(isset( $DeleteCategories)) $cat
Definition: ezforum/admin/categoryedit.php:49
$categoryID
else $categoryID
Definition: productview.php:66
$articleList
$articleList
Definition: unpublishedlist.php:114
$languageIni
$languageIni
Definition: unpublishedlist.php:43
$article
$article
Definition: unpublishedlist.php:112
$AdminListLimit
$AdminListLimit
Definition: unpublishedlist.php:42
$Locale
$Locale
Definition: unpublishedlist.php:41
$t
if(isset( $DeleteArticles)) $t
Definition: unpublishedlist.php:78
$i
$i
Definition: unpublishedlist.php:117
$Language
$Language
Definition: unpublishedlist.php:40
$ini
$ini
Definition: unpublishedlist.php:38
$articleCount
$articleCount
Definition: unpublishedlist.php:115
$articleID
if( $Action=="New") $articleID
Definition: user/articleedit.php:269
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.