Location: PHPKode > projects > Yappa-ng > yappa-ng/admin_modules/admin_module_images.inc.php
<?php

/*
 * ***********************************************************************************************
 * Filename:     admin_module_main.inc.php
 * Module:       Admin-Module
 * Subcategory:  General Album Settings
 * Description:  Sets and changes the album behavior
 * ***********************************************************************************************
 *
 *
 * Project:     yappa-ng : yet another php photo album - next generation
 * Author:      Fritz Berger <hide@address.com>
 * Copyright:   2003 Fritz Berger
 * $Header: /cvsroot/yappa-ng/yappa-ng/admin_modules/admin_module_images.inc.php,v 1.11 2005/04/25 18:02:06 zirkon13 Exp $
 *
 * This program 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.
 *
 * This program 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 this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 * You may contact the author of yappa-ng by e-mail at:
 *    hide@address.com
 *
 * The latest version of yappa-ng can be obtained from:
 *    http://www.zirkon.at/zirkon/scripts/yappa-ng/yappa-ng_main_ger.html (german)
 *    http://www.zirkon.at/zirkon/scripts/yappa-ng/yappa-ng_main_eng.html (english)
 *
 * ***********************************************************************************************
 * ***********************************************************************************************
 * ***                                                                                         ***
 * ***   yappa-ng is based on "YAPPA v1.7 devel - 22.April 2002"                               ***
 * ***                         released on http://sourceforge.net/projects/yappa/              ***
 * ***   YAPPA is Copyright Federico 'pix' Feroldi (hide@address.com)                           ***
 * ***   YAPPA is released under the GNU GPL                                                   ***
 * ***                                                                                         ***
 * ***********************************************************************************************
 * ***********************************************************************************************
 */


?>
<?php

/*
 * Standard Security Check
 */

if (!defined('SecCheck')) {
	die("You Cannot Access This Script Directly - Have a Nice Day.");
}



function HandleForm () {
	global $config_album;
	global $config;
	global $selected_album;

	$admin_form = $_POST['admin_form'];
	
	$config_album["navbar_pos"] = $admin_form["navbar_pos"];
	$config_album['image_info_top'] = $admin_form['image_info_top'];
	$config_album['preview_icons'] = $admin_form['preview_icons'];
	$config_album['preview_firstlast'] = $admin_form['preview_firstlast'];
	$config_album['image_anchor'] = $admin_form['image_anchor'];
	if($admin_form["show_exif"] == "yes") {
		$config_album['show_exif'] = TRUE;
	} else {
		$config_album['show_exif'] = FALSE;
	}

	$configfilename = singleslash($config["photo_root"] . "/" . rawurldecode($_GET["album"]));

	/* write the album-config to the harddisk */
	$l_value = write_albumconf($configfilename, $config_album);
	return $l_value;


}

/* read the config_album.inc.php new!
 * in some setups the settings will get automatically changed.
 * For instance:
 *   if the hits.log for this album is not read/writeable:
 *    - the hitcounter will get switched off
 *    - the TopX will get switched off
 *    - ....some more
 * HERE you want to see your REAL settings!!
 * Thats why you have to read the albumconfig new before editing it!! */
$config_filename = singleslash($config["photo_root"] . "/" . rawurldecode($_GET["album"]));

$config_album = read_albumconf($config_filename);

/* if this form has been submitted than react and set everything! */
if(isset($_POST['BeenSubmitted'])) {
	$answer = HandleForm();
}
?>

<form action="<?php print $global_var['self_url']; ?>" method="post">
<table cellspacing="0" cellpadding="5" border="0" width="100%">
<tr valign="top">
<td class="thumbnailCell">
<table width="100%" border="0" cellspacing="0" cellpadding="3">
	<tr><td colspan=6 align="center" class="adminHeading"><?php print $lang_akt["admin_main_himage_a"]; ?></td></tr>
	<tr><td colspan="6">&nbsp;</td></tr>

	<tr><td colspan="6" align="center" class="adminStatus">
	<?php if(isset($_POST['BeenSubmitted'])) {
		switch($answer) {
			case 1:
				print $lang_akt["admin_main_status1"];
				break;
			case 2:
				print $lang_akt["admin_main_status2"];
				break;
			case 3:
				print $lang_akt["admin_main_status3"];
				break;
			default:
				print "";
				break;
		}
	} ?>
	</td></tr>
	<tr><td colspan="6">&nbsp;</td></tr>


	<!-- Position of Navigation Bar -->
	<tr><td colspan=6 class="adminDescription"><?php print $lang_akt["admin_main_posh"]; ?></td></tr>
	<tr><td colspan=6 class="adminComments"><?php print $lang_akt["admin_main_posfull"]; ?></td></tr>
	<tr>
	<td>&nbsp;</td>
	<?php
	if (!isset($config_album["navbar_pos"])) {
		$config_album["navbar_pos"] = "3";
	} ?>
	<td align="left"><input type="radio" name="admin_form[navbar_pos]" value="1"  <?php if($config_album["navbar_pos"] == "1") { print "checked='checked' "; } ?> > <?php print $lang_akt["above"]; ?></td>
	<td align="left"><input type="radio" name="admin_form[navbar_pos]" value="2"  <?php if($config_album["navbar_pos"] == "2") { print "checked='checked' "; } ?> > <?php print $lang_akt["below"]; ?></td>
	<td align="left"><input type="radio" name="admin_form[navbar_pos]" value="3"  <?php if($config_album["navbar_pos"] == "3") { print "checked='checked' "; } ?> > <?php print $lang_akt["abovebelow"]; ?></td>
	<td align="left"><input type="radio" name="admin_form[navbar_pos]" value="4"  <?php if($config_album["navbar_pos"] == "4") { print "checked='checked' "; } ?> > <?php print $lang_akt["left"]; ?></td>
	<td>&nbsp;</td>
	</tr>
	<tr><td colspan="6">&nbsp;</td></tr>


	<!-- Position of Image Info -->
	<tr><td colspan=6 class="adminDescription"><?php print $lang_akt["admin_main_info_toph"]; ?></td></tr>
	<tr><td colspan=6 class="adminComments"><?php print $lang_akt["admin_main_info_topfull"]; ?></td></tr>
	<tr>
	<td>&nbsp;</td>
	<?php
	if (!isset($config_album["image_info_top"])) {
		$config_album["image_info_top"] = "top";
	}
	if ($config_album["image_info_top"] != "bottom") { ?>
		<td><input type="radio" name="admin_form[image_info_top]" value="top" checked="checked"> <?php print $lang_akt["above"]; ?></td>
		<td><input type="radio" name="admin_form[image_info_top]" value="bottom"> <?php print $lang_akt["below"]; ?></td>
	<?php } else { ?>
		<td><input type="radio" name="admin_form[image_info_top]" value="top"> <?php print $lang_akt["above"]; ?></td>
		<td><input type="radio" name="admin_form[image_info_top]" value="bottom" checked="checked"> <?php print $lang_akt["below"]; ?></td>
	<?php } ?>
	<td colspan="3">&nbsp;</td>
	</tr>
	<tr><td colspan="6">&nbsp;</td></tr>


	<!-- Mini Preview in Single Album Mode On/Off -->
	<tr><td colspan=6 class="adminDescription"><?php print $lang_akt["admin_main_minih"]; ?></td></tr>
	<tr><td colspan=6 class="adminComments"><?php print $lang_akt["admin_main_minifull1"] . $config['resize_mini'] . $lang_akt["admin_main_minifull2"]; ?></td></tr>
	<tr>
	<td>&nbsp;</td>
	<?php if ($config_album["preview_icons"] != "no") { ?>
		<td><input type="radio" name="admin_form[preview_icons]" value="yes" checked="checked"> <?php print $lang_akt["yes"]; ?></td>
		<td><input type="radio" name="admin_form[preview_icons]" value="no"> <?php print $lang_akt["no"]; ?></td>
	<?php } else { ?>
		<td><input type="radio" name="admin_form[preview_icons]" value="yes"> <?php print $lang_akt["yes"]; ?></td>
		<td><input type="radio" name="admin_form[preview_icons]" value="no" checked="checked"> <?php print $lang_akt["no"]; ?></td>
	<?php } ?>
	<td colspan="3">&nbsp;</td>
	</tr>
	<tr><td colspan="6">&nbsp;</td></tr>


	<!-- Mini Preview of first/last image On/Off -->
	<tr><td colspan=6 class="adminDescription"><?php print $lang_akt["admin_main_firstlasth"]; ?></td></tr>
	<tr><td colspan=6 class="adminComments"><?php print $lang_akt["admin_main_firstlastfull"]; ?></td></tr>
	<tr>
	<td>&nbsp;</td>
	<?php
	if (!isset($config_album["preview_firstlast"])) {
		$config_album["preview_firstlast"] = "no";
	}
	if ($config_album["preview_firstlast"] != "no") { ?>
		<td><input type="radio" name="admin_form[preview_firstlast]" value="yes" checked="checked"> <?php print $lang_akt["yes"]; ?></td>
		<td><input type="radio" name="admin_form[preview_firstlast]" value="no"> <?php print $lang_akt["no"]; ?></td>
	<?php } else { ?>
		<td><input type="radio" name="admin_form[preview_firstlast]" value="yes"> <?php print $lang_akt["yes"]; ?></td>
		<td><input type="radio" name="admin_form[preview_firstlast]" value="no" checked="checked"> <?php print $lang_akt["no"]; ?></td>
	<?php } ?>
	<td colspan="3">&nbsp;</td>
	</tr>
	<tr><td colspan="6">&nbsp;</td></tr>

	<!-- Position the Image on the upper browser border -->
	<tr><td colspan=6 class="adminDescription"><?php print $lang_akt["admin_main_anchorh"]; ?></td></tr>
	<tr><td colspan=6 class="adminComments"><?php print $lang_akt["admin_main_anchorfull"]; ?></td></tr>
	<tr>
	<td>&nbsp;</td>
	<?php
	if (!isset($config_album["image_anchor"])) {
		$config_album["image_anchor"] = "no";
	}
	if ($config_album["image_anchor"] != "no") { ?>
		<td><input type="radio" name="admin_form[image_anchor]" value="yes" checked="checked"> <?php print $lang_akt["yes"]; ?></td>
		<td><input type="radio" name="admin_form[image_anchor]" value="no"> <?php print $lang_akt["no"]; ?></td>
	<?php } else { ?>
		<td><input type="radio" name="admin_form[image_anchor]" value="yes"> <?php print $lang_akt["yes"]; ?></td>
		<td><input type="radio" name="admin_form[image_anchor]" value="no" checked="checked"> <?php print $lang_akt["no"]; ?></td>
	<?php } ?>
	<td colspan="3">&nbsp;</td>
	</tr>
	<tr><td colspan="6">&nbsp;</td></tr>

	<!-- show_exif -->
	<?php 
	// check if the EXIF Info of images should be displayed in the Single Image View
	// check if showing the EXIF info is permitted global or not
	if($config['show_exif']) { ?>
		<tr><td colspan=6 class="adminDescription"><?php print $lang_akt["show_exifh"]; ?></td></tr>
		<tr><td colspan=6 class="adminComments"><?php print $lang_akt["show_exiffull"]; ?></td></tr>
		<tr>
		<td>&nbsp;</td>
		<?php if ($config_album['show_exif']) { ?>
			<td><input type="radio" name="admin_form[show_exif]" value="yes" checked="checked"> <?php print $lang_akt["yes"]; ?></td>
			<td><input type="radio" name="admin_form[show_exif]" value="no"> <?php print $lang_akt["no"]; ?></td>
		<?php } else { ?>
			<td><input type="radio" name="admin_form[show_exif]" value="yes"> <?php print $lang_akt["yes"]; ?></td>
			<td><input type="radio" name="admin_form[show_exif]" value="no" checked="checked"> <?php print $lang_akt["no"]; ?></td>
		<?php } ?>
		<td colspan="3">&nbsp;</td>
		</tr>
	<?php } ?>
	<tr><td colspan="6">&nbsp;</td></tr>


	<tr><td colspan="6">&nbsp;</td></tr>
	<tr><td colspan="6" align="center">
		<input type="hidden" name="BeenSubmitted" value="true">
		<input type="submit" name="submit" value="<?php print $lang_akt['submit']; ?>">
	</td></tr>




</table>
</td>
</tr>
</table>
</form>


<?php



?>
Return current item: Yappa-ng