aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mod/photos.php20
-rw-r--r--view/css/mod_photos.css5
-rw-r--r--view/theme/redbasic/css/style.css14
-rwxr-xr-xview/tpl/album_edit.tpl2
-rwxr-xr-xview/tpl/photo_album.tpl3
-rwxr-xr-xview/tpl/photo_albums.tpl8
-rwxr-xr-xview/tpl/photo_view.tpl2
-rwxr-xr-xview/tpl/photos_recent.tpl3
-rwxr-xr-xview/tpl/photos_upload.tpl12
9 files changed, 26 insertions, 43 deletions
diff --git a/mod/photos.php b/mod/photos.php
index a0f11860d..d1f2b4993 100644
--- a/mod/photos.php
+++ b/mod/photos.php
@@ -476,11 +476,9 @@ function photos_content(&$a) {
if(argc() > 3) {
$datatype = argv(2);
$datum = argv(3);
- }
- elseif((argc() > 2) && (argv(2) === 'upload'))
- $datatype = 'upload';
- else
+ } else {
$datatype = 'summary';
+ }
if(argc() > 4)
$cmd = argv(4);
@@ -528,11 +526,7 @@ function photos_content(&$a) {
* Display upload form
*/
- if($datatype === 'upload') {
- if(! ($can_post)) {
- notice( t('Permission denied.'));
- return;
- }
+ if( $can_post) {
$uploader = '';
@@ -575,7 +569,7 @@ function photos_content(&$a) {
$albums = ((array_key_exists('albums', $a->data)) ? $a->data['albums'] : photos_albums_list($a->data['channel'],$a->data['observer']));
$tpl = get_markup_template('photos_upload.tpl');
- $o .= replace_macros($tpl,array(
+ $upload_form = replace_macros($tpl,array(
'$pagename' => t('Upload Photos'),
'$sessid' => session_id(),
'$usage' => $usage_message,
@@ -594,7 +588,6 @@ function photos_content(&$a) {
));
- return $o;
}
/*
@@ -725,7 +718,8 @@ function photos_content(&$a) {
'$can_post' => $can_post,
'$upload' => array(t('Upload'), $a->get_baseurl() . '/photos/' . $a->data['channel']['channel_address'] . '/upload/' . bin2hex($album)),
'$order' => $order,
-
+ '$upload_form' => $upload_form,
+ '$usage' => $usage_message
));
}
@@ -1234,6 +1228,8 @@ function photos_content(&$a) {
'$can_post' => $can_post,
'$upload' => array(t('Upload'), $a->get_baseurl().'/photos/'.$a->data['channel']['channel_address'].'/upload'),
'$photos' => $photos,
+ '$upload_form' => $upload_form,
+ '$usage' => $usage_message
));
}
diff --git a/view/css/mod_photos.css b/view/css/mod_photos.css
index 89041bd09..061f2f40a 100644
--- a/view/css/mod_photos.css
+++ b/view/css/mod_photos.css
@@ -66,10 +66,9 @@
#photo-edit-edit,
-#photo-album-edit-wrapper {
+#photo-album-edit-wrapper,
+#photo-upload-form {
display: none;
- padding: 7px 10px;
- margin-bottom: 3px;
}
#photo-album-edit-submit, #photo-album-edit-drop {
diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css
index 5ffc33d31..114098465 100644
--- a/view/theme/redbasic/css/style.css
+++ b/view/theme/redbasic/css/style.css
@@ -706,9 +706,7 @@ footer {
cursor: pointer;
}
-#photo-album-edit-wrapper,
-#photo-view-wrapper,
-#photo-edit-edit {
+#photo-view-wrapper {
background-color: $item_colour;
}
@@ -2335,12 +2333,10 @@ aside .nav-pills > li > a {
margin-bottom: 0px;
}
-.section-title-submenu {
- margin-top: 10px;
-}
-
-.section-title-submenu a {
- margin-right: 10px;
+.section-content-tools-wrapper {
+ padding: 7px 10px;
+ background-color: $comment_item_colour;
+ margin-bottom: 3px;
}
.section-content-wrapper {
diff --git a/view/tpl/album_edit.tpl b/view/tpl/album_edit.tpl
index a65887d3c..a6815352a 100755
--- a/view/tpl/album_edit.tpl
+++ b/view/tpl/album_edit.tpl
@@ -1,4 +1,4 @@
-<div id="photo-album-edit-wrapper">
+<div id="photo-album-edit-wrapper" class="section-content-tools-wrapper">
<form name="photo-album-edit-form" id="photo-album-edit-form" action="photos/{{$nickname}}/album/{{$hexalbum}}" method="post" >
diff --git a/view/tpl/photo_album.tpl b/view/tpl/photo_album.tpl
index 0a26fc367..2c0b8e5b9 100755
--- a/view/tpl/photo_album.tpl
+++ b/view/tpl/photo_album.tpl
@@ -5,13 +5,14 @@
{{/if}}
<a class="btn btn-default" href="{{$order.1}}" title="{{$order.0}}"><i class="icon-sort"></i></a>
{{if $can_post}}
- <a class="btn btn-xs btn-success" href="{{$upload.1}}"><i class="icon-upload"></i>&nbsp;{{$upload.0}}</a>
+ <button class="btn btn-xs btn-success" title="{{$usage}}" onclick="openClose('photo-upload-form');"><i class="icon-upload"></i>&nbsp;{{$upload.0}}</button>
{{/if}}
</div>
<h2>{{$album}}</h2>
<div class="clear"></div>
</div>
+{{$upload_form}}
{{$album_edit.1}}
<div id="photo-album-contents" class="generic-content-wrapper">
{{foreach $photos as $photo}}
diff --git a/view/tpl/photo_albums.tpl b/view/tpl/photo_albums.tpl
index 0f8b809ac..de1105bbc 100755
--- a/view/tpl/photo_albums.tpl
+++ b/view/tpl/photo_albums.tpl
@@ -1,17 +1,13 @@
<div id="side-bar-photos-albums" class="widget">
<h3>{{$title}}</h3>
<ul class="nav nav-pills nav-stacked">
- {{if $upload}}
- <li><a href="{{$baseurl}}/photos/{{$nick}}/upload" title="{{$upload}}">{{$upload}}</a></li>
- {{/if}}
<li><a href="{{$baseurl}}/photos/{{$nick}}" title="{{$title}}" >Recent Photos</a></li>
- {{if $albums}}
+ {{if $albums}}
{{foreach $albums as $al}}
{{if $al.text}}
<li><a href="{{$baseurl}}/photos/{{$nick}}/album/{{$al.bin2hex}}"><span class="badge pull-right">{{$al.total}}</span>{{$al.text}}</a></li>
{{/if}}
{{/foreach}}
-
- {{/if}}
+ {{/if}}
</ul>
</div>
diff --git a/view/tpl/photo_view.tpl b/view/tpl/photo_view.tpl
index c79cd7d56..d1b077f36 100755
--- a/view/tpl/photo_view.tpl
+++ b/view/tpl/photo_view.tpl
@@ -31,7 +31,7 @@
<div class="clear"></div>
</div>
- <div id="photo-edit-edit">
+ <div id="photo-edit-edit" class="section-content-tools-wrapper">
<form action="photos/{{$edit.nickname}}/{{$edit.resource_id}}" method="post" id="photo_edit_form">
<input type="hidden" name="item_id" value="{{$edit.item_id}}" />
<label id="photo-edit-albumname-label" for="photo-edit-albumname">{{$edit.newalbum}}</label>
diff --git a/view/tpl/photos_recent.tpl b/view/tpl/photos_recent.tpl
index 91b088c93..7727abcea 100755
--- a/view/tpl/photos_recent.tpl
+++ b/view/tpl/photos_recent.tpl
@@ -1,10 +1,11 @@
<div class="section-title-wrapper">
{{if $can_post}}
- <a class="btn btn-xs btn-success pull-right" href="{{$upload.1}}"><i class="icon-upload"></i>&nbsp;{{$upload.0}}</a>
+ <button class="btn btn-xs btn-success pull-right" title="{{$usage}}" onclick="openClose('photo-upload-form');"><i class="icon-upload"></i>&nbsp;{{$upload.0}}</button>
{{/if}}
<h2>{{$title}}</h2>
<div class="clear"></div>
</div>
+{{$upload_form}}
<div id="photo-album-contents" class="generic-content-wrapper">
{{foreach $photos as $photo}}
{{include file="photo_top.tpl"}}
diff --git a/view/tpl/photos_upload.tpl b/view/tpl/photos_upload.tpl
index 4c53a7c62..5bb0092d6 100755
--- a/view/tpl/photos_upload.tpl
+++ b/view/tpl/photos_upload.tpl
@@ -1,18 +1,12 @@
-<div class="generic-content-wrapper">
- <div class="section-title-wrapper">
- <div id="photos-usage-message" class="pull-right">{{$usage}}</div>
- <h2>{{$pagename}}</h2>
- <div class="clear"></div>
- </div>
-
- <div class="section-content-wrapper">
+<div id="photo-upload-form" class="generic-content-wrapper">
+ <div class="section-content-tools-wrapper">
<form action="photos/{{$nickname}}" enctype="multipart/form-data" method="post" name="photos-upload-form" id="photos-upload-form">
<input type="hidden" id="photos-upload-source" name="source" value="photos" />
<div class="form-group">
<label for="photos-upload-album">{{$newalbum_label}}</label>
- <input type="text" class="form-control" id="photos-upload-album" placeholder="{{$newalbum_placeholder}}" value="{{$selname}}" list="dl-photo-upload">
+ <input type="text" class="form-control" id="photos-upload-album" name="newalbum" placeholder="{{$newalbum_placeholder}}" value="{{$selname}}" list="dl-photo-upload">
<datalist id="dl-photo-upload">
{{foreach $albums as $al}}
{{if $al.text}}