aboutsummaryrefslogtreecommitdiffstats
path: root/mod/photos.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-01-15 17:48:42 -0800
committerfriendica <info@friendica.com>2012-01-15 17:48:42 -0800
commite3a415d409c49945bbd84a60ab8ec6cf492c34b3 (patch)
tree0070927d1688ce8082dde742cbddbbb809739979 /mod/photos.php
parente9fb809a2dad29af1c195d86d8891312bac3c09f (diff)
downloadvolse-hubzilla-e3a415d409c49945bbd84a60ab8ec6cf492c34b3.tar.gz
volse-hubzilla-e3a415d409c49945bbd84a60ab8ec6cf492c34b3.tar.bz2
volse-hubzilla-e3a415d409c49945bbd84a60ab8ec6cf492c34b3.zip
add photo upload link to album widget and "upload to this album" ability
Diffstat (limited to 'mod/photos.php')
-rw-r--r--mod/photos.php23
1 files changed, 20 insertions, 3 deletions
diff --git a/mod/photos.php b/mod/photos.php
index 7ec6c8794..77b44ce0d 100644
--- a/mod/photos.php
+++ b/mod/photos.php
@@ -53,6 +53,10 @@ function photos_init(&$a) {
}
$o .= '</ul>';
+ if(local_user() && $a->data['user']['uid'] == local_user()) {
+ $o .= '<div id="photo-albums-upload-link"><a href="' . $a->get_baseurl() . '/photos/' . $a->data['user']['nickname'] . '/upload" >' .t('Upload New Photos') . '</a></div>';
+ }
+
$o .= '</div>';
}
@@ -94,7 +98,7 @@ EOT;
function photos_post(&$a) {
- logger('mod-photos: photos_post(): begin' , 'LOGGER_DEBUG');
+ logger('mod-photos: photos_post: begin' , 'LOGGER_DEBUG');
logger('mod_photos: REQUEST ' . print_r($_REQUEST,true), LOGGER_DATA);
@@ -744,6 +748,7 @@ function photos_content(&$a) {
// URLs:
// photos/name
// photos/name/upload
+ // photos/name/upload/xxxxx (xxxxx is album name)
// photos/name/album/xxxxx
// photos/name/album/xxxxx/edit
// photos/name/image/xxxxx
@@ -860,14 +865,21 @@ function photos_content(&$a) {
notice( t('Permission denied.'));
return;
}
+
+
+ $selname = (($datum) ? hex2bin($datum) : '');
+
+
$albumselect = '<select id="photos-upload-album-select" name="album" size="4">';
- $albumselect .= '<option value="" selected="selected" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</option>';
+
+ $albumselect .= '<option value="" ' . ((! $selname) ? ' selected="selected" ' : '') . '>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</option>';
if(count($a->data['albums'])) {
foreach($a->data['albums'] as $album) {
if(($album['album'] === '') || ($album['album'] === 'Contact Photos') || ($album['album'] === t('Contact Photos')))
continue;
- $albumselect .= '<option value="' . $album['album'] . '">' . $album['album'] . '</option>';
+ $selected = (($selname === $album['album']) ? ' selected="selected" ' : '');
+ $albumselect .= '<option value="' . $album['album'] . '"' . $selected . '>' . $album['album'] . '</option>';
}
}
@@ -958,6 +970,11 @@ function photos_content(&$a) {
}
}
}
+
+ if($can_post) {
+ $o .= '<div class="photos-upload-link" ><a href="' . $a->get_baseurl() . '/photos/' . $a->data['user']['nickname'] . '/upload/' . bin2hex($album) . '" >' . t('Upload New Photos') . '</a></div>';
+ }
+
$tpl = get_markup_template('photo_album.tpl');
if(count($r))
foreach($r as $rr) {