/**
 * emits the html for editing album information
 * called in edit album and mass edit
 * @param string $index the index of the entry in mass edit or '0' if single album
 * @param object $album the album object
 * @param bool $buttons set true for "apply" buttons
 * @since 1.1.3
 */
function printAlbumEditForm($index, $album, $buttons = true)
{
    global $_zp_sortby, $_zp_gallery, $mcr_albumlist, $_zp_albumthumb_selector, $_zp_current_admin_obj;
    $isPrimaryAlbum = '';
    if (!zp_loggedin(MANAGE_ALL_ALBUM_RIGHTS)) {
        $myalbum = $_zp_current_admin_obj->getAlbum();
        if ($myalbum && $album->getID() == $myalbum->getID()) {
            $isPrimaryAlbum = ' disabled="disabled"';
        }
    }
    $tagsort = getTagOrder();
    if ($index == 0) {
        $suffix = $prefix = '';
    } else {
        $prefix = "{$index}-";
        $suffix = "_{$index}";
        echo '<p><em><strong><a href="' . WEBPATH . '/' . ZENFOLDER . '/admin-edit.php?page=edit&album=' . urlencode($album->name) . '&tab=albuminfo">' . urlencode($album->name) . '</a></strong></em></p>';
    }
    if (isset($_GET['subpage'])) {
        ?>
			<input type="hidden" name="subpage" value="<?php 
        echo html_encode(sanitize($_GET['subpage']));
        ?>
" />
			<?php 
    }
    ?>
		<input type="hidden" name="<?php 
    echo $prefix;
    ?>
folder" value="<?php 
    echo $album->name;
    ?>
" />
		<input type="hidden" name="tagsort" value="<?php 
    echo html_encode($tagsort);
    ?>
" />
		<input type="hidden" name="password_enabled<?php 
    echo $suffix;
    ?>
" id="password_enabled<?php 
    echo $suffix;
    ?>
" value="0" />
		<?php 
    if ($buttons) {
        ?>
			<span class="buttons">
				<?php 
        $parent = dirname($album->name);
        if ($parent == '/' || $parent == '.' || empty($parent)) {
            $parent = '';
        } else {
            $parent = '&amp;album=' . $parent . '&tab=subalbuminfo';
        }
        ?>
				<a href="<?php 
        echo WEBPATH . '/' . ZENFOLDER . '/admin-edit.php?page=edit' . $parent;
        ?>
">
					<img	src="images/arrow_left_blue_round.png" alt="" />
					<strong><?php 
        echo gettext("Back");
        ?>
</strong>
				</a>
				<button type="submit">
					<img	src="images/pass.png" alt="" />
					<strong><?php 
        echo gettext("Apply");
        ?>
</strong>
				</button>
				<button type="reset" onclick="$('.deletemsg').hide();" >
					<img	src="images/fail.png" alt="" />
					<strong><?php 
        echo gettext("Reset");
        ?>
</strong>
				</button>
				<div class="floatright">
					<?php 
        if (!$album->isDynamic()) {
            ?>
						<button type="button" title="<?php 
            echo addslashes(gettext('New subalbum'));
            ?>
" onclick="newAlbumJS('<?php 
            echo pathurlencode($album->name);
            ?>
', false);">
							<img src="images/folder.png" alt="" />
							<strong><?php 
            echo gettext('New subalbum');
            ?>
</strong>
						</button>
						<button type="button" title="<?php 
            echo addslashes(gettext('New dynamic subalbum'));
            ?>
" onclick="newAlbumJS('<?php 
            echo pathurlencode($album->name);
            ?>
', true);">
							<img src="images/folder.png" alt="" />
							<strong><?php 
            echo gettext('New dynamic subalbum');
            ?>
</strong>
						</button>
						<?php 
        }
        ?>
					<a href="<?php 
        echo WEBPATH . "/index.php?album=" . html_encode(pathurlencode($album->getFileName()));
        ?>
">
						<img src="images/view.png" alt="" />
						<strong><?php 
        echo gettext('View Album');
        ?>
</strong>
					</a>
				</div>
			</span>
			<?php 
    }
    ?>
		<br class="clearall" /><br />
		<table class="formlayout">
			<tr>
				<td valign="top">
					<table class="width100percent">
						<tr>
							<td class="leftcolumn">
								<?php 
    echo gettext("Album Title");
    ?>
:
							</td>
							<td class="middlecolumn">
								<?php 
    print_language_string_list($album->getTitle('all'), $prefix . "albumtitle", false, null, '', '100%');
    ?>
							</td>
						</tr>
						<tr>
							<td class="leftcolumn">
								<?php 
    echo linkPickerIcon($album, 'pick_link');
    ?>
							</td>
							<td class="middlecolumn">
								<?php 
    echo linkPickerItem($album, 'pick_link');
    ?>
							</td>
						</tr>
						<?php 
    if ($album->isDynamic()) {
        ?>
							<tr>
								<td align="left" valign="top" width="150"><em><?php 
        echo get_class($album);
        ?>
</em></td>
								<td class="noinput">
									<?php 
        switch ($album->isDynamic()) {
            case 'alb':
                echo html_encode(str_replace(',', ', ', urldecode($album->getSearchParams())));
                break;
            case 'fav':
                echo html_encode($album->owner);
                if ($album->instance) {
                    echo ' [' . html_encode($album->instance) . ']';
                }
                break;
        }
        ?>
								</td>
							</tr>

							<?php 
    }
    ?>
						<tr>
							<td class="leftcolumn">
								<?php 
    echo gettext("Album Description:");
    ?>
							</td>
							<td>
								<?php 
    print_language_string_list($album->getDesc('all'), $prefix . "albumdesc", true, NULL, 'texteditor', '100%');
    ?>
							</td>
						</tr>
						<?php 
    if (GALLERY_SECURITY == 'public') {
        ?>
							<tr class="password<?php 
        echo $suffix;
        ?>
extrashow">
								<td class="leftcolumn">
									<a onclick="toggle_passwords('<?php 
        echo $suffix;
        ?>
', true);">
										<?php 
        echo gettext("Album password:"******"middlecolumn">
									<?php 
        $x = $album->getPassword();
        if (empty($x)) {
            ?>
										<a onclick="toggle_passwords('<?php 
            echo $suffix;
            ?>
', true);">
											<img src="images/lock_open.png" /> <?php 
            echo gettext('No album password is currently set. Click to set one.');
            ?>
										</a>
										<?php 
        } else {
            $x = '          ';
            ?>
										<a onclick="resetPass('<?php 
            echo $suffix;
            ?>
');" title="<?php 
            echo addslashes(gettext('clear password'));
            ?>
">
											<img src="images/lock.png" /> <?php 
            echo gettext('An album password is currently set. Click to clear or change the password.');
            ?>
										</a>
										<?php 
        }
        ?>
								</td>
							</tr>
							<tr class="password<?php 
        echo $suffix;
        ?>
extrahide" style="display:none" >
								<td class="leftcolumn">
									<a onclick="toggle_passwords('<?php 
        echo $suffix;
        ?>
', false);">
										<?php 
        echo gettext("Album guest user:"******"checkbox"
													 name="disclose_password<?php 
        echo $suffix;
        ?>
"
													 id="disclose_password<?php 
        echo $suffix;
        ?>
"
													 onclick="passwordClear('<?php 
        echo $suffix;
        ?>
');
																	 togglePassword('<?php 
        echo $suffix;
        ?>
');" /><?php 
        echo addslashes(gettext('Show password'));
        ?>
									</label>
								</td>
								<td>
									<input type="text"
												 class="passignore<?php 
        echo $suffix;
        ?>
 ignoredirty" autocomplete="off"
												 size="<?php 
        echo TEXT_INPUT_SIZE;
        ?>
"
												 onkeydown="passwordClear('<?php 
        echo $suffix;
        ?>
');"
												 id="user_name<?php 
        echo $suffix;
        ?>
" name="user<?php 
        echo $suffix;
        ?>
"
												 value="<?php 
        echo $album->getUser();
        ?>
" />
								</td>
							</tr>
							<tr class="password<?php 
        echo $suffix;
        ?>
extrahide" style="display:none" >
								<td class="leftcolumn">
									<p>
										<span id="strength<?php 
        echo $suffix;
        ?>
"><?php 
        echo gettext("Album password:"******"match<?php 
        echo $suffix;
        ?>
" class="password_field_<?php 
        echo $suffix;
        ?>
">
											<?php 
        echo gettext("repeat password:"******"Password hint:");
        ?>
									</p>
								</td>
								<td>
									<p>
										<input type="password"
													 class="passignore<?php 
        echo $suffix;
        ?>
 ignoredirty" autocomplete="off"
													 id="pass<?php 
        echo $suffix;
        ?>
" name="pass<?php 
        echo $suffix;
        ?>
"
													 onkeydown="passwordClear('<?php 
        echo $suffix;
        ?>
');"
													 onkeyup="passwordStrength('<?php 
        echo $suffix;
        ?>
');"
													 value="<?php 
        echo $x;
        ?>
" />
										<br />
										<span class="password_field_<?php 
        echo $suffix;
        ?>
">
											<input type="password"
														 class="passignore<?php 
        echo $suffix;
        ?>
 ignoredirty" autocomplete="off"
														 id="pass_r<?php 
        echo $suffix;
        ?>
" name="pass_r<?php 
        echo $suffix;
        ?>
" disabled="disabled"
														 onkeydown="passwordClear('<?php 
        echo $suffix;
        ?>
');"
														 onkeyup="passwordMatch('<?php 
        echo $suffix;
        ?>
');"
														 value="<?php 
        echo $x;
        ?>
" />
										</span>
									</p>
									<p>
										<?php 
        print_language_string_list($album->getPasswordHint('all'), "hint" . $suffix, false, NULL, 'hint', '100%');
        ?>
									</p>
								</td>
							</tr>
							<?php 
    }
    $sort = $_zp_sortby;
    if (!$album->isDynamic()) {
        $sort[gettext('Manual')] = 'manual';
    }
    $sort[gettext('Custom')] = 'custom';
    /*
    * not recommended--screws with peoples minds during pagination!
     $sort[gettext('Random')] = 'random';
    */
    ?>
						<tr>
							<td class="leftcolumn"><?php 
    echo gettext("Sort subalbums by:");
    ?>
 </td>
							<td>
								<span class="nowrap">
									<select id="albumsortselect<?php 
    echo $prefix;
    ?>
" name="<?php 
    echo $prefix;
    ?>
subalbumsortby" onchange="update_direction(this, 'album_direction_div<?php 
    echo $suffix;
    ?>
', 'album_custom_div<?php 
    echo $suffix;
    ?>
');">
										<?php 
    if (is_null($album->getParent())) {
        $globalsort = gettext("*gallery album sort order");
    } else {
        $globalsort = gettext("*parent album subalbum sort order");
    }
    echo "\n<option value =''>{$globalsort}</option>";
    $cvt = $type = strtolower($album->get('subalbum_sort_type'));
    if ($type && !in_array($type, $sort)) {
        $cv = array('custom');
    } else {
        $cv = array($type);
    }
    generateListFromArray($cv, $sort, false, true);
    ?>
									</select>
									<?php 
    if ($type == 'manual' || $type == 'random' || $type == '') {
        $dsp = 'none';
    } else {
        $dsp = 'inline';
    }
    ?>
									<label id="album_direction_div<?php 
    echo $suffix;
    ?>
" style="display:<?php 
    echo $dsp;
    ?>
;white-space:nowrap;">
										<?php 
    echo gettext("Descending");
    ?>
										<input type="checkbox" name="<?php 
    echo $prefix;
    ?>
album_sortdirection" value="1" <?php 
    if ($album->getSortDirection('album')) {
        echo "CHECKED";
    }
    ?>
 />
									</label>
								</span>
								<?php 
    $flip = array_flip($sort);
    if (empty($type) || isset($flip[$type])) {
        $dsp = 'none';
    } else {
        $dsp = 'block';
    }
    ?>
								<span id="album_custom_div<?php 
    echo $suffix;
    ?>
" class="customText" style="display:<?php 
    echo $dsp;
    ?>
;white-space:nowrap;">
									<br />
									<?php 
    echo gettext('custom fields:');
    ?>
									<span class="tagSuggestContainer">
										<input id="customalbumsort<?php 
    echo $suffix;
    ?>
" class="customalbumsort" name="<?php 
    echo $prefix;
    ?>
customalbumsort" type="text" value="<?php 
    echo html_encode($cvt);
    ?>
" />
									</span>
								</span>
							</td>
						</tr>

						<tr>
							<td class="leftcolumn"><?php 
    echo gettext("Sort images by");
    ?>
 </td>
							<td>
								<span class="nowrap">
									<select id="imagesortselect<?php 
    echo $prefix;
    ?>
" name="<?php 
    echo $prefix;
    ?>
sortby" onchange="update_direction(this, 'image_direction_div<?php 
    echo $suffix;
    ?>
', 'image_custom_div<?php 
    echo $suffix;
    ?>
')">
										<?php 
    if (is_null($album->getParent())) {
        $globalsort = gettext("*gallery image sort order");
    } else {
        $globalsort = gettext("*parent album image sort order");
    }
    ?>
										<option value =""><?php 
    echo $globalsort;
    ?>
</option>
										<?php 
    $cvt = $type = strtolower($album->get('sort_type'));
    if ($type && !in_array($type, $sort)) {
        $cv = array('custom');
    } else {
        $cv = array($type);
    }
    generateListFromArray($cv, $sort, false, true);
    ?>
									</select>
									<?php 
    if ($type == 'manual' || $type == 'random' || $type == '') {
        $dsp = 'none';
    } else {
        $dsp = 'inline';
    }
    ?>
									<label id="image_direction_div<?php 
    echo $suffix;
    ?>
" style="display:<?php 
    echo $dsp;
    ?>
;white-space:nowrap;">
										<?php 
    echo gettext("Descending");
    ?>
										<input type="checkbox" name="<?php 
    echo $prefix;
    ?>
image_sortdirection" value="1"
										<?php 
    if ($album->getSortDirection('image')) {
        echo ' checked="checked"';
    }
    ?>
 />
									</label>
								</span>
								<?php 
    $flip = array_flip($sort);
    if (empty($type) || isset($flip[$type])) {
        $dsp = 'none';
    } else {
        $dsp = 'block';
    }
    ?>
								<span id="image_custom_div<?php 
    echo $suffix;
    ?>
" class="customText" style="display:<?php 
    echo $dsp;
    ?>
;white-space:nowrap;">
									<br />
									<?php 
    echo gettext('custom fields:');
    ?>
									<span class="tagSuggestContainer">
										<input id="customimagesort<?php 
    echo $suffix;
    ?>
" class="customimagesort" name="<?php 
    echo $prefix;
    ?>
customimagesort" type="text" value="<?php 
    echo html_encode($cvt);
    ?>
" />
									</span>
								</span>
							</td>
						</tr>

						<?php 
    if (is_null($album->getParent())) {
        ?>
							<tr>
								<td class="leftcolumn"><?php 
        echo gettext("Album theme:");
        ?>
 </td>
								<td>
									<select id="album_theme" class="album_theme" name="<?php 
        echo $prefix;
        ?>
album_theme"	<?php 
        if (!zp_loggedin(THEMES_RIGHTS)) {
            echo 'disabled="disabled" ';
        }
        ?>
	>
										<?php 
        $themes = $_zp_gallery->getThemes();
        $oldtheme = $album->getAlbumTheme();
        if (empty($oldtheme)) {
            $selected = 'selected="selected"';
        } else {
            $selected = '';
        }
        ?>
										<option value="" style="background-color:LightGray" <?php 
        echo $selected;
        ?>
 ><?php 
        echo gettext('*gallery theme');
        ?>
</option>
										<?php 
        foreach ($themes as $theme => $themeinfo) {
            if ($oldtheme == $theme) {
                $selected = 'selected="selected"';
            } else {
                $selected = '';
            }
            ?>
											<option value = "<?php 
            echo $theme;
            ?>
" <?php 
            echo $selected;
            ?>
 ><?php 
            echo $themeinfo['name'];
            ?>
</option>
											<?php 
        }
        ?>
									</select>
								</td>
							</tr>
							<?php 
    }
    if (!$album->isDynamic()) {
        ?>
							<tr>
								<td class="leftcolumn"><?php 
        echo gettext("Album watermarks:");
        ?>
 </td>
								<td>
									<?php 
        $current = $album->getWatermark();
        ?>
									<select id="album_watermark<?php 
        echo $suffix;
        ?>
" name="<?php 
        echo $prefix;
        ?>
album_watermark">
										<option value="<?php 
        echo NO_WATERMARK;
        ?>
" <?php 
        if ($current == NO_WATERMARK) {
            echo ' selected="selected"';
        }
        ?>
 style="background-color:LightGray"><?php 
        echo gettext('*no watermark');
        ?>
</option>
										<option value="" <?php 
        if (empty($current)) {
            echo ' selected="selected"';
        }
        ?>
 style="background-color:LightGray"><?php 
        echo gettext('*default');
        ?>
</option>
										<?php 
        $watermarks = getWatermarks();
        generateListFromArray(array($current), $watermarks, false, false);
        ?>
									</select>
									<em><?php 
        echo gettext('Images');
        ?>
</em>
								</td>
							</tr>
							<tr>
								<td class="leftcolumn"></td>
								<td>
									<?php 
        $current = $album->getWatermarkThumb();
        ?>
									<select id="album_watermark_thumb<?php 
        echo $suffix;
        ?>
" name="<?php 
        echo $prefix;
        ?>
album_watermark_thumb">
										<option value="<?php 
        echo NO_WATERMARK;
        ?>
" <?php 
        if ($current == NO_WATERMARK) {
            echo ' selected="selected"';
        }
        ?>
 style="background-color:LightGray"><?php 
        echo gettext('*no watermark');
        ?>
</option>
										<option value="" <?php 
        if (empty($current)) {
            echo ' selected="selected"';
        }
        ?>
 style="background-color:LightGray"><?php 
        echo gettext('*default');
        ?>
</option>
										<?php 
        $watermarks = getWatermarks();
        generateListFromArray(array($current), $watermarks, false, false);
        ?>
									</select>
									<em><?php 
        echo gettext('Thumbs');
        ?>
</em>
								</td>
							</tr>
							<?php 
    }
    if ($index == 0) {
        // suppress for mass-edit
        $showThumb = $_zp_gallery->getThumbSelectImages();
        $album->getAlbumThumbImage();
        //	prime the thumbnail since we will get the field below
        $thumb = $album->get('thumb');
        $selections = array();
        $selected = array();
        foreach ($_zp_albumthumb_selector as $key => $selection) {
            $selections[$selection['desc']] = $key;
            if ($key == $thumb) {
                $selected[] = $key;
            }
        }
        ?>
							<tr>
								<td class="leftcolumn"><?php 
        echo gettext("Thumbnail:");
        ?>
 </td>
								<td>
									<?php 
        if ($showThumb) {
            ?>
										<script type="text/javascript">
											// <!-- <![CDATA[
											updateThumbPreview(document.getElementById('thumbselect'));
											// ]]> -->
										</script>
										<?php 
        }
        ?>
									<select style="width:320px" <?php 
        if ($showThumb) {
            ?>
class="thumbselect" onchange="updateThumbPreview(this);" <?php 
        }
        ?>
 name="<?php 
        echo $prefix;
        ?>
thumb">
										<?php 
        generateListFromArray($selected, $selections, false, true);
        $imagelist = $album->getImages(0);
        $subalbums = $album->getAlbums(0);
        foreach ($subalbums as $folder) {
            $newalbum = newAlbum($folder);
            if ($images = $_zp_gallery->getSecondLevelThumbs()) {
                $images = $newalbum->getImages(0);
                foreach ($images as $filename) {
                    if (is_array($filename)) {
                        $imagelist[] = $filename;
                    } else {
                        $imagelist[] = '/' . $folder . '/' . $filename;
                    }
                }
            }
            if (empty($images)) {
                $t = $newalbum->getAlbumThumbImage();
                if (strtolower(get_class($t)) !== 'transientimage' && $t->exists) {
                    $imagelist[] = '/' . $t->getAlbumName() . '/' . $t->filename;
                }
            }
        }
        if ($thumb && !is_numeric($thumb)) {
            // check for current thumb being in the list. If not, add it
            $target = $thumb;
            $targetA = array('folder' => dirname($thumb), 'filename' => basename($thumb));
            if (!in_array($target, $imagelist) && !in_array($targetA, $imagelist)) {
                array_unshift($imagelist, $target);
            }
        }
        if (!empty($imagelist)) {
            // there are some images to choose from
            foreach ($imagelist as $imagename) {
                if (is_array($imagename)) {
                    $image = newImage($imagename);
                    $imagename = '/' . $imagename['folder'] . '/' . $imagename['filename'];
                    $filename = basename($imagename);
                } else {
                    $albumname = trim(dirname($imagename), '/');
                    if (empty($albumname) || $albumname == '.') {
                        $thumbalbum = $album;
                    } else {
                        $thumbalbum = newAlbum($albumname);
                    }
                    $filename = basename($imagename);
                    $image = newImage($thumbalbum, $filename);
                }
                $selected = $imagename == $thumb;
                if (Gallery::imageObjectClass($filename) == 'Image' || !is_null($image->objectsThumb)) {
                    echo "\n<option";
                    if ($_zp_gallery->getThumbSelectImages()) {
                        echo " class=\"thumboption\"";
                        echo " style=\"background-image: url(" . html_encode(pathurlencode(getAdminThumb($image, 'medium'))) . "); background-repeat: no-repeat;\"";
                    }
                    echo " value=\"" . $imagename . "\"";
                    if ($selected) {
                        echo " selected=\"selected\"";
                    }
                    echo ">" . $image->getTitle();
                    if ($filename != $image->getTitle()) {
                        echo " ({$filename})";
                    }
                    echo "</option>";
                }
            }
        }
        ?>
									</select>
								</td>
							</tr>
							<?php 
    }
    echo $custom = zp_apply_filter('edit_album_custom_data', '', $album, $prefix);
    ?>
					</table>
				</td>
				<?php 
    $bglevels = array('#fff', '#f8f8f8', '#efefef', '#e8e8e8', '#dfdfdf', '#d8d8d8', '#cfcfcf', '#c8c8c8');
    ?>
				<td class="rightcolumn" valign="top">
					<h2 class="h2_bordered_edit"><?php 
    echo gettext("General");
    ?>
</h2>
					<div class="box-edit">
						<label class="checkboxlabel">
							<input type="checkbox"
										 name="<?php 
    echo $prefix;
    ?>
Published"
										 value="1" <?php 
    if ($album->getShow()) {
        echo ' checked="checked"';
    }
    ?>
										 onclick="$('#<?php 
    echo $prefix;
    ?>
publishdate').val('');
													 $('#<?php 
    echo $prefix;
    ?>
expirationdate').val('');
													 $('#<?php 
    echo $prefix;
    ?>
publishdate').css('color', 'black');
													 $('.<?php 
    echo $prefix;
    ?>
expire').html('');"
										 />
										 <?php 
    echo gettext("Published");
    ?>
						</label>
						<?php 
    if (extensionEnabled('comment_form')) {
        ?>
							<label class="checkboxlabel">
								<input type="checkbox" name="<?php 
        echo $prefix . 'allowcomments';
        ?>
" value="1" <?php 
        if ($album->getCommentsAllowed()) {
            echo ' checked="checked"';
        }
        ?>
 />
											 <?php 
        echo gettext("Allow Comments");
        ?>
							</label>
							<?php 
    }
    if (extensionEnabled('hitcounter')) {
        $hc = $album->get('hitcounter');
        if (empty($hc)) {
            $hc = '0';
        }
        ?>
							<label class="checkboxlabel">
								<input type="checkbox" name="reset_hitcounter<?php 
        echo $prefix;
        ?>
"<?php 
        if (!$hc) {
            echo ' disabled="disabled"';
        }
        ?>
 />
								<?php 
        echo sprintf(ngettext("Reset hit counter (%u hit)", "Reset hit counter (%u hits)", $hc), $hc);
        ?>
							</label>
							<?php 
    }
    if (extensionEnabled('rating')) {
        $tv = $album->get('total_value');
        $tc = $album->get('total_votes');
        if ($tc > 0) {
            $hc = $tv / $tc;
            ?>
								<label class="checkboxlabel">
									<input type="checkbox" id="reset_rating<?php 
            echo $suffix;
            ?>
" name="<?php 
            echo $prefix;
            ?>
reset_rating" value="1" />
									<?php 
            printf(gettext('Reset rating (%u stars)'), $hc);
            ?>
								</label>
								<?php 
        } else {
            ?>
								<label class="checkboxlabel">
									<input type="checkbox" name="<?php 
            echo $prefix;
            ?>
reset_rating" value="1" disabled="disabled"/>
									<?php 
            echo gettext('Reset rating (unrated)');
            ?>
								</label>
								<?php 
        }
    }
    $publishdate = $album->getPublishDate();
    $expirationdate = $album->getExpireDate();
    ?>
						<script type="text/javascript">
							// <!-- <![CDATA[
							$(function () {
								$("#<?php 
    echo $prefix;
    ?>
publishdate,#<?php 
    echo $prefix;
    ?>
expirationdate").datepicker({
									dateFormat: 'yy-mm-dd',
									showOn: 'button',
									buttonImage: '../zp-core/images/calendar.png',
									buttonText: '<?php 
    echo addslashes(gettext("calendar"));
    ?>
',
									buttonImageOnly: true
								});
								$('#<?php 
    echo $prefix;
    ?>
publishdate').change(function () {
									var today = new Date();
									var pub = $('#<?php 
    echo $prefix;
    ?>
publishdate').datepicker('getDate');
									if (pub.getTime() > today.getTime()) {
										$("<?php 
    echo $prefix;
    ?>
Published").removeAttr('checked');
										$('#<?php 
    echo $prefix;
    ?>
publishdate').css('color', 'blue');
									} else {
										$("<?php 
    echo $prefix;
    ?>
Published").attr('checked', 'checked');
										$('#<?php 
    echo $prefix;
    ?>
publishdate').css('color', 'black');
									}
								});
								$('#<?php 
    echo $prefix;
    ?>
expirationdate').change(function () {
									var today = new Date();
									var expiry = $('#<?php 
    echo $prefix;
    ?>
expirationdate').datepicker('getDate');
									if (expiry.getTime() > today.getTime()) {
										$(".<?php 
    echo $prefix;
    ?>
expire").html('');
									} else {
										$(".<?php 
    echo $prefix;
    ?>
expire").html('<br /><?php 
    echo addslashes(gettext('Expired!'));
    ?>
');
									}
								});
							});
							// ]]> -->
						</script>
						<br class="clearall" />
						<hr />
						<p>
							<label for="<?php 
    echo $prefix;
    ?>
publishdate"><?php 
    echo gettext('Publish date');
    ?>
 <small>(YYYY-MM-DD)</small></label>
							<br /><input value="<?php 
    echo $publishdate;
    ?>
" type="text" size="20" maxlength="30" name="publishdate-<?php 
    echo $prefix;
    ?>
" id="<?php 
    echo $prefix;
    ?>
publishdate" <?php 
    if ($publishdate > date('Y-m-d H:i:s')) {
        echo 'style="color:blue"';
    }
    ?>
 />
							<label for="<?php 
    echo $prefix;
    ?>
expirationdate"><?php 
    echo gettext('Expiration date');
    ?>
 <small>(YYYY-MM-DD)</small></label>
							<br /><input value="<?php 
    echo $expirationdate;
    ?>
" type="text" size="20" maxlength="30" name="expirationdate-<?php 
    echo $prefix;
    ?>
" id="<?php 
    echo $prefix;
    ?>
expirationdate" />
							<strong class="<?php 
    echo $prefix;
    ?>
expire" style="color:red">
								<?php 
    if (!empty($expirationdate) && $expirationdate <= date('Y-m-d H:i:s')) {
        echo '<br />' . gettext('Expired!');
    }
    ?>
							</strong>
						</p>
					</div>
					<!-- **************** Move/Copy/Rename ****************** -->
					<h2 class="h2_bordered_edit"><?php 
    echo gettext("Utilities");
    ?>
</h2>
					<div class="box-edit">

						<label class="checkboxlabel">
							<input type="radio" id="a-<?php 
    echo $prefix;
    ?>
move" name="a-<?php 
    echo $prefix;
    ?>
MoveCopyRename" value="move"
										 onclick="toggleAlbumMCR('<?php 
    echo $prefix;
    ?>
', 'move');"<?php 
    echo $isPrimaryAlbum;
    ?>
 />
										 <?php 
    echo gettext("Move");
    ?>
						</label>

						<label class="checkboxlabel">
							<input type="radio" id="a-<?php 
    echo $prefix;
    ?>
copy" name="a-<?php 
    echo $prefix;
    ?>
MoveCopyRename" value="copy"
										 onclick="toggleAlbumMCR('<?php 
    echo $prefix;
    ?>
', 'copy');"/>
										 <?php 
    echo gettext("Copy");
    ?>
						</label>

						<label class="checkboxlabel">
							<input type="radio" id="a-<?php 
    echo $prefix;
    ?>
rename" name="a-<?php 
    echo $prefix;
    ?>
MoveCopyRename" value="rename"
										 onclick="toggleAlbumMCR('<?php 
    echo $prefix;
    ?>
', 'rename');" <?php 
    echo $isPrimaryAlbum;
    ?>
 />
										 <?php 
    echo gettext("Rename Folder");
    ?>
						</label>

						<label class="checkboxlabel">
							<input type="radio" id="Delete-<?php 
    echo $prefix;
    ?>
" name="a-<?php 
    echo $prefix;
    ?>
MoveCopyRename" value="delete"
							<?php 
    if ($isPrimaryAlbum) {
        ?>
											 disabled="disabled"
											 <?php 
    } else {
        ?>
											 onclick="toggleAlbumMCR('<?php 
        echo $prefix;
        ?>
', '');
															 deleteConfirm('Delete-<?php 
        echo $prefix;
        ?>
', '<?php 
        echo $prefix;
        ?>
', deleteAlbum1);"
											 <?php 
    }
    ?>
 />
										 <?php 
    echo gettext("Delete album");
    ?>
						</label>

						<br class="clearall" />
						<div class="deletemsg" id="deletemsg<?php 
    echo $prefix;
    ?>
"	style="padding-top: .5em; padding-left: .5em; color: red; display: none">
							<?php 
    echo gettext('Album will be deleted when changes are applied.');
    ?>
							<br class="clearall" />
							<p class="buttons">
								<a	onclick="toggleAlbumMCR('<?php 
    echo $prefix;
    ?>
', '');"><img src="images/reset.png" alt="" /><?php 
    echo addslashes(gettext("Cancel"));
    ?>
</a>
							</p>
						</div>
						<div id="a-<?php 
    echo $prefix;
    ?>
movecopydiv" style="padding-top: .5em; padding-left: .5em; display: none;">
							<?php 
    echo gettext("to:");
    ?>
							<select id="a-<?php 
    echo $prefix;
    ?>
albumselectmenu" name="a-<?php 
    echo $prefix;
    ?>
albumselect" onchange="">
								<?php 
    $exclude = $album->name;
    if (count(explode('/', $exclude)) > 1 && zp_loggedin(MANAGE_ALL_ALBUM_RIGHTS)) {
        ?>
									<option value="" selected="selected">/</option>
									<?php 
    }
    foreach ($mcr_albumlist as $fullfolder => $albumtitle) {
        // don't allow copy in place or to subalbums
        if ($fullfolder == dirname($exclude) || $fullfolder == $exclude || strpos($fullfolder, $exclude . '/') === 0) {
            $disabled = ' disabled="disabled"';
        } else {
            $disabled = '';
        }
        // Get rid of the slashes in the subalbum, while also making a subalbum prefix for the menu.
        $singlefolder = $fullfolder;
        $saprefix = '';
        $salevel = 0;
        while (strstr($singlefolder, '/') !== false) {
            $singlefolder = substr(strstr($singlefolder, '/'), 1);
            $saprefix = "&nbsp; &nbsp;&nbsp;" . $saprefix;
            $salevel = ($salevel + 1) % 8;
        }
        echo '<option value="' . $fullfolder . '"' . ($salevel > 0 ? ' style="background-color: ' . $bglevels[$salevel] . ';"' : '') . "{$disabled}>" . $saprefix . $singlefolder . "</option>\n";
    }
    ?>
							</select>
							<br class="clearall" /><br />
							<p class="buttons">
								<a onclick="toggleAlbumMCR('<?php 
    echo $prefix;
    ?>
', '');"><img src="images/reset.png" alt="" /><?php 
    echo addslashes(gettext("Cancel"));
    ?>
</a>
							</p>
						</div>
						<div id="a-<?php 
    echo $prefix;
    ?>
renamediv" style="padding-top: .5em; padding-left: .5em; display: none;">
							<?php 
    echo gettext("to:");
    ?>
							<input name="a-<?php 
    echo $prefix;
    ?>
renameto" type="text" value="<?php 
    echo basename($album->name);
    ?>
"/><br />
							<br class="clearall" />
							<p class="buttons">
								<a onclick="toggleAlbumMCR('<?php 
    echo $prefix;
    ?>
', '');"><img src="images/reset.png" alt="" /><?php 
    echo addslashes(gettext("Cancel"));
    ?>
</a>
							</p>
						</div>
						<span class="clearall" ></span>
						<?php 
    echo zp_apply_filter('edit_album_utilities', '', $album, $prefix);
    printAlbumButtons($album);
    ?>
						<span class="clearall" ></span>
					</div>
				</td>
			</tr>

		</table>


		<br class="clearall" />
		<?php 
    if ($buttons) {
        ?>
			<span class="buttons">
				<a href="<?php 
        echo WEBPATH . '/' . ZENFOLDER . '/admin-edit.php?page=edit' . $parent;
        ?>
">
					<img	src="images/arrow_left_blue_round.png" alt="" />
					<strong><?php 
        echo gettext("Back");
        ?>
</strong>
				</a>
				<button type="submit">
					<img	src="images/pass.png" alt="" />
					<strong><?php 
        echo gettext("Apply");
        ?>
</strong>
				</button>
				<button type="reset" onclick="$('.deletemsg').hide();">
					<img	src="images/fail.png" alt="" />
					<strong><?php 
        echo gettext("Reset");
        ?>
</strong>
				</button>
				<div class="floatright">
					<?php 
        if (!$album->isDynamic()) {
            ?>
						<button type="button" title="<?php 
            echo addslashes(gettext('New subalbum'));
            ?>
" onclick="newAlbumJS('<?php 
            echo pathurlencode($album->name);
            ?>
', false);">
							<img src="images/folder.png" alt="" />
							<strong><?php 
            echo gettext('New subalbum');
            ?>
</strong>
						</button>
						<?php 
            if (!$album->isDynamic()) {
                ?>
							<button type="button" title="<?php 
                echo addslashes(gettext('New dynamic subalbum'));
                ?>
" onclick="newAlbumJS('<?php 
                echo pathurlencode($album->name);
                ?>
', true);">
								<img src="images/folder.png" alt="" />
								<strong><?php 
                echo gettext('New dynamic subalbum');
                ?>
</strong>
							</button>
							<?php 
            }
        }
        ?>
					<a href="<?php 
        echo WEBPATH . "/index.php?album=" . html_encode(pathurlencode($album->getFileName()));
        ?>
">
						<img src="images/view.png" alt="" />
						<strong><?php 
        echo gettext('View Album');
        ?>
</strong>
					</a>
				</div>
			</span>
			<?php 
    }
    ?>
		<br class="clearall" />
		<?php 
}
Beispiel #2
0
    function handleOption($option, $currentValue)
    {
        $user = getOption('downloadList_user');
        $x = getOption('downloadList_password');
        $hint = getOption('downloadList_hint');
        ?>
		<input type="hidden" name="password_enabled_downloadList" id="password_enabled_downloadList" value="0" />
		<p class="password_downloadListextrashow">
			<a href="javascript:toggle_passwords('_downloadList',true);">
				<?php 
        echo gettext("Password:"******"<?php 
            echo WEBPATH . '/' . ZENFOLDER;
            ?>
/images/lock_open.png" alt="" class="icon-postiion-top8" />
				<?php 
        } else {
            $x = '          ';
            ?>
				<a onclick="resetPass('_downloadList');" title="<?php 
            echo gettext('clear password');
            ?>
"><img src="<?php 
            echo WEBPATH . '/' . ZENFOLDER;
            ?>
/images/lock.png"  alt="" class="icon-postiion-top8" /></a>
				<?php 
        }
        ?>
		</p>
		<div class="password_downloadListextrahide" style="display:none">
			<a href="javascript:toggle_passwords('_downloadList',false);">
				<?php 
        echo gettext("Guest user:"******"text" size="27" id="user_name_downloadList" name="user_downloadList"
						 onkeydown="passwordClear('_downloadList');"
						 value="<?php 
        echo html_encode($user);
        ?>
" />
			<br />
			<span id="strength_downloadList"><?php 
        echo gettext("Password:"******"password" size="27"
						 id="pass_downloadList" name="pass_downloadList"
						 onkeydown="passwordClear('_downloadList');"
						 onkeyup="passwordStrength('_downloadList');"
						 value="<?php 
        echo $x;
        ?>
" />
			<label><input type="checkbox" name="disclose_password_downloadList" id="disclose_password_downloadList" onclick="passwordClear('_downloadList');
							togglePassword('_downloadList');"><?php 
        echo gettext('Show password');
        ?>
</label>
			<br />
			<span class="password_field__downloadList">
				<span id="match_downloadList"><?php 
        echo gettext("(repeat)");
        ?>
</span>
				<br />
				<input type="password" size="27"
							 id="pass_r_downloadList" name="pass_r_downloadList" disabled="disabled"
							 onkeydown="passwordClear('_downloadList');"
							 onkeyup="passwordMatch('_downloadList');"
							 value="<?php 
        echo $x;
        ?>
" />
				<br />
			</span>
			<?php 
        echo gettext("Password hint:");
        ?>
			<br />
			<?php 
        print_language_string_list($hint, 'hint_downloadList', false, NULL, 'hint_downloadList', 27);
        ?>
		</div>
		<?php 
    }
Beispiel #3
0
    if (is_AdminEditPage("newscategory")) {
        $custom = zp_apply_filter('edit_category_custom_data', '', $result);
    }
    if (is_AdminEditPage("page")) {
        $custom = zp_apply_filter('edit_page_custom_data', '', $result);
    }
    if (empty($custom)) {
        ?>
											<tr>
												<td class="topalign-nopadding"><br /><?php 
        echo gettext("Custom:");
        ?>
</td>
												<td class="middlecolumn">
													<?php 
        print_language_string_list($result->getCustomData('all'), 'custom_data', true, NULL, 'custom_data', '100%', 'zenpage_language_string_list', 10);
        ?>
												</td>
											</tr>
											<?php 
    } else {
        echo $custom;
    }
    if (!is_AdminEditPage("newscategory")) {
        ?>
											<tr>
												<td class="topalign-nopadding"><br /><?php 
        echo gettext("Codeblocks:");
        ?>
</td>
												<td class="topalign-nopadding middlecolumn">
Beispiel #4
0
echo gettext("Custom:");
?>
</td>
		<td class="topalign-nopadding">
		<?php 
if (is_AdminEditPage("newsarticle")) {
    $custom = zp_apply_filter('edit_article_custom_data', '', $result);
}
if (is_AdminEditPage("category")) {
    $custom = zp_apply_filter('edit_category_custom_data', '', $result);
}
if (is_AdminEditPage("page")) {
    $custom = zp_apply_filter('edit_page_custom_data', '', $result);
}
if (empty($custom)) {
    print_language_string_list($result->get('custom_data'), 'custom_data', true, NULL, 'custom_data', 92, 'zenpage_language_string_list', 10);
} else {
    echo $custom;
}
?>
		</td>
		</tr>
		<?php 
if (!is_AdminEditPage("category")) {
    ?>
			<tr>
			<td class="topalign-nopadding"><br /><?php 
    echo gettext("Codeblocks:");
    ?>
</td>
			<td class="topalign-nopadding">
Beispiel #5
0
                            echo gettext("Credit:");
                            ?>
</td>
															<td><?php 
                            print_language_string_list($image->getCredit('all'), $currentimage . '-credit', false, NULL, '', '100%');
                            ?>
															</td>
														</tr>

														<tr>
															<td valign="top"><?php 
                            echo gettext("Copyright:");
                            ?>
</td>
															<td><?php 
                            print_language_string_list($image->getCopyright('all'), $currentimage . '-copyright', false, NULL, '', '100%');
                            ?>
															</td>
														</tr>
														<?php 
                        }
                        if ($image->get('hasMetadata')) {
                            ?>
														<tr>
															<td valign="top"><?php 
                            echo gettext("Metadata:");
                            ?>
</td>
															<td>
																<?php 
                            $data = '';
														<br />
														<label><input type="checkbox" name="disclose_password" id="disclose_password" onclick="passwordClear(''); togglePassword('');" /><?php 
        echo gettext('Show password');
        ?>
</label>
													</td>
												</tr>
												<tr class="passwordextrahide" style="display:none" >
													<td style="margin:0; padding:0">
														<?php 
        echo gettext("hint:");
        ?>
													</td>
													<td style="margin:0; padding:0">
														<?php 
        print_language_string_list(getOption('protected_image_hint'), 'hint', false, NULL, 'hint');
        ?>
													</td>
												</tr>
											</table>
											<?php 
    }
    ?>
										<p>
											<?php 
    echo "<select id=\"protect_full_image\" name=\"protect_full_image\">\n";
    $protection = getOption('protect_full_image');
    $list = array(gettext('Protected view') => 'Protected view', gettext('Download') => 'Download', gettext('No access') => 'No access');
    if ($_zp_conf_vars['album_folder_class'] != 'external') {
        $list[gettext('Unprotected')] = 'Unprotected';
    }
Beispiel #7
0
 /**
  * generic handler for the edit fields
  * @param $obj
  * @param $instance
  * @param type $field
  * @return type
  */
 protected static function _editHandler($obj, $field, $instance)
 {
     if (array_key_exists('edit', $field)) {
         $action = $field['edit'];
         if (is_null($action)) {
             return array(NULL, NULL);
         }
     } else {
         $action = 'default';
     }
     switch ($action) {
         case 'multilingual':
             ob_start();
             print_language_string_list($obj->get($field['name']), $instance . '-' . $field['name']);
             $item = ob_get_contents();
             ob_end_clean();
             $formatted = true;
             break;
         case 'function':
             $item = call_user_func($field['function'], $obj, $instance, $field, 'edit');
             if (is_null($item)) {
                 $formatted = NULL;
             } else {
                 $formatted = true;
             }
             break;
         default:
             if ($instance) {
                 $instance = '_' . $instance;
             }
             $item = html_encode($obj->get($field['name']));
             $formatted = false;
             break;
     }
     return array($item, $formatted);
 }
Beispiel #8
0
                        echo linkPickerIcon($image, 'image_link-' . $currentimage);
                        ?>
														<td style="width:100%;">
															<?php 
                        echo linkPickerItem($image, 'image_link-' . $currentimage);
                        ?>
														</td>

													</tr>
													<tr>
														<td align="left" valign="top"><?php 
                        echo gettext("Description:");
                        ?>
</td>
														<td><?php 
                        print_language_string_list($image->getDesc('all'), $currentimage . '-desc', true, NULL, 'texteditor', '100%');
                        ?>
</td>
													</tr>
													<?php 
                        if ($image->get('hasMetadata')) {
                            ?>
														<tr>
															<td valign="top"><?php 
                            echo gettext("Metadata:");
                            ?>
</td>
															<td>
																<?php 
                            $data = '';
                            $exif = $image->getMetaData();
Beispiel #9
0
                        echo gettext("Credit:");
                        ?>
</td>
						<td><?php 
                        print_language_string_list($image->get('credit'), $currentimage . '-credit');
                        ?>
						</td>
					</tr>

					<tr class="imageextrainfo" style="display: none">
						<td valign="top"><?php 
                        echo gettext("Copyright:");
                        ?>
</td>
						<td><?php 
                        print_language_string_list($image->get('copyright'), $currentimage . '-copyright');
                        ?>
						</td>
					</tr>
					<?php 
                        if ($image->get('hasMetadata')) {
                            ?>
						<tr class="imageextrainfo" style="display: none">
							<td valign="top"><?php 
                            echo gettext("Metadata:");
                            ?>
</td>
							<td>
							<?php 
                            $data = '';
                            $exif = $image->getMetaData();
    function handleOption($option, $currentValue)
    {
        global $gallery;
        switch ($option) {
            case 'register_user_page':
                ?>
				<table>
					<tr>
						<td style="margin:0; padding:0"><?php 
                echo gettext('script');
                ?>
</td>
						<td style="margin:0; padding:0">
							<input type="hidden" name="_ZP_CUSTOM_selector-register_user_page_page" value="0" />
							<select id="register_user_page_page" name="register_user_page_page">
								<option value="" style="background-color:LightGray"><?php 
                echo gettext('*no page selected');
                ?>
</option>
								<?php 
                $curdir = getcwd();
                $root = SERVERPATH . '/' . THEMEFOLDER . '/' . $gallery->getCurrentTheme() . '/';
                chdir($root);
                $filelist = safe_glob('*.php');
                $list = array();
                foreach ($filelist as $file) {
                    $list[] = str_replace('.php', '', filesystemToInternal($file));
                }
                $list = array_diff($list, standardScripts());
                generateListFromArray(array(getOption('register_user_page_page')), $list, false, false);
                chdir($curdir);
                ?>
							</select>
						</td>
					</tr>
					<tr>
						<td style="margin:0; padding:0"><?php 
                echo gettext('Link text');
                ?>
</td>
						<td style="margin:0; padding:0">
							<input type="hidden" name="_ZP_CUSTOM_text-register_user_page_link" value="0" />
							<?php 
                print_language_string_list(getOption('register_user_page_link'), 'register_user_page_link', false, NULL, '', TEXTAREA_COLUMNS_SHORT, 'language_string_list_short');
                ?>
						</td>
					</tr>
					<tr>
						<td style="margin:0; padding:0"><?php 
                echo gettext('Hint text');
                ?>
</td>
						<td style="margin:0; padding:0">
							<input type="hidden" name="_ZP_CUSTOM_text-register_user_page_tip" value="0" />
							<?php 
                print_language_string_list(getOption('register_user_page_tip'), 'register_user_page_tip', false, NULL, '', TEXTAREA_COLUMNS_SHORT, 'language_string_list_short');
                ?>
						</td>
					</tr>
				</table>
				<?php 
                break;
            case 'register_user_user_rights':
                printAdminRightsTable('register_user', '', '', getOption('register_user_user_rights'));
                break;
        }
    }
							value="<?php 
                        $d = $image->getDateTime();
                        if ($d != '0000-00-00 00:00:00') {
                            echo $d;
                        }
                        ?>
" /></td>
					</tr>
		
					<tr class="imageextrainfo" style="display: none">
						<td align="right" valign="top"><?php 
                        echo gettext("Custom data:");
                        ?>
</td>
						<td><?php 
                        print_language_string_list($image->get('custom_data'), $currentimage . '-custom_data', true);
                        ?>
						</td>
					</tr>
					
					<tr class="imageextrainfo" style="display: none">
						<td align="right" valign="top"><?php 
                        echo gettext("EXIF information:");
                        ?>
</td>
						<td>
						<?php 
                        $data = '';
                        $exif = $image->getExifData();
                        if (false !== $exif) {
                            foreach ($exif as $field => $value) {
/**
 * emits the html for editing album information
 * called in edit album and mass edit
 * @param string $index the index of the entry in mass edit or '0' if single album
 * @param object $album the album object
 * @param bool $collapse_tags set true to initially hide tab list
 * @since 1.1.3
 */
function printAlbumEditForm($index, $album, $collapse_tags)
{
    global $sortby, $gallery, $mcr_albumlist, $albumdbfields, $imagedbfields, $_thumb_field_text;
    $tagsort = getTagOrder();
    if ($index == 0) {
        if (isset($saved)) {
            $album->setSubalbumSortType('manual');
        }
        $suffix = $prefix = '';
    } else {
        $prefix = "{$index}-";
        $suffix = "_{$index}";
        echo "<p><em><strong>" . $album->name . "</strong></em></p>";
    }
    ?>
	<input type="hidden" name="<?php 
    echo $prefix;
    ?>
folder" value="<?php 
    echo $album->name;
    ?>
" />
	<input type="hidden" name="tagsort" value="<?php 
    echo html_encode($tagsort);
    ?>
" />
	<input	type="hidden" name="<?php 
    echo $prefix;
    ?>
password_enabled" id="password_enabled<?php 
    echo $suffix;
    ?>
" value="0" />
	<span class="buttons">
		<?php 
    $parent = dirname($album->name);
    if ($parent == '/' || $parent == '.' || empty($parent)) {
        $parent = '';
    } else {
        $parent = '&amp;album=' . $parent . '&amp;tab=subalbuminfo';
    }
    ?>
		<a title="<?php 
    echo gettext('Back to the album list');
    ?>
" href="<?php 
    echo WEBPATH . '/' . ZENFOLDER . '/admin-edit.php?page=edit' . $parent;
    ?>
">
		<img	src="images/arrow_left_blue_round.png" alt="" />
		<strong><?php 
    echo gettext("Back");
    ?>
</strong>
		</a>
		<button type="submit" title="<?php 
    echo gettext("Apply");
    ?>
">
		<img	src="images/pass.png" alt="" />
		<strong><?php 
    echo gettext("Apply");
    ?>
</strong>
		</button>
		<button type="reset" title="<?php 
    echo gettext("Reset");
    ?>
" onclick="javascript:$('.deletemsg').hide();" >
		<img	src="images/fail.png" alt="" />
		<strong><?php 
    echo gettext("Reset");
    ?>
</strong>
		</button>
		<div class="floatright">
		<?php 
    if (!$album->isDynamic()) {
        ?>
			<button type="button" title="<?php 
        echo gettext('New subalbum');
        ?>
" onclick="javascript:newAlbum('<?php 
        echo pathurlencode($album->name);
        ?>
',true);">
			<img src="images/folder.png" alt="" />
			<strong><?php 
        echo gettext('New subalbum');
        ?>
</strong>
			</button>
			<?php 
    }
    ?>
		<a title="<?php 
    echo gettext('View Album');
    ?>
" href="<?php 
    echo WEBPATH . "/index.php?album=" . pathurlencode($album->getFolder());
    ?>
">
		<img src="images/view.png" alt="" />
		<strong><?php 
    echo gettext('View Album');
    ?>
</strong>
		</a>
		</div>
	</span>
<br clear="all" /><br />
	<table>
		<tr>
			<td width="70%" valign="top">
				<table>
					<tr>
						<td valign="top"><?php 
    echo gettext("Owner");
    ?>
</td>
						<td>
							<?php 
    if (zp_loggedin(MANAGE_ALL_ALBUM_RIGHTS)) {
        ?>
								<select name="<?php 
        echo $prefix;
        ?>
-owner">
									<?php 
        echo admin_album_list($album->getOwner());
        ?>
								</select>
								<?php 
    } else {
        echo $album->getOwner();
    }
    ?>
						</td>
					</tr>
					<tr>
						<td align="left" valign="top" width="150">
						<?php 
    echo gettext("Album Title");
    ?>
:
						</td>
						<td>
						<?php 
    print_language_string_list($album->get('title'), $prefix . "albumtitle");
    ?>
						</td>
					</tr>

					<tr>
						<td align="left" valign="top" >
						<?php 
    echo gettext("Album Description:");
    ?>
						</td>
						<td>
						<?php 
    print_language_string_list($album->get('desc'), $prefix . "albumdesc", true, NULL, 'texteditor');
    ?>
						</td>
					</tr>
					<?php 
    if (GALLERY_SECURITY != 'private') {
        ?>
						<tr class="password<?php 
        echo $suffix;
        ?>
extrashow" <?php 
        if (GALLERY_SECURITY == 'private') {
            echo 'style="display:none"';
        }
        ?>
 >
							<td align="left" valign="top">
								<p>
									<a href="javascript:toggle_passwords('<?php 
        echo $suffix;
        ?>
',true);">
									<?php 
        echo gettext("Album password:"******"images/lock_open.png" />
								<?php 
        } else {
            $x = '          ';
            ?>
							<a onclick="resetPass();" title="<?php 
            echo gettext('clear password');
            ?>
"><img src="images/lock.png" /></a>
								<?php 
        }
        ?>
							</td>
						</tr>
						<tr class="password<?php 
        echo $suffix;
        ?>
extrahide" style="display:none" >
							<td align="left" valign="top">
								<p>
								<a href="javascript:toggle_passwords('<?php 
        echo $suffix;
        ?>
',false);">
									<?php 
        echo gettext("Album guest user:"******"Album password:"******"repeat:");
        ?>
								</p>
								<p>
								<?php 
        echo gettext("Password hint:");
        ?>
								</p>
							</td>
							<td>
								<p>
									<input type="text" size="<?php 
        echo TEXT_INPUT_SIZE;
        ?>
" id="user_name" name="<?php 
        echo $prefix;
        ?>
albumuser" value="<?php 
        echo $album->getUser();
        ?>
" />
								</p>
								<p>
								<input type="password" size="<?php 
        echo TEXT_INPUT_SIZE;
        ?>
" id="pass" name="<?php 
        echo $prefix;
        ?>
albumpass"  value="<?php 
        echo $x;
        ?>
" />
								<br />
								<input type="password" size="<?php 
        echo TEXT_INPUT_SIZE;
        ?>
" id="pass_2" name="<?php 
        echo $prefix;
        ?>
albumpass_2" value="<?php 
        echo $x;
        ?>
" />
								</p>
								<p>
								<?php 
        print_language_string_list($album->get('password_hint'), $prefix . "albumpass_hint", false, NULL, 'hint');
        ?>
								</p>
							</td>
						</tr>
					<?php 
    }
    $d = $album->getDateTime();
    if ($d == "0000-00-00 00:00:00") {
        $d = "";
    }
    ?>


					<tr>
						<td align="left" valign="top"><?php 
    echo gettext("Date:");
    ?>
 </td>
						<td width="400">
							<script type="text/javascript">
								// <!-- <![CDATA[
								$(function() {
									$("#datepicker<?php 
    echo $suffix;
    ?>
").datepicker({
													showOn: 'button',
													buttonImage: 'images/calendar.png',
													buttonText: '<?php 
    echo gettext('calendar');
    ?>
',
													buttonImageOnly: true
													});
								});
								// ]]> -->
							</script>
							<input type="text" id="datepicker<?php 
    echo $suffix;
    ?>
" size="20" name="<?php 
    echo $prefix;
    ?>
albumdate" value="<?php 
    echo $d;
    ?>
" />
						</td>
					</tr>
					<tr>
						<td align="left" valign="top"><?php 
    echo gettext("Location:");
    ?>
 </td>
						<td>
						<?php 
    print_language_string_list($album->getLocation(), $prefix . "albumlocation");
    ?>
						</td>
					</tr>
					<?php 
    $custom = zp_apply_filter('edit_album_custom_data', '', $album, $prefix);
    if (empty($custom)) {
        ?>
					<tr>
						<td align="left" valign="top"><?php 
        echo gettext("Custom data:");
        ?>
</td>
						<td><?php 
        print_language_string_list($album->get('custom_data'), $prefix . "album_custom_data", true, NULL, 'texteditor_albumcustomdata');
        ?>
</td>
					</tr>
						<?php 
    } else {
        echo $custom;
    }
    $sort = $sortby;
    if (!$album->isDynamic()) {
        $sort[gettext('Manual')] = 'manual';
    }
    $sort[gettext('Custom')] = 'custom';
    /*
     * not recommended--screws with peoples minds during pagination!
    	$sort[gettext('Random')] = 'random';
    */
    ?>
					<tr>
						<td align="left" valign="top"><?php 
    echo gettext("Sort subalbums by:");
    ?>
 </td>
						<td>
							<span class="nowrap">
								<select id="albumsortselect<?php 
    echo $prefix;
    ?>
" name="<?php 
    echo $prefix;
    ?>
subalbumsortby" onchange="update_direction(this,'album_direction_div<?php 
    echo $suffix;
    ?>
','album_custom_div<?php 
    echo $suffix;
    ?>
')">
								<?php 
    if (is_null($album->getParent())) {
        $globalsort = gettext("*gallery album sort order");
    } else {
        $globalsort = gettext("*parent album subalbum sort order");
    }
    echo "\n<option value =''>{$globalsort}</option>";
    $cvt = $type = strtolower($album->get('subalbum_sort_type'));
    if ($type && !in_array($type, $sort)) {
        $cv = array('custom');
    } else {
        $cv = array($type);
    }
    generateListFromArray($cv, $sort, false, true);
    ?>
								</select>
								<?php 
    if ($type == 'manual' || $type == 'random' || $type == '') {
        $dsp = 'none';
    } else {
        $dsp = 'inline';
    }
    ?>
								<label id="album_direction_div<?php 
    echo $suffix;
    ?>
" style="display:<?php 
    echo $dsp;
    ?>
;white-space:nowrap;">
									<?php 
    echo gettext("Descending");
    ?>
									<input type="checkbox" name="<?php 
    echo $prefix;
    ?>
album_sortdirection" value="1" <?php 
    if ($album->getSortDirection('album')) {
        echo "CHECKED";
    }
    ?>
 />
								</label>
							</span>
							<?php 
    $flip = array_flip($sort);
    if (empty($type) || isset($flip[$type])) {
        $dsp = 'none';
    } else {
        $dsp = 'block';
    }
    ?>
							<span id="album_custom_div<?php 
    echo $suffix;
    ?>
" class="customText" style="display:<?php 
    echo $dsp;
    ?>
;white-space:nowrap;">
								<br />
								<?php 
    echo gettext('custom fields:');
    ?>
								<input id="customalbumsort<?php 
    echo $suffix;
    ?>
" class="customalbumsort" name="<?php 
    echo $prefix;
    ?>
customalbumsort" type="text" value="<?php 
    echo html_encode($cvt);
    ?>
"></input>
							</span>
					</td>
				</tr>

				<tr>
					<td align="left" valign="top"><?php 
    echo gettext("Sort images by:");
    ?>
 </td>
						<td>
							<span class="nowrap">
								<select id="imagesortselect<?php 
    echo $prefix;
    ?>
" name="<?php 
    echo $prefix;
    ?>
sortby" onchange="update_direction(this,'image_direction_div<?php 
    echo $suffix;
    ?>
','image_custom_div<?php 
    echo $suffix;
    ?>
')">
								<?php 
    if (is_null($album->getParent())) {
        $globalsort = gettext("*gallery image sort order");
    } else {
        $globalsort = gettext("*parent album image sort order");
    }
    ?>
								<option value =""><?php 
    echo $globalsort;
    ?>
</option>
								<?php 
    $cvt = $type = strtolower($album->get('sort_type'));
    if ($type && !in_array($type, $sort)) {
        $cv = array('custom');
    } else {
        $cv = array($type);
    }
    generateListFromArray($cv, $sort, false, true);
    ?>
								</select>
							<?php 
    if ($type == 'manual' || $type == 'random' || $type == '') {
        $dsp = 'none';
    } else {
        $dsp = 'inline';
    }
    ?>
							<label id="image_direction_div<?php 
    echo $suffix;
    ?>
" style="display:<?php 
    echo $dsp;
    ?>
;white-space:nowrap;">
								<?php 
    echo gettext("Descending");
    ?>
								<input type="checkbox" name="<?php 
    echo $prefix;
    ?>
image_sortdirection" value="1"
									<?php 
    if ($album->getSortDirection('image')) {
        echo ' checked="checked"';
    }
    ?>
 />
							</label>
						</span>
						<?php 
    $flip = array_flip($sort);
    if (empty($type) || isset($flip[$type])) {
        $dsp = 'none';
    } else {
        $dsp = 'block';
    }
    ?>
						<span id="image_custom_div<?php 
    echo $suffix;
    ?>
" class="customText" style="display:<?php 
    echo $dsp;
    ?>
;white-space:nowrap;">
							<br />
							<?php 
    echo gettext('custom fields:');
    ?>
							<input id="customimagesort<?php 
    echo $suffix;
    ?>
" class="customimagesort" name="<?php 
    echo $prefix;
    ?>
customimagesort" type="text" value="<?php 
    echo html_encode($cvt);
    ?>
"></input>
						</span>
					 </td>
				</tr>

				<?php 
    if (is_null($album->getParent())) {
        ?>
					<tr>
						<td align="left" valign="top"><?php 
        echo gettext("Album theme:");
        ?>
 </td>
						<td>
							<select id="album_theme" class="album_theme" name="<?php 
        echo $prefix;
        ?>
album_theme"	<?php 
        if (!zp_loggedin(THEMES_RIGHTS)) {
            echo 'disabled="disabled" ';
        }
        ?>
	>
							<?php 
        $themes = $gallery->getThemes();
        $oldtheme = $album->getAlbumTheme();
        if (empty($oldtheme)) {
            $selected = 'selected="selected"';
        } else {
            $selected = '';
        }
        ?>
							<option value="" style="background-color:LightGray" <?php 
        echo $selected;
        ?>
 ><?php 
        echo gettext('*gallery theme');
        ?>
</option>
							<?php 
        foreach ($themes as $theme => $themeinfo) {
            if ($oldtheme == $theme) {
                $selected = 'selected="selected"';
            } else {
                $selected = '';
            }
            ?>
								<option value = "<?php 
            echo $theme;
            ?>
" <?php 
            echo $selected;
            ?>
 ><?php 
            echo $themeinfo['name'];
            ?>
</option>
							<?php 
        }
        ?>
							</select>
						</td>
					</tr>
					<?php 
    }
    if (!$album->isDynamic()) {
        ?>
					<tr>
						<td align="left" valign="top" width="150"><?php 
        echo gettext("Album watermarks:");
        ?>
 </td>
						<td>
							<?php 
        $current = $album->getWatermark();
        ?>
							<select id="album_watermark" name="<?php 
        echo $prefix;
        ?>
album_watermark">
								<option value="<?php 
        echo NO_WATERMARK;
        ?>
" <?php 
        if ($current == NO_WATERMARK) {
            echo ' selected="selected"';
        }
        ?>
 style="background-color:LightGray"><?php 
        echo gettext('*no watermark');
        ?>
</option>
								<option value="" <?php 
        if (empty($current)) {
            echo ' selected="selected"';
        }
        ?>
 style="background-color:LightGray"><?php 
        echo gettext('*default');
        ?>
</option>
								<?php 
        $watermarks = getWatermarks();
        generateListFromArray(array($current), $watermarks, false, false);
        ?>
							</select>
							<?php 
        echo gettext('Images');
        ?>
							</td>
					</tr>
					<tr>
						<td align="left" valign="top" width="150"></td>
						<td>
							<?php 
        $current = $album->getWatermarkThumb();
        ?>
							<select id="album_watermark_thumb" name="<?php 
        echo $prefix;
        ?>
album_watermark_thumb">
								<option value="<?php 
        echo NO_WATERMARK;
        ?>
" <?php 
        if ($current == NO_WATERMARK) {
            echo ' selected="selected"';
        }
        ?>
 style="background-color:LightGray"><?php 
        echo gettext('*no watermark');
        ?>
</option>
								<option value="" <?php 
        if (empty($current)) {
            echo ' selected="selected"';
        }
        ?>
 style="background-color:LightGray"><?php 
        echo gettext('*default');
        ?>
</option>
								<?php 
        $watermarks = getWatermarks();
        generateListFromArray(array($current), $watermarks, false, false);
        ?>
							</select>
							<?php 
        echo gettext('Thumbs');
        ?>
						</td>
					</tr>
					<?php 
    }
    if ($index == 0) {
        // suppress for mass-edit
        ?>
					<tr>
						<td align="left" valign="top" width="150"><?php 
        echo gettext("Thumbnail:");
        ?>
 </td>
						<td>
						<?php 
        $showThumb = $gallery->getThumbSelectImages();
        $thumb = $album->get('thumb');
        if ($showThumb) {
            ?>
							<script type="text/javascript">
								// <!-- <![CDATA[
								updateThumbPreview(document.getElementById('thumbselect'));
								// ]]> -->
							</script>
							<?php 
        }
        ?>
						<select style="width:320px" <?php 
        if ($showThumb) {
            ?>
class="thumbselect" onchange="updateThumbPreview(this)"	<?php 
        }
        ?>
 name="<?php 
        echo $prefix;
        ?>
thumb">
							<option <?php 
        if ($showThumb) {
            ?>
class="thumboption" style="background-color:#B1F7B6"<?php 
        }
        if ($thumb === '1') {
            ?>
selected="selected"<?php 
        }
        ?>
	value="1"><?php 
        echo $_thumb_field_text[getOption('AlbumThumbSelectField')];
        ?>
							</option>
							<option <?php 
        if ($showThumb) {
            ?>
class="thumboption" style="background-color:#B1F7B6" <?php 
        }
        ?>
								<?php 
        if (empty($thumb) && $thumb !== '1') {
            ?>
 selected="selected" <?php 
        }
        ?>
									value=""><?php 
        echo gettext('randomly selected');
        ?>
							</option>
							<?php 
        if ($album->isDynamic()) {
            $params = $album->getSearchParams();
            $search = new SearchEngine(true);
            $search->setSearchParams($params);
            $images = $search->getImages(0);
            $thumb = $album->get('thumb');
            $imagelist = array();
            foreach ($images as $imagerow) {
                $folder = $imagerow['folder'];
                $filename = $imagerow['filename'];
                $imagelist[] = '/' . $folder . '/' . $filename;
            }
            if (count($imagelist) == 0) {
                $subalbums = $search->getAlbums(0);
                foreach ($subalbums as $folder) {
                    $newalbum = new Album($gallery, $folder);
                    if (!$newalbum->isDynamic()) {
                        $images = $newalbum->getImages(0);
                        foreach ($images as $filename) {
                            $imagelist[] = '/' . $folder . '/' . $filename;
                        }
                    }
                }
            }
            foreach ($imagelist as $imagepath) {
                $list = explode('/', $imagepath);
                $filename = $list[count($list) - 1];
                unset($list[count($list) - 1]);
                $folder = implode('/', $list);
                $albumx = new Album($gallery, $folder);
                $image = newImage($albumx, $filename);
                $selected = $imagepath == $thumb;
                echo "\n<option";
                if ($showThumb) {
                    echo " class=\"thumboption\"";
                    echo " style=\"background-image: url(" . html_encode($image->getSizedImage(80)) . "); background-repeat: no-repeat;\"";
                }
                echo " value=\"" . $imagepath . "\"";
                if ($selected) {
                    echo " selected=\"selected\"";
                }
                echo ">" . $image->getTitle();
                echo " ({$imagepath})";
                echo "</option>";
            }
        } else {
            $images = $album->getImages();
            if (count($images) == 0 && $album->getNumAlbums() > 0) {
                $imagearray = array();
                $albumnames = array();
                $strip = strlen($album->name) + 1;
                $subIDs = getAllSubAlbumIDs($album->name);
                if (!is_null($subIDs)) {
                    foreach ($subIDs as $ID) {
                        $albumnames[$ID['id']] = $ID['folder'];
                        $query = 'SELECT `id` , `albumid` , `filename` , `title` FROM ' . prefix('images') . ' WHERE `albumid` = "' . $ID['id'] . '"';
                        $imagearray = array_merge($imagearray, query_full_array($query));
                    }
                    foreach ($imagearray as $imagerow) {
                        $filename = $imagerow['filename'];
                        $folder = $albumnames[$imagerow['albumid']];
                        $imagepath = substr($folder, $strip) . '/' . $filename;
                        if (substr($imagepath, 0, 1) == '/') {
                            $imagepath = substr($imagepath, 1);
                        }
                        $albumx = new Album($gallery, $folder);
                        $image = newImage($albumx, $filename);
                        if (is_valid_image($filename)) {
                            $selected = $imagepath == $thumb;
                            echo "\n<option";
                            if ($gallery->getThumbSelectImages()) {
                                echo " class=\"thumboption\"";
                                echo " style=\"background-image: url(" . html_encode($image->getSizedImage(80)) . "); background-repeat: no-repeat;\"";
                            }
                            echo " value=\"" . $imagepath . "\"";
                            if ($selected) {
                                echo " selected=\"selected\"";
                            }
                            echo ">" . $image->getTitle();
                            echo " ({$imagepath})";
                            echo "</option>";
                        }
                    }
                }
            } else {
                foreach ($images as $filename) {
                    $image = newImage($album, $filename);
                    $selected = $filename == $album->get('thumb');
                    if (is_valid_image($filename)) {
                        echo "\n<option";
                        if ($gallery->getThumbSelectImages()) {
                            echo " class=\"thumboption\"";
                            echo " style=\"background-image: url(" . html_encode($image->getSizedImage(80)) . "); background-repeat: no-repeat;\"";
                        }
                        echo " value=\"" . $filename . "\"";
                        if ($selected) {
                            echo " selected=\"selected\"";
                        }
                        echo ">" . $image->getTitle();
                        if ($filename != $image->getTitle()) {
                            echo " ({$filename})";
                        }
                        echo "</option>";
                    }
                }
            }
        }
        ?>
						</select>
						</td>
					</tr>
		<?php 
    }
    ?>
	<tr valign="top">
		<td class="topalign-nopadding"><br /><?php 
    echo gettext("Codeblocks:");
    ?>
</td>
		<td>
		<br />
			<div class="tabs">
				<ul class="tabNavigation">
					<li><a href="#first"><?php 
    echo gettext("Codeblock 1");
    ?>
</a></li>
					<li><a href="#second"><?php 
    echo gettext("Codeblock 2");
    ?>
</a></li>
					<li><a href="#third"><?php 
    echo gettext("Codeblock 3");
    ?>
</a></li>
				</ul>
					<?php 
    $getcodeblock = $album->getCodeblock();
    if (!empty($getcodeblock)) {
        $codeblock = unserialize($getcodeblock);
    } else {
        $codeblock[1] = "";
        $codeblock[2] = "";
        $codeblock[3] = "";
    }
    ?>
				<div id="first">
					<textarea name="<?php 
    echo $prefix;
    ?>
codeblock1" id="codeblock1<?php 
    echo $suffix;
    ?>
" rows="40" cols="60"><?php 
    echo html_encode($codeblock[1]);
    ?>
</textarea>
				</div>
				<div id="second">
					<textarea name="<?php 
    echo $prefix;
    ?>
codeblock2" id="codeblock2<?php 
    echo $suffix;
    ?>
" rows="40" cols="60"><?php 
    echo html_encode($codeblock[2]);
    ?>
</textarea>
				</div>
				<div id="third">
					<textarea name="<?php 
    echo $prefix;
    ?>
codeblock3" id="codeblock3<?php 
    echo $suffix;
    ?>
" rows="40" cols="60"><?php 
    echo html_encode($codeblock[3]);
    ?>
</textarea>
				</div>
			</div>
		</td>
	</tr>
</table>
			</td>
			<?php 
    $bglevels = array('#fff', '#f8f8f8', '#efefef', '#e8e8e8', '#dfdfdf', '#d8d8d8', '#cfcfcf', '#c8c8c8');
    ?>
			<td valign="top">
				<h2 class="h2_bordered_edit"><?php 
    echo gettext("General");
    ?>
</h2>
				<div class="box-edit">

						<label class="checkboxlabel">
							<input type="checkbox" name="<?php 
    echo $prefix;
    ?>
Published" value="1" <?php 
    if ($album->getShow()) {
        echo ' checked="checked"';
    }
    ?>
 />
							<?php 
    echo gettext("Published");
    ?>
						</label>
						<label class="checkboxlabel">
							<input type="checkbox" name="<?php 
    echo $prefix . 'allowcomments';
    ?>
" value="1" <?php 
    if ($album->getCommentsAllowed()) {
        echo ' checked="checked"';
    }
    ?>
 />
							<?php 
    echo gettext("Allow Comments");
    ?>
						</label>
						<?php 
    $hc = $album->get('hitcounter');
    if (empty($hc)) {
        $hc = '0';
    }
    ?>
						<label class="checkboxlabel">
							<input type="checkbox" name="<?php 
    echo $prefix;
    ?>
reset_hitcounter" />
							<?php 
    echo sprintf(gettext("Reset hitcounter (%u hits)"), $hc);
    ?>
						</label>
						<?php 
    $tv = $album->get('total_value');
    $tc = $album->get('total_votes');
    if ($tc > 0) {
        $hc = $tv / $tc;
        ?>
							<label class="checkboxlabel">
								<input type="checkbox" id="reset_rating<?php 
        echo $suffix;
        ?>
" name="<?php 
        echo $prefix;
        ?>
reset_rating" value="1" />
								<?php 
        printf(gettext('Reset rating (%u stars)'), $hc);
        ?>
							</label>
							<?php 
    } else {
        ?>
									<label class="checkboxlabel">
										<input type="checkbox" name="<?php 
        echo $prefix;
        ?>
reset_rating" value="1" disabled="disabled"/>
										<?php 
        echo gettext('Reset rating (unrated)');
        ?>
									</label>
							<?php 
    }
    ?>

					<br clear="all" />
				</div>
				<!-- **************** Move/Copy/Rename ****************** -->
				<h2 class="h2_bordered_edit"><?php 
    echo gettext("Utilities");
    ?>
</h2>
				<div class="box-edit">

						<label class="checkboxlabel">
							<input type="radio" id="a-<?php 
    echo $prefix;
    ?>
move" name="a-<?php 
    echo $prefix;
    ?>
MoveCopyRename" value="move"
								onclick="toggleAlbumMoveCopyRename('<?php 
    echo $prefix;
    ?>
', 'movecopy');"/>
							<?php 
    echo gettext("Move");
    ?>
						</label>

						<label class="checkboxlabel">
							<input type="radio" id="a-<?php 
    echo $prefix;
    ?>
copy" name="a-<?php 
    echo $prefix;
    ?>
MoveCopyRename" value="copy"
								onclick="toggleAlbumMoveCopyRename('<?php 
    echo $prefix;
    ?>
', 'movecopy');"/>
							<?php 
    echo gettext("Copy");
    ?>
						</label>

						<label class="checkboxlabel">
							<input type="radio" id="a-<?php 
    echo $prefix;
    ?>
rename" name="a-<?php 
    echo $prefix;
    ?>
MoveCopyRename" value="rename"
								onclick="toggleAlbumMoveCopyRename('<?php 
    echo $prefix;
    ?>
', 'rename');"/>
							<?php 
    echo gettext("Rename Folder");
    ?>
						</label>
						<label class="checkboxlabel">
								<input type="radio" id="Delete-<?php 
    echo $prefix;
    ?>
" name="a-<?php 
    echo $prefix;
    ?>
MoveCopyRename" value="delete"
									onclick="image_deleteconfirm(this,'<?php 
    echo $prefix;
    ?>
',deleteAlbum1)" />
							<?php 
    echo gettext("Delete album");
    ?>
						</label>
						<br clear="all" />
						<div class="deletemsg" id="deletemsg<?php 
    echo $prefix;
    ?>
"	style="padding-top: .5em; padding-left: .5em; color: red; display: none">
						<?php 
    echo gettext('Album will be deleted when changes are applied.');
    ?>
						<p class="buttons"><a	href="javascript:toggleMoveCopyRename('<?php 
    echo $prefix;
    ?>
', '');"><img src="images/reset.png" alt="" /><?php 
    echo gettext("Cancel");
    ?>
</a></p>
						</div>
					<div id="a-<?php 
    echo $prefix;
    ?>
movecopydiv" style="padding-top: .5em; padding-left: .5em; display: none;">
						<?php 
    echo gettext("to:");
    ?>
						<select id="a-<?php 
    echo $prefix;
    ?>
albumselectmenu" name="a-<?php 
    echo $prefix;
    ?>
albumselect" onchange="">
							<?php 
    $exclude = $album->name;
    if (count(explode('/', $exclude)) > 1 && zp_loggedin(MANAGE_ALL_ALBUM_RIGHTS)) {
        ?>
								<option value="" selected="selected">/</option>
								<?php 
    }
    foreach ($mcr_albumlist as $fullfolder => $albumtitle) {
        // don't allow copy in place or to subalbums
        if ($fullfolder == dirname($exclude) || $fullfolder == $exclude || strpos($fullfolder, $exclude . '/') === 0) {
            $disabled = ' disabled="disabled"';
        } else {
            $disabled = '';
        }
        // Get rid of the slashes in the subalbum, while also making a subalbum prefix for the menu.
        $singlefolder = $fullfolder;
        $saprefix = '';
        $salevel = 0;
        while (strstr($singlefolder, '/') !== false) {
            $singlefolder = substr(strstr($singlefolder, '/'), 1);
            $saprefix = "&nbsp; &nbsp;&nbsp;" . $saprefix;
            $salevel = ($salevel + 1) % 8;
        }
        echo '<option value="' . $fullfolder . '"' . ($salevel > 0 ? ' style="background-color: ' . $bglevels[$salevel] . ';"' : '') . "{$disabled}>" . $saprefix . $singlefolder . "</option>\n";
    }
    ?>
						</select>
						<br clear="all" /><br />
						<p class="buttons">
							<a href="javascript:toggleAlbumMoveCopyRename('<?php 
    echo $prefix;
    ?>
', '');"><img src="images/reset.png" alt="" /><?php 
    echo gettext("Cancel");
    ?>
</a>
						</p>
					</div>
					<div id="a-<?php 
    echo $prefix;
    ?>
renamediv" style="padding-top: .5em; padding-left: .5em; display: none;">
						<?php 
    echo gettext("to:");
    ?>
						<input name="a-<?php 
    echo $prefix;
    ?>
renameto" type="text" value="<?php 
    echo basename($album->name);
    ?>
"/><br />
						<br clear="all" />
						<p class="buttons">
						<a href="javascript:toggleAlbumMoveCopyRename('<?php 
    echo $prefix;
    ?>
', '');"><img src="images/reset.png" alt="" /><?php 
    echo gettext("Cancel");
    ?>
</a>
						</p>
					</div>
					<span style="line-height: 0em;"><br clear="all" /></span>
					<?php 
    echo zp_apply_filter('edit_album_utilities', '', $album, $prefix);
    ?>
					<span style="line-height: 0em;"><br clear="all" /></span>
					</div>
					<h2 class="h2_bordered_edit"><?php 
    echo gettext("Tags");
    ?>
</h2>
					<div class="box-edit-unpadded">
						<?php 
    $tagsort = getTagOrder();
    tagSelector($album, 'tags_' . $prefix, false, $tagsort);
    ?>
					</div>
			</td>
		</tr>
	</table>
	<?php 
    if ($album->isDynamic()) {
        ?>
		<table>
			<tr>
				<td align="left" valign="top" width="150"><?php 
        echo gettext("Dynamic album search:");
        ?>
</td>
				<td>
					<table class="noinput">
						<tr>
							<td><?php 
        echo html_encode(urldecode($album->getSearchParams()));
        ?>
</td>
						</tr>
					</table>
				</td>
			</tr>
		</table>
	<?php 
    }
    ?>


<br clear="all" />
	<span class="buttons">
		<a title="<?php 
    echo gettext('Back to the album list');
    ?>
" href="<?php 
    echo WEBPATH . '/' . ZENFOLDER . '/admin-edit.php?page=edit' . $parent;
    ?>
">
		<img	src="images/arrow_left_blue_round.png" alt="" />
		<strong><?php 
    echo gettext("Back");
    ?>
</strong>
		</a>
		<button type="submit" title="<?php 
    echo gettext("Apply");
    ?>
">
		<img	src="images/pass.png" alt="" />
		<strong><?php 
    echo gettext("Apply");
    ?>
</strong>
		</button>
		<button type="reset" title="<?php 
    echo gettext("Reset");
    ?>
" onclick="javascript:$('.deletemsg').hide();">
		<img	src="images/fail.png" alt="" />
		<strong><?php 
    echo gettext("Reset");
    ?>
</strong>
		</button>
		<div class="floatright">
		<?php 
    if (!$album->isDynamic()) {
        ?>
			<button type="button" title="<?php 
        echo gettext('New subalbum');
        ?>
" onclick="javascript:newAlbum('<?php 
        echo pathurlencode($album->name);
        ?>
',true);">
			<img src="images/folder.png" alt="" />
			<strong><?php 
        echo gettext('New subalbum');
        ?>
</strong>
			</button>
			<?php 
    }
    ?>
		<a title="<?php 
    echo gettext('View Album');
    ?>
" href="<?php 
    echo WEBPATH . "/index.php?album=" . pathurlencode($album->getFolder());
    ?>
">
		<img src="images/view.png" alt="" />
		<strong><?php 
    echo gettext('View Album');
    ?>
</strong>
		</a>
		</div>
	</span>
<br clear="all" />
<?php 
}
/**
 * emits the html for editing album information
 * called in edit album and mass edit
 *@param string param1 the index of the entry in mass edit or '0' if single album
 *@param object param2 the album object
 *@since 1.1.3
 */
function printAlbumEditForm($index, $album)
{
    // Note: This is some pretty confusing spaghetti code with all the echo statements.
    // Please refactor it so the HTML is readable and easily editable.
    // FYI: It's perfectly acceptable to drop out of php-parsing mode in a function.
    // See the move/copy/rename block for an example.
    global $sortby, $gallery, $_zp_loggedin, $mcr_albumlist, $albumdbfields, $imagedbfields;
    $tagsort = getTagOrder();
    if ($index == 0) {
        if (isset($saved)) {
            $album->setSubalbumSortType('manual');
        }
        $suffix = $prefix = '';
    } else {
        $prefix = "{$index}-";
        $suffix = "_{$index}";
        echo "<p><em><strong>" . $album->name . "</strong></em></p>";
    }
    echo "\n<input type=\"hidden\" name=\"" . $prefix . "folder\" value=\"" . $album->name . "\" />";
    echo "\n" . '<input type="hidden" name="tagsort" value=' . $tagsort . ' />';
    echo "\n<table>";
    echo "\n<td width = \"60%\">\n<table>\n<tr>";
    echo "\n<tr>";
    echo "<td align=\"right\" valign=\"top\" width=\"150\">" . gettext("Album Title") . ": </td>";
    echo '<td>';
    print_language_string_list($album->get('title'), $prefix . "albumtitle", false);
    echo "</td></tr>\n";
    echo '<tr><td></td>';
    $hc = $album->get('hitcounter');
    if (empty($hc)) {
        $hc = '0';
    }
    echo "<td>";
    echo sprintf(gettext("Hit counter: %u"), $hc) . " <input type=\"checkbox\" name=\"reset_hitcounter\"> Reset";
    $tv = $album->get('total_value');
    $tc = $album->get('total_votes');
    echo '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
    if ($tc > 0) {
        $hc = $tv / $tc;
        printf(gettext('Rating: <strong>%u</strong>'), $hc);
        echo "<label for=\"" . $prefix . "reset_rating\"><input type=\"checkbox\" id=\"" . $prefix . "reset_rating\" name=\"" . $prefix . "reset_rating\" value=1> " . gettext("Reset") . "</label> ";
    } else {
        echo gettext("Rating: Unrated");
    }
    echo "</td>";
    echo '</tr>';
    echo "\n<tr><td align=\"right\" valign=\"top\">" . gettext("Album Description:") . " </td> <td>";
    print_language_string_list($album->get('desc'), $prefix . "albumdesc", true, NULL, 'texteditor');
    echo "</td></tr>";
    echo "\n<tr><td align=\"right\" value=\"top\">" . gettext("Album guest user:"******"\n<td><input type='text' size='48' name='" . $prefix . "albumuser' value='" . $album->getUser() . "' /></td></tr>";
    echo "\n<tr>";
    echo "\n<td align=\"right\">" . gettext("Album password:"******" <br/>" . gettext("repeat:") . " </td>";
    echo "\n<td>";
    $x = $album->getPassword();
    if (!empty($x)) {
        $x = '			 ';
    }
    echo "\n<input type=\"password\" size=\"48\" name=\"" . $prefix . "albumpass\"";
    echo "\nvalue=\"" . $x . '" /><br/>';
    echo "\n<input type=\"password\" size=\"48\" name=\"" . $prefix . "albumpass_2\"";
    echo "\nvalue=\"" . $x . '" />';
    echo "\n</td>";
    echo "\n</tr>";
    echo "\n<tr><td align=\"right\" valign=\"top\">" . gettext("Password hint:") . " </td> <td>";
    print_language_string_list($album->get('password_hint'), $prefix . "albumpass_hint", false);
    echo "</td></tr>";
    $d = $album->getDateTime();
    if ($d == "0000-00-00 00:00:00") {
        $d = "";
    }
    echo "\n<tr><td align=\"right\" valign=\"top\">" . gettext("Date:") . " </td> <td width = \"400\"><input type=\"text\" size='48' name=\"" . $prefix . "albumdate\" value=\"" . $d . '" /></td></tr>';
    echo "\n<tr><td align=\"right\" valign=\"top\">" . gettext("Location:") . " </td> <td>";
    print_language_string_list($album->get('place'), $prefix . "albumplace", false);
    echo "</td></tr>";
    echo "\n<tr><td align=\"right\" valign=\"top\">" . gettext("Custom data:") . "</td><td>";
    print_language_string_list($album->get('custom_data'), $prefix . "album_custom_data", true);
    echo "</td></tr>";
    $sort = $sortby;
    if (!$album->isDynamic()) {
        $sort[gettext('Manual')] = 'manual';
    }
    $sort[gettext('Custom')] = 'custom';
    echo "\n<tr>";
    echo "\n<td align=\"right\" valign=\"top\">" . gettext("Sort subalbums by:") . " </td>";
    echo "\n<td>";
    // script to test for what is selected
    $javaprefix = 'js_' . preg_replace("/[^a-z0-9_]/", "", strtolower($prefix));
    ?>
	<table>
		<tr>
			<td>
			<select id="sortselect" name="<?php 
    echo $prefix;
    ?>
subalbumsortby" onchange="update_direction(this,'<?php 
    echo $javaprefix;
    ?>
album_direction_div','<?php 
    echo $javaprefix;
    ?>
album_custom_div')">
			<?php 
    if (is_null($album->getParent())) {
        $globalsort = gettext("gallery album sort order");
    } else {
        $globalsort = gettext("parent album subalbum sort order");
    }
    echo "\n<option value =''>{$globalsort}</option>";
    $cvt = $type = strtolower($album->get('subalbum_sort_type'));
    generateListFromArray(array($type), $sort, false, true);
    ?>
			</select>
			</td>
		<td>
	<?php 
    if ($type == 'manual' || $type == '') {
        $dsp = 'none';
    } else {
        $dsp = 'block';
    }
    echo "\n<span id=\"" . $javaprefix . "album_direction_div\" style=\"display:" . $dsp . "\">";
    echo "&nbsp;" . gettext("Descending") . " <input type=\"checkbox\" name=\"" . $prefix . "album_sortdirection\" value=\"1\"";
    if ($album->getSortDirection('album')) {
        echo "CHECKED";
    }
    echo ">";
    echo '</span>';
    $flip = array_flip($sort);
    if (empty($type) || isset($flip[$type])) {
        $dsp = 'none';
    } else {
        $dsp = 'block';
    }
    ?>
		</td>
	</tr>
	<script type="text/javascript">
		$(function () {
			$('#<?php 
    echo $javaprefix;
    ?>
customalbumsort').tagSuggest({
				tags: [<?php 
    echo $albumdbfields;
    ?>
]
			});
		});
	</script>
	<tr>
		<td colspan="2">
		<span id="<?php 
    echo $javaprefix;
    ?>
album_custom_div" class="customText" style="display:<?php 
    echo $dsp;
    ?>
">
		<?php 
    echo gettext('custom fields:');
    ?>
		<input id="<?php 
    echo $javaprefix;
    ?>
customalbumsort" name="<?php 
    echo $prefix;
    ?>
customalbumsort" type="text" value="<?php 
    echo $cvt;
    ?>
"></input>
		</span>
	
		</td>
	</tr>
</table>
	<?php 
    echo "\n</td>";
    echo "\n</tr>";
    echo "\n<tr>";
    echo "\n<td align=\"right\" valign=\"top\">" . gettext("Sort images by:") . " </td>";
    echo "\n<td>";
    // script to test for what is selected
    $javaprefix = 'js_' . preg_replace("/[^a-z0-9_]/", "", strtolower($prefix));
    ?>
	<table>
		<tr>
			<td>
			<select id="sortselect" name="<?php 
    echo $prefix;
    ?>
sortby" onchange="update_direction(this,'<?php 
    echo $javaprefix;
    ?>
image_direction_div','<?php 
    echo $javaprefix;
    ?>
image_custom_div')">
			<?php 
    if (is_null($album->getParent())) {
        $globalsort = gettext("gallery default image sort order");
    } else {
        $globalsort = gettext("parent album image sort order");
    }
    echo "\n<option value =''>{$globalsort}</option>";
    $cvt = $type = strtolower($album->get('sort_type'));
    generateListFromArray(array($type), $sort, false, true);
    ?>
			</select>
			</td>
		<td>
	<?php 
    if ($type == 'manual' || $type == '') {
        $dsp = 'none';
    } else {
        $dsp = 'block';
    }
    echo "\n<span id=\"" . $javaprefix . "image_direction_div\" style=\"display:" . $dsp . "\">";
    echo "&nbsp;" . gettext("Descending") . " <input type=\"checkbox\" name=\"" . $prefix . "image_sortdirection\" value=\"1\"";
    if ($album->getSortDirection('image')) {
        echo "CHECKED";
    }
    echo ">";
    echo '</span>';
    $flip = array_flip($sort);
    if (empty($type) || isset($flip[$type])) {
        $dsp = 'none';
    } else {
        $dsp = 'block';
    }
    ?>
			</td>
		</tr>
		<script type="text/javascript">
			$(function () {
				$('#<?php 
    echo $javaprefix;
    ?>
customimagesort').tagSuggest({
					tags: [<?php 
    echo $imagedbfields;
    ?>
]
				});
			});
		</script>
		<tr>
			<td colspan="2">
			<span id="<?php 
    echo $javaprefix;
    ?>
image_custom_div" class="customText" style="display:<?php 
    echo $dsp;
    ?>
">
			<?php 
    echo gettext('custom fields:');
    ?>
			<input id="<?php 
    echo $javaprefix;
    ?>
customimagesort" name="<?php 
    echo $prefix;
    ?>
customimagesort" type="text" value="<?php 
    echo $cvt;
    ?>
"></input>
			</span>
			</td>
		</tr>
	</table>
	<?php 
    echo "\n</td>";
    echo "\n</tr>";
    echo "\n<tr>";
    echo "\n<td align=\"right\" valign=\"top\"></td><td><input type=\"checkbox\" name=\"" . $prefix . "allowcomments\" value=\"1\"";
    if ($album->getCommentsAllowed()) {
        echo "CHECKED";
    }
    echo "> " . gettext("Allow Comments") . " ";
    echo "<input type=\"checkbox\" name=\"" . $prefix . "Published\" value=\"1\"";
    if ($album->getShow()) {
        echo "CHECKED";
    }
    echo "> " . gettext("Published") . " ";
    echo "</td>\n</tr>";
    if (is_null($album->getParent())) {
        echo "\n<tr>";
        echo "\n<td align=\"right\" valign=\"top\">" . gettext("Album theme:") . " </td> ";
        echo "\n<td>";
        echo "\n<select id=\"album_theme\" class=\"album_theme\" name=\"" . $prefix . "album_theme\" ";
        if (!($_zp_loggedin & (ADMIN_RIGHTS | THEMES_RIGHTS))) {
            echo "DISABLED ";
        }
        echo ">";
        $themes = $gallery->getThemes();
        $oldtheme = $album->getAlbumTheme();
        if (empty($oldtheme)) {
            echo "<option value = \"\" selected=\"SELECTED\" />";
        } else {
            echo "<option value = \"\" />";
        }
        echo "</option>";
        foreach ($themes as $theme => $themeinfo) {
            echo "<option value = \"{$theme}\"";
            if ($oldtheme == $theme) {
                echo "selected = \"SELECTED\"";
            }
            echo "\t/>";
            echo $themeinfo['name'];
            echo "</option>";
        }
        echo "\n</select>";
        echo "\n</td>";
        echo "\n</tr>";
    }
    echo "\n</table>\n</td>";
    echo "\n<td valign=\"top\">";
    $bglevels = array('#fff', '#f8f8f8', '#efefef', '#e8e8e8', '#dfdfdf', '#d8d8d8', '#cfcfcf', '#c8c8c8');
    /* **************** Move/Copy/Rename ****************** */
    ?>

	<label for="a-<?php 
    echo $prefix;
    ?>
move" style="padding-right: .5em">
		<input type="radio" id="a-<?php 
    echo $prefix;
    ?>
move" name="a-<?php 
    echo $prefix;
    ?>
MoveCopyRename" value="move"
			onclick="toggleAlbumMoveCopyRename('<?php 
    echo $prefix;
    ?>
', 'movecopy');"/>
		<?php 
    echo gettext("Move");
    ?>
	</label>
	<label for="a-<?php 
    echo $prefix;
    ?>
copy" style="padding-right: .5em">
		<input type="radio" id="a-<?php 
    echo $prefix;
    ?>
copy" name="a-<?php 
    echo $prefix;
    ?>
MoveCopyRename" value="copy"
			onclick="toggleAlbumMoveCopyRename('<?php 
    echo $prefix;
    ?>
', 'movecopy');"/>
		<?php 
    echo gettext("Copy");
    ?>
	</label>
	<label for="a-<?php 
    echo $prefix;
    ?>
rename" style="padding-right: .5em">
		<input type="radio" id="a-<?php 
    echo $prefix;
    ?>
rename" name="a-<?php 
    echo $prefix;
    ?>
MoveCopyRename" value="rename"
			onclick="toggleAlbumMoveCopyRename('<?php 
    echo $prefix;
    ?>
', 'rename');"/>
		<?php 
    echo gettext("Rename Folder");
    ?>
	</label>


	<div id="a-<?php 
    echo $prefix;
    ?>
movecopydiv" style="padding-top: .5em; padding-left: .5em; display: none;">
		<?php 
    echo gettext("to");
    ?>
: <select id="a-<?php 
    echo $prefix;
    ?>
albumselectmenu" name="a-<?php 
    echo $prefix;
    ?>
albumselect" onChange="">
			<option value="" selected="selected">/</option>
			<?php 
    foreach ($mcr_albumlist as $fullfolder => $albumtitle) {
        $singlefolder = $fullfolder;
        $saprefix = "";
        $salevel = 0;
        $selected = "";
        if ($album->name == $fullfolder) {
            continue;
        }
        // Get rid of the slashes in the subalbum, while also making a subalbum prefix for the menu.
        while (strstr($singlefolder, '/') !== false) {
            $singlefolder = substr(strstr($singlefolder, '/'), 1);
            $saprefix = "&nbsp; &nbsp;&nbsp;" . $saprefix;
            $salevel++;
        }
        echo '<option value="' . $fullfolder . '"' . ($salevel > 0 ? ' style="background-color: ' . $bglevels[$salevel] . ';"' : '') . "{$selected}>" . $saprefix . $singlefolder . "</option>\n";
    }
    ?>
		</select>
		<p style="text-align: right;">
			<a href="javascript:toggleAlbumMoveCopyRename('<?php 
    echo $prefix;
    ?>
', '');"><?php 
    echo gettext("Cancel");
    ?>
</a>
		</p>
	</div>
	<div id="a-<?php 
    echo $prefix;
    ?>
renamediv" style="padding-top: .5em; padding-left: .5em; display: none;">
		<?php 
    echo gettext("to");
    ?>
: <input name="a-<?php 
    echo $prefix;
    ?>
renameto" type="text" size="35" value="<?php 
    echo basename($album->name);
    ?>
"/><br />
		<p style="text-align: right; padding: .25em 0px;">
			<a href="javascript:toggleAlbumMoveCopyRename('<?php 
    echo $prefix;
    ?>
', '');"><?php 
    echo gettext("Cancel");
    ?>
</a>
		</p>
	</div>

	<br/><br />

	<?php 
    echo gettext("Tags:");
    $tagsort = getTagOrder();
    tagSelector($album, 'tags_' . $prefix, false, $tagsort);
    echo "\n</td>\n</tr>";
    echo "\n</table>";
    echo "\n<table>";
    if ($album->isDynamic()) {
        echo "\n<tr>";
        echo "\n<td> </td>";
        echo "\n<td align=\"right\" valign=\"top\" width=\"150\">" . gettext("Dynamic album search:") . "</td>";
        echo "\n<td>";
        echo "\n<table class=\"noinput\">";
        echo "\n<tr><td >" . urldecode($album->getSearchParams()) . "</td></tr>";
        echo "\n</table>";
        echo "\n</td>";
        echo "\n</tr>";
    }
    echo "\n<tr>";
    echo "\n<td> </td>";
    echo "\n<td align=\"right\" valign=\"top\" width=\"150\">" . gettext("Thumbnail:") . " </td> ";
    echo "\n<td>";
    $showThumb = getOption('thumb_select_images');
    if ($showThumb) {
        echo "\n<script type=\"text/javascript\">updateThumbPreview(document.getElementById('thumbselect'));</script>";
    }
    echo "\n<select id=\"\"";
    if ($showThumb) {
        echo " class=\"thumbselect\" onChange=\"updateThumbPreview(this)\"";
    }
    echo " name=\"" . $prefix . "thumb\">";
    $thumb = $album->get('thumb');
    echo "\n<option";
    if ($showThumb) {
        echo " class=\"thumboption\" value=\"\" style=\"background-color:#B1F7B6\"";
    }
    if ($thumb === '1') {
        echo " selected=\"selected\"";
    }
    echo ' value="1">' . gettext('most recent');
    echo '</option>';
    echo "\n<option";
    if ($showThumb) {
        echo " class=\"thumboption\" value=\"\" style=\"background-color:#B1F7B6\"";
    }
    if (empty($thumb) && $thumb !== '1') {
        echo " selected=\"selected\"";
    }
    echo ' value="">' . gettext('randomly selected');
    echo '</option>';
    if ($album->isDynamic()) {
        $params = $album->getSearchParams();
        $search = new SearchEngine();
        $search->setSearchParams($params);
        $images = $search->getImages(0);
        $thumb = $album->get('thumb');
        $imagelist = array();
        foreach ($images as $imagerow) {
            $folder = $imagerow['folder'];
            $filename = $imagerow['filename'];
            $imagelist[] = '/' . $folder . '/' . $filename;
        }
        if (count($imagelist) == 0) {
            $subalbums = $search->getAlbums(0);
            foreach ($subalbums as $folder) {
                $newalbum = new Album($gallery, $folder);
                if (!$newalbum->isDynamic()) {
                    $images = $newalbum->getImages(0);
                    foreach ($images as $filename) {
                        $imagelist[] = '/' . $folder . '/' . $filename;
                    }
                }
            }
        }
        foreach ($imagelist as $imagepath) {
            $list = explode('/', $imagepath);
            $filename = $list[count($list) - 1];
            unset($list[count($list) - 1]);
            $folder = implode('/', $list);
            $albumx = new Album($gallery, $folder);
            $image = newImage($albumx, $filename);
            $selected = $imagepath == $thumb;
            echo "\n<option";
            if ($showThumb) {
                echo " class=\"thumboption\"";
                echo " style=\"background-image: url(" . $image->getThumb() . "); background-repeat: no-repeat;\"";
            }
            echo " value=\"" . $imagepath . "\"";
            if ($selected) {
                echo " selected=\"selected\"";
            }
            echo ">" . $image->getTitle();
            echo " ({$imagepath})";
            echo "</option>";
        }
    } else {
        $images = $album->getImages();
        if (count($images) == 0 && count($album->getSubalbums()) > 0) {
            $imagearray = array();
            $albumnames = array();
            $strip = strlen($album->name) + 1;
            $subIDs = getAllSubAlbumIDs($album->name);
            if (!is_null($subIDs)) {
                foreach ($subIDs as $ID) {
                    $albumnames[$ID['id']] = $ID['folder'];
                    $query = 'SELECT `id` , `albumid` , `filename` , `title` FROM ' . prefix('images') . ' WHERE `albumid` = "' . $ID['id'] . '"';
                    $imagearray = array_merge($imagearray, query_full_array($query));
                }
                foreach ($imagearray as $imagerow) {
                    $filename = $imagerow['filename'];
                    $folder = $albumnames[$imagerow['albumid']];
                    $imagepath = substr($folder, $strip) . '/' . $filename;
                    if (substr($imagepath, 0, 1) == '/') {
                        $imagepath = substr($imagepath, 1);
                    }
                    $albumx = new Album($gallery, $folder);
                    $image = newImage($albumx, $filename);
                    if (is_valid_image($filename)) {
                        $selected = $imagepath == $thumb;
                        echo "\n<option";
                        if (getOption('thumb_select_images')) {
                            echo " class=\"thumboption\"";
                            echo " style=\"background-image: url(" . $image->getThumb() . "); background-repeat: no-repeat;\"";
                        }
                        echo " value=\"" . $imagepath . "\"";
                        if ($selected) {
                            echo " selected=\"selected\"";
                        }
                        echo ">" . $image->getTitle();
                        echo " ({$imagepath})";
                        echo "</option>";
                    }
                }
            }
        } else {
            foreach ($images as $filename) {
                $image = newImage($album, $filename);
                $selected = $filename == $album->get('thumb');
                if (is_valid_image($filename)) {
                    echo "\n<option";
                    if (getOption('thumb_select_images')) {
                        echo " class=\"thumboption\"";
                        echo " style=\"background-image: url(" . $image->getThumb() . "); background-repeat: no-repeat;\"";
                    }
                    echo " value=\"" . $filename . "\"";
                    if ($selected) {
                        echo " selected=\"selected\"";
                    }
                    echo ">" . $image->getTitle();
                    if ($filename != $image->getTitle()) {
                        echo " ({$filename})";
                    }
                    echo "</option>";
                }
            }
        }
    }
    echo "\n</select>";
    echo "\n</td>";
    echo "\n</tr>";
    echo "\n</table>";
    echo "\n<input type=\"submit\" value=\"" . gettext("save album") . "\" />";
}
Beispiel #14
0
    static function cmsItemEdit($html, $object)
    {
        ob_start();
        ?>
		<tr>
			<td class="topalign-nopadding nowrap"><?php 
        echo gettext("Custom:");
        ?>
</td>
			<td class="middlecolumn">
				<?php 
        print_language_string_list($object->getCustomData('all'), 'custom_data', true, NULL, 'custom_data', '100%', 'zenpage_language_string_list', 10);
        ?>

			</td>
		</tr>
		<?php 
        $html .= ob_get_contents();
        ob_end_clean();
        return $html;
    }
Beispiel #15
0
													<?php 
    }
    ?>
											</td>
										</tr>
										<tr>
											<td class="topalign-padding"><?php 
    echo gettext("Content:");
    ?>
</td>
											<td class="middlecolumn">
												<?php 
    if (is_AdminEditPage("newscategory")) {
        print_language_string_list($result->getDesc('all'), 'desc', true, NULL, 'desc', '100%', 'zenpage_language_string_list', 10);
    } else {
        print_language_string_list($result->getContent('all'), 'content', true, NULL, 'content', '100%', 'zenpage_language_string_list', 13);
    }
    ?>
											</td>
										</tr>
										<?php 
    if (is_AdminEditPage("newsarticle")) {
        $custom = zp_apply_filter('edit_article_custom_data', '', $result);
    }
    if (is_AdminEditPage("newscategory")) {
        $custom = zp_apply_filter('edit_category_custom_data', '', $result);
    }
    if (is_AdminEditPage("page")) {
        $custom = zp_apply_filter('edit_page_custom_data', '', $result);
    }
    echo $custom;
                        $list[] = str_replace('.php', '', FilesystemToUTF8($file));
                    }
                    $list = array_diff($list, array('themeoptions', 'theme_description', '404', 'slideshow', 'search', 'image', 'index', 'album', 'customfunctions', 'news', 'pages'));
                    generateListFromArray(array(getThemeOption($album, 'user_registration_page')), $list, false, false);
                    chdir($curdir);
                    ?>
					</select>
					<br />
					<?php 
                    echo gettext('Link text') . ' ';
                    print_language_string_list(getThemeOption($album, 'user_registration_text'), 'user_registration_text');
                    ?>
					<br />
					<?php 
                    echo gettext('Hint text') . ' ';
                    print_language_string_list(getThemeOption($album, 'user_registration_tip'), 'user_registration_tip');
                    ?>
				</td>
				<td><?php 
                    echo gettext("If this option is not empty, the visitor login form will include a link to this page. The link text will be labeled with the text provided.");
                    ?>
</td>
			</tr>
			<?php 
                }
                if (!(false === ($requirePath = getPlugin('themeoptions.php', $themename)))) {
                    require_once $requirePath;
                    $optionHandler = new ThemeOptions();
                    $supportedOptions = $optionHandler->getOptionsSupported();
                    if (count($supportedOptions) > 0) {
                        ?>
 static function extracontent($obj, $instance, $field, $type)
 {
     if ($type == 'save') {
         $extracontent = zpFunctions::updateImageProcessorLink(process_language_string_save("extracontent", EDITOR_SANITIZE_LEVEL));
         $obj->setExtracontent($extracontent);
         $obj->save();
         return NULL;
     } else {
         ob_start();
         print_language_string_list($obj->getExtraContent('all'), 'extracontent', true, NULL, 'extracontent', '100%', 'zenpage_language_string_list', 13);
         $item = ob_get_contents();
         ob_end_clean();
         return $item;
     }
 }
Beispiel #18
0
    /**
     * Dummy for object inheritance purposes
     */
    function handleOption($option, $currentValue)
    {
        global $_zp_current_admin_obj;
        switch ($option) {
            case 'password_strength':
                ?>
				<input type="hidden" size="3" id="password_strength" name="password_strength" value="<?php 
                echo getOption('password_strength');
                ?>
" />
				<script type="text/javascript">
					// <!-- <![CDATA[
					function sliderColor(strength) {
						var url = 'url(<?php 
                echo WEBPATH . '/' . ZENFOLDER;
                ?>
/images/strengths/strength' + strength + '.png)';
						$('#slider-password_strength').css('background-image', url);
					}
					$(function () {
						$("#slider-password_strength").slider({
				<?php 
                $v = getOption('password_strength');
                ?>
							startValue: <?php 
                echo $v;
                ?>
,
							value: <?php 
                echo $v;
                ?>
,
							min: 1,
							max: 30,
							slide: function (event, ui) {
								$("#password_strength").val(ui.value);
								$('#password_strength_display').html(ui.value);
								sliderColor(ui.value);
							}
						});
						var strength = $("#slider-password_strength").slider("value");
						$("#password_strength").val(strength);
						$('#password_strength_display').html(strength);
						sliderColor(strength);
					});
					// ]]> -->
				</script>
				<div id="slider-password_strength"></div>
				<?php 
                break;
            case 'challenge_foil':
                $questions = getSerializedArray(getOption('challenge_foils'));
                $questions[] = array('');
                foreach ($questions as $key => $question) {
                    ?>
					<?php 
                    print_language_string_list($question, 'challenge_foil_' . $key, false, NULL, '', '100%');
                    ?>
	<br/>
					<?php 
                }
                break;
        }
    }
Beispiel #19
0
						</tr>
						<tr style="vertical-align: top">
							<td><?php 
echo gettext("Description:");
?>
</td>
							<td id="description"></td>
						</tr>
						<tr>
							<td><span id="titlelabel"><?php 
echo gettext("Title:");
?>
</span></td>
							<td>
								<span id="titleinput"><?php 
print_language_string_list($result['title'], "title", false, NULL, '', 100);
?>
</span>
								<?php 
printAlbumsSelector($result['link']);
if (class_exists('CMS')) {
    printPagesSelector($result['link']);
    printNewsCategorySelector($result['link']);
}
?>
							</td>
						</tr>
						<tr id="link_row">
							<td><span id="link_label"></span></td>
							<td>
								<?php 
        echo 30;
        ?>
" id="pass_2" name="imagepass_2" value="<?php 
        echo $x;
        ?>
" />
							</td>
						</tr>
						<tr class="passwordextrahide" style="display:none">
							<td style="margin:0; padding:0"><?php 
        echo gettext("hint:");
        ?>
</td>
							<td style="margin:0; padding:0">
							<?php 
        print_language_string_list(getOption('protected_image_hint'), 'protected_image_hint', false, NULL, 'hint', TEXT_INPUT_SIZE_SHORT);
        ?>
							</td>
						</tr>
					</table>
					<?php 
    }
    ?>
				<p>
				<?php 
    echo "<select id=\"protect_full_image\" name=\"protect_full_image\">\n";
    $protection = getOption('protect_full_image');
    generateListFromArray(array($protection), array(gettext('Unprotected') => 'Unprotected', gettext('Protected view') => 'Protected view', gettext('Download') => 'Download', gettext('No access') => 'No access'), false, true);
    echo "</select>\n";
    ?>
				</p>