aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-11-07 18:48:31 -0800
committerfriendica <info@friendica.com>2012-11-07 18:48:31 -0800
commit3d56ab227d03840928a9fcebb0a8508fe69f31b6 (patch)
tree79930213612e9b8791550b3fa5c64bdbf211819e
parentcc8a11eee2c0f8c190ac421542845bfc3ae0b5c4 (diff)
downloadvolse-hubzilla-3d56ab227d03840928a9fcebb0a8508fe69f31b6.tar.gz
volse-hubzilla-3d56ab227d03840928a9fcebb0a8508fe69f31b6.tar.bz2
volse-hubzilla-3d56ab227d03840928a9fcebb0a8508fe69f31b6.zip
turn multiple profiles into a feature, implement connection flags (block,hide,archive,etc.)
-rw-r--r--boot.php1
-rw-r--r--include/features.php23
-rw-r--r--include/nav.php4
-rw-r--r--mod/connections.php55
-rw-r--r--version.inc2
-rw-r--r--view/theme/redbasic/css/style.css1
-rw-r--r--view/tpl/abook_edit.tpl8
-rw-r--r--view/tpl/contact_slider.tpl2
-rw-r--r--view/tpl/main_slider.tpl2
9 files changed, 77 insertions, 21 deletions
diff --git a/boot.php b/boot.php
index 105bad381..fca06f57c 100644
--- a/boot.php
+++ b/boot.php
@@ -189,6 +189,7 @@ define ( 'PERMS_SPECIFIC' , 0x0080 );
define ( 'ABOOK_FLAG_BLOCKED' , 0x0001);
define ( 'ABOOK_FLAG_IGNORED' , 0x0002);
define ( 'ABOOK_FLAG_HIDDEN' , 0x0004);
+define ( 'ABOOK_FLAG_ARCHIVED' , 0x0008);
define ( 'ABOOK_FLAG_SELF' , 0x0080);
diff --git a/include/features.php b/include/features.php
index 5ed412698..5711c22b6 100644
--- a/include/features.php
+++ b/include/features.php
@@ -16,17 +16,18 @@ function get_features() {
$arr = array(
-array('multi_delete', t('Multiple Deletion'), t('Select and delete multiple posts/comments at once')),
-array('expire', t('Content Expiration'), t('Remove old posts/comments after a period of time')),
-array('commtag', t('Community Tagging'), t('Tag existing posts and share the links')),
-array('categories', t('Post Categories'), t('Add categories to your channel postings')),
-array('filing', t('Saved Folders'), t('Ability to file posts under easily remembered names')),
-array('archives', t('Search by Date'), t('Select posts by date ranges')),
-array('dislike', t('Dislike Posts'), t('Ability to dislike posts/comments')),
-array('savedsearch', t('Saved Searches'), t('Save search terms for re-use')),
-array('preview', t('Post Preview'), t('Preview posts and comments before publishing them')),
-array('edit_posts', t('Edit Sent Posts'), t('Edit and correct posts and comments after sending')),
-array('richtext', t('Richtext Editor'), t('Use richtext/visual editor where applicable')),
+array('multi_delete', t('Multiple Deletion'), t('Select and delete multiple posts/comments at once')),
+array('expire', t('Content Expiration'), t('Remove old posts/comments after a period of time')),
+array('commtag', t('Community Tagging'), t('Tag existing posts and share the links')),
+array('categories', t('Post Categories'), t('Add categories to your channel postings')),
+array('filing', t('Saved Folders'), t('Ability to file posts under easily remembered names')),
+array('archives', t('Search by Date'), t('Select posts by date ranges')),
+array('dislike', t('Dislike Posts'), t('Ability to dislike posts/comments')),
+array('savedsearch', t('Saved Searches'), t('Save search terms for re-use')),
+array('preview', t('Post Preview'), t('Preview posts and comments before publishing them')),
+array('edit_posts', t('Edit Sent Posts'), t('Edit and correct posts and comments after sending')),
+array('richtext', t('Richtext Editor'), t('Use richtext/visual editor where applicable')),
+array('multi_profiles', t('Multiple Profiles'), t('Show different profiles to different connections/collections')),
);
call_hooks('get_features',$arr);
diff --git a/include/nav.php b/include/nav.php
index 5b86a0691..c714502a1 100644
--- a/include/nav.php
+++ b/include/nav.php
@@ -152,7 +152,9 @@ EOT;
$nav['manage'] = array('manage', t('Channel Select'), "", t('Manage Your Channels'));
$nav['settings'] = array('settings', t('Settings'),"", t('Account/Channel Settings'));
- $nav['profiles'] = array('profiles', t('Profiles'),"", t('Manage/Edit Profiles'));
+ if(feature_enabled(local_user(),'multi_profiles'))
+ $nav['profiles'] = array('profiles', t('Profiles'),"", t('Manage/Edit Profiles'));
+
$nav['contacts'] = array('connections', t('Connections'),"", t('Manage/Edit Friends and Connections'));
}
diff --git a/mod/connections.php b/mod/connections.php
index 6c63d1b14..a542abb7a 100644
--- a/mod/connections.php
+++ b/mod/connections.php
@@ -307,9 +307,56 @@ EOT;
$contact_id = $a->data['abook']['abook_id'];
$contact = $a->data['abook'];
- $editselect = 'none';
- if(feature_enabled(local_user(),'richtext'))
- $editselect = 'exact';
+
+ $tabs = array(
+
+ array(
+ 'label' => t('View Profile'),
+ 'url' => $a->get_baseurl(true) . '/connections/' . $contact['abook_id'] . '/profile',
+ 'sel' => '',
+ 'title' => sprintf( t('View %s\'s profile'), $contact['xchan_name']),
+ ),
+
+ array(
+ 'label' => (($contact['abook_flags'] & ABOOK_FLAG_BLOCKED) ? t('Unblock') : t('Block')),
+ 'url' => $a->get_baseurl(true) . '/connections/' . $contact['abook_id'] . '/block',
+ 'sel' => (($contact['abook_flags'] & ABOOK_FLAG_BLOCKED) ? 'active' : ''),
+ 'title' => t('Block or Unblock this connection'),
+ ),
+
+ array(
+ 'label' => (($contact['abook_flags'] & ABOOK_FLAG_IGNORED) ? t('Unignore') : t('Ignore')),
+ 'url' => $a->get_baseurl(true) . '/connections/' . $contact['abook_id'] . '/ignore',
+ 'sel' => (($contact['abook_flags'] & ABOOK_FLAG_IGNORED) ? 'active' : ''),
+ 'title' => t('Ignore or Unignore this connection'),
+ ),
+ array(
+ 'label' => (($contact['abook_flags'] & ABOOK_FLAG_ARCHIVED) ? t('Unarchive') : t('Archive')),
+ 'url' => $a->get_baseurl(true) . '/connections/' . $contact['abook_id'] . '/archive',
+ 'sel' => (($contact['abook_flags'] & ABOOK_FLAG_ARCHIVED) ? 'active' : ''),
+ 'title' => t('Archive or Unarchive this connection'),
+ ),
+ array(
+ 'label' => (($contact['abook_flags'] & ABOOK_FLAG_HIDDEN) ? t('Unhide') : t('Hide')),
+ 'url' => $a->get_baseurl(true) . '/connections/' . $contact['abook_id'] . '/hide',
+ 'sel' => (($contact['abook_flags'] & ABOOK_FLAG_HIDDEN) ? 'active' : ''),
+ 'title' => t('Hide or Unhide this connection'),
+ ),
+
+ array(
+ 'label' => t('Delete'),
+ 'url' => $a->get_baseurl(true) . '/connections/' . $contact['abook_id'] . '/drop',
+ 'sel' => '',
+ 'title' => t('Delete this connection'),
+ ),
+
+ );
+
+ $tab_tpl = get_markup_template('common_tabs.tpl');
+ $t = replace_macros($tab_tpl, array('$tabs'=>$tabs));
+
+
+
$a->page['htmlhead'] .= replace_macros(get_markup_template('contact_head.tpl'), array(
'$baseurl' => $a->get_baseurl(true),
@@ -326,7 +373,6 @@ EOT;
'$val' => $contact['abook_closeness'],
'$intimate' => t('Best Friends'),
'$friends' => t('Friends'),
- '$coworkers' => t('Co-workers'),
'$oldfriends' => t('Former Friends'),
'$acquaintances' => t('Acquaintances'),
'$world' => t('Unknown')
@@ -337,6 +383,7 @@ EOT;
'$header' => t('Contact Settings') . ' for ' . $contact['xchan_name'],
'$viewprof' => t('View Profile'),
'$slide' => $slide,
+ '$tabs' => $t,
'$tab_str' => $tab_str,
'$submit' => t('Submit'),
'$lbl_vis1' => t('Profile Visibility'),
diff --git a/version.inc b/version.inc
index e3a923096..924b1152a 100644
--- a/version.inc
+++ b/version.inc
@@ -1 +1 @@
-2012-11-06.130
+2012-11-07.131
diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css
index a996a2d04..7dbea7acf 100644
--- a/view/theme/redbasic/css/style.css
+++ b/view/theme/redbasic/css/style.css
@@ -3709,3 +3709,4 @@ ul.menu-popup {
.notify-seen {
background: #DDDDDD;
}
+
diff --git a/view/tpl/abook_edit.tpl b/view/tpl/abook_edit.tpl
index 82372a297..c534dbde7 100644
--- a/view/tpl/abook_edit.tpl
+++ b/view/tpl/abook_edit.tpl
@@ -1,8 +1,10 @@
<h2>$header</h2>
-<br />
-<a href="connections/$contact_id/profile">$viewprof</a>
+
+<div id="connection-flag-tabs">
+$tabs
+</div>
<div id="contact-edit-wrapper">
<br />
@@ -10,6 +12,8 @@
$slide
+
+
<h3>Permissions</h3>
<form action="abook/$contact_id" method="post" >
diff --git a/view/tpl/contact_slider.tpl b/view/tpl/contact_slider.tpl
index 1334f58b1..2ccb08a90 100644
--- a/view/tpl/contact_slider.tpl
+++ b/view/tpl/contact_slider.tpl
@@ -1,4 +1,4 @@
<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>
<script>
- $("#contact-range").slider({ from: 0, to: 99, step: 1, scale: ['$me', '$intimate', '|', '$friends', '|', '$coworkers', '|', '$oldfriends', '|', '$acquaintances', '|', '$world' ], onstatechange: function(v) { $("#contact-closeness-mirror").val(v); } });
+ $("#contact-range").slider({ from: 0, to: 99, step: 1, scale: ['$me', '|', '$intimate', '|', '$friends', '|', '$oldfriends', '|', '$acquaintances', '|', '$world' ], onstatechange: function(v) { $("#contact-closeness-mirror").val(v); } });
</script>
diff --git a/view/tpl/main_slider.tpl b/view/tpl/main_slider.tpl
index 0bcf1384f..ea8b04cf3 100644
--- a/view/tpl/main_slider.tpl
+++ b/view/tpl/main_slider.tpl
@@ -1,6 +1,6 @@
<div id="main-slider" class="slider" ><input id="main-range" type="text" name="cminmax" value="$val" /></div>
<script>
- $("#main-range").slider({ from: 0, to: 99, step: 1, scale: ['$me', '$intimate', '|', '$friends', '|', '$coworkers', '|', '$oldfriends', '|', '$acquaintances', '|', '$world' ], onstatechange: function(v) {
+ $("#main-range").slider({ from: 0, to: 99, step: 1, scale: ['$me', '|', '$intimate', '|', '$friends', '|', '$oldfriends', '|', '$acquaintances', '|', '$world' ], onstatechange: function(v) {
var carr = v.split(";");
network_cmin = carr[0];
network_cmax = carr[1];