-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathexifmgr.php
135 lines (98 loc) · 4.08 KB
/
exifmgr.php
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
<?php
/*************************
Coppermine Photo Gallery
************************
Copyright (c) 2003-2016 Coppermine Dev Team
v1.0 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.6.03
$HeadURL$
**********************************************/
define('IN_COPPERMINE', true);
define('DISPLAYIMAGE_PHP', true);
require('include/init.inc.php');
require('include/picmgmt.inc.php');
if (!GALLERY_ADMIN_MODE) {
cpg_die(ERROR, $lang_errors['access_denied'], __FILE__, __LINE__);
}
// Initialize some variables
$icon_array = array(
'ok' => cpg_fetch_icon('ok', 0),
);
$output_message = '';
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);
// The form has been submit --- start
if ($superCage->post->keyExists('save')) {
$str = "";
$exif_tags = $superCage->post->getEscaped('exif_tags');
foreach ($exifRawData as $val) {
if (in_array($val, $exif_tags)) {
$str .= "1|";
} else {
$str .= "0|";
}
}
//Remove the last pipe from the string.
$selectedExifTags = trim($str, '|');
cpg_config_set('show_which_exif', $selectedExifTags);
$output_message = $lang_picinfo['success'];
}
// The form has been submit --- end
$exifCurrentData = explode("|", $CONFIG['show_which_exif']);
// Main code starts here
echo <<< EOT
<form method="post" action="" name="editForm" id="cpgform">
<input type="hidden" name="save" value="save" />
EOT;
$exif_help = ' ' . cpg_display_help('f=exif.htm&as=exif&ae=exif_end', '640', '450');
starttable('100%', cpg_fetch_icon('exif_mgr', 2) . $lang_picinfo['ManageExifDisplay'] . $exif_help, 2);
echo <<< EOT
<tr>
<td class="tableh2">
<span class="cpg_user_message">{$output_message}</span>
</td>
<td class="tableh2" align="center">
<input type="checkbox" name="checkAll" onclick="selectAll('cpgform');" class="checkbox" title="{$lang_common['check_uncheck_all']}" />
</td>
</tr>
EOT;
$loopCounter = 0;
foreach ($exifRawData as $key => $val) {
$checked = $exifCurrentData[$key] == 1 ? 'checked="checked"' : '';
if (($loopCounter / 2) == floor($loopCounter / 2)) {
$style = 'tableb';
} else {
$style = 'tableb tableb_alternate';
}
$loopCounter++;
echo <<< EOT
<tr>
<td class="$style">{$lang_picinfo[$val]}</td>
<td class="$style" align="center">
<input type="checkbox" name="exif_tags[]" value="$val" $checked class="checkbox" />
</td>
</tr>
EOT;
}
echo <<< EOT
<tr>
<td class="tablef" align="center">
<button type="submit" class="button" name="submit" id="submit" value="{$lang_common['apply_changes']}">{$icon_array['ok']}{$lang_common['apply_changes']}</button>
</td>
<td class="tablef" align="center">
<input type="checkbox" name="checkAll2" onclick="selectAll('cpgform');" class="checkbox" title="{$lang_common['check_uncheck_all']}" />
</td>
</tr>
EOT;
endtable();
echo <<< EOT
</form>
EOT;
pagefooter();
//EOF