printAdminToolbox() printing Toolbox as a list, if one would like to replace it. It produces valid xhtml. `javascript.toogle(...)` link is thrown away, it could have be done in CSS.
`function printAdminToolbox($context=null, $id='admin') {
global $_zp_current_album, $_zp_current_image, $_zp_current_search, $_zp_loggedin, $_zen_gallery_page;
if (zp_loggedin()) {
$zf = WEBPATH."/".ZENFOLDER;
$dataid = $id . '_data';
$page = getCurrentPage();
$redirect = '';
echo "\n<script type=\"text/javascript\" src=\"".$zf."/js/admin.js\"></script>\n";
if (is_null($context)) { $context = get_context(); }
echo ''."\n".''.gettext('Admin Toolbox').''."\n"."\n";
echo '<ul id="' .$dataid. '">'."\n";
echo "[*]";
printAdminLink(gettext('Admin'), '', "\n");
echo "\n";
$albumname = $_zp_current_album->name;
if ($_zen_gallery_page === 'index.php') {
if (isMyAlbum($albumname, EDIT_RIGHTS)) {
echo "[*]";
printSortableGalleryLink(gettext('Sort gallery'), gettext('Manual sorting'));
echo "\n";
}
if (isMyAlbum($albumname, UPLOAD_RIGHTS)) {
echo "[*]";
printLink($zf . '/admin.php?page=upload' . urlencode($_zp_current_album->name), gettext("New album"), NULL, NULL, NULL);
echo "\n";
}
if (isset($_GET['p'])) {
$redirect = "&p=" . $_GET['p'];
}
if ($page>1) {
$redirect .= "&page=$page";
}
} else if ($_zen_gallery_page === 'album.php') {
if (isMyAlbum($albumname, EDIT_RIGHTS)) {
echo "[*]";
printSubalbumAdmin(gettext('Edit album'), '', "\n");
if (!$_zp_current_album->isDynamic()) {
echo "[*]";
printSortableAlbumLink(gettext('Sort album'), gettext('Manual sorting'));
echo "\n";
}
echo "[*]<a href=\"javascript: confirmDeleteAlbum('".$zf."/admin.php?page=edit&action=deletealbum&album=" .
urlencode($albumname) .
"','".gettext("Are you sure you want to delete this entire album?")."','".gettext("Are you Absolutely Positively sure you want to delete the album? THIS CANNOT BE UNDONE!").
"');\" title=\"".gettext("Delete the album")."\">".gettext("Delete album")."</a>\n";
}
if (isMyAlbum($albumname, UPLOAD_RIGHTS) && !$_zp_current_album->isDynamic()) {
echo "[*]";
printLink($zf . '/admin.php?page=upload&album=' . urlencode($albumname), gettext("Upload Here"), NULL, NULL, NULL);
echo "\n";
echo "[*]";
printLink($zf . '/admin.php?page=upload&new&album=' . urlencode($albumname), gettext("New Album Here"), NULL, NULL, NULL);
echo "\n";
}
$redirect = "&album=".urlencode($albumname)."&page=$page";
} else if ($_zen_gallery_page === 'image.php') {
$imagename = urlencode($_zp_current_image->filename);
if (isMyAlbum($albumname, EDIT_RIGHTS)) {
echo "[*]<a href=\"javascript: confirmDeleteImage('".$zf."/admin.php?page=edit&action=deleteimage&album=" .
urlencode($albumname) . "&image=". urlencode($imagename) . "','". gettext("Are you sure you want to delete the image? THIS CANNOT BE UNDONE!") . "');\" title=\"".gettext("Delete the image")."\">".gettext("Delete image")."</a>";
echo "\n";
}
$redirect = "&album=".urlencode($albumname)."&image=$imagename";
} else if (($_zen_gallery_page === 'search.php')&& !empty($_zp_current_search->words)) {
if ($_zp_loggedin & UPLOAD_RIGHTS) {
echo "[*]<a href=\"".$zf."/dynamic.php\" title=\"".gettext("Create an album from the search")."\">".gettext("Create Album")."</a>";
}
$redirect = "&p=search" . $_zp_current_search->getSearchParams() . "&page=$page";
}
echo "[*]<a href=\"".$zf."/admin.php?logout$redirect\">".gettext("Logout")."</a>\n";
echo "</ul>\n";
}
}`