Compare commits

...

4 Commits

5 changed files with 46 additions and 4 deletions

View File

@ -2,6 +2,8 @@
require '../header.php';
requireLogin();
$data = array();
$data["success"] = false;
@ -16,6 +18,8 @@ if ( $album->getID() == 0 ) {
$album->setTitle($_REQUEST['title']);
$album->setDescription($_REQUEST['description']);
$album->setManufacturer($_REQUEST['manufacturer']);
$album->setScale($_REQUEST['scale']);
$album->save();
$data["success"] = true;
$data["album"] = $album;

View File

@ -2,6 +2,8 @@
require '../header.php';
requireLogin();
$data = array();
$data["success"] = false;

View File

@ -173,6 +173,20 @@ class Album implements JsonSerializable {
return true;
}
public function setManufacturer($manufacturer = null) {
if (is_null($manufacturer) || ($manufacturer == "")) return false;
settype($manufacturer, "string");
$this->manufacturer = $manufacturer;
return true;
}
public function setScale($scale = null) {
if (is_null($scale) || ($scale == "")) return false;
settype($scale, "string");
$this->scale = $scale;
return true;
}
public function refreshImages() {
global $globaldbh;

View File

@ -6,13 +6,15 @@ var currentAlbum = 0;
$(document).ready(function() {
$("#edit_album").dialog({
autoOpen: false,
height: 250,
width: 350,
height: 350,
width: 400,
closeOnEscape: true,
draggable: false,
close: function() {
editAlbumID = 0;
$("#edit_album_title").val("");
$("#edit_album_manufacturer").val("");
$("#edit_album_scale").val("");
$("#edit_album_description").val("");
},
buttons: [
@ -97,8 +99,10 @@ function getAlbumInfo() {
$("#albumdetails").removeClass("hidden");
lightboxImages = data.images;
}
$("#albumtitle").html(data.albumtitle);
$("#albumdescription").html(data.albumdescription);
$("#albumtitle").text(data.albumtitle);
$("#albummanufacturer").text(data.albummanufacturer);
$("#albumscale").text(data.albumscale);
$("#albumdescription").text(data.albumdescription);
$("#albumcontents").html(data.albumcontents);
$(".albumthumbnail").click(function() {
if ( data.currentalbum == 0 ) {
@ -201,6 +205,8 @@ function saveAlbumInfo() {
data: {
albumid: editAlbumID,
title: $("#edit_album_title").val(),
manufacturer: $("#edit_album_manufacturer").val(),
scale: $("#edit_album_scale").val(),
description: $("#edit_album_description").val()
},
success: function(data, stat, jqo) {
@ -209,6 +215,8 @@ function saveAlbumInfo() {
$("#title_"+data.album.id).text(data.album.title);
if ( currentAlbum != 0 ) {
$("#albumtitle").text(data.album.title);
$("#albummanufacturer").text(data.album.manufacturer);
$("#albumscale").text(data.album.scale);
$("#albumdescription").text(data.album.description);
}
} else {
@ -233,6 +241,8 @@ function editAlbum(albumid) {
if ( data.success ) {
editAlbumID = data.album.id;
$("#edit_album_title").val(data.album.title);
$("#edit_album_manufacturer").val(data.album.manufacturer);
$("#edit_album_scale").val(data.album.scale);
$("#edit_album_description").val(data.album.description);
$("#edit_album").dialog("open");
} else {

View File

@ -15,6 +15,8 @@ if ( $currentuser->isLoggedIn() ) {
?>
<div class="albumdetails hidden" id="albumdetails">
<div><span class="albuminfo_label textlink">Album Title:</span> <span class="albuminfo" id="albumtitle"></span></div>
<div><span class="albuminfo_label textlink">Album Manufacturer:</span> <span class="albuminfo" id="albummanufacturer"></span></div>
<div><span class="albuminfo_label textlink">Album Scale:</span> <span class="albuminfo" id="albumscale"></span></div>
<div class="albuminfo_label textlink">Album Description:</div>
<div class="albuminfo spacebelow_small" id="albumdescription"></div>
<div id="albumdescription"></div>
@ -28,6 +30,16 @@ if ( $currentuser->isLoggedIn() ) {
<input placeholder="Enter Title" name="edit_album_title" id="edit_album_title" size="40" required>
</div>
<p />
<div>
<label for="edit_album_manufacturer"><b>Manufacturer</b></label>
<input placeholder="Enter Manufacturer" name="edit_album_manufacturer" id="edit_album_manufacturer" size="40" required>
</div>
<p />
<div>
<label for="edit_album_scale"><b>Scale</b></label>
<input placeholder="Enter Scale" name="edit_album_scale" id="edit_album_scale" size="40" required>
</div>
<p />
<div>
<label for="edit_album_description"><b>Description</b></label>
<textarea placeholder="Enter Description" name="edit_album_description" id="edit_album_description" rows="5" cols="40"></textarea>