Change logic of "don't create a status post for this photo upload" and turn it into a bona-fide on/off toggle. This takes up one more vertical line, but we have it to spare, and the single button (while concise visually) provided no feedback of the current state, or indicate whether a second click toggled it. Some addons use this setting so addons will need to be pulled when this is pulled in order to remain in sync.

This commit is contained in:
friendica 2015-03-10 15:43:15 -07:00
parent 57384b9f9f
commit 5b35f1e6c4
5 changed files with 8 additions and 15 deletions

View File

@ -174,7 +174,7 @@ function reflect_photo_callback($matches) {
'resource_id' => str_replace('-','',$hash),
'filename' => $hash . '.jpg',
'type' => 'image/jpeg',
'not_visible' => true
'visible' => false
)
);

View File

@ -54,8 +54,8 @@ function photo_upload($channel, $observer, $args) {
else
$visible = 0;
if(intval($args['not_visible']) || $args['not_visible'] === 'true')
$visible = 0;
if(intval($args['visible']) || $args['visible'] === 'true')
$visible = 1;
$str_group_allow = perms2str(((is_array($args['group_allow'])) ? $args['group_allow'] : explode(',',$args['group_allow'])));
$str_contact_allow = perms2str(((is_array($args['contact_allow'])) ? $args['contact_allow'] : explode(',',$args['contact_allow'])));

View File

@ -553,7 +553,7 @@ function photos_content(&$a) {
'$nickname' => $a->data['channel']['channel_address'],
'$newalbum_label' => t('Enter a new album name'),
'$newalbum_placeholder' => t('or select an existing one (doubleclick)'),
'$nosharetext' => t('Do not show a status post for this upload'),
'$visible' => array('visible', t('Create a status post for this upload'),0,''),
'$albums' => $albums['albums'],
'$selname' => $selname,
'$permissions' => t('Permissions'),

View File

@ -32,7 +32,7 @@ function wall_upload_post(&$a) {
$observer = $a->get_observer();
$args = array( 'source' => 'editor', 'not_visible' => 1, 'contact_allow' => array($channel['channel_hash']));
$args = array( 'source' => 'editor', 'visible' => 0, 'contact_allow' => array($channel['channel_hash']));
$ret = photo_upload($channel,$observer,$args);

View File

@ -21,12 +21,8 @@
<div class="form-group">
<input id="photos-upload-choose" type="file" name="userfile" />
</div>
{{include file="field_checkbox.tpl" field=$visible}}
<div class="pull-right btn-group form-group">
<div class="btn-group" data-toggle="buttons">
<label class="btn btn-default btn-sm" title="{{$nosharetext}}">
<input class="checkbox-inline" id="photos-upload-noshare" type="checkbox" name="not_visible" value="1" /><i class="icon-ban-circle"></i>
</label>
</div>
<div class="btn-group">
{{if $lockstate}}
<button id="dbtn-acl" class="btn btn-default btn-sm" data-toggle="modal" data-target="#aclModal" onclick="return false;">
@ -41,12 +37,9 @@
<div class="clear"></div>
{{if $uploader}}
{{include file="field_checkbox.tpl" field=$visible}}
<div id="photos-upload-perms" class="btn-group pull-right">
<div class="btn-group" data-toggle="buttons">
<label class="btn btn-default btn-sm" title="{{$nosharetext}}">
<input class="checkbox-inline" id="photos-upload-noshare" type="checkbox" name="not_visible" value="1" /><i class="icon-ban-circle"></i>
</label>
</div>
{{if $lockstate}}
<button class="btn btn-default btn-sm" data-toggle="modal" data-target="#aclModal" onclick="return false;">
<i id="jot-perms-icon" class="icon-{{$lockstate}}"></i>