Merge pull request #922 from dawnbreak/master

View upload photo button only if you have permission.
This commit is contained in:
RedMatrix 2015-03-11 09:10:28 +11:00
commit 57384b9f9f
2 changed files with 77 additions and 80 deletions

View File

@ -1135,8 +1135,8 @@ function status_editor($a,$x,$popup=false) {
'$nickname' => $x['nickname'],
'$ispublic' => t('Visible to <strong>everybody</strong>'),
'$linkurl' => t('Please enter a link URL:'),
'$vidurl' => t("Please enter a video link/URL:"),
'$audurl' => t("Please enter an audio link/URL:"),
'$vidurl' => t('Please enter a video link/URL:'),
'$audurl' => t('Please enter an audio link/URL:'),
'$term' => t('Tag term:'),
'$fileas' => t('Save to Folder:'),
'$whereareu' => t('Where are you right now?'),
@ -1144,7 +1144,7 @@ function status_editor($a,$x,$popup=false) {
));
$tpl = get_markup_template("jot.tpl");
$tpl = get_markup_template('jot.tpl');
$jotplugins = '';
$jotnets = '';
@ -1156,7 +1156,6 @@ function status_editor($a,$x,$popup=false) {
$defexpire = ((($z = get_pconfig($x['profile_uid'], 'system', 'default_post_expire')) && (! $webpage)) ? $z : '');
$cipher = get_pconfig($x['profile_uid'], 'system', 'default_cipher');
if(! $cipher)
$cipher = 'aes256';
@ -1173,6 +1172,7 @@ function status_editor($a,$x,$popup=false) {
'$pagetitle' => (x($x,'pagetitle') ? $x['pagetitle'] : ''),
'$id_select' => $id_select,
'$id_seltext' => t('Post as'),
'$writephoto' => perm_is_allowed($x['profile_uid'], get_observer_hash(), 'post_photos'),
'$upload' => t('Upload photo'),
'$shortupload' => t('upload photo'),
'$attach' => t('Attach file'),
@ -1227,10 +1227,8 @@ function status_editor($a,$x,$popup=false) {
'$expiryModalCANCEL' => t('Cancel')
));
if ($popup==true){
$o = '<div id="jot-popup" style="display: none;">'.$o.'</div>';
if ($popup === true) {
$o = '<div id="jot-popup" style="display:none">' . $o . '</div>';
}
return $o;
@ -1285,7 +1283,6 @@ function conv_sort($arr,$order) {
return array();
$parents = array();
$children = array();
foreach($arr as $x)
if($x['id'] == $x['parent'])
@ -1340,6 +1337,7 @@ function find_thread_parent_index($arr,$x) {
foreach($arr as $k => $v)
if($v['id'] == $x['parent'])
return $k;
return false;
}
@ -1368,6 +1366,7 @@ function render_location_default($item) {
else
$location = '<span class="smalltext">' . $coord . '</span>';
}
return $location;
}
@ -1393,6 +1392,7 @@ function prepare_page($item) {
$tpl = get_pconfig($item['uid'], 'system', 'pagetemplate');
if (! $tpl)
$tpl = 'page_display.tpl';
return replace_macros(get_markup_template($tpl), array(
'$author' => (($naked) ? '' : $item['author']['xchan_name']),
'$auth_url' => (($naked) ? '' : zid($item['author']['xchan_url'])),
@ -1442,7 +1442,6 @@ function network_tabs() {
}
if (($new_active == '')
&& ($starred_active == '')
&& ($conv_active == '')
@ -1532,7 +1531,6 @@ function network_tabs() {
$tpl = get_markup_template('common_tabs.tpl');
return replace_macros($tpl, array('$tabs' => $arr['tabs']));
}
@ -1636,13 +1634,10 @@ function profile_tabs($a, $is_owner=False, $nickname=Null){
'id' => 'webpages-tab',
);
}
else {
// FIXME
// we probably need a listing of events that were created by
// this channel and are visible to the observer
}
$arr = array('is_owner' => $is_owner, 'nickname' => $nickname, 'tab' => (($tab) ? $tab : false), 'tabs' => $tabs);

View File

@ -25,12 +25,12 @@
</div>
{{if $catsenabled}}
<div id="jot-category-wrap" class="jothidden" style="display:none">
<input name="category" id="jot-category" type="text" placeholder="{{$placeholdercategory}}" value="{{$category}}" data-role="tagsinput"/>
<input name="category" id="jot-category" type="text" placeholder="{{$placeholdercategory}}" value="{{$category}}" data-role="tagsinput">
</div>
{{/if}}
{{if $webpage}}
<div id="jot-pagetitle-wrap" class="jothidden" style="display:none">
<input name="pagetitle" id="jot-pagetitle" type="text" placeholder="{{$placeholdpagetitle}}" value="{{$pagetitle}}" />
<input name="pagetitle" id="jot-pagetitle" type="text" placeholder="{{$placeholdpagetitle}}" value="{{$pagetitle}}">
</div>
{{/if}}
<div id="jot-text-wrap">
@ -57,9 +57,11 @@
</div>
{{if $visitor}}
<div class="btn-group hidden-xs">
{{if $writephoto}}
<button id="wall-image-upload" class="btn btn-default btn-sm" title="{{$upload}}" >
<i class="icon-camera jot-icons"></i>
</button>
{{/if}}
<button id="wall-file-upload" class="btn btn-default btn-sm" title="{{$attach}}" >
<i id="wall-file-upload-icon" class="icon-paper-clip jot-icons"></i>
</button>
@ -109,7 +111,7 @@
<li class="visible-xs"><a href="#" onclick="preview_post();return false;"><i class="icon-eye-open"></i>&nbsp;{{$preview}}</a></li>
{{if $visitor}}
<li class="divider visible-xs"></li>
<li class="visible-xs"><a id="wall-image-upload-sub" href="#" ><i class="icon-camera"></i>&nbsp;{{$upload}}</a></li>
{{if $writephoto}}<li class="visible-xs"><a id="wall-image-upload-sub" href="#" ><i class="icon-camera"></i>&nbsp;{{$upload}}</a></li>{{/if}}
<li class="visible-xs"><a id="wall-file-upload-sub" href="#" ><i class="icon-paper-clip"></i>&nbsp;{{$attach}}</a></li>
<li class="visible-xs"><a href="#" onclick="jotGetLink(); return false;"><i class="icon-link"></i>&nbsp;{{$weblink}}</a></li>
<li class="visible-xs"><a href="#" onclick="jotVideoURL(); return false;"><i class="icon-facetime-video"></i>&nbsp;{{$video}}</a></li>