From 1021a4d4763974c3c40f40a0ca9682f1fcc3f6ee Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 1 Nov 2012 17:06:34 -0700 Subject: add current selection to channel manager --- mod/manage.php | 12 ++++++++++-- view/css/mod_manage.css | 17 ++++++++++++++++- view/tpl/channel.tpl | 2 ++ view/tpl/channels.tpl | 8 +++++++- 4 files changed, 35 insertions(+), 4 deletions(-) diff --git a/mod/manage.php b/mod/manage.php index d29830f90..ac4454567 100644 --- a/mod/manage.php +++ b/mod/manage.php @@ -37,20 +37,28 @@ function manage_content(&$a) { intval(get_account_id()) ); + $selected_channel = null; + if($r && count($r)) { $channels = $r; - for($x = 0; $x < count($channels); $x ++) + for($x = 0; $x < count($channels); $x ++) { $channels[$x]['link'] = 'manage/' . intval($channels[$x]['channel_id']); + if($channels[$x]['channel_id'] == local_user()) + $selected_channel = $channels[$x]; + $channels[$x]['primary_links'] = '1'; + } } } $links = array( - array( 'new_channel', t('Create a new channel'), t('New Channel')) + array( 'new_channel', t('Create a new channel'), t('Create a new channel')) ); $o = replace_macros(get_markup_template('channels.tpl'), array( '$header' => t('Channel Manager'), + '$msg_selected' => t('Current Channel'), + '$selected' => $selected_channel, '$desc' => t('Attach to one of your channels by selecting it.'), '$msg_primary' => t('Default Channel'), '$msg_make_primary' => t('Make Default'), diff --git a/view/css/mod_manage.css b/view/css/mod_manage.css index 5f06e5064..921ddfc8f 100644 --- a/view/css/mod_manage.css +++ b/view/css/mod_manage.css @@ -1,14 +1,29 @@ - +#channels-selected { + margin-top: 20px; + margin-bottom: 10px; +} #channels-desc { + color: #888888; + font-size: 1.2em; margin-top: 15px; margin-bottom: 20px; } +.channel-selection-primary { + font-size: 0.8em; + margin-bottom: 10px; +} + .channel-selection { width: 120px; float: left; } .channels-end { clear: both; +} + +.channel-selection-name-link { + font-size: 1.2em; + margin-top: 10px; } \ No newline at end of file diff --git a/view/tpl/channel.tpl b/view/tpl/channel.tpl index 9c8ded1d9..5bae5ba33 100644 --- a/view/tpl/channel.tpl +++ b/view/tpl/channel.tpl @@ -1,9 +1,11 @@
+{{ if $channel.primary_links }} {{ if $channel.channel_primary }}
$msg_primary
{{ else }} {{ endif }} +{{ endif }} $channel.channel_name
$channel.channel_name
diff --git a/view/tpl/channels.tpl b/view/tpl/channels.tpl index 50366efa6..916ba1c75 100644 --- a/view/tpl/channels.tpl +++ b/view/tpl/channels.tpl @@ -7,10 +7,16 @@ {{ endfor }} {{ endif }} +{{ if $selected }} +
$msg_selected
+{{ inc channel.tpl with $channel=$selected }}{{ endinc }} +
+{{ endif }} +
$desc
{{ for $all_channels as $chn }} {{ inc channel.tpl with $channel=$chn }}{{ endinc }} {{ endfor }} -
+
-- cgit v1.2.3