Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

ezarticle/admin/datasupplier.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: datasupplier.php 9560 2002-05-22 13:35:33Z bf $
5 //
6 // Created on: <23-Oct-2000 17:53:46 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( "ezarticle/classes/ezarticle.php" );
29 // include_once( "ezarticle/classes/ezarticlecategory.php" );
30 // include_once( "ezuser/classes/ezuser.php" );
31 // include_once( "ezuser/classes/ezobjectpermission.php" );
32 // include_once( "ezuser/classes/ezpermission.php" );
33 // include_once( "classes/ezdatetime.php" );
34
35 #echo " " . $url_array[2] . " " . $url_array[3] . " " . $url_array[4] . " " . $url_array[5];
36 #exit();
37
38 $user =& eZUser::currentUser();
39 if ( eZPermission::checkPermission( $user, "eZArticle", "ModuleEdit" ) == false )
40 {
41 eZHTTPTool::header( "Location: /error/403" );
42 exit();
43 }
44
45 switch ( $url_array[2] )
46 {
47 case "export":
48 {
49 include( "kernel/ezarticle/admin/export.php" );
50 }
51 break;
52
53 case "topiclist":
54 {
55 eZHTTPTool::extractVar(array('NewTopic','DeleteTopic','Store','IDArray','Description','Name'));
56 include( "kernel/ezarticle/admin/topiclist.php" );
57 }
58 break;
59
60 case "archive":
61 {
62 if ( !is_numeric( $CategoryID=eZHTTPTool::getVar( "CategoryID", true ) ) )
63 {
64 $CategoryID = $url_array[3];
65 if ( !isset( $CategoryID ) || ( $CategoryID == "" ) )
66 $CategoryID = 0;
67 }
68
69 if ( isset($url_array[4]) && $url_array[4] == "parent" )
70 $Offset = $url_array[5];
71
72 if ( $CategoryID == 0 || eZObjectPermission::hasPermission( $CategoryID, "article_category", 'r' ) ||
73 eZArticleCategory::isOwner( $user, $CategoryID ) )
74 include( "kernel/ezarticle/admin/articlelist.php" );
75 }
76 break;
77
78 case "unpublished":
79 {
80 $CategoryID = $url_array[3];
81 if ( !isset( $CategoryID ) || ( $CategoryID == "" ) )
82 $CategoryID = 0;
83
84 if ( $url_array[4] == "parent" )
85 $Offset = $url_array[5];
86
87 if ( $CategoryID == 0 || eZObjectPermission::hasPermission( $CategoryID, "article_category", 'r' ) ||
88 eZArticleCategory::isOwner( $user, $CategoryID) )
89 include( "kernel/ezarticle/admin/unpublishedlist.php" );
90 }
91 break;
92
93 case "pendinglist":
94 {
95 $CategoryID = $url_array[3];
96 if ( !isset( $CategoryID ) || ( $CategoryID == "" ) )
97 $CategoryID = 0;
98
99 if ( $url_array[4] == "parent" )
100 $Offset = $url_array[5];
101
102 if ( $CategoryID == 0 || eZObjectPermission::hasPermission( $CategoryID, "article_category", 'r' ) ||
103 eZArticleCategory::isOwner( $user, $CategoryID) )
104 include( "kernel/ezarticle/admin/pendinglist.php" );
105 }
106 break;
107
108 case "search" :
109 {
110 if ( $url_array[3] == "advanced" )
111 {
112 include( "kernel/ezarticle/admin/searchform.php" );
113 }
114 else
115 {
116 $Offset = 0;
117 if ( $url_array[3] == "parent" )
118 {
119 $SearchText = urldecode( $url_array[4] );
120 if ( $url_array[5] != urlencode( "+" ) )
121 $StartStamp = urldecode( $url_array[5] );
122 if ( $url_array[6] != urlencode( "+" ) )
123 $StopStamp = urldecode( $url_array[6] );
124 if ( $url_array[7] != urlencode( "+" ) )
125 $CategoryArray = explode( "-", urldecode( $url_array[7] ) );
126 if ( $url_array[8] != urlencode( "+" ) )
127 $ContentsWriterID = urldecode( $url_array[8] );
128 if ( $url_array[9] != urlencode( "+" ) )
129 $PhotographerID = urldecode( $url_array[9] );
130
131 $Offset = $url_array[10];
132 }
133 include( "kernel/ezarticle/admin/search.php" );
134 }
135 }
136 break;
137
138 case "view":
139 case "articleview":
140 case "articlepreview":
141 {
142 $ArticleID = $url_array[3];
143 $PageNumber= $url_array[4];
144 if ( !isset( $PageNumber ) || ( $PageNumber == "" ) )
145 $PageNumber= 1;
146
147 if ( eZObjectPermission::hasPermission( $ArticleID, "article_article", 'r' ) ||
148 eZArticle::isAuthor( $user, $ArticleID ) )
149 include( "kernel/ezarticle/admin/articlepreview.php" );
150 }
151 break;
152
153 case "articlelog" :
154 {
155 $ArticleID = $url_array[3];
156 if ( eZObjectPermission::hasPermission( $ArticleID, "article_article", 'w' ) ||
157 eZArticle::isAuthor( $user, $ArticleID ) )
158 include( "kernel/ezarticle/admin/articlelog.php" );
159 }
160 break;
161
162 // FIXME: test for writeable categories!!!
163 case "articleedit":
164 {
165 if ( eZObjectPermission::getObjects( "article_category", 'w', true ) < 1 )
166 {
167 $text = "You do not have write permission to any categories";
168 $info = urlencode( $text );
169 eZHTTPTool::header( "Location: /error/403?Info=$info" );
170 exit();
171 }
172
173 eZHTTPTool::extractVar(array('Name','Keywords','Contents','AuthorText','AuthorEmail', 'LinkText',
174 'StartDay', 'StartMonth', 'StartYear', 'StartHour', 'StartMinute',
175 'StopDay', 'StopMonth', 'StopYear', 'StopHour', 'StopMinute',
176 //Actions
177 'Action', 'PublishArticle', 'AddItem', 'ItemToAdd', 'Preview', 'Log',
178 ));
179
180 switch ( $url_array[3] )
181 {
182
183 case "insert" :
184 {
185 $Action = "Insert";
186 $ArticleID = $url_array[4];
187 include( "kernel/ezarticle/admin/articleedit.php" );
188 }
189 break;
190
191 case "new" :
192 {
193 $Action = "New";
194 include( "kernel/ezarticle/admin/articleedit.php" );
195 }
196 break;
197
198 case "update" :
199 {
200 $Action = "Update";
201 $ArticleID = $url_array[4];
202
203 if ( eZObjectPermission::hasPermission( $ArticleID, "article_article", 'w' ) ||
204 eZArticle::isAuthor( $user, $ArticleID ) )
205 include( "kernel/ezarticle/admin/articleedit.php" );
206 }
207 break;
208
209 case "cancel" :
210 {
211 $Action = "Cancel";
212 $ArticleID = $url_array[4];
213
214 if ( eZObjectPermission::hasPermission( $ArticleID, "article_article", 'w' ) ||
215 eZArticle::isAuthor( $user, $ArticleID ) )
216 include( "kernel/ezarticle/admin/articleedit.php" );
217 }
218 break;
219
220 case "edit" :
221 {
222 $Action = "Edit";
223 $ArticleID = $url_array[4];
224
225 if ( eZObjectPermission::hasPermission( $ArticleID, "article_article", 'w' ) ||
226 eZArticle::isAuthor( $user, $ArticleID ) )
227 include( "kernel/ezarticle/admin/articleedit.php" );
228 else
229 print("Not allowed");
230 }
231 break;
232
233 case "delete" :
234 {
235 $Action = "Delete";
236 $ArticleID = $url_array[4];
237
238 if ( eZObjectPermission::hasPermission( $ArticleID, "article_article", 'w' ) ||
239 eZArticle::isAuthor( $user , $ArticleID ) )
240 include( "kernel/ezarticle/admin/articleedit.php" );
241 }
242 break;
243
244 case "imagelist" :
245 {
246 eZHTTPTool::extractVar(array('MoveImageUp','MoveImageDown','AddImages',
247 'ImageArrayID' ));
248 $ArticleID = $url_array[4];
249 if ( eZObjectPermission::hasPermission( $ArticleID, "article_article", 'w' ) ||
250 eZArticle::isAuthor( $user, $ArticleID ) )
251 include( "kernel/ezarticle/admin/imagelist.php" );
252 }
253 break;
254
255 case "medialist" :
256 {
257 eZHTTPTool::extractVar(array('MoveImageUp','MoveImageDown','AddMedia',
258 'MediaArrayID' ));
259 $ArticleID = $url_array[4];
260 if ( eZObjectPermission::hasPermission( $ArticleID, "article_article", 'w' ) ||
261 eZArticle::isAuthor( $user, $ArticleID ) )
262 include( "kernel/ezarticle/admin/medialist.php" );
263 }
264 break;
265
266 case "filelist" :
267 {
268 eZHTTPTool::extractVar(array('MoveImageUp','MoveImageDown','AddFile',
269 'FileArrayID' ));
270 $ArticleID = $url_array[4];
271 if ( eZObjectPermission::hasPermission( $ArticleID, "article_article", 'w' ) ||
272 eZArticle::isAuthor( $user, $ArticleID ) )
273 include( "kernel/ezarticle/admin/filelist.php" );
274 }
275 break;
276
277 case "link" :
278 {
279 $ItemID = $url_array[5];
280 include_once( "ezarticle/classes/ezarticle.php" );
281 include_once( "ezarticle/classes/ezarticletool.php" );
282
283 $INIGroup = "eZArticleMain";
284 $DefaultSectionsName = "ArticleLinkSections";
285 $PreferencesSetting = "ArticleLinkType";
286 $ClientModuleName = "eZArticle";
287 $ClientModuleType = "Article";
288 $root = "/article/articleedit";
289 $URLS = array( "back" => "$root/edit/%s",
290 "linklist" => "$root/link/list/%s",
291 "linkmoveup" => "$root/link/moveup/link/%d/%d/%d",
292 "linkmovedown" => "$root/link/movedown/link/%d/%d/%d",
293 "sectionmoveup" => "$root/link/moveup/section/%d/%d",
294 "sectionmovedown" => "$root/link/movedown/section/%d/%d",
295 "linkselect" => "$root/link/select/%s/%s/%s/%s/%s/0/%s",
296 "linkselect_basic" => "$root/link/select/",
297 "linkselect_std" => "$root/link/select/%s/%s/%s/%s/%s",
298 "urledit" => "$root/link/select/%s/%s/%s/%s",
299 "linkedit" => "$root/link/select/%s/%s/%s/0/0/%s" );
300 $Funcs = array( "delete" => "deleteCacheHelper" );
301
302 function deleteCacheHelper( $ArticleID )
303 {
304 eZArticleTool::deleteCache( $ArticleID, $CategoryID, $CategoryArray );
305 }
306
307 switch( $url_array[4] )
308 {
309 case "list":
310 {
311 include( "classes/admin/linklist.php" );
312 break;
313 }
314 case "select":
315 {
316 if ( isset( $url_array[6] ) )
317 $ModuleName = $url_array[6];
318 if ( isset( $url_array[7] ) )
319 $Type = $url_array[7];
320 if ( isset( $url_array[8] ) )
321 $SectionID = $url_array[8];
322 if ( isset( $url_array[9] ) )
323 $Category = $url_array[9];
324 if ( isset( $url_array[10] ) )
325 $Offset = $url_array[10];
326 if ( isset( $url_array[11] ) )
327 $LinkID = $url_array[11];
328
329 include( "classes/admin/linkselect.php" );
330 break;
331 }
332 case "moveup":
333 $MoveUp = true;
334 case "movedown":
335 {
336 if ( isset( $url_array[5] ) )
337 $ObjectType = $url_array[5];
338 if ( isset( $url_array[6] ) )
339 $ItemID = $url_array[6];
340 if ( isset( $url_array[7] ) )
341 $ObjectID = $url_array[7];
342 if ( isset( $url_array[8] ) )
343 $LinkID = $url_array[8];
344 include( "classes/admin/linkmove.php" );
345 break;
346 }
347 default:
348 {
349 eZHTTPTool::header( "Location: /error/404" );
350 break;
351 }
352 }
353 break;
354 }
355
356 case "imagemap" :
357 {
358 switch ( $url_array[4] )
359 {
360 case "edit" :
361 {
362 $ArticleID = $url_array[6];
363 $ImageID = $url_array[5];
364 $Action = "Edit";
365 if ( eZObjectPermission::hasPermission( $ArticleID, "article_article", 'w' ) ||
366 eZArticle::isAuthor( $user, $ArticleID ) )
367 include( "kernel/ezarticle/admin/imagemap.php" );
368 }
369 break;
370
371 case "store" :
372 {
373 $ArticleID = $url_array[6];
374 $ImageID = $url_array[5];
375 $Action = "Store";
376 if ( eZObjectPermission::hasPermission( $ArticleID, "article_article", 'w' ) ||
377 eZArticle::isAuthor( $user, $ArticleID ) )
378 include( "kernel/ezarticle/admin/imagemap.php" );
379 }
380 break;
381 }
382 }
383 break;
384
385 case "attributelist" :
386 {
387 $ArticleID = $url_array[4];
388 if ( eZObjectPermission::hasPermission( $ArticleID, "article_article", 'w' ) ||
389 eZArticle::isAuthor( $user, $ArticleID ) )
390 include( "kernel/ezarticle/admin/attributelist.php" );
391 }
392 break;
393
394 case "attributeedit" :
395 {
396 $Action = $url_array[4];
397 if ( !isset( $TypeID ) )
398 $TypeID = $url_array[5];
399 if ( eZObjectPermission::hasPermission( $ArticleID, "article_article", 'w' ) ||
400 eZArticle::isAuthor( $user, $ArticleID ) )
401 include( "kernel/ezarticle/admin/attributeedit.php" );
402 }
403 break;
404
405
406 case "formlist" :
407 {
408 $ArticleID = $url_array[4];
409 if( eZObjectPermission::hasPermission( $ArticleID, "article_article", 'w' ) ||
410 eZArticle::isAuthor( $user, $ArticleID ) )
411 include( "kernel/ezarticle/admin/formlist.php" );
412 }
413 break;
414
415
416 case "imageedit" :
417 {
418 if ( isset( $Browse ) )
419 {
420 include ( "kernel/ezimagecatalogue/admin/browse.php" );
421 break;
422 }
423 switch ( $url_array[4] )
424 {
425 case "new" :
426 {
427 $Action = "New";
428 $ArticleID = $url_array[5];
429 if ( eZObjectPermission::hasPermission( $ArticleID, "article_article", 'w' ) ||
430 eZArticle::isAuthor( $user, $ArticleID ) )
431 include( "kernel/ezarticle/admin/imageedit.php" );
432 }
433 break;
434
435 case "edit" :
436 {
437 $Action = "Edit";
438 $ArticleID = $url_array[6];
439 $ImageID = $url_array[5];
440 if ( eZObjectPermission::hasPermission( $ArticleID, "article_article", 'w' ) ||
441 eZArticle::isAuthor( $user, $ArticleID ) )
442 include( "kernel/ezarticle/admin/imageedit.php" );
443 }
444 break;
445
446 case "storedef" :
447 {
448 $Action = "StoreDef";
449 if ( isset( $DeleteSelected ) )
450 $Action = "Delete";
451 $ArticleID = $url_array[5];
452 if ( eZObjectPermission::hasPermission( $ArticleID, "article_article", 'w' ) ||
453 eZArticle::isAuthor( $user, $ArticleID ) )
454 include( "kernel/ezarticle/admin/imageedit.php" );
455 }
456 break;
457
458 default :
459 {
460 if ( eZObjectPermission::hasPermission( $ArticleID, "article_article", 'w' ) ||
461 eZArticle::isAuthor( $user, $ArticleID ) )
462 include( "kernel/ezarticle/admin/imageedit.php" );
463 }
464 }
465 }
466 break;
467
468 case "mediaedit" :
469 {
470 if ( isset ( $Browse ) )
471 {
472 include ( "kernel/ezmediacatalogue/admin/browse.php" );
473 break;
474 }
475 $ArticleID = $url_array[4];
476 $MediaID = $url_array[5];
477 if ( eZObjectPermission::hasPermission( $ArticleID, "article_article", 'w' ) ||
478 eZArticle::isAuthor( $user, $ArticleID ) )
479 include( "kernel/ezarticle/admin/mediaedit.php" );
480 }
481 break;
482
483 case "fileedit" :
484 {
485 if ( isset( $Browse ) )
486 {
487 include( "kernel/ezfilemanager/admin/browse.php" );
488 break;
489 }
490 switch ( $url_array[4] )
491 {
492 case "new" :
493 {
494 $Action = "New";
495 $ArticleID = $url_array[5];
496 if ( eZObjectPermission::hasPermission( $ArticleID, "article_article", 'w' ) ||
497 eZArticle::isAuthor( $user, $ArticleID ) )
498 include( "kernel/ezarticle/admin/fileedit.php" );
499 }
500 break;
501
502 case "edit" :
503 {
504 $Action = "Edit";
505 $ArticleID = $url_array[6];
506 $FileID = $url_array[5];
507 if ( eZObjectPermission::hasPermission( $ArticleID, "article_article", 'w' ) ||
508 eZArticle::isAuthor( $user, $ArticleID ) )
509 include( "kernel/ezarticle/admin/fileedit.php" );
510 }
511 break;
512
513 case "delete" :
514 {
515 $Action = "Delete";
516 $ArticleID = $url_array[6];
517 $FileID = $url_array[5];
518 if ( eZObjectPermission::hasPermission( $ArticleID, "article_article", 'w' ) ||
519 eZArticle::isAuthor( $user, $ArticleID ) )
520 include( "kernel/ezarticle/admin/fileedit.php" );
521 }
522 break;
523
524 default :
525 {
526 if ( eZObjectPermission::hasPermission( $ArticleID, "article_article", 'w' ) ||
527 eZArticle::isAuthor( $user, $ArticleID ) )
528 include( "kernel/ezarticle/admin/fileedit.php" );
529 }
530 }
531 }
532 break;
533 }
534 }
535 break;
536
537
538 case "categoryedit":
539 {
540 // make switch
541 if ( $url_array[3] == "cancel" )
542 {
543 $Action = "Cancel";
544 $CategoryID = $url_array[4];
545 eZHTTPTool::header( "Location: /article/archive/$CategoryID/" );
546 exit();
547 }
548
549 if ( $url_array[3] == "insert" )
550 {
551 $Action = "insert";
552 include( "kernel/ezarticle/admin/categoryedit.php" );
553 }
554 if ( $url_array[3] == "new" )
555 {
556 $Action = "new";
557 include( "kernel/ezarticle/admin/categoryedit.php" );
558 }
559 if ( $url_array[3] == "update" )
560 {
561 $CategoryID = $url_array[4];
562 $Action = "update";
563 if ( eZObjectPermission::hasPermission( $CategoryID, "article_category", 'w' ) ||
564 eZArticleCategory::isOwner( $user, $CategoryID) )
565 include( "kernel/ezarticle/admin/categoryedit.php" );
566 }
567 if ( $url_array[3] == "delete" )
568 {
569 $CategoryID = $url_array[4];
570 $Action = "delete";
571 if ( eZObjectPermission::hasPermission( $CategoryID, "article_category", 'w' ) ||
572 eZArticleCategory::isOwner( $user, $CategoryID) )
573 include( "kernel/ezarticle/admin/categoryedit.php" );
574 }
575 if ( $url_array[3] == "edit" )
576 {
577 $CategoryID = $url_array[4];
578 $Action = "edit";
579 include( "kernel/ezarticle/admin/categoryedit.php" );
580 }
581
582 }
583 break;
584
585 case "sitemap":
586 {
587 include( "kernel/ezarticle/admin/sitemap.php" );
588 }
589 break;
590
591 case "type":
592 {
593 switch( $url_array[3] )
594 {
595 case "list":
596 {
597 include( "kernel/ezarticle/admin/typelist.php" );
598 }
599 break;
600
601 case "new":
602 case "edit":
603 case "insert":
604 case "update":
605 case "delete":
606 case "up":
607 case "down":
608 {
609 if ( !isset( $Action ) )
610 $Action = $url_array[3];
611 if ( isset( $TypeID ) && is_numeric( $TypeID ) )
612 {
613 $ActionValue = "update";
614 }
615 else
616 {
617 $TypeID = $url_array[4];
618 }
619
620 if ( !isset( $AttributeID ) )
621 {
622 $AttributeID = $url_array[5];
623 }
624 include( "kernel/ezarticle/admin/typeedit.php" );
625 }
626 break;
627 }
628 }
629 break;
630
631 default :
632 {
633 eZHTTPTool::header( "Location: /error/404" );
634 exit();
635 }
636 break;
637 }
638
639 // display a page with error msg
640
641 ?>
$CategoryID
$CategoryID
Definition: admin/articleedit.php:53
eZArticleCategory\isOwner
isOwner( $user, $categoryID)
Definition: ezarticlecategory.php:825
eZArticleTool\deleteCache
static deleteCache( $ArticleID, $CategoryID, $CategoryArray)
Definition: ezarticletool.php:52
eZArticle\isAuthor
static isAuthor( $user, $articleID)
Definition: ezarticle.php:2672
eZHTTPTool\header
static header( $string)
Definition: ezhttptool.php:96
eZHTTPTool\getVar
static getVar( $name, $onlyCheckPost=false)
Definition: ezhttptool.php:55
eZHTTPTool\extractVar
static extractVar( $vars, $onlyCheckPost=false)
Definition: ezhttptool.php:80
eZObjectPermission\hasPermission
static hasPermission( $objectID, $moduleTable, $permission, $user=false)
Definition: ezobjectpermission.php:76
eZObjectPermission\getObjects
static getObjects( $moduleTable, $permission, $count=false, $user=false)
Definition: ezobjectpermission.php:425
eZPermission\checkPermission
static checkPermission( $user, $moduleName, $permissionName)
Definition: ezpermission.php:430
eZUser\currentUser
static & currentUser()
Definition: ezuser.php:896
$Action
$Action
Definition: companysearch.php:80
$ImageID
$ImageID
Definition: companytypelist.php:201
$ArticleID
$ArticleID
Definition: export.php:48
$url_array
$url_array
Definition: ezaddress/admin/datasupplier.php:34
$SearchText
$SearchText
Definition: ezaddress/admin/typelist.php:143
$ActionValue
$ActionValue
Definition: ezarticle/admin/attributeedit.php:79
$user
$user
Definition: ezarticle/admin/datasupplier.php:38
$Offset
$Offset
Definition: ezarticle/user/search.php:110
$ModuleName
$ModuleName
Definition: ezarticle/user/searchsupplier.php:30
$SectionID
$SectionID
Definition: ezfilemanager/user/filelist.php:46
exit
exit
Definition: folder.php:81
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.