Conflicts:
	mod/connedit.php
This commit is contained in:
redmatrix 2015-07-14 17:10:13 -07:00
commit e8f19c1e15
13 changed files with 318 additions and 520 deletions

View File

@ -5,7 +5,7 @@ function contact_profile_assign($current) {
$o = ''; $o = '';
$o .= "<select id=\"contact-profile-selector\" name=\"profile_assign\" />\r\n"; $o .= "<select id=\"contact-profile-selector\" name=\"profile_assign\" class=\"form-control\"/>\r\n";
$r = q("SELECT profile_guid, profile_name FROM `profile` WHERE `uid` = %d", $r = q("SELECT profile_guid, profile_name FROM `profile` WHERE `uid` = %d",
intval($_SESSION['uid'])); intval($_SESSION['uid']));

View File

@ -1088,7 +1088,9 @@ function zot_import($arr, $sender_url) {
logger('specific recipients'); logger('specific recipients');
$recip_arr = array(); $recip_arr = array();
foreach($i['notify']['recipients'] as $recip) { foreach($i['notify']['recipients'] as $recip) {
$recip_arr[] = make_xchan_hash($recip['guid'],$recip['guid_sig']); if(is_array($recip)) {
$recip_arr[] = make_xchan_hash($recip['guid'],$recip['guid_sig']);
}
} }
stringify_array_elms($recip_arr); stringify_array_elms($recip_arr);
$recips = implode(',',$recip_arr); $recips = implode(',',$recip_arr);

View File

@ -144,7 +144,6 @@ function connedit_post(&$a) {
dbesc($orig_record[0]['abook_xchan']) dbesc($orig_record[0]['abook_xchan'])
); );
if($z) { if($z) {
$record = $z[0]['xlink_id']; $record = $z[0]['xlink_id'];
$w = q("update xlink set xlink_rating = '%d', xlink_rating_text = '%s', xlink_sig = '%s', xlink_updated = '%s' $w = q("update xlink set xlink_rating = '%d', xlink_rating_text = '%s', xlink_sig = '%s', xlink_updated = '%s'
@ -493,59 +492,58 @@ function connedit_content(&$a) {
$contact_id = $a->poi['abook_id']; $contact_id = $a->poi['abook_id'];
$contact = $a->poi; $contact = $a->poi;
$buttons = array(
$tabs = array( 'view' => array(
array(
'label' => t('View Profile'), 'label' => t('View Profile'),
'url' => chanlink_cid($contact['abook_id']), 'url' => chanlink_cid($contact['abook_id']),
'sel' => '', 'sel' => '',
'title' => sprintf( t('View %s\'s profile'), $contact['xchan_name']), 'title' => sprintf( t('View %s\'s profile'), $contact['xchan_name']),
), ),
array( 'refresh' => array(
'label' => t('Refresh Permissions'), 'label' => t('Refresh Permissions'),
'url' => $a->get_baseurl(true) . '/connedit/' . $contact['abook_id'] . '/refresh', 'url' => $a->get_baseurl(true) . '/connedit/' . $contact['abook_id'] . '/refresh',
'sel' => '', 'sel' => '',
'title' => t('Fetch updated permissions'), 'title' => t('Fetch updated permissions'),
), ),
array( 'recent' => array(
'label' => t('Recent Activity'), 'label' => t('Recent Activity'),
'url' => $a->get_baseurl(true) . '/network/?f=&cid=' . $contact['abook_id'], 'url' => $a->get_baseurl(true) . '/network/?f=&cid=' . $contact['abook_id'],
'sel' => '', 'sel' => '',
'title' => t('View recent posts and comments'), 'title' => t('View recent posts and comments'),
) ),
);
$buttons = array( 'block' => array(
array(
'label' => (intval($contact['abook_blocked']) ? t('Unblock') : t('Block')), 'label' => (intval($contact['abook_blocked']) ? t('Unblock') : t('Block')),
'url' => $a->get_baseurl(true) . '/connedit/' . $contact['abook_id'] . '/block', 'url' => $a->get_baseurl(true) . '/connedit/' . $contact['abook_id'] . '/block',
'sel' => (intval($contact['abook_blocked']) ? 'active' : ''), 'sel' => (intval($contact['abook_blocked']) ? 'active' : ''),
'title' => t('Block (or Unblock) all communications with this connection'), 'title' => t('Block (or Unblock) all communications with this connection'),
), ),
array( 'ignore' => array(
'label' => (intval($contact['abook_ignored']) ? t('Unignore') : t('Ignore')), 'label' => (intval($contact['abook_ignored']) ? t('Unignore') : t('Ignore')),
'url' => $a->get_baseurl(true) . '/connedit/' . $contact['abook_id'] . '/ignore', 'url' => $a->get_baseurl(true) . '/connedit/' . $contact['abook_id'] . '/ignore',
'sel' => (intval($contact['abook_ignored']) ? 'active' : ''), 'sel' => (intval($contact['abook_ignored']) ? 'active' : ''),
'title' => t('Ignore (or Unignore) all inbound communications from this connection'), 'title' => t('Ignore (or Unignore) all inbound communications from this connection'),
), ),
array(
'archive' => array(
'label' => (intval($contact['abook_archived']) ? t('Unarchive') : t('Archive')), 'label' => (intval($contact['abook_archived']) ? t('Unarchive') : t('Archive')),
'url' => $a->get_baseurl(true) . '/connedit/' . $contact['abook_id'] . '/archive', 'url' => $a->get_baseurl(true) . '/connedit/' . $contact['abook_id'] . '/archive',
'sel' => (intval($contact['abook_archived']) ? 'active' : ''), 'sel' => (intval($contact['abook_archived']) ? 'active' : ''),
'title' => t('Archive (or Unarchive) this connection - mark channel dead but keep content'), 'title' => t('Archive (or Unarchive) this connection - mark channel dead but keep content'),
), ),
array(
'hide' => array(
'label' => (intval($contact['abook_hidden']) ? t('Unhide') : t('Hide')), 'label' => (intval($contact['abook_hidden']) ? t('Unhide') : t('Hide')),
'url' => $a->get_baseurl(true) . '/connedit/' . $contact['abook_id'] . '/hide', 'url' => $a->get_baseurl(true) . '/connedit/' . $contact['abook_id'] . '/hide',
'sel' => (intval($contact['abook_hidden']) ? 'active' : ''), 'sel' => (intval($contact['abook_hidden']) ? 'active' : ''),
'title' => t('Hide or Unhide this connection from your other connections'), 'title' => t('Hide or Unhide this connection from your other connections'),
), ),
array( 'delete' => array(
'label' => t('Delete'), 'label' => t('Delete'),
'url' => $a->get_baseurl(true) . '/connedit/' . $contact['abook_id'] . '/drop', 'url' => $a->get_baseurl(true) . '/connedit/' . $contact['abook_id'] . '/drop',
'sel' => '', 'sel' => '',
@ -556,18 +554,9 @@ function connedit_content(&$a) {
$self = false; $self = false;
if(! intval($contact['abook_self'])) { if(intval($contact['abook_self']))
$tab_tpl = get_markup_template('common_tabs.tpl');
$t = replace_macros($tab_tpl, array('$tabs'=>$tabs));
}
else
$self = true; $self = true;
$a->page['htmlhead'] .= replace_macros(get_markup_template('contact_head.tpl'), array(
'$baseurl' => $a->get_baseurl(true),
'$editselect' => $editselect
));
require_once('include/contact_selectors.php'); require_once('include/contact_selectors.php');
$tpl = get_markup_template("abook_edit.tpl"); $tpl = get_markup_template("abook_edit.tpl");
@ -616,7 +605,6 @@ function connedit_content(&$a) {
$rating_text = $xl[0]['xlink_rating_text']; $rating_text = $xl[0]['xlink_rating_text'];
} }
$poco_rating = get_config('system','poco_rating_enable'); $poco_rating = get_config('system','poco_rating_enable');
// if unset default to enabled // if unset default to enabled
@ -640,8 +628,19 @@ function connedit_content(&$a) {
$global_perms = get_perms(); $global_perms = get_perms();
$existing = get_all_perms(local_channel(),$contact['abook_xchan']); $existing = get_all_perms(local_channel(),$contact['abook_xchan']);
$unapproved = array('pending', t('Approve this connection'), '', t('Accept connection to allow communication')); $unapproved = array('pending', t('Approve this connection'), '', t('Accept connection to allow communication'), array(t('No'),('Yes')));
$multiprofs = ((feature_enabled(local_channel(),'multi_profiles')) ? true : false);
if($slide && !$multiprofs)
$affinity = t('Set Affinity');
if(!$slide && $multiprofs)
$affinity = t('Set Profile');
if($slide && $multiprofs)
$affinity = t('Set Affinity & Profile');
foreach($global_perms as $k => $v) { foreach($global_perms as $k => $v) {
$thisperm = (($contact['abook_my_perms'] & $v[1]) ? "1" : ''); $thisperm = (($contact['abook_my_perms'] & $v[1]) ? "1" : '');
@ -656,85 +655,50 @@ function connedit_content(&$a) {
$o .= replace_macros($tpl,array( $o .= replace_macros($tpl,array(
'$header' => (($self) ? t('Connection Default Permissions') : sprintf( t('Connections: settings for %s'),$contact['xchan_name'])), '$header' => (($self) ? t('Connection Default Permissions') : sprintf( t('Connection: %s'),$contact['xchan_name'])),
'$autoperms' => array('autoperms',t('Apply these permissions automatically'), ((get_pconfig(local_channel(),'system','autoperms')) ? 1 : 0), ''), '$autoperms' => array('autoperms',t('Apply these permissions automatically'), ((get_pconfig(local_channel(),'system','autoperms')) ? 1 : 0), '', array(t('No'),('Yes'))),
'$addr' => $contact['xchan_addr'], '$addr' => $contact['xchan_addr'],
'$addr_text' => t('This connection\'s address is'),
'$notself' => (($self) ? '' : '1'), '$notself' => (($self) ? '' : '1'),
'$self' => (($self) ? '1' : ''), '$self' => (($self) ? '1' : ''),
'$autolbl' => t('Apply the permissions indicated on this page to all new connections.'), '$autolbl' => t('Apply the permissions indicated on this page to all new connections.'),
'$buttons' => (($self) ? '' : $buttons), '$buttons' => (($self) ? '' : $buttons),
'$viewprof' => t('View Profile'),
'$clickme' => t('Click to open/close'),
'$lbl_slider' => t('Slide to adjust your degree of friendship'), '$lbl_slider' => t('Slide to adjust your degree of friendship'),
'$lbl_rating' => t('Rating (this information is public)'), '$lbl_rating' => t('Rating'),
'$lbl_rating_txt' => t('Optionally explain your rating (this information is public)'), '$lbl_rating_label' => t('Slide to adjust your rating'),
'$lbl_rating_txt' => t('Optionally explain your rating'),
'$connfilter' => feature_enabled(local_channel(),'connfilter'), '$connfilter' => feature_enabled(local_channel(),'connfilter'),
'$connfilter_label' => t('Custom Filter'),
'$incl' => array('abook_incl',t('Only import posts with this text'), $contact['abook_incl'],t('words one per line or #tags or /patterns/, leave blank to import all posts')), '$incl' => array('abook_incl',t('Only import posts with this text'), $contact['abook_incl'],t('words one per line or #tags or /patterns/, leave blank to import all posts')),
'$excl' => array('abook_excl',t('Do not import posts with this text'), $contact['abook_excl'],t('words one per line or #tags or /patterns/, leave blank to import all posts')), '$excl' => array('abook_excl',t('Do not import posts with this text'), $contact['abook_excl'],t('words one per line or #tags or /patterns/, leave blank to import all posts')),
'$rating_text' => array('rating_text', t('Optionally explain your rating (this information is public)'),$rating_text,''), '$rating_text' => array('rating_text', t('Optionally explain your rating'),$rating_text,''),
'$rating_info' => t('This information is public!'),
'$rating' => $rating, '$rating' => $rating,
'$rating_val' => $rating_val, '$rating_val' => $rating_val,
'$slide' => $slide, '$slide' => $slide,
'$tabs' => $t, '$affinity' => $affinity,
'$tab_str' => $tab_str, '$pending_label' => t('Connection Pending Approval'),
'$perms_step1' => t('Default permissions for your channel type have (just) been applied. They have not yet been submitted. Please review the permissions on this page and make any desired changes at this time. This new connection may <em>not</em> be able to communicate with you until you submit this page, which will install and apply the selected permissions.'), '$pending_modal_title' => t('Connection Request'),
'$pending_modal_body' => sprintf(t('(%s) would like to connect with you. Please approve this connection to allow communication.'), $contact['xchan_addr']),
'$pending_modal_approve' => t('Approve'),
'$pending_modal_dismiss' => t('Approve Later'),
'$is_pending' => (intval($contact['abook_pending']) ? 1 : ''), '$is_pending' => (intval($contact['abook_pending']) ? 1 : ''),
'$unapproved' => $unapproved, '$unapproved' => $unapproved,
'$inherited' => t('inherited'), '$inherited' => t('inherited'),
'$approve' => t('Approve this connection'),
'$noperms' => (($contact['abook_my_perms']) ? false : true),
'$no_perms' => (((! $self) && (! $contact['abook_my_perms'])) ? t('Connection has no individual permissions!') : ''),
'$noperm_desc' => (((! $self) && (! $contact['abook_my_perms'])) ? t('This may be appropriate based on your <a href="settings">privacy settings</a>, though you may wish to review the "Advanced Permissions".') : ''),
'$submit' => t('Submit'), '$submit' => t('Submit'),
'$lbl_vis1' => t('Profile Visibility'),
'$lbl_vis2' => sprintf( t('Please choose the profile you would like to display to %s when viewing your profile securely.'), $contact['xchan_name']), '$lbl_vis2' => sprintf( t('Please choose the profile you would like to display to %s when viewing your profile securely.'), $contact['xchan_name']),
'$lbl_info1' => t('Contact Information / Notes'),
'$infedit' => t('Edit contact notes'),
'$close' => $contact['abook_closeness'], '$close' => $contact['abook_closeness'],
'$them' => t('Their Settings'), '$them' => t('Their Settings'),
'$me' => t('My Settings'), '$me' => t('My Settings'),
'$perms' => $perms, '$perms' => $perms,
'$perms_new' => t('Default permissions for this channel type have (just) been applied. They have <em>not</em> been saved and there are currently no stored default permissions. Please review/edit the applied settings and click [Submit] to finalize.'),
'$clear' => t('Clear/Disable Automatic Permissions'),
'$forum' => t('Forum Members'),
'$soapbox' => t('Soapbox'),
'$full' => t('Full Sharing (typical social network permissions)'),
'$cautious' => t('Cautious Sharing '),
'$follow' => t('Follow Only'),
'$permlbl' => t('Individual Permissions'), '$permlbl' => t('Individual Permissions'),
'$permnote' => t('Some permissions may be inherited from your channel <a href="settings">privacy settings</a>, which have higher priority than individual settings. Changing those inherited settings on this page will have no effect.'), '$permnote' => t('Some permissions may be inherited from your channel\'s <a href="settings"><strong>privacy settings</strong></a>, which have higher priority than individual settings. You can <strong>not</strong> change those settings here.'),
'$advanced' => t('Advanced Permissions'),
'$quick' => t('Simple Permissions (select one and submit)'),
'$common_link' => $a->get_baseurl(true) . '/common/loc/' . local_channel() . '/' . $contact['id'],
'$all_friends' => $all_friends,
'$relation_text' => $relation_text,
'$visit' => sprintf( t('Visit %s\'s profile - %s'),$contact['xchan_name'],$contact['xchan_url']),
'$blockunblock' => t('Block/Unblock contact'),
'$ignorecont' => t('Ignore contact'),
'$lblcrepair' => t("Repair URL settings"),
'$lblrecent' => t('View conversations'),
'$lblsuggest' => $lblsuggest,
'$delete' => t('Delete contact'),
'$poll_interval' => contact_poll_interval($contact['priority'],(! $poll_enabled)),
'$poll_enabled' => $poll_enabled,
'$lastupdtext' => t('Last update:'), '$lastupdtext' => t('Last update:'),
'$lost_contact' => $lost_contact,
'$updpub' => t('Update public posts'),
'$last_update' => relative_date($contact['abook_connected']), '$last_update' => relative_date($contact['abook_connected']),
'$udnow' => t('Update now'),
'$profile_select' => contact_profile_assign($contact['abook_profile']), '$profile_select' => contact_profile_assign($contact['abook_profile']),
'$multiprofs' => feature_enabled(local_channel(),'multi_profiles'), '$multiprofs' => $multiprofs,
'$contact_id' => $contact['abook_id'], '$contact_id' => $contact['abook_id'],
'$block_text' => (($contact['blocked']) ? t('Unblock') : t('Block') ), '$name' => $contact['xchan_name'],
'$ignore_text' => (($contact['readonly']) ? t('Unignore') : t('Ignore') ),
'$blocked' => (($contact['blocked']) ? t('Currently blocked') : ''),
'$ignored' => (($contact['readonly']) ? t('Currently ignored') : ''),
'$archived' => (($contact['archive']) ? t('Currently archived') : ''),
'$pending' => (($contact['archive']) ? t('Currently pending') : ''),
'$name' => $contact['name'],
'$alt_text' => $alt_text,
'$url' => $url
)); ));

View File

@ -35,6 +35,7 @@ function import_post(&$a) {
$filename = basename($_FILES['filename']['name']); $filename = basename($_FILES['filename']['name']);
$filesize = intval($_FILES['filename']['size']); $filesize = intval($_FILES['filename']['size']);
$filetype = $_FILES['filename']['type']; $filetype = $_FILES['filename']['type'];
$resume = ((array_key_exists('resume',$_REQUEST)) ? intval($_REQUEST['resume']) : 0);
if($src) { if($src) {

View File

@ -729,6 +729,6 @@ function what_next() {
."<p>".t('IMPORTANT: You will need to [manually] setup a scheduled task for the poller.') ."<p>".t('IMPORTANT: You will need to [manually] setup a scheduled task for the poller.')
.t('Please see the file "install/INSTALL.txt".') .t('Please see the file "install/INSTALL.txt".')
."</p><p>" ."</p><p>"
.t("Go to your new Red node <a href='$baseurl/register'>registration page</a> and register as new user. Remember to use the same email you have entered as administrator email. This will allow you to enter the site admin panel.") .t("Go to your new hub <a href='$baseurl/register'>registration page</a> and register as new member. Remember to use the same email you have entered as administrator email. This will allow you to enter the site admin panel.")
."</p>"; ."</p>";
} }

View File

@ -1 +1 @@
2015-07-11.1090 2015-07-14.1093

View File

@ -1,188 +1,18 @@
.abook-them,
.field_abook_help {
color: #000;
}
.abook-them {
padding: 5px;
text-align: center;
}
.abook-me { .abook-me {
padding: 5px 5px 5px 15px;
text-align: center;
}
.acheckbox {
margin-bottom: 5px !important;
}
.abook-pending-contact, .abook-autotext {
background: orange;
font-weight: bold; font-weight: bold;
margin: 10px;
padding: 20px 5px 10px;
} }
.abook-perms-msg { .slider {
background: orange; position: relative;
font-weight: bold; left: 1%;
margin: 10px; padding-bottom: 15px;
padding: 20px 5px 10px;
} }
.abook-permschange { #perms-tool-table {
width: 100%; width: 100%;
} }
.abook-perms-steps { #perms-tool-table td {
float: left; vertical-align: top;
width: 200px;
height: 210px;
background: orange;
font-weight: bold;
margin: 10px;
padding: 20px 5px 10px;
}
.abook-permssave {
margin-left: 10px;
clear: both;
}
#contact-slider {
width: 600px !important;
}
#rating-slider {
width: 600px !important;
}
#rating-text {
width: 400px;
height: 60px;
}
.abook-edit-them, .abook-edit-me {
float: left;
margin-left: 10px;
margin-right: 10px;
}
.field_abook_help {
float: left;
}
#contacts-main {
margin-top: 20px;
margin-bottom: 20px;
}
#contact-edit-wrapper {
margin-top: 10px;
}
#contact-edit-banner-name {
font-size: 1.4em;
font-weight: bold;
}
#contact-edit-poll-wrapper {
margin-top: 15px;
}
#contact-edit-poll-text {
margin-top: 15px;
margin-bottom: 5px;
}
#contact-edit-update-now {
margin-top: 15px;
}
#contact-edit-links{
clear: both;
}
#contact-edit-links ul {
list-style: none;
list-style-type: none;
margin-left: 0px;
padding-left: 0px;
}
#contact-edit-links li {
margin-top: 5px;
}
#contact-edit-drop-link {
float: right;
margin-right: 20px;
}
#contact-edit-nav-end {
clear: both;
}
#contact-edit-wrapper {
width: 100%;
}
#contact-edit-end {
clear: both;
margin-top: 15px;
}
#contact-profile-selector {
width: 175px;
margin-left: 175px;
}
.contact-edit-submit {
margin-top: 20px;
}
.contact-entry-wrapper {
float: left;
width: 120px;
height: 120px;
padding: 10px;
}
#contacts-search {
font-size: 1em;
width: 300px;
}
#contacts-search-end {
margin-bottom: 10px;
}
.contact-entry-photo-end {
clear: both;
}
.contact-entry-name {
float: left;
margin-left: 0px;
margin-right: 10px;
width: 120px;
overflow: hidden;
}
.contact-entry-end {
clear: both;
}
#abook-advanced-panel, #abook-advanced {
opacity: 0.3;
filter:alpha(opacity=30);
}
#abook-advanced-panel:hover, #abook-advanced:hover {
opacity: 1.0;
filter:alpha(opacity=100);
}
#abook-advanced {
margin-top: 15px;
} }

View File

@ -1,23 +1,12 @@
function abook_perms_msg() {
// $('.abook-permsmsg').show();
// $('.abook-permschange').html(aStr['permschange']);
// $('.abook-permssave').show();
}
function abook_perms_new() {
// $('.abook-permsnew').show();
// $('.abook-permssave').show();
}
$(document).ready(function() { $(document).ready(function() {
$('form').areYouSure({'addRemoveFieldsMarksDirty':true, 'message': aStr['leavethispage'] }); // Warn user about unsaved settings
if(typeof(after_following) !== 'undefined' && after_following) { if(typeof(after_following) !== 'undefined' && after_following) {
if(typeof(connectDefaultShare) !== 'undefined') if(typeof(connectDefaultShare) !== 'undefined')
connectDefaultShare(); connectDefaultShare();
else else
connectFullShare(); connectFullShare();
abook_perms_new();
} }
$('#id_pending').click(function() { $('#id_pending').click(function() {
@ -25,16 +14,10 @@ $(document).ready(function() {
connectDefaultShare(); connectDefaultShare();
else else
connectFullShare(); connectFullShare();
abook_perms_new();
}); });
// $('.abook-edit-me').click(function() {
// abook_perms_msg();
// });
}); });
function connectFullShare() { function connectFullShare() {
$('.abook-edit-me').each(function() { $('.abook-edit-me').each(function() {
if(! $(this).is(':disabled')) if(! $(this).is(':disabled'))
@ -54,85 +37,4 @@ function connectFullShare() {
$('#me_id_perms_view_storage').attr('checked','checked'); $('#me_id_perms_view_storage').attr('checked','checked');
$('#me_id_perms_republish').attr('checked','checked'); $('#me_id_perms_republish').attr('checked','checked');
$('#me_id_perms_post_like').attr('checked','checked'); $('#me_id_perms_post_like').attr('checked','checked');
// abook_perms_msg();
} }
function connectCautiousShare() {
$('.abook-edit-me').each(function() {
if(! $(this).is(':disabled'))
$(this).removeAttr('checked');
});
$('#me_id_perms_view_stream').attr('checked','checked');
$('#me_id_perms_view_profile').attr('checked','checked');
$('#me_id_perms_view_photos').attr('checked','checked');
$('#me_id_perms_view_storage').attr('checked','checked');
$('#me_id_perms_view_pages').attr('checked','checked');
$('#me_id_perms_send_stream').attr('checked','checked');
$('#me_id_perms_post_comments').attr('checked','checked');
$('#me_id_perms_post_mail').attr('checked','checked');
$('#me_id_perms_post_like').attr('checked','checked');
// abook_perms_msg();
}
function connectForum() {
$('.abook-edit-me').each(function() {
if(! $(this).is(':disabled'))
$(this).removeAttr('checked');
});
$('#me_id_perms_view_stream').attr('checked','checked');
$('#me_id_perms_view_profile').attr('checked','checked');
$('#me_id_perms_view_photos').attr('checked','checked');
$('#me_id_perms_view_contacts').attr('checked','checked');
$('#me_id_perms_view_storage').attr('checked','checked');
$('#me_id_perms_view_pages').attr('checked','checked');
$('#me_id_perms_send_stream').attr('checked','checked');
$('#me_id_perms_post_wall').attr('checked','checked');
$('#me_id_perms_post_comments').attr('checked','checked');
$('#me_id_perms_post_mail').attr('checked','checked');
$('#me_id_perms_tag_deliver').attr('checked','checked');
$('#me_id_perms_republish').attr('checked','checked');
$('#me_id_perms_post_like').attr('checked','checked');
// abook_perms_msg();
}
function connectClear() {
$('.abook-edit-me').each(function() {
if(! $(this).is(':disabled'))
$(this).removeAttr('checked');
});
// abook_perms_msg();
}
function connectSoapBox() {
$('.abook-edit-me').each(function() {
if(! $(this).is(':disabled'))
$(this).removeAttr('checked');
});
$('#me_id_perms_view_stream').attr('checked','checked');
$('#me_id_perms_view_profile').attr('checked','checked');
$('#me_id_perms_view_photos').attr('checked','checked');
$('#me_id_perms_view_contacts').attr('checked','checked');
$('#me_id_perms_view_storage').attr('checked','checked');
$('#me_id_perms_view_pages').attr('checked','checked');
// abook_perms_msg();
}
function connectFollowOnly() {
$('.abook-edit-me').each(function() {
if(! $(this).is(':disabled'))
$(this).removeAttr('checked');
});
$('#me_id_perms_send_stream').attr('checked','checked');
// abook_perms_msg();
}

View File

@ -1284,12 +1284,6 @@ div.jGrowl div.jGrowl-notification {
text-align: center; text-align: center;
} }
#contact-slider {
position: relative;
left: 5%;
width: 90%;
}
a.rconnect, a.rateme, div.rateme { a.rconnect, a.rateme, div.rateme {
color: $nav_active_icon_colour; color: $nav_active_icon_colour;
text-decoration: none; text-decoration: none;
@ -1932,7 +1926,7 @@ nav .dropdown-menu {
.section-content-wrapper .section-content-warning-wrapper, .section-content-wrapper .section-content-warning-wrapper,
.section-content-tools-wrapper .section-content-danger-wrapper, .section-content-tools-wrapper .section-content-danger-wrapper,
.section-content-wrapper .section-content-danger-wrapper { .section-content-wrapper .section-content-danger-wrapper {
margin-bottom: 0px; margin-bottom: 10px;
border-radius: $radiuspx; border-radius: $radiuspx;
} }
@ -1965,6 +1959,10 @@ nav .dropdown-menu {
background-color: $item_colour; background-color: $item_colour;
} }
#perms-tool-table .highlight:hover {
background-color: $item_colour;
}
nav ul li .undefined, nav ul li .undefined,
nav ul li .notify-seen, nav ul li .notify-seen,
nav ul li .notify-unseen nav ul li .notify-unseen
@ -2298,4 +2296,3 @@ nav .badge.mail-update:hover {
.channels_ckbx, .pending_ckbx, .users_ckbx { .channels_ckbx, .pending_ckbx, .users_ckbx {
margin-top: -5px !important; margin-top: -5px !important;
} }

View File

@ -1,140 +1,211 @@
<div class="generic-content-wrapper-styled"> <div class="generic-content-wrapper">
<h2>{{$header}}</h2> <div class="section-title-wrapper">
{{if $notself}}
<div class="dropdown pull-right">
<button id="connection-dropdown" class="btn btn-default btn-xs" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="icon-caret-down"></i>
</button>
<ul class="dropdown-menu" aria-labelledby="dLabel">
<li><a href="{{$buttons.view.url}}" title="{{$buttons.view.title}}">{{$buttons.view.label}}</a></li>
<li><a href="{{$buttons.recent.url}}" title="{{$buttons.recent.title}}">{{$buttons.recent.label}}</a></li>
<li class="divider"></li>
<li><a href="#" title="{{$buttons.refresh.title}}" onclick="window.location.href='{{$buttons.refresh.url}}'; return false;">{{$buttons.refresh.label}}</a></li>
<li><a href="#" title="{{$buttons.block.title}}" onclick="window.location.href='{{$buttons.block.url}}'; return false;">{{$buttons.block.label}}</a></li>
<li><a href="#" title="{{$buttons.ignore.title}}" onclick="window.location.href='{{$buttons.ignore.url}}'; return false;">{{$buttons.ignore.label}}</a></li>
<li><a href="#" title="{{$buttons.archive.title}}" onclick="window.location.href='{{$buttons.archive.url}}'; return false;">{{$buttons.archive.label}}</a></li>
<li><a href="#" title="{{$buttons.hide.title}}" onclick="window.location.href='{{$buttons.hide.url}}'; return false;">{{$buttons.hide.label}}</a></li>
<li><a href="#" title="{{$buttons.delete.title}}" onclick="window.location.href='{{$buttons.delete.url}}'; return false;">{{$buttons.delete.label}}</a></li>
</ul>
</div>
{{/if}}
<h2>{{$header}}</h2>
</div>
<div class="section-content-wrapper-np">
{{if $notself}}
<div class="section-content-info-wrapper">
<div>
{{$addr_text}} <strong>'{{$addr}}'</strong>
</div>
{{if $last_update}}
<div>
{{$lastupdtext}} {{$last_update}}
</div>
{{/if}}
</div>
{{/if}}
<h3>{{$addr}}</h3> <form id="abook-edit-form" action="connedit/{{$contact_id}}" method="post" >
{{if $notself}} <input type="hidden" name="contact_id" value="{{$contact_id}}">
<div id="connection-flag-tabs">
{{$tabs}} <div class="panel-group" id="contact-edit-tools" role="tablist" aria-multiselectable="true">
</div> {{if $notself}}
<div id="connection-edit-buttons">
{{foreach $buttons as $b }} {{if $is_pending}}
<button class="btn btn-sm btn-default" title="{{$b.title}}" onclick="window.location.href='{{$b.url}}'; return false;">{{$b.label}}</button> <div class="panel">
{{/foreach}} <div class="section-subtitle-wrapper" role="tab" id="pending-tool">
{{/if}} <h3>
<a data-toggle="collapse" data-parent="#contact-edit-tools" href="#pending-tool-collapse" aria-expanded="true" aria-controls="pending-tool-collapse">
{{$pending_label}}
<div id="contact-edit-wrapper"> </a>
<form id="abook-edit-form" action="connedit/{{$contact_id}}" method="post" > </h3>
</div>
<div class="abook-permsnew" style="display: none;"> <div id="pending-tool-collapse" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="pending-tool">
<div class="abook-perms-msg">{{$perms_step1}}</div> <div class="section-content-tools-wrapper">
</div> {{include file="field_checkbox.tpl" field=$unapproved}}
<div class="settings-submit-wrapper" >
<div class="abook-permsmsg" style="display: none;"> <button type="submit" name="done" value="{{$submit}}" class="btn btn-primary">{{$submit}}</button>
<div class="abook-perms-msg">{{$perms_new}}</div> </div>
</div> </div>
</div>
</div>
<div class="abook-permssave" style="display: none;"> <div class="modal" id="abook-pending-modal" tabindex="-1" role="dialog">
<input class="contact-edit-submit" type="submit" name="done" value="{{$submit}}" /> <div class="modal-dialog" role="document">
</div> <div class="modal-content">
<div class="modal-header">
{{if $last_update}} <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
{{$lastupdtext}} {{$last_update}} <h4 class="modal-title" id="myModalLabel">{{$pending_modal_title}}</h4>
{{/if}} </div>
<div class="modal-body">
<strong>{{$name}}</strong> {{$pending_modal_body}}
{{if $is_pending}} </div>
<div class="abook-pending-contact"> <div class="modal-footer">
{{include file="field_checkbox.tpl" field=$unapproved}} <button class="btn btn-sm btn-danger pull-left" title="{{$buttons.delete.title}}" onclick="window.location.href='{{$buttons.delete.url}}'; return false;">{{$buttons.delete.label}}</button>
</div> <button type="button" class="btn btn-default" data-dismiss="modal">{{$pending_modal_dismiss}}</button>
{{/if}} <button type="submit" class="btn btn-primary" name="pending" value="1">{{$pending_modal_approve}}</button>
</div>
</div>
{{if $notself}} </div>
{{if $slide}} </div>
<h3>{{$lbl_slider}}</h3> <script>$('#abook-pending-modal').modal('show');</script>
{{/if}}
{{$slide}}
{{if $affinity }}
{{/if}} <div class="panel">
<div class="section-subtitle-wrapper" role="tab" id="affinity-tool">
{{if $connfilter}} <h3>
{{include file="field_textarea.tpl" field=$incl}} <a data-toggle="collapse" data-parent="#contact-edit-tools" href="#affinity-tool-collapse" aria-expanded="true" aria-controls="affinity-tool-collapse">
{{include file="field_textarea.tpl" field=$excl}} {{$affinity }}
{{else}} </a>
<input type="hidden" name="{{$incl.0}}" value="{{$incl.2}}" /> </h3>
<input type="hidden" name="{{$excl.0}}" value="{{$excl.2}}" /> </div>
{{/if}} <div id="affinity-tool-collapse" class="panel-collapse collapse{{if !$is_pending}} in{{/if}}" role="tabpanel" aria-labelledby="affinity-tool">
<div class="section-content-tools-wrapper">
{{if $rating}} {{if $slide}}
<h3>{{$lbl_rating}}</h3> <div class="form-group"><strong>{{$lbl_slider}}</strong></div>
{{$slide}}
{{$rating}} <input id="contact-closeness-mirror" type="hidden" name="closeness" value="{{$close}}" />
{{/if}}
{{/if}} {{if $multiprofs }}
<div class="form-group">
<strong>{{$lbl_vis2}}</strong>
{{$profile_select}}
{{/if}} </div>
{{/if}}
<div class="settings-submit-wrapper" >
{{if $self}} <button type="submit" name="done" value="{{$submit}}" class="btn btn-primary">{{$submit}}</button>
<div class="abook-autotext"> </div>
<div id="autoperm-desc" class="descriptive-paragraph">{{$autolbl}}</div> </div>
{{include file="field_checkbox.tpl" field=$autoperms}} </div>
</div> </div>
{{/if}} {{/if}}
<input type="hidden" name="contact_id" value="{{$contact_id}}"> {{if $connfilter}}
<input id="contact-closeness-mirror" type="hidden" name="closeness" value="{{$close}}" /> <div class="panel">
<input id="contact-rating-mirror" type="hidden" name="rating" value="{{$rating_val}}" /> <div class="section-subtitle-wrapper" role="tab" id="fitert-tool">
<h3>
<a data-toggle="collapse" data-parent="#contact-edit-tools" href="#fitert-tool-collapse" aria-expanded="true" aria-controls="fitert-tool-collapse">
{{if $rating}} {{$connfilter_label}}
{{if $notself}} </a>
{{include file="field_textarea.tpl" field=$rating_text}} </h3>
{{/if}} </div>
{{/if}} <div id="fitert-tool-collapse" class="panel-collapse collapse{{if !$is_pending && !($slide || $multiprofs)}} in{{/if}}" role="tabpanel" aria-labelledby="fitert-tool">
<div class="section-content-tools-wrapper">
{{if $notself}} {{include file="field_textarea.tpl" field=$incl}}
{{if $multiprofs }} {{include file="field_textarea.tpl" field=$excl}}
<div> <div class="settings-submit-wrapper" >
<h3>{{$lbl_vis1}}</h3> <button type="submit" name="done" value="{{$submit}}" class="btn btn-primary">{{$submit}}</button>
<div>{{$lbl_vis2}}</div> </div>
</div>
{{$profile_select}} </div>
</div> </div>
{{/if}} {{else}}
{{/if}} <input type="hidden" name="{{$incl.0}}" value="{{$incl.2}}" />
<input type="hidden" name="{{$excl.0}}" value="{{$excl.2}}" />
<h3>{{$permlbl}}</h3> {{/if}}
{{if $notself}} {{if $rating}}
<div id="connedit-perms-wrap" class="fakelink" onclick="openClose('connedit-perms');">{{$clickme}}</div> <div class="panel">
<div id="connedit-perms" style="display: none;" > <div class="section-subtitle-wrapper" role="tab" id="rating-tool">
{{/if}} <h3>
<a data-toggle="collapse" data-parent="#contact-edit-tools" href="#rating-tool-collapse" aria-expanded="true" aria-controls="rating-tool-collapse">
<div id="perm-desc" class="descriptive-text">{{$permnote}}</div> {{$lbl_rating}}
<table> </a>
<tr><td></td><td class="abook-them">{{$them}}</td><td colspan="2" class="abook-me">{{$me}}</td><td></td></tr> </h3>
<tr><td colspan="5"><hr /></td></tr> </div>
{{foreach $perms as $prm}} <div id="rating-tool-collapse" class="panel-collapse collapse{{if !$is_pending && !($slide || $multiprofs) && !$connfilter}} in{{/if}}" role="tabpanel" aria-labelledby="rating-tool">
{{include file="field_acheckbox.tpl" field=$prm}} <div class="section-content-tools-wrapper">
{{/foreach}} <div class="section-content-warning-wrapper">
<tr><td colspan="5"><hr /></td></tr> {{$rating_info}}
</table> </div>
<div class="form-group"><strong>{{$lbl_rating_label}}</strong></div>
</div> {{$rating}}
{{include file="field_textarea.tpl" field=$rating_text}}
{{if $notself}} <input id="contact-rating-mirror" type="hidden" name="rating" value="{{$rating_val}}" />
</div> <div class="settings-submit-wrapper" >
{{/if}} <button type="submit" name="done" value="{{$submit}}" class="btn btn-primary">{{$submit}}</button>
</div>
<input class="contact-edit-submit" type="submit" name="done" value="{{$submit}}" /> </div>
</div>
{{if $self && $noperms}} </div>
<script> {{/if}}
if(typeof(connectDefaultShare) !== 'undefined')
connectDefaultShare(); {{/if}}
else
connectFullShare(); <div class="panel">
abook_perms_msg(); {{if $notself}}
</script> <div class="section-subtitle-wrapper" role="tab" id="perms-tool">
{{/if}} <h3>
<a data-toggle="collapse" data-parent="#contact-edit-tools" href="#perms-tool-collapse" aria-expanded="true" aria-controls="perms-tool-collapse">
</form> {{$permlbl}}
</div> </a>
</h3>
</div>
{{/if}}
<div id="perms-tool-collapse" class="panel-collapse collapse{{if $self}} in{{/if}}" role="tabpanel" aria-labelledby="perms-tool">
<div class="section-content-tools-wrapper">
<div class="section-content-warning-wrapper">
{{$permnote}}
</div>
<table id="perms-tool-table" class=form-group>
<tr>
<td></td>
{{if $notself}}
<td class="abook-them">{{$them}}</td>
{{/if}}
<td colspan="2" class="abook-me">{{$me}}</td>
</tr>
{{foreach $perms as $prm}}
{{include file="field_acheckbox.tpl" field=$prm}}
{{/foreach}}
</table>
{{if $self}}
<div>
<div>{{$autolbl}}</div>
{{include file="field_checkbox.tpl" field=$autoperms}}
</div>
{{/if}}
<div class="settings-submit-wrapper" >
<button type="submit" name="done" value="{{$submit}}" class="btn btn-primary">{{$submit}}</button>
</div>
</div>
</div>
</div>
</div>
</form>
</div>
</div> </div>

View File

@ -1,4 +1,20 @@
<div id="contact-slider" class="slider" style="height: 32px; position: relative; left: 5%; width: 90%;"><input id="contact-range" type="text" name="fake-closeness" value="{{$val}}" /></div> <div id="contact-slider" class="slider form-group"><input id="contact-range" type="text" name="fake-closeness" value="{{$val}}" /></div>
<script> <script>
$("#contact-range").jRange({ from: {{$min|default:'0'}}, to: 99, step: 1, scale: [{{$labels}}], width:'100%', showLabels: false, onstatechange: function(v) { $("#contact-closeness-mirror").val(v); } }); $(document).ready(function() {
// The slider does not render correct if width is given in % and
// the slider container is hidden (display: none) during rendering.
// So let's unhide it to render and hide again afterwards.
if(!$("#affinity-tool-collapse").hasClass("in")) {
$("#affinity-tool-collapse").addClass("in");
makeContactSlider();
$("#affinity-tool-collapse").removeClass("in");
}
else {
makeContactSlider();
}
});
function makeContactSlider() {
$("#contact-range").jRange({ from: {{$min|default:'0'}}, to: 99, step: 1, scale: [{{$labels}}], width:'98%', showLabels: false, onstatechange: function(v) { $("#contact-closeness-mirror").val(v); } });
}
</script> </script>

View File

@ -1,17 +1,17 @@
<tr> <tr class="highlight">
<td> <td>
<label class="mainlabel" for='id_{{$field.0}}'>{{$field.1}}</label> <label class="mainlabel" for='id_{{$field.0}}'>{{$field.1}}</label><br>
<span class='field_abook_help'>{{$field.6}}</span>
</td> </td>
{{if $notself}}
<td class="abook-them"> <td class="abook-them">
<input type="checkbox" name='them_{{$field.0}}' id='them_id_{{$field.0}}' value="1" disabled="disabled" {{if $field.2}}checked="checked"{{/if}} /> <input type="checkbox" name='them_{{$field.0}}' id='them_id_{{$field.0}}' value="1" disabled="disabled" {{if $field.2}}checked="checked"{{/if}} />
</td> </td>
{{/if}}
<td class="abook-me"> <td class="abook-me">
<input type="checkbox" name='{{$field.0}}' class='abook-edit-me' id='me_id_{{$field.0}}' value="{{$field.4}}" {{if $field.3}}checked="checked"{{/if}} /> <input type="checkbox" name='{{$field.0}}' class='abook-edit-me' id='me_id_{{$field.0}}' value="{{$field.4}}" {{if $field.3}}checked="checked"{{/if}}{{if $field.5 && $notself}} disabled="disabled"{{/if}}/>
</td> </td>
<td> <td>
{{if $field.5}}<span class="permission-inherited">{{$inherited}}</span> {{/if}} {{if $field.5}}<span class="permission-inherited">{{$inherited}}</span>{{/if}}
</td> </td>
<td> </tr>
<span class='field_abook_help'>{{$field.6}}</span>
</td>
</tr>

View File

@ -1,4 +1,19 @@
<div id="rating-slider" class="slider" style="height: 32px; position: relative; left: 5%; width: 90%;"><input id="rating-range" type="text" name="fake-rating" value="{{$val}}" /></div> <div id="rating-slider" class="slider form-group"><input id="rating-range" type="text" name="fake-rating" value="{{$val}}" /></div>
<script> <script>
$("#rating-range").jRange({ from: -10, to: 10, step: 1, width:'100%', showLabels: false, showScale: true, scale : [ '-10','-8','-6','-4','-2','0','2','4','6','8','10' ], onstatechange: function(v) { $("#contact-rating-mirror").val(v); } }); $(document).ready(function() {
// The slider does not render correct if width is given in % and
// the slider container is hidden (display: none) during rendering.
// So let's unhide it to render and hide again afterwards.
if(!$("#rating-tool-collapse").hasClass("in")) {
$("#rating-tool-collapse").addClass("in");
makeRatingSlider();
$("#rating-tool-collapse").removeClass("in");
}
else {
makeRatingSlider();
}
});
function makeRatingSlider() {
$("#rating-range").jRange({ from: -10, to: 10, step: 1, width:'98%', showLabels: false, showScale: true, scale : [ '-10','-8','-6','-4','-2','0','2','4','6','8','10' ], onstatechange: function(v) { $("#contact-rating-mirror").val(v); } });
}
</script> </script>