Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

unacceptededit.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: unacceptededit.php 6220 2001-07-20 11:15:21Z jakobn $
5 //
6 // Created on: <21-Jan-2001 13:34:48 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( "ezlink/classes/ezlink.php" );
29 // include_once( "ezlink/classes/ezlinkcategory.php" );
30
31 require( "kernel/ezuser/admin/admincheck.php" );
32
33 for( $i = 0; $i < isset( $LinkArrayID ) ? count( $LinkArrayID ) : 0; $i++ )
34 {
35 unset( $link );
36 $link = new eZLink( $LinkArrayID[$i] );
37 $link->setName( $Name[$i] );
38 $link->setCategoryDefinition( $LinkCategoryID[$i] );
39
40 // Calculate new and unused categories
41 $old_maincategory = $link->categoryDefinition();
42 $old_categories =& array_unique( array_merge( array( $old_maincategory->id() ),
43 $link->categories( false ) ) );
44
45 $new_categories =& array_unique( array_merge( array( $LinkCategoryID[$i] ), array( $CategoryArray[$i] ) ) );
46 $remove_categories = array_diff( $old_categories, $new_categories );
47 $add_categories = array_diff( $new_categories, $old_categories );
48
49 foreach ( $remove_categories as $category )
50 {
51 eZLinkCategory::removeLink( $link, $category );
52 }
53 foreach ( $add_categories as $category )
54 {
55 eZLinkCategory::addLink( $link, $category );
56 }
57
58 $link->setUrl( $Url[$i] );
59 $link->setKeyWords( $Keywords[$i] );
60 $link->setDescription( $Description[$i] );
61 $link->setAccepted( false );
62
63 if ( $ActionValueArray[$i] == "Defer" )
64 {
65 }
66 else if ( $ActionValueArray[$i] == "Accept" )
67 {
68 $link->setAccepted( true );
69 $link->update();
70 }
71 else if ( $ActionValueArray[$i] == "Delete" )
72 {
73 $link->delete();
74 }
75 else if ( $ActionValueArray[$i] == "Update" )
76 {
77 $link->update();
78 }
79 }
80
81 eZHTTPTool::header( "Location: /link/unacceptedlist/" );
82 exit();
83
84 ?>
$category
if( $Action=="Edit") $category
Definition: adedit.php:378
$i
$i
Definition: admin/adlist.php:91
$Description
$Description
Definition: articlelistrss.php:38
eZHTTPTool\header
static header( $string)
Definition: ezhttptool.php:96
eZLinkCategory\addLink
static addLink( $value, $categoryid=false)
Definition: ezlinkcategory.php:139
eZLinkCategory\removeLink
static removeLink( $value, $categoryid=false)
Definition: ezlinkcategory.php:117
eZLink
Definition: ezlink.php:65
$link
$link
Definition: ezlink/admin/attributeedit.php:49
exit
exit
Definition: folder.php:81
$Name
$Name
Definition: polledit.php:250
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.