add current selection to channel manager

This commit is contained in:
friendica 2012-11-01 17:06:34 -07:00
parent 42ac706b9f
commit 1021a4d476
4 changed files with 35 additions and 4 deletions

View File

@ -37,20 +37,28 @@ function manage_content(&$a) {
intval(get_account_id()) intval(get_account_id())
); );
$selected_channel = null;
if($r && count($r)) { if($r && count($r)) {
$channels = $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']); $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( $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( $o = replace_macros(get_markup_template('channels.tpl'), array(
'$header' => t('Channel Manager'), '$header' => t('Channel Manager'),
'$msg_selected' => t('Current Channel'),
'$selected' => $selected_channel,
'$desc' => t('Attach to one of your channels by selecting it.'), '$desc' => t('Attach to one of your channels by selecting it.'),
'$msg_primary' => t('Default Channel'), '$msg_primary' => t('Default Channel'),
'$msg_make_primary' => t('Make Default'), '$msg_make_primary' => t('Make Default'),

View File

@ -1,14 +1,29 @@
#channels-selected {
margin-top: 20px;
margin-bottom: 10px;
}
#channels-desc { #channels-desc {
color: #888888;
font-size: 1.2em;
margin-top: 15px; margin-top: 15px;
margin-bottom: 20px; margin-bottom: 20px;
} }
.channel-selection-primary {
font-size: 0.8em;
margin-bottom: 10px;
}
.channel-selection { .channel-selection {
width: 120px; width: 120px;
float: left; float: left;
} }
.channels-end { .channels-end {
clear: both; clear: both;
}
.channel-selection-name-link {
font-size: 1.2em;
margin-top: 10px;
} }

View File

@ -1,9 +1,11 @@
<div class="channel-selection"> <div class="channel-selection">
{{ if $channel.primary_links }}
{{ if $channel.channel_primary }} {{ if $channel.channel_primary }}
<div class="channel-selection-primary primary">$msg_primary</div> <div class="channel-selection-primary primary">$msg_primary</div>
{{ else }} {{ else }}
<div class="channel-selection-primary"><a href="manage/$channel.channel_id/primary">$msg_make_primary</a></div> <div class="channel-selection-primary"><a href="manage/$channel.channel_id/primary">$msg_make_primary</a></div>
{{ endif }} {{ endif }}
{{ endif }}
<a href="$channel.link" class="channel-selection-photo-link" title="$channel.channel_name"><img class="channel-photo" src="$channel.xchan_photo_m" alt="$channel.channel_name" /></a> <a href="$channel.link" class="channel-selection-photo-link" title="$channel.channel_name"><img class="channel-photo" src="$channel.xchan_photo_m" alt="$channel.channel_name" /></a>
<a href="$channel.link" class="channel-selection-name-link" title="$channel.channel_name"><div class="channel-name">$channel.channel_name</div></a> <a href="$channel.link" class="channel-selection-name-link" title="$channel.channel_name"><div class="channel-name">$channel.channel_name</div></a>
</div> </div>

View File

@ -7,10 +7,16 @@
{{ endfor }} {{ endfor }}
{{ endif }} {{ endif }}
{{ if $selected }}
<div id="channels-selected">$msg_selected</div>
{{ inc channel.tpl with $channel=$selected }}{{ endinc }}
<div class="channels-end selected"></div>
{{ endif }}
<div id="channels-desc" class="descriptive-text">$desc</div> <div id="channels-desc" class="descriptive-text">$desc</div>
{{ for $all_channels as $chn }} {{ for $all_channels as $chn }}
{{ inc channel.tpl with $channel=$chn }}{{ endinc }} {{ inc channel.tpl with $channel=$chn }}{{ endinc }}
{{ endfor }} {{ endfor }}
<div class="channels-end"></div> <div class="channels-end all"></div>