Matt's demands (ticket #217)
This commit is contained in:
parent
e525e9ab9b
commit
e9e5fdb139
@ -172,12 +172,16 @@ class EditphotoAction extends Action
|
||||
$this->showForm(_('Error: The photo data is not valid.'));
|
||||
return;
|
||||
}
|
||||
common_redirect('/photo/' . $this->photo->id, '303');
|
||||
$this->showForm(_('Success!'));
|
||||
|
||||
}
|
||||
|
||||
function deletePhoto()
|
||||
{
|
||||
//For redirection
|
||||
$oldalbum = $this->album_id;
|
||||
|
||||
$this->photo->title = "";
|
||||
$this->photo->photo_description = "";
|
||||
$this->photo->profile_id = 0;
|
||||
@ -192,6 +196,7 @@ class EditphotoAction extends Action
|
||||
return;
|
||||
}
|
||||
$this->showForm(_('Success!'));
|
||||
common_redirect('/' . $this->user->nickname . '/photos/' . $oldalbum, '303');
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -99,7 +99,7 @@ class PhotoAction extends Action
|
||||
$this->elementEnd('div');
|
||||
}
|
||||
|
||||
$this->element('p', array(), $this->photo->photo_description);
|
||||
$this->element('p', array('class' => 'photodescription'), $this->photo->photo_description);
|
||||
//This is a hack to hide the top-level comment
|
||||
$this->element('style', array(), "#notice-{$this->photo->notice_id} div { display: none } #notice-{$this->photo->notice_id} ol li div { display: inline }");
|
||||
$this->conversation->show();
|
||||
|
@ -74,6 +74,16 @@ class PhotosAction extends Action
|
||||
$nav->show();
|
||||
}
|
||||
|
||||
function showResizeImagesBox()
|
||||
{
|
||||
$this->elementStart('select', array('onchange' => 'return scalePhotosToSize(this.value)'));
|
||||
$this->element('option', array('value' => ''), "");
|
||||
$this->element('option', array('value' => '60'), _("Thumbnail"));
|
||||
$this->element('option', array('value' => '120'), _("Medium"));
|
||||
$this->element('option', array('value' => '400'), _("Normal"));
|
||||
$this->elementEnd('select');
|
||||
}
|
||||
|
||||
function showAlbums()
|
||||
{
|
||||
$album = new GNUsocialPhotoAlbum();
|
||||
@ -85,13 +95,17 @@ class PhotosAction extends Action
|
||||
}
|
||||
|
||||
$this->elementStart('div', array('class' => 'galleryheader'));
|
||||
$this->element('a', array('href' => '#',
|
||||
'onclick' => 'return increasePhotoSize()'), '+');
|
||||
$this->raw(' | ');
|
||||
$this->element('a', array('href' => '#',
|
||||
'onclick' => 'return decreasePhotoSize()'), '-');
|
||||
//$this->element('a', array('href' => '#',
|
||||
// 'onclick' => 'return increasePhotoSize()'), '+');
|
||||
//$this->raw(' | ');
|
||||
//$this->element('a', array('href' => '#',
|
||||
// 'onclick' => 'return decreasePhotoSize()'), '-');
|
||||
|
||||
$this->showResizeImagesBox();
|
||||
$this->elementEnd('div');
|
||||
|
||||
|
||||
|
||||
while ($album->fetch()) {
|
||||
$this->elementStart('div', array('class' => 'photocontainer'));
|
||||
$this->elementStart('a', array('href' => $album->getPageLink()));
|
||||
@ -126,13 +140,16 @@ class PhotosAction extends Action
|
||||
$this->element('a', array('href' => $album->getPageLink() . '?pageid=' . ($page+1) ), 'Next page');
|
||||
$this->raw(' | ');
|
||||
}
|
||||
$this->element('a', array('href' => '#',
|
||||
'onclick' => 'return increasePhotoSize()'), '+');
|
||||
$this->raw(' | ');
|
||||
$this->element('a', array('href' => '#',
|
||||
'onclick' => 'return decreasePhotoSize()'), '-');
|
||||
$this->elementEnd('div');
|
||||
|
||||
//$this->element('a', array('href' => '#',
|
||||
// 'onclick' => 'return increasePhotoSize()'), '+');
|
||||
//$this->raw(' | ');
|
||||
//$this->element('a', array('href' => '#',
|
||||
// 'onclick' => 'return decreasePhotoSize()'), '-');
|
||||
//$this->raw(' | ');
|
||||
|
||||
$this->showResizeImagesBox();
|
||||
$this->elementEnd('div');
|
||||
|
||||
foreach ($photos as $photo) {
|
||||
$this->elementStart('a', array('href' => $photo->getPageLink()));
|
||||
|
@ -13,3 +13,17 @@ function decreasePhotoSize() {
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
function scalePhotosToSize(size) {
|
||||
$('.photoingallery, .albumingallery').each(function(index) {
|
||||
if(this.height > this.width) {
|
||||
this.width = this.width*size/this.height;
|
||||
this.height = size;
|
||||
}
|
||||
else {
|
||||
this.height = this.height*size/this.width;
|
||||
this.width = size;
|
||||
}
|
||||
});
|
||||
return false;
|
||||
}
|
@ -6,3 +6,9 @@
|
||||
margin: 15px;
|
||||
}
|
||||
|
||||
.photodescription {
|
||||
display: block;
|
||||
background-color: #dddddd;
|
||||
padding: 20px;
|
||||
margin: 15px;
|
||||
}
|
Loading…
Reference in New Issue
Block a user