Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

ezarticlesupplier.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: ezarticlesupplier.php 6206 2001-07-19 12:19:22Z jakobn $
5 //
6 // Definition of eZArticleSupplier class
7 //
8 // Created on: <04-May-2001 17:14:30 amos>
9 //
10 // This source file is part of Exponential Basic, publishing software.
11 //
12 // Copyright (C) 1999-2001 eZ Systems. All rights reserved.
13 //
14 // This program is free software; you can redistribute it and/or
15 // modify it under the terms of the GNU General Public License
16 // as published by the Free Software Foundation; either version 2
17 // of the License, or (at your option) any later version.
18 //
19 // This program is distributed in the hope that it will be useful,
20 // but WITHOUT ANY WARRANTY; without even the implied warranty of
21 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 // GNU General Public License for more details.
23 //
24 // You should have received a copy of the GNU General Public License
25 // along with this program; if not, write to the Free Software
26 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, US
27 //
28
31
35 class eZArticleSupplier
36 {
37 function __construct()
38 {
39 }
40
44 function &urlTypes()
45 {
46 return $this->UrlTypes;
47 }
48
52 function moduleName()
53 {
54 return "eZArticle";
55 }
56
60 function &urlList( $type, $category = 0, $offset = 0 )
61 {
62 $ini =& eZINI::instance( 'site.ini' );
63 $ret = false;
64 switch( $type )
65 {
66 case "article":
67 {
68 // include_once( "ezarticle/classes/ezarticle.php" );
69 // include_once( "ezarticle/classes/ezarticlecategory.php" );
70 $limit = $ini->variable( "eZArticleMain", "AdminListLimit" );
71 $cat = new eZArticleCategory( $category );
72 $categories = $cat->getByParent( $cat, false, "name" );
73 $articles = $cat->articles( "alpha", false, true, $offset, $limit );
74 $num_articles = $cat->articleCount( false, true );
75 $path = $cat->path( $category );
76 $category_path = array();
77 foreach( $path as $path_item )
78 {
79 $category_path[] = array( "id" => $path_item[0],
80 "name" => $path_item[1] );
81 }
82 $category_array = array();
83 $category_url = "/article/archive";
84 foreach( $categories as $category )
85 {
86 $id = $category->id();
87 $url = "$category_url/$id";
88 $category_array[] = array( "name" => $category->name(),
89 "id" => $id,
90 "url" => $url );
91 }
92 $article_array = array();
93 $article_url = "/article/view";
94 foreach( $articles as $article )
95 {
96 $id = $article->id();
97 $cat = $article->categoryDefinition();
98 $cat = $cat->id();
99 // $url = "$article_url/$id/$cat/1";
100 $url = "$article_url/$id/1/$cat";
101 $article_array[] = array( "name" => $article->name(),
102 "id" => $id,
103 "url" => $url );
104 }
105 $ret = array();
106 $ret["path"] = $category_path;
107 $ret["categories"] = $category_array;
108 $ret["items"] = $article_array;
109 $ret["item_total_count"] = $num_articles;
110 $ret["max_items_shown"] = $limit;
111 break;
112 }
113 }
114 return $ret;
115 }
116
117 function &item( $type, $id, $is_category )
118 {
119 $ret = false;
120 switch( $type )
121 {
122 case "article":
123 {
124 if ( $is_category )
125 {
126 // include_once( "ezarticle/classes/ezarticlecategory.php" );
127 $category = new eZArticleCategory( $id );
128 $category_url = "/article/archive";
129 $url = "$category_url/$id";
130 $ret = array( "name" => $category->name(),
131 "id" => $id,
132 "url" => $url );
133 }
134 else
135 {
136 // include_once( "ezarticle/classes/ezarticle.php" );
137 $article = new eZArticle( $id );
138 $article_url = "/article/view";
139 $cat = $article->categoryDefinition();
140 $cat = $cat->id();
141 // $url = "$article_url/$id/$cat/1";
142 $url = "$article_url/$id/1/$cat";
143 $ret = array( "name" => $article->name(),
144 "id" => $id,
145 "url" => $url );
146 }
147 }
148 }
149 return $ret;
150 }
151
152 var $UrlTypes = array( "article" => "{intl-article}" );
153 }
154
155 ?>
$category
if( $Action=="Edit") $category
Definition: adedit.php:378
$article
$article
Definition: articlelog.php:45
$articles
$articles
Definition: authorview.php:64
eZArticleCategory
Definition: ezarticlecategory.php:45
eZArticleSupplier
Definition: ezarticlesupplier.php:36
eZArticleSupplier\moduleName
moduleName()
Definition: ezarticlesupplier.php:52
eZArticleSupplier\urlTypes
& urlTypes()
Definition: ezarticlesupplier.php:44
eZArticleSupplier\item
& item( $type, $id, $is_category)
Definition: ezarticlesupplier.php:117
eZArticleSupplier\__construct
__construct()
Definition: ezarticlesupplier.php:37
eZArticleSupplier\$UrlTypes
$UrlTypes
Definition: ezarticlesupplier.php:152
eZArticleSupplier\urlList
& urlList( $type, $category=0, $offset=0)
Definition: ezarticlesupplier.php:60
eZArticle
Definition: ezarticle.php:82
$ini
$ini
Definition: classes/admin/linklist.php:64
$type
$type
Definition: classes/admin/linkselect.php:220
$id
$id
Definition: companytypelist.php:193
$categories
$categories
Definition: ezarticle/admin/categoryedit.php:636
$cat
if(isset( $DeleteCategories)) $cat
Definition: ezforum/admin/categoryedit.php:49
$limit
$limit
Definition: ezimagecatalogue/admin/imagelist.php:312
$ret
$ret
Definition: ezsitemanager/admin/filelist.php:88
$offset
$offset
Definition: ezstats/admin/cron.php:51
$url
$url
Definition: messagereviewlist.php:153
$category_array
$category_array
Definition: todoedit.php:604
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.