From a07be48017fd4b9a83c14153674386f2bcdc016c Mon Sep 17 00:00:00 2001 From: zottel Date: Mon, 13 Jul 2015 17:30:04 +0200 Subject: change account_default_channel if default channel is removed --- include/Contact.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/include/Contact.php b/include/Contact.php index 9490fd2da..035e83a82 100644 --- a/include/Contact.php +++ b/include/Contact.php @@ -311,6 +311,24 @@ function channel_remove($channel_id, $local = true, $unset_session=true) { intval(PAGE_REMOVED), intval($channel_id) ); + // if this was the default channel, set another one as default + if($a->account['account_default_channel'] == $channel_id) { + $r = q("select channel_id from channel where channel_account_id = %d and not ( channel_pageflags & %d)>0 limit 1", + intval($a->account['account_id']), + intval(PAGE_REMOVED)); + if ($r) { + $rr = q("update account set account_default_channel = %d where account_id = %d", + intval($r[0]['channel_id']), + intval($a->account['account_id'])); + logger("Default channel deleted, changing default to channel_id " . $r[0]['channel_id']); + } + else { + $rr = q("update account set account_default_channel = 0 where account_id = %d", + intval($r[0]['channel_id']), + intval($a->account['account_id'])); + } + } + $r = q("update hubloc set hubloc_flags = (hubloc_flags | %d) where hubloc_hash = '%s' and hubloc_url = '%s' ", intval(HUBLOC_FLAGS_DELETED), -- cgit v1.2.3 From 7f712973831212694de824a2e63961b98ef53959 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Tue, 14 Jul 2015 12:46:40 +0200 Subject: cleanup connedit --- include/contact_selectors.php | 2 +- mod/connedit.php | 118 +++++-------- view/css/mod_connedit.css | 186 +------------------- view/js/mod_connedit.js | 134 +-------------- view/theme/redbasic/css/style.css | 17 +- view/tpl/abook_edit.tpl | 349 +++++++++++++++++++++++--------------- view/tpl/contact_slider.tpl | 20 ++- view/tpl/field_acheckbox.tpl | 14 +- view/tpl/rating_slider.tpl | 19 ++- 9 files changed, 309 insertions(+), 550 deletions(-) diff --git a/include/contact_selectors.php b/include/contact_selectors.php index 726efce9d..8671f1bd1 100644 --- a/include/contact_selectors.php +++ b/include/contact_selectors.php @@ -5,7 +5,7 @@ function contact_profile_assign($current) { $o = ''; - $o .= "\r\n"; $r = q("SELECT profile_guid, profile_name FROM `profile` WHERE `uid` = %d", intval($_SESSION['uid'])); diff --git a/mod/connedit.php b/mod/connedit.php index 71166b2cc..39a69364d 100644 --- a/mod/connedit.php +++ b/mod/connedit.php @@ -144,7 +144,6 @@ function connedit_post(&$a) { dbesc($orig_record[0]['abook_xchan']) ); - if($z) { $record = $z[0]['xlink_id']; $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 = $a->poi; + $buttons = array( - $tabs = array( - - array( + 'view' => array( 'label' => t('View Profile'), 'url' => chanlink_cid($contact['abook_id']), 'sel' => '', 'title' => sprintf( t('View %s\'s profile'), $contact['xchan_name']), ), - array( + 'refresh' => array( 'label' => t('Refresh Permissions'), 'url' => $a->get_baseurl(true) . '/connedit/' . $contact['abook_id'] . '/refresh', 'sel' => '', 'title' => t('Fetch updated permissions'), ), - array( + 'recent' => array( 'label' => t('Recent Activity'), 'url' => $a->get_baseurl(true) . '/network/?f=&cid=' . $contact['abook_id'], 'sel' => '', 'title' => t('View recent posts and comments'), - ) - ); + ), - $buttons = array( - array( + 'block' => array( 'label' => (($contact['abook_flags'] & ABOOK_FLAG_BLOCKED) ? t('Unblock') : t('Block')), 'url' => $a->get_baseurl(true) . '/connedit/' . $contact['abook_id'] . '/block', 'sel' => (($contact['abook_flags'] & ABOOK_FLAG_BLOCKED) ? 'active' : ''), 'title' => t('Block (or Unblock) all communications with this connection'), ), - array( + 'ignore' => array( 'label' => (($contact['abook_flags'] & ABOOK_FLAG_IGNORED) ? t('Unignore') : t('Ignore')), 'url' => $a->get_baseurl(true) . '/connedit/' . $contact['abook_id'] . '/ignore', 'sel' => (($contact['abook_flags'] & ABOOK_FLAG_IGNORED) ? 'active' : ''), 'title' => t('Ignore (or Unignore) all inbound communications from this connection'), ), - array( + + 'archive' => array( 'label' => (($contact['abook_flags'] & ABOOK_FLAG_ARCHIVED) ? t('Unarchive') : t('Archive')), 'url' => $a->get_baseurl(true) . '/connedit/' . $contact['abook_id'] . '/archive', 'sel' => (($contact['abook_flags'] & ABOOK_FLAG_ARCHIVED) ? 'active' : ''), 'title' => t('Archive (or Unarchive) this connection - mark channel dead but keep content'), ), - array( + + 'hide' => array( 'label' => (($contact['abook_flags'] & ABOOK_FLAG_HIDDEN) ? t('Unhide') : t('Hide')), 'url' => $a->get_baseurl(true) . '/connedit/' . $contact['abook_id'] . '/hide', 'sel' => (($contact['abook_flags'] & ABOOK_FLAG_HIDDEN) ? 'active' : ''), 'title' => t('Hide or Unhide this connection from your other connections'), ), - array( + 'delete' => array( 'label' => t('Delete'), 'url' => $a->get_baseurl(true) . '/connedit/' . $contact['abook_id'] . '/drop', 'sel' => '', @@ -556,18 +554,9 @@ function connedit_content(&$a) { $self = false; - if(! ($contact['abook_flags'] & ABOOK_FLAG_SELF)) { - $tab_tpl = get_markup_template('common_tabs.tpl'); - $t = replace_macros($tab_tpl, array('$tabs'=>$tabs)); - } - else + if(($contact['abook_flags'] & ABOOK_FLAG_SELF)) $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'); $tpl = get_markup_template("abook_edit.tpl"); @@ -616,7 +605,6 @@ function connedit_content(&$a) { $rating_text = $xl[0]['xlink_rating_text']; } - $poco_rating = get_config('system','poco_rating_enable'); // if unset default to enabled @@ -640,8 +628,19 @@ function connedit_content(&$a) { $global_perms = get_perms(); $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) { $thisperm = (($contact['abook_my_perms'] & $v[1]) ? "1" : ''); @@ -656,85 +655,44 @@ function connedit_content(&$a) { $o .= replace_macros($tpl,array( - '$header' => (($self) ? t('Connection Default Permissions') : sprintf( t('Connections: settings for %s'),$contact['xchan_name'])), - '$autoperms' => array('autoperms',t('Apply these permissions automatically'), ((get_pconfig(local_channel(),'system','autoperms')) ? 1 : 0), ''), + '$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), '', array(t('No'),('Yes'))), '$addr' => $contact['xchan_addr'], + '$addr_text' => t('This connection\'s address is'), '$notself' => (($self) ? '' : '1'), '$self' => (($self) ? '1' : ''), '$autolbl' => t('Apply the permissions indicated on this page to all new connections.'), '$buttons' => (($self) ? '' : $buttons), - '$viewprof' => t('View Profile'), - '$clickme' => t('Click to open/close'), '$lbl_slider' => t('Slide to adjust your degree of friendship'), - '$lbl_rating' => t('Rating (this information is public)'), - '$lbl_rating_txt' => t('Optionally explain your rating (this information is public)'), + '$lbl_rating' => t('Rating'), + '$lbl_rating_label' => t('Slide to adjust your rating'), + '$lbl_rating_txt' => t('Optionally explain your rating'), '$connfilter' => feature_enabled(local_channel(),'connfilter'), '$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')), - '$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_val' => $rating_val, '$slide' => $slide, - '$tabs' => $t, - '$tab_str' => $tab_str, - '$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 not be able to communicate with you until you submit this page, which will install and apply the selected permissions.'), + '$affinity' => $affinity, '$is_pending' => (($contact['abook_flags'] & ABOOK_FLAG_PENDING) ? 1 : ''), '$unapproved' => $unapproved, '$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 privacy settings, though you may wish to review the "Advanced Permissions".') : ''), '$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_info1' => t('Contact Information / Notes'), - '$infedit' => t('Edit contact notes'), '$close' => $contact['abook_closeness'], '$them' => t('Their Settings'), '$me' => t('My Settings'), '$perms' => $perms, - '$perms_new' => t('Default permissions for this channel type have (just) been applied. They have not 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'), - '$permnote' => t('Some permissions may be inherited from your channel privacy settings, which have higher priority than individual settings. Changing those inherited settings on this page will have no effect.'), - '$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, + '$permnote' => t('Some permissions may be inherited from your channel\'s privacy settings, which have higher priority than individual settings. You can not change those settings here.'), '$lastupdtext' => t('Last update:'), - '$lost_contact' => $lost_contact, - '$updpub' => t('Update public posts'), '$last_update' => relative_date($contact['abook_connected']), - '$udnow' => t('Update now'), '$profile_select' => contact_profile_assign($contact['abook_profile']), - '$multiprofs' => feature_enabled(local_channel(),'multi_profiles'), + '$multiprofs' => $multiprofs, '$contact_id' => $contact['abook_id'], - '$block_text' => (($contact['blocked']) ? t('Unblock') : t('Block') ), - '$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 + '$name' => $contact['xchan_name'], )); diff --git a/view/css/mod_connedit.css b/view/css/mod_connedit.css index 44a0a1abf..87eff66d4 100644 --- a/view/css/mod_connedit.css +++ b/view/css/mod_connedit.css @@ -1,188 +1,18 @@ - -.field_abook_help { - color: #000; -} -.abook-them { - padding: 5px; - text-align: center; -} +.abook-them, .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; - margin: 10px; - padding: 20px 5px 10px; -} - -.abook-perms-msg { - background: orange; - font-weight: bold; - margin: 10px; - padding: 20px 5px 10px; -} - -.abook-permschange { - width: 100%; -} - -.abook-perms-steps { - float: left; - 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; +.slider { + position: relative; + left: 1%; + padding-bottom: 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 { +#perms-tool-table { 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; +#perms-tool-table td { + vertical-align: top; } diff --git a/view/js/mod_connedit.js b/view/js/mod_connedit.js index ee34f0508..fd545afeb 100644 --- a/view/js/mod_connedit.js +++ b/view/js/mod_connedit.js @@ -1,138 +1,6 @@ - -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() { - if(typeof(after_following) !== 'undefined' && after_following) { - if(typeof(connectDefaultShare) !== 'undefined') - connectDefaultShare(); - else - connectFullShare(); - abook_perms_new(); - } - - $('#id_pending').click(function() { - if(typeof(connectDefaultShare) !== 'undefined') - connectDefaultShare(); - else - connectFullShare(); - abook_perms_new(); - }); -// $('.abook-edit-me').click(function() { -// abook_perms_msg(); -// }); + $('form').areYouSure({'addRemoveFieldsMarksDirty':true, 'message': aStr['leavethispage'] }); // Warn user about unsaved settings }); - -function connectFullShare() { - $('.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_chat').attr('checked','checked'); - $('#me_id_perms_view_storage').attr('checked','checked'); - $('#me_id_perms_republish').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(); - -} - diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css index 939b9cf54..679d48edb 100644 --- a/view/theme/redbasic/css/style.css +++ b/view/theme/redbasic/css/style.css @@ -1284,13 +1284,7 @@ div.jGrowl div.jGrowl-notification { text-align: center; } -#contact-slider { - position: relative; - left: 5%; - width: 90%; -} - -a.rconnect, a.rateme, div.rateme { +.rconnect, a.rateme, div.rateme { color: $nav_active_icon_colour; text-decoration: none; font-weight: normal; @@ -1932,7 +1926,7 @@ nav .dropdown-menu { .section-content-wrapper .section-content-warning-wrapper, .section-content-tools-wrapper .section-content-danger-wrapper, .section-content-wrapper .section-content-danger-wrapper { - margin-bottom: 0px; + margin-bottom: 10px; border-radius: $radiuspx; } @@ -1965,6 +1959,10 @@ nav .dropdown-menu { background-color: $item_colour; } +#perms-tool-table .highlight:hover { + background-color: $item_colour; +} + nav ul li .undefined, nav ul li .notify-seen, nav ul li .notify-unseen @@ -2299,3 +2297,6 @@ nav .badge.mail-update:hover { margin-top: -5px !important; } +.collapse { +width: 100% !important; +} diff --git a/view/tpl/abook_edit.tpl b/view/tpl/abook_edit.tpl index d118cbb9c..202c6881e 100755 --- a/view/tpl/abook_edit.tpl +++ b/view/tpl/abook_edit.tpl @@ -1,140 +1,211 @@ -
-

{{$header}}

- -

{{$addr}}

- -{{if $notself}} -
-{{$tabs}} -
-
-{{foreach $buttons as $b }} - -{{/foreach}} -{{/if}} - - -
-
- - - - - - - - -{{if $last_update}} -{{$lastupdtext}} {{$last_update}} -{{/if}} - - -{{if $is_pending}} -
-{{include file="field_checkbox.tpl" field=$unapproved}} -
-{{/if}} - - -{{if $notself}} -{{if $slide}} -

{{$lbl_slider}}

- -{{$slide}} - -{{/if}} - -{{if $connfilter}} - {{include file="field_textarea.tpl" field=$incl}} - {{include file="field_textarea.tpl" field=$excl}} -{{else}} - - -{{/if}} - -{{if $rating}} -

{{$lbl_rating}}

- -{{$rating}} - - -{{/if}} - - - -{{/if}} - - -{{if $self}} -
-
{{$autolbl}}
-{{include file="field_checkbox.tpl" field=$autoperms}} -
-{{/if}} - - - - - - -{{if $rating}} -{{if $notself}} - {{include file="field_textarea.tpl" field=$rating_text}} -{{/if}} -{{/if}} - -{{if $notself}} -{{if $multiprofs }} -
-

{{$lbl_vis1}}

-
{{$lbl_vis2}}
- -{{$profile_select}} -
-{{/if}} -{{/if}} - -

{{$permlbl}}

- -{{if $notself}} - - - -{{if $notself}} -
-{{/if}} - - - -{{if $self && $noperms}} - -{{/if}} - - -
+
+ +
+ {{if $notself}} + + {{/if}} + +
+ + + +
+ {{if $notself}} + + {{if $is_pending}} +
+ +
+
+ {{include file="field_checkbox.tpl" field=$unapproved}} +
+ +
+
+
+
+ + + {{/if}} + + {{if $affinity }} +
+ +
+
+ {{if $slide}} +
{{$lbl_slider}}
+ {{$slide}} + + {{/if}} + + {{if $multiprofs }} +
+ {{$lbl_vis2}} + {{$profile_select}} +
+ {{/if}} +
+ +
+
+
+
+ {{/if}} + + {{if $connfilter}} +
+ +
+
+ {{include file="field_textarea.tpl" field=$incl}} + {{include file="field_textarea.tpl" field=$excl}} +
+ +
+
+
+
+ {{else}} + + + {{/if}} + + {{if $rating}} +
+ +
+
+
+ {{$rating_info}} +
+
{{$lbl_rating_label}}
+ {{$rating}} + {{include file="field_textarea.tpl" field=$rating_text}} + +
+ +
+
+
+
+ {{/if}} + + {{/if}} + +
+ {{if $notself}} + + {{/if}} +
+
+
+ {{$permnote}} +
+ + + + + {{if $notself}} + + {{/if}} + + + {{foreach $perms as $prm}} + {{include file="field_acheckbox.tpl" field=$prm}} + {{/foreach}} +
{{$them}}{{$me}}
+ + {{if $self}} +
+
{{$autolbl}}
+ {{include file="field_checkbox.tpl" field=$autoperms}} +
+ {{/if}} + +
+ +
+
+
+
+
+
+
diff --git a/view/tpl/contact_slider.tpl b/view/tpl/contact_slider.tpl index 5c15e1c2c..550abc147 100755 --- a/view/tpl/contact_slider.tpl +++ b/view/tpl/contact_slider.tpl @@ -1,4 +1,20 @@ -
+
diff --git a/view/tpl/field_acheckbox.tpl b/view/tpl/field_acheckbox.tpl index 816af2a65..a4f271f1a 100755 --- a/view/tpl/field_acheckbox.tpl +++ b/view/tpl/field_acheckbox.tpl @@ -1,17 +1,17 @@ - + - +
+ {{$field.6}} + {{if $notself}} + {{/if}} - + {{if $field.5}}{{$inherited}} {{/if}} - - {{$field.6}} - - \ No newline at end of file + diff --git a/view/tpl/rating_slider.tpl b/view/tpl/rating_slider.tpl index 4702fc65b..4c36504e6 100644 --- a/view/tpl/rating_slider.tpl +++ b/view/tpl/rating_slider.tpl @@ -1,4 +1,19 @@ -
+
-- cgit v1.2.3 From a28da40fa8937e87d633689527c84594a771855d Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Tue, 14 Jul 2015 12:52:50 +0200 Subject: css fixes --- view/theme/redbasic/css/style.css | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css index 679d48edb..046d8471b 100644 --- a/view/theme/redbasic/css/style.css +++ b/view/theme/redbasic/css/style.css @@ -1284,7 +1284,7 @@ div.jGrowl div.jGrowl-notification { text-align: center; } -.rconnect, a.rateme, div.rateme { +a.rconnect, a.rateme, div.rateme { color: $nav_active_icon_colour; text-decoration: none; font-weight: normal; @@ -2296,7 +2296,3 @@ nav .badge.mail-update:hover { .channels_ckbx, .pending_ckbx, .users_ckbx { margin-top: -5px !important; } - -.collapse { -width: 100% !important; -} -- cgit v1.2.3 From 711dd1468db2116a2003494d4fe6d8a7c5ed7c7b Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Tue, 14 Jul 2015 13:16:08 +0200 Subject: provide inherited perms for connection default permissions --- mod/connedit.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mod/connedit.php b/mod/connedit.php index 39a69364d..a72714a1d 100644 --- a/mod/connedit.php +++ b/mod/connedit.php @@ -650,9 +650,11 @@ function connedit_content(&$a) { if((! $self) && ($existing[$k])) $thisperm = "1"; - $perms[] = array('perms_' . $k, $v[3], (($contact['abook_their_perms'] & $v[1]) ? "1" : ""),$thisperm, $v[1], (($channel[$v[0]] == PERMS_SPECIFIC || $self) ? '' : '1'), $v[4]); + $perms[] = array('perms_' . $k, $v[3], (($contact['abook_their_perms'] & $v[1]) ? "1" : ""),$thisperm, $v[1], (($channel[$v[0]] == PERMS_SPECIFIC) ? '' : '1'), $v[4]); } + //print_r($perms); killme(); + $o .= replace_macros($tpl,array( '$header' => (($self) ? t('Connection Default Permissions') : sprintf( t('Connection: %s'),$contact['xchan_name'])), -- cgit v1.2.3 From d8edb66287d7f5423c7a4ca8f87ae949465f3b68 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Tue, 14 Jul 2015 13:21:39 +0200 Subject: remove dbg --- mod/connedit.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/mod/connedit.php b/mod/connedit.php index a72714a1d..a769ed686 100644 --- a/mod/connedit.php +++ b/mod/connedit.php @@ -653,8 +653,6 @@ function connedit_content(&$a) { $perms[] = array('perms_' . $k, $v[3], (($contact['abook_their_perms'] & $v[1]) ? "1" : ""),$thisperm, $v[1], (($channel[$v[0]] == PERMS_SPECIFIC) ? '' : '1'), $v[4]); } - //print_r($perms); killme(); - $o .= replace_macros($tpl,array( '$header' => (($self) ? t('Connection Default Permissions') : sprintf( t('Connection: %s'),$contact['xchan_name'])), -- cgit v1.2.3 From dd57864867da2a1ddaf7b96094f924de9a3262a4 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Tue, 14 Jul 2015 13:46:22 +0200 Subject: revert provide inherited perms for connection default permissions --- mod/connedit.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/connedit.php b/mod/connedit.php index a769ed686..39a69364d 100644 --- a/mod/connedit.php +++ b/mod/connedit.php @@ -650,7 +650,7 @@ function connedit_content(&$a) { if((! $self) && ($existing[$k])) $thisperm = "1"; - $perms[] = array('perms_' . $k, $v[3], (($contact['abook_their_perms'] & $v[1]) ? "1" : ""),$thisperm, $v[1], (($channel[$v[0]] == PERMS_SPECIFIC) ? '' : '1'), $v[4]); + $perms[] = array('perms_' . $k, $v[3], (($contact['abook_their_perms'] & $v[1]) ? "1" : ""),$thisperm, $v[1], (($channel[$v[0]] == PERMS_SPECIFIC || $self) ? '' : '1'), $v[4]); } $o .= replace_macros($tpl,array( -- cgit v1.2.3 From f267bd55d68f6d3c63c33b1d307728e4ed12ddd5 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Tue, 14 Jul 2015 14:20:23 +0200 Subject: revert this until further investigation --- view/tpl/field_acheckbox.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/view/tpl/field_acheckbox.tpl b/view/tpl/field_acheckbox.tpl index a4f271f1a..2b5195322 100755 --- a/view/tpl/field_acheckbox.tpl +++ b/view/tpl/field_acheckbox.tpl @@ -9,7 +9,7 @@ {{/if}} - + {{if $field.5}}{{$inherited}} {{/if}} -- cgit v1.2.3 From cc1764989f70b28654b47fd58fd59b12b270b470 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Tue, 14 Jul 2015 17:37:33 +0200 Subject: fix mod_connedit.js after cleanup --- view/js/mod_connedit.js | 34 ++++++++++++++++++++++++++++++++++ view/tpl/field_acheckbox.tpl | 2 +- 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/view/js/mod_connedit.js b/view/js/mod_connedit.js index fd545afeb..d6cc42175 100644 --- a/view/js/mod_connedit.js +++ b/view/js/mod_connedit.js @@ -2,5 +2,39 @@ $(document).ready(function() { $('form').areYouSure({'addRemoveFieldsMarksDirty':true, 'message': aStr['leavethispage'] }); // Warn user about unsaved settings + if(typeof(after_following) !== 'undefined' && after_following) { + if(typeof(connectDefaultShare) !== 'undefined') + connectDefaultShare(); + else + connectFullShare(); + } + + $('#id_pending').click(function() { + if(typeof(connectDefaultShare) !== 'undefined') + connectDefaultShare(); + else + connectFullShare(); + }); + }); +function connectFullShare() { + $('.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_chat').attr('checked','checked'); + $('#me_id_perms_view_storage').attr('checked','checked'); + $('#me_id_perms_republish').attr('checked','checked'); + $('#me_id_perms_post_like').attr('checked','checked'); +} diff --git a/view/tpl/field_acheckbox.tpl b/view/tpl/field_acheckbox.tpl index 2b5195322..5b03a7848 100755 --- a/view/tpl/field_acheckbox.tpl +++ b/view/tpl/field_acheckbox.tpl @@ -12,6 +12,6 @@ - {{if $field.5}}{{$inherited}} {{/if}} + {{if $field.5}}{{$inherited}}{{/if}} -- cgit v1.2.3 From 4fe64179c8c99dbcbabd1580ddf760288d049547 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Tue, 14 Jul 2015 19:29:49 +0200 Subject: disable the inherited checkboxes for notself --- view/tpl/field_acheckbox.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/view/tpl/field_acheckbox.tpl b/view/tpl/field_acheckbox.tpl index 5b03a7848..d2aad3875 100755 --- a/view/tpl/field_acheckbox.tpl +++ b/view/tpl/field_acheckbox.tpl @@ -9,7 +9,7 @@ {{/if}} - + {{if $field.5}}{{$inherited}}{{/if}} -- cgit v1.2.3 From 104cbcab722477340961d45a93a441bb9fbc7e7a Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Tue, 14 Jul 2015 21:32:18 +0200 Subject: make strings translateable --- mod/connedit.php | 6 ++++++ view/tpl/abook_edit.tpl | 12 ++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/mod/connedit.php b/mod/connedit.php index 39a69364d..f628fb9d3 100644 --- a/mod/connedit.php +++ b/mod/connedit.php @@ -668,6 +668,7 @@ function connedit_content(&$a) { '$lbl_rating_label' => t('Slide to adjust your rating'), '$lbl_rating_txt' => t('Optionally explain your rating'), '$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')), '$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'),$rating_text,''), @@ -676,6 +677,11 @@ function connedit_content(&$a) { '$rating_val' => $rating_val, '$slide' => $slide, '$affinity' => $affinity, + '$pending_label' => t('Connection Pending Approval'), + '$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' => (($contact['abook_flags'] & ABOOK_FLAG_PENDING) ? 1 : ''), '$unapproved' => $unapproved, '$inherited' => t('inherited'), diff --git a/view/tpl/abook_edit.tpl b/view/tpl/abook_edit.tpl index 202c6881e..71693a553 100755 --- a/view/tpl/abook_edit.tpl +++ b/view/tpl/abook_edit.tpl @@ -46,7 +46,7 @@ @@ -64,15 +64,15 @@
@@ -116,7 +116,7 @@ -- cgit v1.2.3