Location: PHPKode > projects > Buzzword > buzzword-0.8.12/gallery/editgallery.php

 * buzzword
 * Copyright (c) 2003 Jon Tai
 * $Id: editgallery.php 355 2004-04-27 21:54:25Z bradt $
 * This file is part of buzzword.
 * buzzword 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.
 * buzzword is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * GNU General Public License for more details.
 * You should have received a copy of the GNU General Public License
 * along with buzzword; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

require_once './config.inc';

$gallery = new gallery_gallery(import_gallery_gallery_key());
if (!$gallery->exists())
    display_error('gallery does not exist');

if (get_request_var('gallery-submit')) {
    $gallery->modified = time();
    $gallery->is_private = get_request_var('is_private');
    $gallery->is_hidden = get_request_var('is_hidden');
    $gallery->highlight = (int) get_request_var('highlight');
    $gallery->title = ($title = get_request_var('title')) ? $title : 'gallery';
    $gallery->description = get_request_var('description');
    $gallery->allow_comments = get_request_var('allow_comments');

    header('Location: index.php?g='.$gallery->gallery_key);

include '../includes/header.inc';

<table cellpadding="0" cellspacing="0" border="0" width="100%">
<td id="content">
<h1>edit gallery</h1>
<div class="content-container">
<table cellpadding="0" cellspacing="0" border="0">
<td class="gallery-highlight">
<a href="#" onClick="gallery_filebrowser_popup('', ''); return false;">

$highlight = new gallery_image($gallery->highlight);
if ($highlight->exists()) {

<img name="highlight" src="thumb.php?i=<?php echo $highlight->image_key; ?>" <?php echo $highlight->get_alt(); ?> 
 border="0" <?php echo $highlight->get_thumb_size(); ?>></a>

} else {

<img name="highlight" src="images/spacer.gif" width=<?php echo
 get_pref('gallery_thumb_width'); ?> height=<?php echo
 round(get_pref('gallery_thumb_width') * 3 / 4); ?> alt=""></a>


<td class="gallery-description">
Click on the highlight to choose a new highlight for this gallery.
<form name="gallery" method="post" action="editgallery.php">
<input type="hidden" name="gallery-submit" value="1">
<input type="hidden" name="g" value="<?php echo $gallery->gallery_key; ?>">
<input type="hidden" name="highlight" value="<?php echo $gallery->highlight; ?>">
<p>gallery title:<br>
<input type="text" name="title" class="input" value="<?php echo htmlspecialchars($gallery->title); ?>"></p>
<p>gallery description:<br>
<?php echo toolbar_hook('gallery', 'description'); ?>
<textarea name="description" rows="10" cols="10" class="input"><?php echo htmlspecialchars($gallery->description); ?></textarea></p>
<p>gallery is private:
<input type="checkbox" name="is_private"<?php if ($gallery->is_private) echo ' checked'; ?>></p>
<p>gallery is hidden:
<input type="checkbox" name="is_hidden"<?php if ($gallery->is_hidden) echo ' checked'; ?>></p>
<p>allow comments:
<input type="checkbox" name="allow_comments"<?php if ($gallery->allow_comments) echo ' checked'; ?>></p>
<p><input type="submit" value="save" class="submit"></p>

include '../includes/footer.inc';

Return current item: Buzzword