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
|
<?php /************************* Coppermine Photo Gallery ************************ Copyright (c) 2003-2008 Dev Team v1.1 originally written by Gregory DEMAR
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 3 as published by the Free Software Foundation. ******************************************** Coppermine version: 1.4.19 $HeadURL: https://coppermine.svn.sourceforge.net/svnroot/coppermine/trunk/cpg1.4.x/exifmgr.php $ $Revision: 4392 $ $Author: gaugau $ $Date: 2008-04-16 09:25:35 +0200 (Mi, 16 Apr 2008) $ **********************************************/
define('IN_COPPERMINE', true); define('DISPLAYIMAGE_PHP', true); require('include/init.inc.php'); require('include/picmgmt.inc.php');
if (!GALLERY_ADMIN_MODE) die('Access denied'); pageheader($lang_picinfo['ManageExifDisplay']);
//String containing all the available exif tags. $exif_info = "AFFocusPosition|Adapter|ColorMode|ColorSpace|ComponentsConfiguration|CompressedBitsPerPixel|Contrast|CustomerRender|DateTimeOriginal|DateTimedigitized|DigitalZoom|DigitalZoomRatio|ExifImageHeight|ExifImageWidth|ExifInteroperabilityOffset|ExifOffset|ExifVersion|ExposureBiasValue|ExposureMode|ExposureProgram|ExposureTime|FNumber|FileSource|Flash|FlashPixVersion|FlashSetting|FocalLength|FocusMode|GainControl|IFD1Offset|ISOSelection|ISOSetting|ISOSpeedRatings|ImageAdjustment|ImageDescription|ImageSharpening|LightSource|Make|ManualFocusDistance|MaxApertureValue|MeteringMode|Model|NoiseReduction|Orientation|Quality|ResolutionUnit|Saturation|SceneCaptureMode|SceneType|Sharpness|Software|WhiteBalance|YCbCrPositioning|xResolution|yResolution";
$exifRawData = explode ("|",$exif_info); $exifCurrentData = explode ("|",$CONFIG['show_which_exif']);
//If the form is submitted to save the data if (isset($_POST['save'])) { $str = ""; foreach ($exifRawData as $val) { if (in_array($val, $_POST['exif_tags'])) { $str .= "1|"; } else { $str .= "0|"; } }
//Remove the last pipe from the string. $selectedExifTags = substr ($str,0,strlen($str)-1); $selectedExifTags = $str; $sql = "UPDATE ".$CONFIG['TABLE_CONFIG']." SET value = '".$selectedExifTags."' WHERE name = 'show_which_exif'"; cpg_db_query($sql); msg_box($lang_picinfo['ManageExifDisplay'], $lang_picinfo['success'], $lang_continue, "admin.php"); } else { echo <<< EOT <form method="POST" action="" name="editForm"> <input type="hidden" name="save" value="save" />
<script type="text/javascript" language="javascript"> <!-- function selectAll(d,box) { var f = document.editForm; for (i = 0; i < f.length; i++) { //alert (f[i].name.indexOf(box)); if (f[i].type == "checkbox" && f[i].name.indexOf(box) >= 0) { if (d.checked) { f[i].checked = true; } else { f[i].checked = false; } } } if (d.name == "checkAll") { document.getElementsByName('checkAll2')[0].checked = document.getElementsByName('checkAll')[0].checked; } else { document.getElementsByName('checkAll')[0].checked = document.getElementsByName('checkAll2')[0].checked; } }
--> </script> EOT; starttable(-2,$lang_picinfo['ManageExifDisplay'], 2); echo '<tr><td class="tableh2"> </td><td class="tableh2" align="center">'; echo '<input type="checkbox" name="checkAll" onClick="selectAll(this,\'exif_tags\');" class="checkbox" title="'.$lang_check_uncheck_all.'" />'; echo '</td></tr>'; foreach ($exifRawData as $key => $val) { $checked = $exifCurrentData[$key] == 1 ? 'checked' : ''; echo '<tr><td class="tableb">'.$lang_picinfo[$val].'</td><td class="tableb" align="center"><input type="checkbox" name="exif_tags[]" value="'.$val.'" ' . $checked . ' class="checkbox" /></td></tr>'; } echo '<tr> <td class="tablef" align="center"><input type="submit" class="button" name="submit" value="'.$lang_picinfo['submit'].'" />'; echo '<td class="tablef" align="center">'; echo '<input type="checkbox" name="checkAll2" onClick="selectAll(this,\'exif_tags\');" class="checkbox" title="'.$lang_check_uncheck_all.'" />'; echo ' </td></tr>'; endtable(); echo <<< EOT </form> EOT; } ob_end_flush(); pagefooter(); ?>
|