echo gettext('all'); ?> </span> </label> </h2> <form class="dirtylistening" onReset="setClean('tag_action_form');" name="tag_action_form" id="tag_action_form" action="?action=true&tagsort=<?php echo html_encode($tagsort); ?> " method="post" autocomplete="off" > <?php XSRFToken('tag_action'); ?> <input type="hidden" name="tag_action" id="tag_action" value="delete" /> <div class="box-tags-unpadded"> <?php tagSelector(NULL, 'tags_', true, $tagsort, false); list($list, $counts, $languages, $flags) = $_zp_admin_ordered_taglist; ?> </div> <p class="buttons"> <button type="submit" id='delete_tags' value="<?php echo gettext("Delete checked tags"); ?> " onclick="$('#tag_action').val('delete'); this.form.submit();"> <img src="images/fail.png" alt="" /> <?php echo gettext("Delete checked tags"); ?>
static function tags($object, $i, $field, $type) { global $tagsort; $i = trim($i, '-'); if ($type == 'save') { $tagsprefix = 'tag_list_tags_' . $i; if (isset($_POST[$tagsprefix])) { $tags = sanitize($_POST[$tagsprefix]); } else { $tags = array(); } $found = false; $l = strlen($tagsprefix); $found = isset($_POST['newtag_tags_' . $i]); if ($found) { if (isset($_POST['additive_tags_' . $i]) && $_POST['additive_tags_' . $i]) { $tags = array_merge($tags, $object->getTags()); } $tags = array_unique($tags); $object->setTags($tags); $object->save(); } return NULL; } else { ob_start(); if ($i) { $add = 2; $obj = NULL; $tags = $object->getTags(false); if (count($tags) == 0) { echo gettext('No tags assigned'); } else { ?> <span id = "existing_tags_<?php echo $i; ?> "><?php echo trim(implode(', ', $tags)); ?> </span> <a id="tag_clear_link_tags_<?php echo $i; ?> " onclick="clearOldTags('tags_<?php echo $i; ?> ');"><img src="<?php echo WEBPATH . '/' . ZENFOLDER; ?> /images/fail.png" title="<?php echo gettext('remove tags'); ?> "></a> <a id="tag_restore_link_tags_<?php echo $i; ?> " onclick="restoreOldTags('tags_<?php echo $i; ?> ');" style="display:none;"><img src="<?php echo WEBPATH . '/' . ZENFOLDER; ?> /images/add.png" title="<?php echo gettext('cancel'); ?> "></a> <?php } echo '<br /><br />' . gettext('Add') . '<br />'; } else { $add = true; $obj = $object; } ?> <div class="box-edit-unpadded"> <?php tagSelector($obj, 'tags_' . $i, false, $tagsort, $add, 1); ?> </div> <?php $item = ob_get_contents(); ob_end_clean(); return $item; } }
<br /> <?php } // if article for categories } // if !category end if (!is_AdminEditPage("newscategory")) { ?> <h2 class="h2_bordered_edit"><?php echo gettext("Tags"); ?> </h2> <div class="box-edit-unpadded"> <?php tagSelector($result, 'tags_', false, getTagOrder()); ?> </div> <?php } ?> </td> </tr> <tr> <td><?php echo gettext("TitleLink:"); ?> </td> <td class="middlecolumn"> <?php if ($result->transient) {
/** * Edit tab bulk actions drop-down * @param array $checkarray the list of actions * @param bool $checkAll set true to include check all box */ function printBulkActions($checkarray, $checkAll = false) { $customInfo = $colorboxBookmark = array(); foreach ($checkarray as $key => $value) { if (is_array($value)) { $checkarray[$key] = $value['name']; switch ($action = $value['action']) { case 'mass_customTextarea_data': $data['size'] = -1; case 'mass_customText_data': $customInfo[$value['name']] = $value; $action = 'mass_' . $value['name'] . '_data'; break; } $colorboxBookmark[$value['name']] = $action; } } if (!empty($colorboxBookmark)) { ?> <script type="text/javascript"> //<!-- <![CDATA[ function checkFor(obj) { var sel = obj.options[obj.selectedIndex].value; var mark; switch (sel) { <?php foreach ($colorboxBookmark as $key => $mark) { ?> case '<?php echo $key; ?> ': mark = '<?php echo $mark; ?> '; break; <?php } ?> default: mark = false; break; } if (mark) { $.colorbox({ href: '#' + mark, inline: true, open: true, close: '<?php echo gettext("ok"); ?> ' }); } } // ]]> --> </script> <?php } ?> <span style="float:right"> <select class="ignoredirty" name="checkallaction" id="checkallaction" size="1" onchange="checkFor(this);" > <?php generateListFromArray(array('noaction'), $checkarray, false, true); ?> </select> <?php if ($checkAll) { ?> <br /> <?php echo gettext("Check All"); ?> <input class="ignoredirty" type="checkbox" name="allbox" id="allbox" onclick="checkAll(this.form, 'ids[]', this.checked);" /> <?php } ?> </span> <?php foreach ($customInfo as $key => $data) { ?> <div id="mass_<?php echo $key; ?> " style="display:none; "> <div id="mass_<?php echo $key; ?> _data"> <?php printf('Value for %s:', $data['desc']); if ($data['action'] == 'mass_customText_data') { if (isset($data['size']) && $data['size'] >= 0) { $size = max(5, min($data['size'], 200)); } else { $size = 100; } ?> <input type="text" name="<?php echo $key; ?> " size="<?php echo $size; ?> " value=""> <?php } else { ?> <textarea name="<?php echo $key; ?> " cols="<?php echo TEXTAREA_COLUMNS; ?> " style="width: 320px" rows="6"></textarea> <?php } ?> </div> </div> <?php } if (in_array('mass_tags_data', $colorboxBookmark)) { ?> <div id="mass_tags" style="display:none;"> <div id="mass_tags_data"> <?php tagSelector(NULL, 'mass_tags_', false, getTagOrder(), true, false, 'checkTagsAuto ignoredirty'); ?> </div> </div> <?php } if (in_array('mass_cats_data', $colorboxBookmark)) { ?> <div id="mass_cats" style="display:none;"> <div id="mass_cats_data"> <?php echo gettext('New categorys:'); ?> <ul> <?php printNestedItemsList('cats-checkboxlist', '', 'all', 'ignoredirty'); ?> </ul> </div> </div> <?php } if (in_array('mass_owner_data', $colorboxBookmark)) { ?> <div id="mass_owner" style="display:none;"> <div id="mass_owner_data"> <?php echo gettext('New owner:'); ?> <ul> <select class="ignoredirty" id="massownermenu" name="massownerselect" onchange=""> <?php echo admin_album_list(NULL); ?> </select> </ul> </div> </div> <?php } if (in_array('mass_movecopy_data', $colorboxBookmark)) { global $mcr_albumlist, $album, $bglevels; ?> <div id="mass_movecopy_copy" style="display:none;"> <div id="mass_movecopy_data"> <input type="hidden" name="massfolder" value="<?php echo $album->name; ?> " /> <?php echo gettext('Destination'); ?> <select class="ignoredirty" id="massalbumselectmenu" name="massalbumselect" onchange=""> <?php foreach ($mcr_albumlist as $fullfolder => $albumtitle) { $singlefolder = $fullfolder; $saprefix = ""; $salevel = 0; $selected = ""; if ($album->name == $fullfolder) { $selected = " selected=\"selected\" "; } // 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 = " " . $saprefix; $salevel++; } echo '<option value="' . $fullfolder . '"' . ($salevel > 0 ? ' style="background-color: ' . $bglevels[$salevel] . ';"' : '') . "{$selected}>" . $saprefix . $singlefolder . "</option>\n"; } ?> </select> </div> </div> <?php } }
?> </td> </tr> <?php } if ($singleimage) { ?> <tr> <td valign="top"><?php echo gettext("Tags:"); ?> </td> <td> <div class="box-edit-unpadded"> <?php tagSelector($image, 'tags_' . $currentimage . '-', false, $tagsort, true, 1); ?> </div> </td> </tr> <?php $custom = zp_apply_filter('edit_image_custom_data', '', $image, $currentimage); if (empty($custom)) { ?> <tr> <td valign="top"><?php echo gettext("Custom data:"); ?> </td> <td><?php print_language_string_list($image->getCustomData('all'), $currentimage . '-custom_data', true, NULL, 'texteditor_imagecustomdata', '100%');
/** * Edit tab bulk actions drop-down * @param array $checkarray the list of actions * @param bool $checkAll set true to include check all box */ function printBulkActions($checkarray, $checkAll = false) { $tags = in_array('addtags', $checkarray) || in_array('alltags', $checkarray); $movecopy = in_array('moveimages', $checkarray) || in_array('copyimages', $checkarray); $categories = in_array('addcats', $checkarray) || in_array('clearcats', $checkarray); $changeowner = in_array('changeowner', $checkarray); if ($tags || $movecopy || $categories || $changeowner) { ?> <script type="text/javascript"> //<!-- <![CDATA[ function checkFor(obj) { var sel = obj.options[obj.selectedIndex].value; <?php if ($tags) { ?> if (sel == 'addtags' || sel == 'alltags') { $.colorbox({ href: "#mass_tags_data", inline: true, open: true, close: '<?php echo gettext("ok"); ?> ' }); } <?php } if ($movecopy) { ?> if (sel == 'moveimages' || sel == 'copyimages') { $.colorbox({ href: "#mass_movecopy_data", inline: true, open: true, close: '<?php echo gettext("ok"); ?> ' }); } <?php } if ($categories) { ?> if (sel == 'addcats') { $.colorbox({ href: "#mass_cats_data", inline: true, open: true, close: '<?php echo gettext("ok"); ?> ' }); } <?php } if ($changeowner) { ?> if (sel == 'changeowner') { $.colorbox({ href: "#mass_owner_data", inline: true, open: true, close: '<?php echo gettext("ok"); ?> ' }); } <?php } ?> } // ]]> --> </script> <?php } ?> <span style="float:right"> <select class="ays-ignore" name="checkallaction" id="checkallaction" size="1" onchange="checkFor(this);" > <?php generateListFromArray(array('noaction'), $checkarray, false, true); ?> </select> <?php if ($checkAll) { ?> <br /> <?php echo gettext("Check All"); ?> <input class="ays-ignore" type="checkbox" name="allbox" id="allbox" onclick="checkAll(this.form, 'ids[]', this.checked);" /> <?php } ?> </span> <?php if ($tags) { ?> <div id="mass_tags" style="display:none;"> <div id="mass_tags_data"> <?php tagSelector(NULL, 'mass_tags_', false, false, true, false, 'checkTagsAuto ays-ignore'); ?> </div> </div> <?php } if ($categories) { ?> <div id="mass_cats" style="display:none;"> <ul id="mass_cats_data"> <?php printNestedItemsList('cats-checkboxlist', '', 'all', 'ays-ignore'); ?> </ul> </div> <?php } if ($changeowner) { ?> <div id="mass_owner" style="display:none;"> <ul id="mass_owner_data"> <select class="ays-ignore" id="massownermenu" name="massownerselect" onchange=""> <?php echo admin_album_list(NULL); ?> </select> </ul> </div> <?php } if ($movecopy) { global $mcr_albumlist, $album, $bglevels; ?> <div id="mass_movecopy_copy" style="display:none;"> <div id="mass_movecopy_data"> <input type="hidden" name="massfolder" value="<?php echo $album->name; ?> " /> <?php echo gettext('Destination'); ?> <select class="ays-ignore" id="massalbumselectmenu" name="massalbumselect" onchange=""> <?php foreach ($mcr_albumlist as $fullfolder => $albumtitle) { $singlefolder = $fullfolder; $saprefix = ""; $salevel = 0; $selected = ""; if ($album->name == $fullfolder) { $selected = " selected=\"selected\" "; } // 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 = " " . $saprefix; $salevel++; } echo '<option value="' . $fullfolder . '"' . ($salevel > 0 ? ' style="background-color: ' . $bglevels[$salevel] . ';"' : '') . "{$selected}>" . $saprefix . $singlefolder . "</option>\n"; } ?> </select> </div> </div> <?php } }
} else { echo '<p><a class="tagsort" href="?tagsort=1' . '" title="' . gettext('Sort the tags by most used') . '">'; echo ' ' . gettext('Order by most used') . '</a></p>'; } echo "\n<table class=\"bordered\">"; echo "\n<tr>"; echo "\n<th>" . gettext("Delete tags from the gallery") . "</th>"; echo "\n<th>" . gettext("Rename tags") . "</th>"; echo "\n<th>"; echo gettext("New tags"); echo "</th>"; echo "\n</tr>"; echo "\n<tr>"; echo "\n<td valign='top'>"; echo "\n" . '<form name="tag_delete" action="?delete=true&tagsort=' . $tagsort . '" method="post">'; tagSelector(NULL, '', true, $tagsort); echo "\n<p align='center'><input type=\"submit\" class=\"tooltip\" id='delete_tags' value=\"" . gettext("delete checked tags") . "\" title=\"" . gettext("Delete all the tags checked above.") . "\"/></p>"; echo "\n</form>"; echo '<p>' . gettext('To delete tags from the gallery, place a checkmark in the box for each tag you wish to delete then press the <em>delete checked tags</em> button. The brackets contain the number of times the tag appears.') . '</p>'; echo "\n</td>"; echo "\n<td valign='top'>"; echo "\n" . '<form name="tag_rename" action="?rename=true&tagsort=' . $tagsort . '" method="post">'; echo "\n<ul class=\"tagrenamelist\">"; $list = $_zp_admin_ordered_taglist; foreach ($list as $item) { $listitem = 'R_' . postIndexEncode($item); echo "\n" . '<li><label for="' . $listitem . '">' . $item . '<br /><input id="' . $listitem . '" name="' . $listitem . '" type="text"'; echo " size='33'/></label></li>"; } echo "\n</ul>"; echo "\n<p align='center'><input type=\"submit\" class=\"tooltip\" id='rename_tags' value=\"" . gettext("rename tags") . "\" title=\"" . gettext("Save all the changes entered above.") . "\" /></p>";
if ($pagechecked) { echo ' checked="checked"'; } ?> /><?php printf(ngettext('Tag %d page', 'Tag %d pages', $c = count($pages)), $c); ?> </li> <?php } ?> </ul> </div> <div > <?php tagSelector(NULL, 'tags_'); ?> </div> <br clear="all"> <p class="buttons"> <button type="submit" title="<?php echo gettext("Tag the items"); ?> "> <img src="<?php echo WEBPATH . '/' . ZENFOLDER; ?> /images/pass.png" alt="" /> <?php echo gettext("Tag the items"); ?>
/** * 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 ' '; 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 " " . 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 " " . 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 = " " . $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") . "\" />"; }