Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

ezarticlecategory.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: ezarticlecategory.php 9804 2003-04-10 13:26:14Z br $
5 //
6 // Definition of eZArticleCategory class
7 //
8 // Created on: <18-Oct-2000 14:05:56 bf>
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
39 // include_once( "classes/ezdb.php" );
40 // include_once( "ezuser/classes/ezusergroup.php" );
41 // include_once( "ezuser/classes/ezuser.php" );
42 // include_once( "ezarticle/classes/ezarticle.php" );
43
44 class eZArticleCategory
45 {
52 function __construct( $id=-1 )
53 {
54 $this->SortMode = 1;
55 $this->ImageID = 0;
56 $this->ParentID = 0;
57 $this->ExcludeFromSearch = "0";
58 $this->ListLimit = 0;
59
60 if ( is_array( $id ) )
61 {
62 $this->fill( $id );
63 }
64 else if ( $id != -1 )
65 {
66 $this->ID = $id;
67 $this->get( $this->ID );
68 }
69 }
70
74 function store()
75 {
76 $db =& eZDB::globalDatabase();
77
78 $name = $db->escapeString( $this->Name );
79 $description = $db->escapeString( $this->Description );
80
81 if ( !isset( $this->ID ) )
82 {
83 $db->lock( "eZArticle_Category" );
84
85 $nextID = $db->nextID( "eZArticle_Category", "ID" );
86
87 $res = $db->query( "INSERT INTO eZArticle_Category
88 ( ID, Name, Description, ExcludeFromSearch,
89 SortMode, Placement, OwnerID, SectionID,
90 ImageID, ParentID, EditorGroupID, ListLimit )
91 VALUES
92 ( '$nextID',
93 '$name',
94 '$description',
95 '$this->ExcludeFromSearch',
96 '$this->SortMode',
97 '$nextID',
98 '$this->OwnerID',
99 '$this->SectionID',
100 '$this->ImageID',
101 '$this->ParentID',
102 '$this->EditorGroupID',
103 '$this->ListLimit')" );
104
105 $db->unlock();
106 $this->ID = $nextID;
107 }
108 else
109 {
110 $query = "UPDATE eZArticle_Category SET
111 Name='$name',
112 Description='$description',
113 ExcludeFromSearch='$this->ExcludeFromSearch',
114 SortMode='$this->SortMode',
115 Placement='$this->Placement',
116 OwnerID='$this->OwnerID',
117 SectionID='$this->SectionID',
118 ImageID='$this->ImageID',
119 EditorGroupID='$this->EditorGroupID',
120 ParentID='$this->ParentID',
121 ListLimit='$this->ListLimit'
122 WHERE ID='$this->ID'";
123
124 $res = $db->query( $query );
125 }
126
127 if ( $res == false )
128 $db->rollback( );
129 else
130 $db->commit();
131
132 return true;
133 }
134
138 function delete( $catID=-1 )
139 {
140 if ( $catID == -1 )
141 $catID = $this->ID;
142
143 $db =& eZDB::globalDatabase();
144
145
146 $category = new eZArticleCategory( $catID );
147 $categoryList = $category->getByParent( $category );
148 foreach ( $categoryList as $categoryItem )
149 {
150 eZArticleCategory::delete( $categoryItem->id() );
151 }
152
153 $categoryID = $category->id();
154 foreach ( $category->articles() as $article )
155 {
156 $categoryDefinition = $article->categoryDefinition();
157 if ( $categoryDefinition->id() == $category->id() )
158 {
159 $article->delete();
160 }
161 else
162 {
163 $articleID = $article->id();
164 $db->query( "DELETE FROM eZArticle_ArticleCategoryLink
165 WHERE CategoryID='$categoryID' AND ArticleID='$articledID'" );
166 }
167 }
168
169 $db->query( "DELETE FROM eZArticle_CategoryPermission WHERE ObjectID='$categoryID'" );
170 $db->query( "DELETE FROM eZArticle_Category WHERE ID='$categoryID'" );
171 }
172
176 function get( $id=-1 )
177 {
178 $db =& eZDB::globalDatabase();
179 $ret = false;
180
181 if ( $id != "" )
182 {
183 $db->array_query( $category_array, "SELECT * FROM eZArticle_Category WHERE ID='$id'" );
184 if ( count( $category_array ) > 1 )
185 {
186 die( "Error: Category's with the same ID was found in the database. This shouldent happen." );
187 }
188 else if ( count( $category_array ) == 1 )
189 {
190 $this->fill( $category_array[0] );
191 /*
192 $this->ID = $category_array[0][$db->fieldName( "ID" )];
193 $this->Name = $category_array[0][$db->fieldName( "Name" )];
194 $this->Description = $category_array[0][$db->fieldName( "Description" )];
195 $this->ParentID = $category_array[0][$db->fieldName( "ParentID" )];
196 $this->ExcludeFromSearch = $category_array[0][$db->fieldName( "ExcludeFromSearch" )];
197 $this->SortMode = $category_array[0][$db->fieldName( "SortMode" )];
198 $this->OwnerID = $category_array[0][$db->fieldName( "OwnerID" )];
199 $this->Placement = $category_array[0][$db->fieldName( "Placement" )];
200 $this->SectionID = $category_array[0][$db->fieldName( "SectionID" )];
201 $this->ImageID = $category_array[0][$db->fieldName( "ImageID" )];
202 $this->EditorGroupID = $category_array[0][$db->fieldName( "EditorGroupID" )];
203 $this->ListLimit = $category_array[0][$db->fieldName( "ListLimit" )];
204 */
205 $ret = true;
206 }
207 }
208 return $ret;
209 }
210
211 function fill( $category_array )
212 {
213 $db =& eZDB::globalDatabase();
214 $this->ID = $category_array[$db->fieldName( "ID" )];
215 $this->Name = $category_array[$db->fieldName( "Name" )];
216 $this->Description = $category_array[$db->fieldName( "Description" )];
217 $this->ParentID = $category_array[$db->fieldName( "ParentID" )];
218 $this->ExcludeFromSearch = $category_array[$db->fieldName( "ExcludeFromSearch" )];
219 $this->SortMode = $category_array[$db->fieldName( "SortMode" )];
220 $this->OwnerID = $category_array[$db->fieldName( "OwnerID" )];
221 $this->Placement = $category_array[$db->fieldName( "Placement" )];
222 $this->SectionID = $category_array[$db->fieldName( "SectionID" )];
223 $this->ImageID = $category_array[$db->fieldName( "ImageID" )];
224 $this->EditorGroupID = $category_array[$db->fieldName( "EditorGroupID" )];
225 $this->ListLimit = $category_array[$db->fieldName( "ListLimit" )];
226 }
227
233 function getAll()
234 {
235 $db =& eZDB::globalDatabase();
236 $return_array = array();
237 $category_array = array();
238
239 $db->array_query( $category_array, "SELECT * FROM eZArticle_Category ORDER BY Name" );
240
241 for ( $i=0; $i < count($category_array); $i++ )
242 {
243 $return_array[$i] = new eZArticleCategory( $category_array[$i] );
244 }
245
246 return $return_array;
247 }
248
255 function &getByName( $name )
256 {
257 $db =& eZDB::globalDatabase();
258 $category = false;
259 $name = $db->escapeString( $name );
260
261 if ( $name != "" )
262 {
263 $db->array_query( $author_array, "SELECT * FROM eZArticle_Category WHERE Name='$name'" );
264
265 if ( count( $author_array ) == 1 )
266 {
267 $category = new eZArticleCategory( $author_array[0] );
268 }
269 }
270
271 return $category;
272 }
273
282 function &search( $name, $showAll = false, $sortby='placement', $user = false )
283 {
284 $db =& eZDB::globalDatabase();
285 $topic = array();
286
287 if ( is_array( $name ) )
288 {
289 $searches = "";
290 foreach ( $name as $n )
291 {
292 $n = $db->escapeString( $n );
293 if ( $searches != "" )
294 $searches .= "OR ";
295 $searches .= "Category.Name='$n' OR Category.Description='$n'";
296 }
297 $search = "$searches";
298 }
299 else if ( $name == "" )
300 {
301 $search = "";
302 }
303 else
304 {
305 $name = $db->escapeString( $name );
306 $search = "Category.Name='$name' OR Category.Description='$name'";
307 }
308
309 $sortbySQL = "Name";
310 switch ( $sortby )
311 {
312 case "name" : $sortbySQL = "Name"; break;
313 case "placement" : $sortbySQL = "Placement"; break;
314 }
315
316 if ( is_a( $user, "eZUser" ) )
317 $user =& eZUser::currentUser();
318
319 $show_str = "";
320 $usePermission = true;
321 if ( !$showAll )
322 $show_str = "AND Category.ExcludeFromSearch='0'";
323
324 if ( $user )
325 {
326 $groups =& $user->groups( false );
327
328 $i = 0;
329 foreach ( $groups as $group )
330 {
331 if ( $i == 0 )
332 $groupSQL .= " Permission.GroupID=$group OR";
333 else
334 $groupSQL .= " Permission.GroupID=$group OR";
335 $i++;
336 }
337 $currentUserID = $user->id();
338
339 if ( $user->hasRootAccess() )
340 $usePermission = false;
341 }
342
343 if ( $usePermission )
344 $permissionSQL = "( ($groupSQL Permission.GroupID='-1') AND Permission.ReadPermission='1' ) AND ";
345 else
346 $permissionSQL = "";
347
348 $db->array_query( $author_array,
349 "SELECT Category.ID
350 FROM eZArticle_Category AS Category,
351 eZArticle_CategoryPermission as Permission
352 WHERE $permissionSQL ($search)
353 AND Permission.ObjectID=Category.ID
354 GROUP BY Category.ID, Category.Placement
355 ORDER BY $sortbySQL" );
356
357 foreach ( $author_array as $author )
358 {
359 $topic[] = new eZArticleCategory( $author[$db->fieldName("ID")] );
360 }
361 return $topic;
362 }
363
373 function getByParent( $parent, $showAll=false, $sortby='placement', $offset = 0, $max = -1, $user = false,
374 $check_write = false )
375 {
376 if ( is_a( $parent, "eZArticleCategory" ) )
377 {
378 $perm_str = '';
379 $PermGroupBy = '';
380
381 $db =& eZDB::globalDatabase();
382 if ( !is_a( $user, "eZUser" ) )
383 $user =& eZUser::currentUser();
384
385 $sortbySQL = "Name";
386 switch ( $sortby )
387 {
388 case "name" : $sortbySQL = "Name"; break;
389 case "placement" : $sortbySQL = "Placement"; break;
390 }
391
392 $return_array = array();
393 $category_array = array();
394
395 $parentID = $parent->id();
396
397 $show_str = "";
398 $usePermission = true;
399 if ( !$showAll )
400 $show_str = "AND ExcludeFromSearch='0'";
401
402 if ( !isset( $groupSQL ) )
403 $groupSQL = "";
404 if ( $user )
405 {
406 $groups =& $user->groups( false );
407
408 $i = 0;
409 foreach ( $groups as $group )
410 {
411 if ( $i == 0 )
412 $groupSQL .= " Permission.GroupID=$group OR";
413 else
414 $groupSQL .= " Permission.GroupID=$group OR";
415 $i++;
416 }
417 $currentUserID = $user->id();
418
419 if ( $user->hasRootAccess() )
420 $usePermission = false;
421 }
422
423 $having_str = "";
424 if ( $usePermission )
425 {
426 if ( $check_write )
427 {
428 $perm_str = ", MAX(Permission.WritePermission) AS MaxWritePerm, MAX(Permission.ReadPermission) AS MaxReadPerm";
429 $PermGroupBy = "Permission.ObjectID, ";
430
431 $permissionSQL = "( ($groupSQL Permission.GroupID='-1') ) AND ";
432 $having_str = "HAVING MaxWritePerm=1 AND MaxReadPerm=1 ";
433 }
434 else
435 $permissionSQL = "( ($groupSQL Permission.GroupID='-1') AND Permission.ReadPermission='1' ) AND ";
436 }
437 else
438 $permissionSQL = "";
439
440 $query = "SELECT Category.ID $perm_str
441 FROM eZArticle_Category as Category,
442 eZArticle_CategoryPermission as Permission
443 WHERE $permissionSQL
444 ParentID='$parentID'
445 AND Permission.ObjectID=Category.ID
446 $show_str
447 GROUP BY $PermGroupBy Category.ID, Category.Placement, Category.Name
448 $having_str
449 ORDER BY $sortbySQL";
450
451 $db->array_query( $category_array, $query, array( "Limit" => $max, "Offset" => $offset ) );
452
453 for ( $i=0; $i < count($category_array); $i++ )
454 {
455 $return_array[$i] = new eZArticleCategory( $category_array[$i][$db->fieldName("ID")] );
456 }
457 return $return_array;
458 }
459 else
460 {
461 return 0;
462 }
463 }
464
476 function countByParent( $parent, $showAll=false, $user = false, $check_write = false )
477 {
478 if ( is_a( $parent, "eZArticleCategory" ) )
479 {
480 $db =& eZDB::globalDatabase();
481 if ( !is_a( $user, "eZUser" ) )
482 $user =& eZUser::currentUser();
483
484 $return_array = array();
485 $category_array = array();
486
487 $parentID = $parent->id();
488
489 $show_str = "";
490 $usePermission = true;
491
492 if ( !$showAll )
493 $show_str = "AND ExcludeFromSearch='0'";
494
495 if ( $user )
496 {
497 $groups =& $user->groups( false );
498
499 $i = 0;
500 foreach ( $groups as $group )
501 {
502 if ( $i == 0 )
503 $groupSQL .= " Permission.GroupID=$group OR";
504 else
505 $groupSQL .= " Permission.GroupID=$group OR";
506 $i++;
507 }
508 $currentUserID = $user->id();
509
510 if ( $user->hasRootAccess() )
511 $usePermission = false;
512 }
513
514 $permissionTables = "";
515 $having_str = "";
516
517 $sel_str = "count( DISTINCT Category.ID ) AS Count";
518 if ( $usePermission )
519 {
520 if ( $check_write )
521 {
522 $permissionSQL = "( ($groupSQL Permission.GroupID='-1') ) AND ";
523 $sel_str = "max( Permission.ReadPermission ) AS MaxRead, max( Permission.WritePermission ) AS MaxWrite ";
524 $having_str = "GROUP BY Permission.ObjectID HAVING MaxRead='1' AND MaxWrite='1'";
525 }
526 else
527 $permissionSQL = "( ($groupSQL Permission.GroupID='-1') AND Permission.ReadPermission='1' ) AND ";
528 }
529 else
530 $permissionSQL = "";
531
532 $query = "SELECT $sel_str
533 FROM eZArticle_Category AS Category,
534 eZArticle_CategoryPermission as Permission
535 WHERE $permissionSQL
536 ParentID='$parentID'
537 AND Permission.ObjectID=Category.ID
538 $show_str $having_str";
539 if ( $usePermission and $check_write )
540 {
541 $db->array_query( $category_array, $query );
542 return count( $category_array );
543 }
544 else
545 {
546 $db->query_single( $category_array, $query,
547 "Count" );
548 return $category_array;
549 }
550 }
551 else
552 {
553 return 0;
554 }
555 }
556
564 function path( $categoryID=0 )
565 {
566 if ( $categoryID == 0 )
567 {
568 $categoryID = $this->ID;
569 }
570
571 $category = new eZArticleCategory( $categoryID );
572
573 $path = array();
574
575 $parent = $category->parent();
576
577 if ( is_a($parent, 'eZArticleCategory') )
578 {
579 $path = array_merge( $path, $this->path( $parent->id() ) );
580 }
581 else
582 {
583 // array_push( $path, $category->name() );
584 }
585
586 if ( $categoryID != 0 )
587 array_push( $path, array( $category->id(), $category->name() ) );
588
589 return $path;
590 }
591
596 function getTree( $parentID=0, $level=0 )
597 {
598 if ( is_a( $parentID, "eZArticleCategory" ) )
599 $category = $parentID;
600 else
601 $category = new eZArticleCategory( $parentID );
602
603 $categoryList = $category->getByParent( $category, true );
604
605 $tree = array();
606 $level++;
607 foreach ( $categoryList as $category )
608 {
609 array_push( $tree, array( $return_array[] = $category, $level ) );
610
611 if ( isset($category) )
612 {
613 $tree = array_merge( $tree, $this->getTree( $category, $level ) );
614 }
615 }
616 return $tree;
617 }
618
622 function copyTree( $parentID, $parentCategory )
623 {
624 $category = new eZArticleCategory( $parentID );
625
626 $categoryList = $category->getByParent( $category, true );
627
628 $tree = array();
629 $level++;
630 foreach ( $categoryList as $category )
631 {
632 array_push( $tree, array( $return_array[] = new eZArticleCategory( $category->id() ) ) );
633
634 $newCategory = new eZArticleCategory( );
635 $newCategory->setName( $category->name() );
636 $newCategory->setDescription( $category->description() );
637 $newCategory->setParent( $parentCategory );
638 $newCategory->setOwner( eZUser::currentUser() );
639 $newCategory->store();
640
641 // write access
642 eZObjectPermission::setPermission( -1, $newCategory->id(), "article_category", 'w' );
643
644 // read access
645 eZObjectPermission::setPermission( -1, $newCategory->id(), "article_category", 'r' );
646
647
648 if ( $category != 0 )
649 {
650 $tree = array_merge( $tree, $this->copyTree( $category->id(), $newCategory ) );
651 }
652
653 }
654
655 return $tree;
656 }
657
662 static public function sectionIDStatic($categoryID )
663 {
664 $db =& eZDB::globalDatabase();
665 $res = array();
666
667 $db->query_single( $res, "SELECT SectionID from eZArticle_Category WHERE ID='$categoryID'");
668
669 if ( isset( $res[$db->fieldName("SectionID")] ) )
670 $sectionID = $res[$db->fieldName("SectionID")];
671 else
672 $sectionID = 0;
673
674 if ( $sectionID > 0 )
675 return (int)$sectionID;
676 else
677 return false;
678 }
679
683 function &image( $AsObject = true )
684 {
685 if ( $AsObject )
686 $image = new eZImage( $this->ImageID );
687 else
688 $image = $this->ImageID;
689
690 return $image;
691 }
692
696 function sectionID( )
697 {
698 return $this->SectionID;
699 }
700
704 function id()
705 {
706 return $this->ID;
707 }
708
712 function name( $asHTML = true )
713 {
714 if ( isset( $this->Name ) )
715 {
716 $this->Name = stripslashes($this->Name);
717 if ( $asHTML )
718 return eZTextTool::fixhtmlentities( htmlspecialchars( $this->Name ) );
719 return $this->Name;
720 }
721 else
722 return;
723 }
724
728 function description( $asHTML = true )
729 {
730 if ( isset( $this->Description ) )
731 {
732 $this->Description = stripslashes($this->Description);
733 if ( $asHTML )
734 return eZTextTool::fixhtmlentities( htmlspecialchars( $this->Description ) );
735 return $this->Description;
736 }
737 else
738 return;
739 }
740
744 function listLimit()
745 {
746 if ( isset( $this->ListLimit ) )
747 {
748 return $this->ListLimit;
749 }
750 else
751 return;
752 }
753
757 function placement()
758 {
759 if ( isset( $this->Placement ) )
760 {
761 return htmlspecialchars( $this->Placement );
762 }
763 else
764 return;
765 }
766
770 function parent( $as_object = true )
771 {
772 if ( !$as_object )
773 return $this->ParentID;
774 else if ( $this->ParentID != 0 )
775 {
776 return new eZArticleCategory( $this->ParentID );
777 }
778 else
779 {
780 return 0;
781 }
782 }
783
787 function editorGroup( $as_object = true )
788 {
789 if ( !$as_object )
790 return $this->EditorGroupID;
791 else if ( $this->EditorGroupID != 0 )
792 {
793 return new eZUserGroup( $this->EditorGroupID );
794 }
795 else
796 {
797 return 0;
798 }
799 }
800
804 function owner( $as_object = true )
805 {
806 if ( !$as_object )
807 return $this->OwnerID;
808 else if ( $this->OwnerID != 0 )
809 {
810 return new eZUser( $this->OwnerID );
811 }
812 else
813 {
814 return 0;
815 }
816
817 }
818
825 function isOwner( $user, $categoryID )
826 {
827 if ( !is_a( $user, "eZUser" ) )
828 return false;
829
830 $db =& eZDB::globalDatabase();
831 $db->query_single( $res, "SELECT OwnerID from eZArticle_Category WHERE ID='$categoryID'");
832
833 if ( !$res )
834 return false;
835
836 $ownerID = $res[$db->fieldName("OwnerID")];
837 if ( $ownerID == $user->id() )
838 return true;
839
840 return false;
841 }
842
843
853 function sortMode( $return_id = false )
854 {
855 switch ( $this->SortMode )
856 {
857 case 1 :
858 {
859 $SortMode = "time";
860 }
861 break;
862
863 case 2 :
864 {
865 $SortMode = "alpha";
866 }
867 break;
868
869 case 3 :
870 {
871 $SortMode = "alphadesc";
872 }
873 break;
874
875 case 4 :
876 {
877 $SortMode = "absolute_placement";
878 }
879 break;
880
881 case 5 :
882 {
883 $SortMode = "modification";
884 }
885 break;
886
887 default :
888 {
889 $SortMode = "time";
890 }
891 }
892
893 if ( $return_id == true )
894 return $this->SortMode;
895 else
896 return $SortMode;
897
898 }
899
904 function excludeFromSearch( )
905 {
906 $ret = false;
907 if ( $this->ExcludeFromSearch == "1" )
908 {
909 $ret = true;
910 }
911
912 return $ret;
913 }
914
915
916
920 function setName( $value )
921 {
922 $this->Name = $value;
923 }
924
928 function setListLimit( $value )
929 {
930 $this->ListLimit = $value;
931 }
932
936 function setPlacement( $value )
937 {
938 $this->Placement = $value;
939 }
940
944 function setSectionID( $value )
945 {
946 $this->SectionID = $value;
947 }
948
952 function setImage( $value )
953 {
954 if ( is_a( $value, "eZImage" ) )
955 $value = $value->id();
956
957 $this->ImageID = $value;
958 }
959
963 function setDescription( $value )
964 {
965 $this->Description = $value;
966 }
967
971 function setParent( $value )
972 {
973 if ( is_a( $value, "eZArticleCategory" ) )
974 {
975 $this->ParentID = $value->id();
976 }
977 else
978 {
979 $this->ParentID = $value;
980 setType( $this->ParentID, "integer" );
981
982 }
983 }
984
988 function setEditorGroup( $value )
989 {
990 if ( is_a( $value, "eZUserGroup" ) )
991 {
992 $this->EditorGroupID = $value->id();
993 }
994 else
995 {
996 $this->EditorGroupID = $value;
997 setType( $this->EditorGroupID, "integer" );
998
999 }
1000 }
1001
1005 function setOwner( $value )
1006 {
1007 if ( is_a( $value, "eZUser" ) )
1008 {
1009 $this->OwnerID = $value->id();
1010 }
1011 else
1012 {
1013 $this->OwnerID = $value;
1014 }
1015 }
1016
1017
1026 function setSortMode( $value )
1027 {
1028 $this->SortMode = $value;
1029 }
1030
1035 function setExcludeFromSearch( $value )
1036 {
1037 if ( $value == true )
1038 {
1039 $this->ExcludeFromSearch = "1";
1040 }
1041 else
1042 {
1043 $this->ExcludeFromSearch = "0";
1044 }
1045 }
1046
1052 static public function removeArticle( $value, $categoryid = false )
1053 {
1054 if ( is_a( $value, "eZArticle" ) )
1055 $articleID = $value->id();
1056 else if ( is_numeric( $value ) )
1057 $articleID = $value;
1058 else
1059 return false;
1060
1061 if ( !$categoryid )
1062 $categoryid = $this->ID;
1063 // $categoryid = false;
1064 // //this->ID;
1065
1066 $db =& eZDB::globalDatabase();
1067 $query = "DELETE FROM eZArticle_ArticleCategoryLink
1068 WHERE CategoryID='$categoryid' AND
1069 ArticleID='$articleID'";
1070
1071 $db->query( $query );
1072 }
1073
1079 static public function addArticle( $value, $categoryid = false )
1080 {
1081 $db =& eZDB::globalDatabase();
1082
1083 if ( is_a( $value, "eZArticle" ) )
1084 $articleID = $value->id();
1085 else if ( is_numeric( $value ) )
1086 $articleID = $value;
1087 else
1088 return false;
1089
1090 if ( !$categoryid )
1091 $categoryid = $this->ID;
1092 // $categoryid = 1;
1093 //$categoryid = $this->ID;
1094 // check if article already exists in category.
1095 $db->array_query( $qry, "SELECT ID FROM eZArticle_ArticleCategoryLink
1096 WHERE CategoryID='$categoryid' AND ArticleID='$articleID'" );
1097
1098 if ( count( $qry ) > 0 )
1099 return false;
1100
1101 $db->array_query( $qry, "SELECT ID, Placement FROM eZArticle_ArticleCategoryLink
1102 WHERE CategoryID='$categoryid'
1103 ORDER BY Placement DESC", array( "Limit" => 1, "Offset" => 0 ) );
1104
1105 $place = count( $qry ) == 1 ? $qry[0][$db->fieldName("Placement")] + 1 : 1;
1106
1107 $db->begin();
1108 $db->lock( "eZArticle_ArticleCategoryLink" );
1109 $nextID = $db->nextID( "eZArticle_ArticleCategoryLink", "ID" );
1110
1111 $query = "INSERT INTO eZArticle_ArticleCategoryLink
1112 ( ID, CategoryID, ArticleID, Placement )
1113 VALUES
1114 ( '$nextID', '$categoryid', '$articleID', '$place' )";
1115
1116 $res = $db->query( $query );
1117
1118 $db->unlock();
1119
1120 if ( $res == false )
1121 $db->rollback( );
1122 else
1123 $db->commit();
1124 }
1125
1126
1130 function userHasPermision( $categoryID = -1, $read = true, $write = true, $user = false )
1131 {
1132 if ( $categoryID == -1 )
1133 {
1134 if ( is_object( $this ) )
1135 {
1136 $categoryID = $this->id();
1137 }
1138 else
1139 {
1140 return false;
1141 }
1142 }
1143 $perm = '';
1144 if ( $read )
1145 {
1146 $perm .= 'r';
1147 }
1148 if ( $write )
1149 {
1150 $perm .= 'w';
1151 }
1152
1153 return eZObjectPermission::hasPermission( $categoryID, 'article_category', $perm, $user );
1154 }
1155
1156
1167 public function &articles( $sortMode="time",
1168 $fetchAll=true,
1169 $fetchPublished=true,
1170 $offset=0,
1171 $limit=50,
1172 $categoryID=0,
1173 $check_write = false )
1174 {
1175 if ( $categoryID != 0 )
1176 $catID = $categoryID;
1177 else
1178 $catID = $this->ID;
1179
1180 $db =& eZDB::globalDatabase();
1181
1182 if ( $offset == false )
1183 $offset = 0;
1184
1185 switch ( $sortMode )
1186 {
1187 case "time" :
1188 {
1189 $GroupBy = ", Article.Published";
1190 $OrderBy = "Article.Published DESC";
1191 }
1192 break;
1193
1194 case "alpha" :
1195 {
1196 $GroupBy = ", Article.Name";
1197 $OrderBy = "Article.Name ASC";
1198 }
1199 break;
1200
1201 case "alphadesc" :
1202 {
1203 $GroupBy = ", Article.Name";
1204 $OrderBy = "Article.Name DESC";
1205 }
1206 break;
1207
1208 case "absolute_placement" :
1209 {
1210 $GroupBy = ", Link.Placement";
1211 $OrderBy = "Link.Placement ASC";
1212 }
1213 break;
1214
1215 case "modification" :
1216 {
1217 $GroupBy = ", Article.Modified";
1218 $OrderBy = "Article.Modified DESC";
1219 }
1220 break;
1221
1222 default :
1223 {
1224 $GroupBy = ", Article.Published";
1225 $OrderBy = "Article.Published DESC";
1226 }
1227 }
1228
1229 $return_array = array();
1230 $article_array = array();
1231
1232 $user =& eZUser::currentUser();
1233
1234 $loggedInSQL = "";
1235 $groupSQL = "";
1236 $categoryGroupSQL = "AND";
1237 $usePermission = true;
1238 if ( $user )
1239 {
1240 $groups = $user->groups( false );
1241
1242 foreach ( $groups as $group )
1243 {
1244 $groupSQL .= " ( Permission.GroupID='$group' AND CategoryPermission.GroupID='$group' ) OR
1245 ( Permission.GroupID='$group' AND CategoryPermission.GroupID='-1' ) OR
1246 ( Permission.GroupID='-1' AND CategoryPermission.GroupID='$group' ) OR
1247 ";
1248 }
1249 $currentUserID = $user->id();
1250 $loggedInSQL = "Article.AuthorID=$currentUserID OR";
1251
1252 if ( $user->hasRootAccess() )
1253 $usePermission = false;
1254 }
1255
1256 $perm_str = "";
1257 $PermGroupBy = "";
1258 $having_str = '';
1259 if ( $usePermission )
1260 {
1261 if ( $check_write )
1262 {
1263 $perm_str = ", MAX(Permission.WritePermission) AS MaxWritePerm, MAX(Permission.ReadPermission) AS MaxReadPerm,
1264 MAX(CategoryPermission.WritePermission) AS CatMaxWritePerm, MAX(CategoryPermission.ReadPermission) AS CatMaxReadPerm";
1265 $PermGroupBy = "Permission.ObjectID, ";
1266
1267 $permissionSQL = "( $loggedInSQL ( $groupSQL Permission.GroupID='-1' AND CategoryPermission.GroupID='-1' ) ) ";
1268 $having_str = "HAVING MaxReadPerm='1' AND MaxWritePerm='1' AND CatMaxReadPerm='1' AND CatMaxWritePerm='1'";
1269 }
1270 else
1271 $permissionSQL = "( $loggedInSQL ( $groupSQL Permission.GroupID='-1' AND CategoryPermission.GroupID='-1' )
1272 AND Permission.ReadPermission='1' AND CategoryPermission.ReadPermission='1' ) AND ";
1273 }
1274 else
1275 $permissionSQL = "";
1276
1277 // fetch all articles
1278 if ( $fetchAll == true )
1279 {
1280 if ( $permissionSQL == "" )
1281 $publishedSQL = "";
1282 else
1283 $publishedSQL = "";
1284 }
1285
1286 // fetch only published articles
1287 else if ( $fetchPublished == true )
1288 {
1289 if ( $permissionSQL == "" )
1290 $publishedSQL = " Article.IsPublished = '1' ";
1291 else
1292 $publishedSQL = " Article.IsPublished = '1' ";
1293 }
1294
1295 // fetch only non-published articles
1296 else
1297 {
1298 if ( $permissionSQL == "" )
1299 $publishedSQL = " Article.IsPublished = '0' ";
1300 else
1301 $publishedSQL = " AND Article.IsPublished = '0' ";
1302 }
1303
1304 if( $catID == false )
1305 {
1306 $categorySQL = '';
1307 }
1308 elseif ($permissionSQL == '' && $publishedSQL == '')
1309 {
1310 $categorySQL = "Link.CategoryID='$catID' ";
1311 }
1312 else
1313 {
1314 $categorySQL = "AND Link.CategoryID='$catID' ";
1315 }
1316
1317 $query = "SELECT Article.* $perm_str
1318 FROM eZArticle_ArticleCategoryDefinition as Definition,
1319 eZArticle_Article as Article,
1320 eZArticle_ArticleCategoryLink as Link,
1321 eZArticle_CategoryPermission as CategoryPermission,
1322 eZArticle_ArticlePermission AS Permission
1323 WHERE
1324 $permissionSQL
1325 $publishedSQL
1326 $categorySQL
1327 AND Permission.ObjectID=Article.ID
1328 AND Link.ArticleID=Article.ID
1329 AND Definition.ArticleID=Article.ID
1330 AND CategoryPermission.ObjectID=Definition.CategoryID
1331 GROUP BY $PermGroupBy Article.ID, Article.Published, Article.Name, Article.Contents, Article.ContentsWriterID, Article.LinkText, Article.AuthorID, Article.Modified, Article.Created, Article.PageCount, Article.IsPublished, Article.Keywords, Article.Discuss, Article.TopicID, Article.StartDate, Article.StopDate, Article.ImportID $GroupBy
1332 $having_str
1333 ORDER BY $OrderBy";
1334
1335 if ( $limit == -1 )
1336 {
1337 $db->array_query( $article_array, $query );
1338 }
1339 else
1340 {
1341 $db->array_query( $article_array, $query, array( "Limit" => $limit, "Offset" => $offset ) );
1342 }
1343
1344 for ( $i=0; $i < count( $article_array ); $i++ )
1345 {
1346 // // Bad hack to make permission work with read *AND* write
1347 // if ( $usePermission and $check_write )
1348 // {
1349 // if ( $article_array[$i][$db->fieldName( "MaxReadPerm" )] == 1 and
1350 // $article_array[$i][$db->fieldName( "MaxWritePerm" )] == 1 )
1351 // $return_array[$i] = new eZArticle( $article_array[$i][$db->fieldName( "ArticleID" )] );
1352 // }
1353 // else
1354 // $return_array[$i] = new eZArticle( $article_array[$i] );
1355 $return_array[$i] = new eZArticle( $article_array[$i] );
1356 }
1357
1358 return $return_array;
1359 }
1360
1371 function articleCount( $fetchAll=true, $fetchPublished=true, $check_write = false )
1372 {
1373 $db =& eZDB::globalDatabase();
1374
1375 $return_array = array();
1376 $article_array = array();
1377
1378 $user =& eZUser::currentUser();
1379
1380 $loggedInSQL = "";
1381 $groupSQL = "";
1382 $categoryGroupSQL = "AND";
1383 $usePermission = true;
1384 $having_str = '';
1385 if ( $user )
1386 {
1387 $groups =& $user->groups( false );
1388
1389 foreach ( $groups as $group )
1390 {
1391 $groupSQL .= " ( Permission.GroupID='$group' AND CategoryPermission.GroupID='$group' ) OR
1392 ( Permission.GroupID='$group' AND CategoryPermission.GroupID='-1' ) OR
1393 ( Permission.GroupID='-1' AND CategoryPermission.GroupID='$group' ) OR
1394 ";
1395 }
1396 $currentUserID = $user->id();
1397 $loggedInSQL = "Article.AuthorID=$currentUserID OR";
1398
1399 if ( $user->hasRootAccess() )
1400 $usePermission = false;
1401 }
1402
1403 $sel_str = "COUNT( DISTINCT Article.ID ) as Count";
1404 $group_str = "";
1405 if ( $usePermission )
1406 {
1407 if ( $check_write )
1408 {
1409 $sel_str = "Article.ID, max( Permission.ReadPermission ) AS MaxRead, max( Permission.WritePermission ) AS MaxWrite,
1410 max( CategoryPermission.ReadPermission ) AS CatMaxRead, max( CategoryPermission.WritePermission ) AS CatMaxWrite ";
1411 $permissionSQL = "( ( $loggedInSQL ($groupSQL Permission.GroupID='-1' AND CategoryPermission.GroupID='-1' ) ) ) ";
1412 $group_str = "GROUP BY Article.ID";
1413 $having_str = "HAVING MaxRead='1' AND MaxWrite='1' AND CatMaxRead='1' AND CatMaxWrite='1' ";
1414 }
1415 else
1416 $permissionSQL = "( ( $loggedInSQL ($groupSQL Permission.GroupID='-1' AND CategoryPermission.GroupID='-1' ) AND Permission.ReadPermission='1' AND CategoryPermission.ReadPermission='1') ) ";
1417 }
1418 else
1419 $permissionSQL = "";
1420
1421 // fetch all articles
1422 if ( $fetchAll == true )
1423 {
1424 if ( $permissionSQL == "" )
1425 $publishedSQL = "";
1426 else
1427 $publishedSQL = " AND";
1428 }
1429
1430 // fetch only published articles
1431 else if ( $fetchPublished == true )
1432 {
1433 if ( $permissionSQL == "" )
1434 $publishedSQL = " Article.IsPublished = '1' AND ";
1435 else
1436 $publishedSQL = " AND Article.IsPublished = '1' AND ";
1437 }
1438
1439 // fetch only non-published articles
1440 else
1441 {
1442 if ( $permissionSQL == "" )
1443 $publishedSQL = " Article.IsPublished = '0' AND ";
1444 else
1445 $publishedSQL = " AND Article.IsPublished = '0' AND ";
1446 }
1447
1448 $query = "SELECT $sel_str
1449 FROM eZArticle_ArticleCategoryDefinition as Definition,
1450 eZArticle_Article as Article,
1451 eZArticle_ArticleCategoryLink as Link,
1452 eZArticle_CategoryPermission as CategoryPermission,
1453 eZArticle_ArticlePermission AS Permission
1454 WHERE
1455 $permissionSQL
1456 $publishedSQL
1457 Link.CategoryID='$this->ID'
1458 AND Permission.ObjectID=Article.ID
1459 AND Link.ArticleID=Article.ID
1460 AND Definition.ArticleID=Article.ID
1461 AND CategoryPermission.ObjectID=Definition.CategoryID
1462 $group_str
1463 $having_str
1464 ";
1465
1466 $db->array_query( $article_array, $query );
1467
1468 if ( $usePermission and $check_write )
1469 $cnt = count( $article_array );
1470 else
1471 $cnt = $article_array[0][$db->fieldName("Count")];
1472 return $cnt;
1473 }
1474
1475
1479 function moveUp( $id )
1480 {
1481 $db =& eZDB::globalDatabase();
1482
1483 $db->query_single( $qry, "SELECT * FROM eZArticle_ArticleCategoryLink
1484 WHERE ArticleID='$id' AND CategoryID='$this->ID'" );
1485
1486 if ( is_numeric( $qry[$db->fieldName("ID")] ) )
1487 {
1488 $linkID = $qry[$db->fieldName("ID")];
1489 $placement = $qry[$db->fieldName("Placement")];
1490
1491 $db->query_single( $qry, "SELECT ID, Placement FROM eZArticle_ArticleCategoryLink
1492 WHERE Placement<'$placement' AND eZArticle_ArticleCategoryLink.CategoryID='$this->ID'
1493 ORDER BY Placement DESC" );
1494
1495 $newPlacement = $qry[$db->fieldName("Placement")];
1496 $listid = $qry[$db->fieldName("ID")];
1497
1498 if ( $newPlacement == $placement )
1499 {
1500 $placement += 1;
1501 }
1502
1503 if ( is_numeric( $listid ) )
1504 {
1505 $db->query( "UPDATE eZArticle_ArticleCategoryLink SET Placement='$newPlacement' WHERE ID='$linkID'" );
1506 $db->query( "UPDATE eZArticle_ArticleCategoryLink SET Placement='$placement' WHERE ID='$listid'" );
1507 }
1508 }
1509 }
1510
1514 function moveDown( $id )
1515 {
1516 $db =& eZDB::globalDatabase();
1517
1518 $db->query_single( $qry, "SELECT * FROM eZArticle_ArticleCategoryLink
1519 WHERE ArticleID='$id' AND CategoryID='$this->ID'" );
1520
1521 if ( is_numeric( $qry[$db->fieldName("ID")] ) )
1522 {
1523 $linkID = $qry[$db->fieldName("ID")];
1524 $placement = $qry[$db->fieldName("Placement")];
1525 $db->query_single( $qry, "SELECT ID, Placement FROM eZArticle_ArticleCategoryLink
1526 WHERE Placement>'$placement' AND eZArticle_ArticleCategoryLink.CategoryID='$this->ID' ORDER BY Placement ASC" );
1527
1528 $newPlacement = $qry[$db->fieldName("Placement")];
1529 $listid = $qry[$db->fieldName("ID")];
1530
1531 if ( $newPlacement == $placement )
1532 {
1533 $newPlacement += 1;
1534 }
1535
1536 if ( is_numeric( $listid ) )
1537 {
1538 $db->query( "UPDATE eZArticle_ArticleCategoryLink SET Placement='$newPlacement' WHERE ID='$linkID'" );
1539 $db->query( "UPDATE eZArticle_ArticleCategoryLink SET Placement='$placement' WHERE ID='$listid'" );
1540 }
1541 }
1542 }
1543
1544
1548 function moveCategoryUp()
1549 {
1550 $db =& eZDB::globalDatabase();
1551
1552 $query = "SELECT ID, Placement FROM eZArticle_Category
1553 WHERE Placement<'$this->Placement' AND ParentID='$this->ParentID' ORDER BY Placement DESC";
1554
1555 $db->query_single( $qry, $query );
1556 if ( is_numeric( $qry[$db->fieldName("ID")] ) )
1557 {
1558 $swapCatPlacement = $qry[$db->fieldName("Placement")];
1559 $swapCatID = $qry[$db->fieldName("ID")];
1560
1561 if ( is_numeric( $swapCatPlacement ) )
1562 {
1563 $db->query( "UPDATE eZArticle_Category SET Placement='$swapCatPlacement' WHERE ID='$this->ID'" );
1564 $db->query( "UPDATE eZArticle_Category SET Placement='$this->Placement' WHERE ID='$swapCatID'" );
1565 }
1566 }
1567 else
1568 {
1569 $query = "SELECT ID, Placement FROM eZArticle_Category
1570 WHERE Placement>'$this->Placement' AND ParentID='$this->ParentID' ORDER BY Placement DESC";
1571
1572 $db->query_single( $qry, $query );
1573 if ( is_numeric( $qry[$db->fieldName("ID")] ) )
1574 {
1575 $swapCatPlacement = $qry[$db->fieldName("Placement")];
1576 $swapCatID = $qry[$db->fieldName("ID")];
1577
1578 if ( is_numeric( $swapCatPlacement ) )
1579 {
1580 $db->query( "UPDATE eZArticle_Category SET Placement=Placement-1 WHERE ParentID='$this->ParentID'" );
1581 $db->query( "UPDATE eZArticle_Category SET Placement='$swapCatPlacement' WHERE ID='$this->ID'" );
1582 }
1583 }
1584 }
1585 }
1586
1590 function moveCategoryDown( )
1591 {
1592 $db =& eZDB::globalDatabase();
1593 $query = "SELECT ID, Placement FROM eZArticle_Category
1594 WHERE Placement>'$this->Placement' AND ParentID='$this->ParentID' ORDER BY Placement ASC";
1595
1596 $db->query_single( $qry, $query );
1597 if ( is_numeric( $qry[$db->fieldName("ID")] ) )
1598 {
1599 $swapCatPlacement = $qry[$db->fieldName("Placement")];
1600 $swapCatID = $qry[$db->fieldName("ID")];
1601
1602 if ( is_numeric( $swapCatPlacement ) )
1603 {
1604 $db->query( "UPDATE eZArticle_Category SET Placement='$swapCatPlacement' WHERE ID='$this->ID'" );
1605 $db->query( "UPDATE eZArticle_Category SET Placement='$this->Placement' WHERE ID='$swapCatID'" );
1606 }
1607 }
1608 else
1609 {
1610 $query = "SELECT ID, Placement FROM eZArticle_Category
1611 WHERE Placement<'$this->Placement' AND ParentID='$this->ParentID' ORDER BY Placement ASC";
1612
1613 $db->query_single( $qry, $query );
1614 if ( is_numeric( $qry[$db->fieldName("ID")] ) )
1615 {
1616 $swapCatPlacement = $qry[$db->fieldName("Placement")];
1617 $swapCatID = $qry[$db->fieldName("ID")];
1618
1619 if ( is_numeric( $swapCatPlacement ) )
1620 {
1621 $db->query( "UPDATE eZArticle_Category SET Placement=Placement+1 WHERE ParentID='$this->ParentID'" );
1622 $db->query( "UPDATE eZArticle_Category SET Placement='$swapCatPlacement' WHERE ID='$this->ID'" );
1623 }
1624 }
1625 }
1626 }
1627
1631 function setBulkMailCategory( $value )
1632 {
1633 if ( is_a( $value, "eZBulkMailCategory" ) )
1634 $value = $value->id();
1635
1636 $db =& eZDB::globalDatabase();
1637 $db->query( "DELETE FROM eZArticle_BulkMailCategoryLink WHERE ArticleCategoryID='$this->ID'" );
1638
1639 if ( $value != false )
1640 $db->query( "INSERT INTO eZArticle_BulkMailCategoryLink SET ArticleCategoryID='$this->ID', BulkMailCategoryID='$value'" );
1641 }
1642
1646 function bulkMailCategory( $asObject = true )
1647 {
1648 $db =& eZDB::globalDatabase();
1649 $result_array = array();
1650 $result = false;
1651 $db->array_query( $result_array, "SELECT BulkMailCategoryID FROM eZArticle_BulkMailCategoryLink WHERE ArticleCategoryID='$this->ID'" );
1652
1653 if ( count( $result_array ) > 0 )
1654 $result = ( $asObject == true ) ? new eZBulkMailCategory( $result_array[0][$db->fieldName("BulkMailCategoryID")] ) : $result_array[0][$db->fieldName("BulkMailCategoryID")];
1655
1656 return $result;
1657 }
1658
1659 var $ID;
1660 var $Name;
1661 var $ListLimit;
1662 var $ParentID;
1663 var $Description;
1664 var $ExcludeFromSearch;
1665 var $SortMode;
1666 var $OwnerID;
1667 var $Placement;
1668 var $SectionID;
1669 var $ImageID;
1670 var $EditorGroupID;
1671 }
1672
1673 ?>
$category
if( $Action=="Edit") $category
Definition: adedit.php:378
$i
$i
Definition: admin/adlist.php:91
$categoryList
foreach( $pathArray as $path) $categoryList
Definition: admin/adlist.php:86
$topic
foreach( $authorArray as $author) $topic
Definition: admin/articleedit.php:852
$group
$group
Definition: admin/articleedit.php:799
$author
$author
Definition: admin/articleedit.php:834
$level
$level
Definition: admin/message.php:106
$article
$article
Definition: articlelog.php:45
eZArticleCategory
Definition: ezarticlecategory.php:45
eZArticleCategory\$ParentID
$ParentID
Definition: ezarticlecategory.php:1662
eZArticleCategory\setDescription
setDescription( $value)
Definition: ezarticlecategory.php:963
eZArticleCategory\$ImageID
$ImageID
Definition: ezarticlecategory.php:1669
eZArticleCategory\copyTree
copyTree( $parentID, $parentCategory)
Definition: ezarticlecategory.php:622
eZArticleCategory\$SortMode
$SortMode
Definition: ezarticlecategory.php:1665
eZArticleCategory\excludeFromSearch
excludeFromSearch()
Definition: ezarticlecategory.php:904
eZArticleCategory\setSectionID
setSectionID( $value)
Definition: ezarticlecategory.php:944
eZArticleCategory\addArticle
static addArticle( $value, $categoryid=false)
Definition: ezarticlecategory.php:1079
eZArticleCategory\parent
parent( $as_object=true)
Definition: ezarticlecategory.php:770
eZArticleCategory\moveUp
moveUp( $id)
Definition: ezarticlecategory.php:1479
eZArticleCategory\setPlacement
setPlacement( $value)
Definition: ezarticlecategory.php:936
eZArticleCategory\image
& image( $AsObject=true)
Definition: ezarticlecategory.php:683
eZArticleCategory\setImage
setImage( $value)
Definition: ezarticlecategory.php:952
eZArticleCategory\editorGroup
editorGroup( $as_object=true)
Definition: ezarticlecategory.php:787
eZArticleCategory\owner
owner( $as_object=true)
Definition: ezarticlecategory.php:804
eZArticleCategory\articles
& articles( $sortMode="time", $fetchAll=true, $fetchPublished=true, $offset=0, $limit=50, $categoryID=0, $check_write=false)
Definition: ezarticlecategory.php:1167
eZArticleCategory\delete
delete( $catID=-1)
Definition: ezarticlecategory.php:138
eZArticleCategory\$Name
$Name
Definition: ezarticlecategory.php:1660
eZArticleCategory\getAll
getAll()
Definition: ezarticlecategory.php:233
eZArticleCategory\moveCategoryDown
moveCategoryDown()
Definition: ezarticlecategory.php:1590
eZArticleCategory\path
path( $categoryID=0)
Definition: ezarticlecategory.php:564
eZArticleCategory\sectionID
sectionID()
Definition: ezarticlecategory.php:696
eZArticleCategory\$ID
$ID
Definition: ezarticlecategory.php:1659
eZArticleCategory\isOwner
isOwner( $user, $categoryID)
Definition: ezarticlecategory.php:825
eZArticleCategory\description
description( $asHTML=true)
Definition: ezarticlecategory.php:728
eZArticleCategory\getByName
& getByName( $name)
Definition: ezarticlecategory.php:255
eZArticleCategory\setBulkMailCategory
setBulkMailCategory( $value)
Definition: ezarticlecategory.php:1631
eZArticleCategory\removeArticle
static removeArticle( $value, $categoryid=false)
Definition: ezarticlecategory.php:1052
eZArticleCategory\sectionIDStatic
static sectionIDStatic($categoryID)
Definition: ezarticlecategory.php:662
eZArticleCategory\setParent
setParent( $value)
Definition: ezarticlecategory.php:971
eZArticleCategory\placement
placement()
Definition: ezarticlecategory.php:757
eZArticleCategory\name
name( $asHTML=true)
Definition: ezarticlecategory.php:712
eZArticleCategory\fill
fill( $category_array)
Definition: ezarticlecategory.php:211
eZArticleCategory\listLimit
listLimit()
Definition: ezarticlecategory.php:744
eZArticleCategory\sortMode
sortMode( $return_id=false)
Definition: ezarticlecategory.php:853
eZArticleCategory\$EditorGroupID
$EditorGroupID
Definition: ezarticlecategory.php:1670
eZArticleCategory\getTree
getTree( $parentID=0, $level=0)
Definition: ezarticlecategory.php:596
eZArticleCategory\$Placement
$Placement
Definition: ezarticlecategory.php:1667
eZArticleCategory\moveCategoryUp
moveCategoryUp()
Definition: ezarticlecategory.php:1548
eZArticleCategory\bulkMailCategory
bulkMailCategory( $asObject=true)
Definition: ezarticlecategory.php:1646
eZArticleCategory\getByParent
getByParent( $parent, $showAll=false, $sortby='placement', $offset=0, $max=-1, $user=false, $check_write=false)
Definition: ezarticlecategory.php:373
eZArticleCategory\$Description
$Description
Definition: ezarticlecategory.php:1663
eZArticleCategory\id
id()
Definition: ezarticlecategory.php:704
eZArticleCategory\countByParent
countByParent( $parent, $showAll=false, $user=false, $check_write=false)
Definition: ezarticlecategory.php:476
eZArticleCategory\articleCount
articleCount( $fetchAll=true, $fetchPublished=true, $check_write=false)
Definition: ezarticlecategory.php:1371
eZArticleCategory\$SectionID
$SectionID
Definition: ezarticlecategory.php:1668
eZArticleCategory\__construct
__construct( $id=-1)
Definition: ezarticlecategory.php:52
eZArticleCategory\setName
setName( $value)
Definition: ezarticlecategory.php:920
eZArticleCategory\setOwner
setOwner( $value)
Definition: ezarticlecategory.php:1005
eZArticleCategory\$ExcludeFromSearch
$ExcludeFromSearch
Definition: ezarticlecategory.php:1664
eZArticleCategory\setSortMode
setSortMode( $value)
Definition: ezarticlecategory.php:1026
eZArticleCategory\moveDown
moveDown( $id)
Definition: ezarticlecategory.php:1514
eZArticleCategory\setExcludeFromSearch
setExcludeFromSearch( $value)
Definition: ezarticlecategory.php:1035
eZArticleCategory\search
& search( $name, $showAll=false, $sortby='placement', $user=false)
Definition: ezarticlecategory.php:282
eZArticleCategory\store
store()
Definition: ezarticlecategory.php:74
eZArticleCategory\$OwnerID
$OwnerID
Definition: ezarticlecategory.php:1666
eZArticleCategory\setListLimit
setListLimit( $value)
Definition: ezarticlecategory.php:928
eZArticleCategory\setEditorGroup
setEditorGroup( $value)
Definition: ezarticlecategory.php:988
eZArticleCategory\$ListLimit
$ListLimit
Definition: ezarticlecategory.php:1661
eZArticleCategory\userHasPermision
userHasPermision( $categoryID=-1, $read=true, $write=true, $user=false)
Definition: ezarticlecategory.php:1130
eZArticle
Definition: ezarticle.php:82
eZDB\globalDatabase
static & globalDatabase()
Definition: ezdb.php:134
eZImage
Definition: ezimage.php:95
eZObjectPermission\hasPermission
static hasPermission( $objectID, $moduleTable, $permission, $user=false)
Definition: ezobjectpermission.php:76
eZObjectPermission\setPermission
static setPermission( $group, $objectID, $moduleTable, $permission)
Definition: ezobjectpermission.php:236
eZTextTool\fixhtmlentities
static fixhtmlentities( $string)
Definition: eztexttool.php:156
eZUserGroup
Definition: ezusergroup.php:66
eZUser
Definition: ezuser.php:76
eZUser\currentUser
static & currentUser()
Definition: ezuser.php:896
$result
$result
Definition: companysearch.php:94
$name
$name
Definition: companytypelist.php:194
$id
$id
Definition: companytypelist.php:193
$query
if(isset( $Year) &&!is_numeric( $Year)||isset( $Month) &&!is_numeric( $Month)) $query
Definition: entryexitpages.php:65
$search
$search
Definition: export_froogle.php:153
$tree
$tree
Definition: ezad/admin/categoryedit.php:172
$db
$db
Definition: ezarticle/user/authorlist.php:53
$groups
if( $CategoryID !=0) $groups
Definition: ezbulkmail/admin/categoryedit.php:108
$limit
$limit
Definition: ezimagecatalogue/admin/imagelist.php:312
$ret
$ret
Definition: ezsitemanager/admin/filelist.php:88
$res
$res
Definition: ezstats/admin/cron.php:45
$offset
$offset
Definition: ezstats/admin/cron.php:51
$categoryID
else $categoryID
Definition: productview.php:66
$OrderBy
$OrderBy
Definition: reciverpopup.php:21
Name
if($user) if(isset( $next) && $next)<?=isset($all_fields_error) &&$all_fields_error ?><?=isset($password_error) &&$password_error ?></p ><? endif;?>< form method="post">< table border="0" cellspacing="2" cellpadding="2" class="boxtext" style="font-size=13;">< tr >< td style="color:<?= isset( $error['first_name'] ) ?> First Name
Definition: step1.php:127
$category_array
$category_array
Definition: todoedit.php:604
$currentUserID
$currentUserID
Definition: todolist.php:128
$user
$user
Definition: user/adlist.php:39
$articleID
if( $Action=="New") $articleID
Definition: user/articleedit.php:269
$image
$image
Definition: user/articlelist.php:242
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.