/** * Move existing image to new gallery * $texts - localized labels and hints * $current_gallery - selected gallery (if any) * $current_image - selected image (if any) * $galleries - available galleries info */ public static function renderMoveImageForm($texts, $current_gallery, $current_image, $galleries) { // to avoid php warnings... if (!$current_image["exists"]) { $current_image["id"] = 0; } // render form echo '<form method="post" action="/admin/move_image">' . PHP_EOL; echo '<table class="admin">' . PHP_EOL; // info about selected image echo '<tr>' . PHP_EOL; echo '<td class="label">' . $texts["admin_image_current"] . ':</td>' . PHP_EOL; echo '<td class="value">' . PHP_EOL; if ($current_image["exists"]) { echo '<a href="/gallery/i/' . $current_image["id"] . '">' . $current_image["name"] . '(#' . $current_image["id"] . ')</a>' . PHP_EOL; } else { echo $texts["admin_image_notselected"] . PHP_EOL; } echo '<input type="hidden" name="iid" value="' . $current_image["id"] . '">'; // store ID value for processing script (0 means new) echo '</td>' . PHP_EOL; echo '</tr>' . PHP_EOL; // info about current gallery echo '<tr>' . PHP_EOL; echo '<td class="label">' . $texts["admin_image_gallery"] . ':</td>' . PHP_EOL; echo '<td class="value">' . PHP_EOL; if ($current_gallery["exists"]) { echo '<a href="/gallery/g/' . $current_gallery["id"] . '">' . $current_gallery["name"] . '</a>' . PHP_EOL; } else { echo $texts["admin_image_notselected"] . PHP_EOL; } echo '</td>' . PHP_EOL; echo '</tr>' . PHP_EOL; // select gallery to move image to echo '<tr>' . PHP_EOL; echo '<td class="label">' . $texts["admin_image_moveto"] . ':</td>' . PHP_EOL; echo '<td class="value">' . PHP_EOL; if ($current_image["exists"]) { include_once getcwd() . '/scripts/admin-helpers/admin-forms/elrh_forms_gallery.php'; echo ELRHGalleryFormRenderer::renderGalleriesSelect("target", $galleries, false, $current_image["gallery"]) . PHP_EOL; echo ' <input type="submit" value="' . $texts["admin_move"] . '">' . PHP_EOL; } else { echo $texts["admin_image_notselected"] . PHP_EOL; } echo '</td>' . PHP_EOL; echo '</tr>' . PHP_EOL; echo '</table>' . PHP_EOL; echo '</form>' . PHP_EOL; }
/** * Delete existing gallery * $texts - localized labels and hints * $current - selected gallery (if any) * $galleries - available galleries info */ public static function renderDeleteGalleryForm($texts, $current, $galleries) { include_once getcwd() . '/scripts/admin-helpers/admin-forms/elrh_forms_gallery.php'; return ELRHGalleryFormRenderer::renderDeleteGalleryForm($texts, $current, $galleries); }
/** * Delete existing gallery * $texts - localized labels and hints * $current - selected gallery (if any) * $galleries - available galleries info */ public static function renderDeleteGalleryForm($texts, $current, $galleries) { // to avoid php warnings... if (!$current["exists"]) { $current["id"] = 0; } // render form // including JS confirmation echo '<form method="post" action="/admin/delete_gallery" onsubmit="return confirm(\'' . $texts["admin_delete_gallery_confirm"] . '\');">' . PHP_EOL; echo '<strong>' . $texts["admin_delete_gallery_info"] . ':</strong> ' . PHP_EOL; if (!empty($galleries)) { echo ELRHGalleryFormRenderer::renderGalleriesSelect("gallery", $galleries, false, $current["id"]); echo ' <input type="submit" value="' . $texts["admin_delete"] . '">' . PHP_EOL; } else { echo $texts["admin_no_galleries"] . PHP_EOL; } echo '</form>' . PHP_EOL; }