forked from Public/pics
Add very basic context buttons to album pages.
This commit is contained in:
parent
ddcc28aff6
commit
2d77fbdbb7
@ -57,6 +57,17 @@ class ViewPhotoAlbum extends HTMLController
|
||||
if (isset($header_box))
|
||||
$this->page->adopt($header_box);
|
||||
|
||||
$this->page->adopt(new AlbumButtonBox([
|
||||
[
|
||||
'url' => BASEURL . '/uploadmedia/?tag=' . $id_tag,
|
||||
'caption' => 'Upload new photos here',
|
||||
],
|
||||
[
|
||||
'url' => BASEURL . '/addalbum/?tag=' . $id_tag,
|
||||
'caption' => 'Create new subalbum here',
|
||||
]
|
||||
]));
|
||||
|
||||
// Fetch subalbums, but only if we're on the first page.
|
||||
if ($page === 1)
|
||||
{
|
||||
|
@ -314,6 +314,23 @@ ul#nav li a:hover {
|
||||
}
|
||||
|
||||
|
||||
/* Album button box
|
||||
---------------------*/
|
||||
.album_button_box {
|
||||
float: right;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.album_button_box > a {
|
||||
background: #fff;
|
||||
box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
|
||||
display: inline-block;
|
||||
float: left;
|
||||
font-size: 1em;
|
||||
padding: 8px 10px;
|
||||
margin-left: 12px;
|
||||
}
|
||||
|
||||
|
||||
/* Generic boxed content
|
||||
--------------------------*/
|
||||
.boxed_content {
|
||||
@ -703,6 +720,7 @@ a#previous_photo:hover, a#next_photo:hover {
|
||||
border-color: #aaa;
|
||||
}
|
||||
|
||||
|
||||
/* Spinner animation
|
||||
----------------------*/
|
||||
.spinner {
|
||||
|
28
templates/AlbumButtonBox.php
Normal file
28
templates/AlbumButtonBox.php
Normal file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
/*****************************************************************************
|
||||
* AlbumButtonBox.php
|
||||
* Defines the AlbumButtonBox template.
|
||||
*
|
||||
* Kabuki CMS (C) 2013-2016, Aaron van Geffen
|
||||
*****************************************************************************/
|
||||
|
||||
class AlbumButtonBox extends SubTemplate
|
||||
{
|
||||
public function __construct($buttons)
|
||||
{
|
||||
$this->buttons = $buttons;
|
||||
}
|
||||
|
||||
protected function html_content()
|
||||
{
|
||||
echo '
|
||||
<div class="album_button_box">';
|
||||
|
||||
foreach ($this->buttons as $button)
|
||||
echo '
|
||||
<a href="', $button['url'], '">', $button['caption'], '</a>';
|
||||
|
||||
echo '
|
||||
</div>';
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user