Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

ezcontactsupplier.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: ezcontactsupplier.php 6970 2001-09-05 11:57:07Z jhe $
5 //
6 // Definition of ezcontactsupplier class
7 //
8 // Created on: <19-Mar-2001 16:51:20 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 eZContactSupplier
36 {
37 function __construct()
38 {
39 }
40
44 function &urlTypes()
45 {
46 return $this->UrlTypes;
47 }
48
52 function moduleName()
53 {
54 return "eZContact";
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 "company":
67 {
68 // include_once( "ezcontact/classes/ezcompany.php" );
69 // include_once( "ezcontact/classes/ezcompanytype.php" );
70 $limit = $ini->variable( "eZContactMain", "MaxCompanyList" );
71 $categories = eZCompanyType::getByParentID( $category, "name" );
72 $companies = eZCompany::getByCategory( $category, $offset, $limit );
73 $num_companies = eZCompany::countByCategory( $category );
74 $path = eZCompanyType::path( $category );
75 $category_path = array();
76 foreach ( $path as $path_item )
77 {
78 $category_path[] = array( "id" => $path_item[0],
79 "name" => $path_item[1] );
80 }
81 $category_array = array();
82 $category_url = "/contact/company/list";
83 foreach ( $categories as $category )
84 {
85 $id = $category->id();
86 $url = "$category_url/$id";
87 $category_array[] = array( "name" => $category->name(),
88 "id" => $id,
89 "url" => $url );
90 }
91 $company_array = array();
92 $company_url = "/contact/company/view";
93 foreach ( $companies as $company )
94 {
95 $id = $company->id();
96 $url = "$company_url/$id";
97 $company_array[] = array( "name" => $company->name(),
98 "id" => $id,
99 "url" => $url );
100 }
101 $ret = array();
102 $ret["path"] = $category_path;
103 $ret["categories"] = $category_array;
104 $ret["items"] = $company_array;
105 $ret["item_total_count"] = $num_companies;
106 $ret["max_items_shown"] = $limit;
107 break;
108 }
109
110 // case "person":
111 // {
112 // break;
113 // }
114 }
115 return $ret;
116 }
117
118 function &item( $type, $id, $is_category )
119 {
120 $ret = false;
121 switch ( $type )
122 {
123 case "company":
124 {
125 if ( $is_category )
126 {
127 // include_once( "ezcontact/classes/ezcompanytype.php" );
128 $category = new eZCompanyType( $id );
129 $category_url = "/contact/company/list";
130 $url = "$category_url/$id";
131 $ret = array( "name" => $category->name(),
132 "id" => $id,
133 "url" => $url );
134 }
135 else
136 {
137 // include_once( "ezcontact/classes/ezcompany.php" );
138 $company = new eZCompany( $id );
139 $company_url = "/contact/company/view";
140 $url = "$company_url/$id";
141 $ret = array( "name" => $company->name(),
142 "id" => $id,
143 "url" => $url );
144 }
145 }
146
147 // case "person":
148 // {
149 // break;
150 // }
151 }
152 return $ret;
153 }
154
155 var $UrlTypes = array( "company" => "{intl-contact_company}" /*,
156 "person" => "{intl-contact_person}"*/ );
157 }
158
159 ?>
$category
if( $Action=="Edit") $category
Definition: adedit.php:378
$companies
else $companies
Definition: admin/consultationlist.php:221
eZCompany
Definition: ezcompany.php:54
eZCompany\countByCategory
countByCategory( $categoryID)
Definition: ezcompany.php:335
eZCompany\getByCategory
& getByCategory( $categoryID, $offset=0, $limit=-1, $order="name")
Definition: ezcompany.php:277
eZContactSupplier
Definition: ezcontactsupplier.php:36
eZContactSupplier\item
& item( $type, $id, $is_category)
Definition: ezcontactsupplier.php:118
eZContactSupplier\urlList
& urlList( $type, $category=0, $offset=0)
Definition: ezcontactsupplier.php:60
eZContactSupplier\urlTypes
& urlTypes()
Definition: ezcontactsupplier.php:44
eZContactSupplier\$UrlTypes
$UrlTypes
Definition: ezcontactsupplier.php:155
eZContactSupplier\__construct
__construct()
Definition: ezcontactsupplier.php:37
eZContactSupplier\moduleName
moduleName()
Definition: ezcontactsupplier.php:52
$ini
$ini
Definition: classes/admin/linklist.php:64
$type
$type
Definition: classes/admin/linkselect.php:220
$company
if(!is_numeric( $Year)) if(!is_numeric( $Month)) if(!is_numeric( $Day)) $company
Definition: companystats.php:72
$id
$id
Definition: companytypelist.php:193
$categories
$categories
Definition: ezarticle/admin/categoryedit.php:636
$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+.