Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

ezimagemap.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: ezimagemap.php 9410 2002-04-10 12:04:04Z jhe $
5 //
6 // Created on: <12-Jun-2001 17:41:10 jhe>
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
29
33 // include_once( "classes/ezdb.php" );
34 // include_once( "ezimagecatalogue/classes/ezimage.php" );
35
36 class eZImageMap
37 {
38 function __construct( $image )
39 {
40 $this->Elements = array();
41 $this->get( $image );
42 }
43
44 function get( $id )
45 {
46 $db =& eZDB::globalDatabase();
47 $this->ID = $id;
48 $db->array_query( $article_array, "SELECT Link, AltText, Shape, StartPosX, StartPosY, EndPosX, EndPosY FROM eZImageCatalogue_ImageMap WHERE ImageID='$this->ID'" );
49
50 for ( $i = 0; $i < count( $article_array ); $i++ )
51 {
52 $this->Elements[$i] = $article_array[$i][0] . "|" . $article_array[$i][1] . "|" . $article_array[$i][2] . "|" . $article_array[$i][3] . "|" . $article_array[$i][4] . "|" . $article_array[$i][5] . "|" . $article_array[$i][6];
53 }
54 }
55
56 function elements()
57 {
58 return $this->Elements;
59 }
60
61 function store( $elements )
62 {
63 $db =& eZDB::globalDatabase();
64 $db->begin();
65 $res = array();
66 $res[] = $db->query( "DELETE FROM eZImageCatalogue_ImageMap WHERE ImageID='$this->ID'" );
67
68 $list = array();
69 $element_list = array();
70 $element_list = split( "\n", $elements );
71 $db->lock( "eZImageCatalogue_ImageMap" );
72
73 for ( $i = 0; $i < count( $element_list ); $i++ )
74 {
75 if ( $element_list[$i] != "" )
76 {
77 if ( $list[4] > $list[6] )
78 {
79 $temp = $list[6];
80 $list[6] = $list[4];
81 $list[4] = $list[6];
82 }
83 if ( $list[3] > $list[5] )
84 {
85 $temp = $list[5];
86 $list[5] = $list[3];
87 $list[3] = $list[5];
88 }
89 $list = split( "\|", $element_list[$i] );
90 $id = $db->nextID( "eZImageCatalogue_ImageMap", "ID" );
91 $res[] = $db->query( "INSERT INTO eZImageCatalogue_ImageMap
92 (ID,
93 ImageID,
94 Link,
95 AltText,
96 Shape,
97 StartPosX,
98 StartPosY,
99 EndPosX,
100 EndPosY) VALUES
101 ('$id',
102 '$this->ID',
103 '$list[0]',
104 '$list[1]',
105 '$list[2]',
106 '$list[3]',
107 '$list[4]',
108 '$list[5]',
109 '$list[6]')" );
110 }
111 }
112 $db->unlock();
113 if ( in_array( false, $res ) )
114 $db->rollback();
115 else
116 $db->commit();
117 }
118
119 var $Elements;
120 }
121
122 ?>
$i
$i
Definition: admin/adlist.php:91
eZDB\globalDatabase
static & globalDatabase()
Definition: ezdb.php:134
eZImageMap
Definition: ezimagemap.php:37
eZImageMap\$Elements
$Elements
Definition: ezimagemap.php:119
eZImageMap\store
store( $elements)
Definition: ezimagemap.php:61
eZImageMap\__construct
__construct( $image)
Definition: ezimagemap.php:38
eZImageMap\elements
elements()
Definition: ezimagemap.php:56
$id
$id
Definition: companytypelist.php:193
$db
$db
Definition: ezarticle/user/authorlist.php:53
$res
$res
Definition: ezstats/admin/cron.php:45
$elements
$elements
Definition: formedit.php:355
$image
$image
Definition: user/articlelist.php:242
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.