File: define_annotated_photo.php

package info (click to toggle)
zoph 0.6-2.1etch1
  • links: PTS
  • area: main
  • in suites: etch
  • size: 1,716 kB
  • ctags: 2,283
  • sloc: php: 8,560; perl: 1,601; sh: 760; sql: 382; python: 338; makefile: 71
file content (257 lines) | stat: -rw-r--r-- 9,318 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
<?php
/*
 * This file is part of Zoph.
 *
 * Zoph is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 * 
 * Zoph is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * You should have received a copy of the GNU General Public License
 * along with Zoph; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */

  /* **************************************************************************
   * define_annotated_photo.php
   * Creates a form showing all populated fields in tne photos record.
   * Field values are displayed as text boxes so user can edit if desired.
   * Checkboxes determine if field is included, and are of the form field_cb
   *   for easier parsing.
   *
   * Copyright 2003 Nixon P. Childs
   * **************************************************************************/

    require_once("include.inc.php");

    if (!ANNOTATE_PHOTOS) {
        header("Location: " . add_sid("zoph.php"));
    }

    $title = translate("Annotate Photo");
    require_once("header.inc.php");
    $photo_id = getvar("photo_id");
    $photo = new photo($photo_id);
    $found = $photo->lookup($user);
?>
          <h1><?php echo strtolower($title) ?></h1>
      <div class="main">
        <form action="mail.php" method="POST">
<?php
    if (!$found) {
?>
            <?php echo sprintf(translate("Could not find photo id %s."), $photo_id); ?>
<?php
    }
    else {
?>
            <input type="hidden" name="_action" value="compose">
            <input type="hidden" name="annotate" value="1">
            <input type="hidden" name="photo_id" value="<?php echo $photo->get("photo_id") ?>">
            <img src="<?php echo $photo->get_image_href("mid")?>" class="mid" ALT="<?php $photo->get("title") ?>">
          <br>
          <label for="size"><?php echo translate("send fullsize") ?></label>
          <?php echo create_pulldown("_size", "mid", array("full" => translate("Yes",0), "mid" => translate("No",0)) ) ?><br>
          <input type="checkbox" name="photo_title_cb">
          <label for="photo_title"><?php echo translate("title") ?></label>
<?php echo create_text_input("photo_title", $photo->get("title"), 35, 50) ?><br>
<?php
        $location = "";
        $place_id = $photo->get("location_id");
        if($place_id) {
           $place = new place($place_id);
           $place->lookup();
           $location = $place->get("title") ? $place->get("title") : $place->get("city");
        }
?>
          <input type="checkbox" name="location_cb">
          <label for="location"><?php echo translate("location") ?></label>
          <?php echo create_text_input("location", $location, 35, 50) ?><br>
<?php
        //}
        if($photo->get("date")) {
?>
          <input type="checkbox" name="date_cb">
          <label for="date"><?php echo translate("date") ?></label>
          <?php echo create_text_input("date", $photo->get("date"), 35, 50) ?><br>
<?php
        }
        if($photo->get("time")) {
?>
          <input type="checkbox" name="time_cb">
          <label for="time"><?php echo translate("time") ?></label>
          <?php echo create_text_input("time", $photo->get("time"), 35, 50) ?><br>
<?php
        }
        //if($photo->get("view")) {
?>
          <input type="checkbox" name="view_cb">
          <label for="view"><?php echo translate("view") ?></label>
          <?php echo create_text_input("view", $photo->get("view"), 35, 50) ?><br>
<?php
        //}
        $photographer = "";
        $p_id = $photo->get("photographer_id");
        if($p_id) {
            $person = new person($p_id);
            $person->lookup();
            $photographer = $person->get_name();
        }
?>
          <input type="checkbox" name="photographer_cb">
          <label for="photographer"><?php echo translate("photographer") ?></label>
          <?php echo create_text_input("photographer", $photographer, 15, 28) ?><br>
<?php
        //}
        //if($photo->get("description")) {
?>
          <input type="checkbox" name="description_cb">
          <label for="description"><?php echo translate("description") ?></label>
          <textarea name="description" rows="2" cols="35"><?php echo $photo->get("description") ?></textarea><br>
<?php
        //}
        $people_string = "";
        $people = $photo->lookup_people();
        if ($people) {
            $count = 0;
            foreach ($people as $person) {
               if ($count > 0) { $people_string .= ", "; }
               $count++;
               $people_string .= $person->get_name();
            }
        }
?>
          <input type="checkbox" name="people_cb">
          <label for="people"><?php echo translate("people") ?></label>
          <textarea name="people" rows="2" cols="35"><?php echo $people_string ?></textarea><br>
<?php
        //}
        if($photo->get("camera_make")) {
?>
        
          <input type="checkbox" name="camera_make_cb">
          <label for="camera_make"><?php echo translate("camera make") ?></label>
          <?php echo create_text_input("camera_make", $photo->get("camera_make"), 35, 50) ?>
        <br>
<?php
        }
        if($photo->get("camera_model")) {
?>
        
          <input type="checkbox" name="camera_model_cb">
          <label for="camera_model"><?php echo translate("camera model") ?></label>
          <?php echo create_text_input("camera_model", $photo->get("camera_model"), 35, 50) ?>
        <br>
<?php
        }
        if($photo->get("flash_used")) {
?>
        
          <input type="checkbox" name="flash_used_cb">
          <label for="flash_used"><?php echo translate("flash used") ?></label>
          <?php echo create_text_input("flash_used", $photo->get("flash_used"), 35, 50) ?>
        <br>
<?php
        }
        if($photo->get("focal_length")) {
?>
        
          <input type="checkbox" name="focal_length_cb">
          <label for="focal_length"><?php echo translate("focal length") ?></label>
          <?php echo create_text_input("focal_length", $photo->get("focal_length"), 35, 50) ?>
        <br>
<?php
        }
        if($photo->get("exposure")) {
?>
        
          <input type="checkbox" name="exposure_cb">
          <label for="exposure"><?php echo translate("exposure") ?></label>
          <?php echo create_text_input("exposure", $photo->get("exposure"), 35, 50) ?>
        <br>
<?php
        }
        if($photo->get("aperature")) {
?>
        
          <input type="checkbox" name="aperture_cb">
          <label for="aperture"><?php echo translate("aperture") ?></label>
          <?php echo create_text_input("aperture", $photo->get("aperture"), 35, 50) ?>
        <br>
<?php
        }
        if($photo->get("compression")) {
?>
        
          <input type="checkbox" name="compression_cb">
          <label for="compression"><?php echo translate("compression") ?></label>
          <?php echo create_text_input("compression", $photo->get("compression"), 35, 50) ?>
        <br>
<?php
        }
        if($photo->get("iso_equiv")) {
?>
        
          <input type="checkbox" name="iso_equiv_cb">
          <label for="iso_equiv"><?php echo translate("iso equiv") ?></label>
          <?php echo create_text_input("iso_equiv", $photo->get("iso_equiv"), 35, 50) ?>
        <br>
<?php
        }
        if($photo->get("metering_mode")) {
?>
        
          <input type="checkbox" name="metering mode_cb">
          <label for="metering_mode"><?php echo translate("metering mode") ?></label>
          <?php echo create_text_input("metering_mode", $photo->get("metering_mode"), 35, 50) ?>
        <br>
<?php
        }
        if($photo->get("focus_dist")) {
?>
        
          <input type="checkbox" name="focus_dist_cb">
          <label for="focus_dist"><?php echo translate("focus distance") ?></label>
          <?php echo create_text_input("focus_dist", $photo->get("focus_dist"), 35, 50) ?>
        <br>
<?php
        }
        if($photo->get("ccd_width")) {
?>
        
          <input type="checkbox" name="ccd_width_cb">
          <label for="ccd_width"><?php echo translate("ccd width") ?></label>
          <?php echo create_text_input("ccd_width", $photo->get("ccd_width"), 35, 50) ?>
        <br>
<?php
        }
        if($photo->get("comment")) {
?>
        
          <input type="checkbox" name="comment_cb">
          <label for="comment"><?php echo translate("comment") ?></label>
          <?php echo create_text_input("comment", $photo->get("comment"), 35, 50) ?>
        <br>
<?php
        }
?>
        
          <input type="checkbox" name="extra_cb">
          <label><?php echo create_text_input("extra_name", "", 15, 50) ?></label>
          <?php echo create_text_input("extra", "", 35, 50) ?>
        <br>
       
            <input class="bigbutton" type="submit" value="<?php echo translate("Annotate Photo") ?>">
          
<?php
    } // if found
?>
        </form>
    
  <br>
</div>
<?php require_once("footer.inc.php"); ?>