}
-function populate_acl($user = null,$celeb = false,$show_jotnets = true,$show_mail = false) {
+function populate_acl($user = null,$celeb = false,$show_jotnets = false) {
$perms = get_acl_permissions($user);
$jotnets = '';
if($show_jotnets) {
+ $mail_disabled = ((function_exists('imap_open') && (! get_config('system','imap_disabled'))) ? 0 : 1);
+
+ $mail_enabled = false;
+ $pubmail_enabled = false;
+
+ if(! $mail_disabled) {
+ $r = q("SELECT * FROM `mailacct` WHERE `uid` = %d AND `server` != '' LIMIT 1",
+ intval(local_user())
+ );
+ if(count($r)) {
+ $mail_enabled = true;
+ if(intval($r[0]['pubmail']))
+ $pubmail_enabled = true;
+ }
+ }
+
+ if($mail_enabled) {
+ $selected = (($pubmail_enabled) ? ' checked="checked" ' : '');
+ $jotnets .= '<div class="profile-jot-net"><input type="checkbox" name="pubmail_enable"' . $selected . ' value="1" /> '
+ . t("Post to Email") . '</div>';
+ }
+
call_hooks('jot_networks', $jotnets);
}
'$allowgid' => json_encode($perms['allow_gid']),
'$denycid' => json_encode($perms['deny_cid']),
'$denygid' => json_encode($perms['deny_gid']),
+ '$networks' => $show_jotnets,
'$emailcc' => t('CC: email addresses'),
'$emtitle' => t('Example: bob@example.com, mary@example.com'),
'$jotnets' => $jotnets,
((strlen($a->user['allow_cid'])) || (strlen($a->user['allow_gid'])) ||
(strlen($a->user['deny_cid'])) || (strlen($a->user['deny_gid']))))) ? 'lock' : 'unlock'),
'default_perms' => get_acl_permissions($a->user),
- 'acl' => populate_acl((($group || $cid || $nets) ? $def_acl : $a->user), $celeb),
+ 'acl' => populate_acl((($group || $cid || $nets) ? $def_acl : $a->user), $celeb, true),
'bang' => (($group || $cid || $nets) ? '!' : ''),
'visitor' => 'block',
'profile_uid' => local_user(),
if($a->theme['template_engine'] === 'internal') {
$albumselect_e = template_escape($albumselect);
- $aclselect_e = (($visitor) ? '' : template_escape(populate_acl($a->user, $celeb,false)));
+ $aclselect_e = (($visitor) ? '' : template_escape(populate_acl($a->user, $celeb)));
}
else {
$albumselect_e = $albumselect;
- $aclselect_e = (($visitor) ? '' : populate_acl($a->user, $celeb,false));
+ $aclselect_e = (($visitor) ? '' : populate_acl($a->user, $celeb));
}
$o .= replace_macros($tpl,array(
'default_location' => (($is_owner) ? $a->user['default-location'] : ''),
'nickname' => $a->profile['nickname'],
'lockstate' => (((is_array($a->user) && ((strlen($a->user['allow_cid'])) || (strlen($a->user['allow_gid'])) || (strlen($a->user['deny_cid'])) || (strlen($a->user['deny_gid']))))) ? 'lock' : 'unlock'),
- 'acl' => (($is_owner) ? populate_acl($a->user, $celeb) : ''),
+ 'acl' => (($is_owner) ? populate_acl($a->user, $celeb, true) : ''),
'bang' => '',
'visitor' => (($is_owner || $commvisitor) ? 'block' : 'none'),
'profile_uid' => $a->profile['profile_uid'],
<a href="#" class='acl-button-hide'>{{$hide}}</a>
</div>
+{{if $networks}}
+<hr style="clear:both"/>
+<div id="profile-jot-email-label">{{$emailcc}}</div><input type="text" name="emailcc" id="profile-jot-email" title="{{$emtitle|escape:'html'}}" />
+<div id="profile-jot-email-end"></div>
+{{if $jotnets}}
+{{$jotnets}}
+{{/if}}{{/if}}
+
<script>
$(document).ready(function() {
if(typeof acl=="undefined"){
<div style="display: none;">
<div id="profile-jot-acl-wrapper" style="width:auto;height:auto;overflow:auto;">
{{$acl}}
- <hr style="clear:both"/>
- <div id="profile-jot-email-label">{{$emailcc}}</div><input type="text" name="emailcc" id="profile-jot-email" title="{{$emtitle|escape:'html'}}" />
- <div id="profile-jot-email-end"></div>
- {{$jotnets}}
</div>
</div>