Merge pull request #772 from pafcu/chanman

Some work on the channel manager
This commit is contained in:
RedMatrix 2014-12-29 09:29:12 +11:00
commit 7b98a6fcb0
2 changed files with 11 additions and 4 deletions

View file

@ -28,8 +28,13 @@ function manage_content(&$a) {
if($change_channel) {
$r = change_channel($change_channel);
if($r && $r['channel_startpage'])
goaway(z_root() . '/' . $r['channel_startpage']);
if((argc() > 2) && !(argv(2) === 'default')) {
goaway(z_root() . '/' . implode('/',array_slice($a->argv,2))); // Go to whatever is after /manage/, but with the new channel
}
else {
if($r && $r['channel_startpage'])
goaway(z_root() . '/' . $r['channel_startpage']); // If nothing extra is specified, go to the default page
}
goaway(z_root());
}
@ -49,7 +54,7 @@ function manage_content(&$a) {
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];
$selected_channel = &$channels[$x]; // Needs to be a reference!
$channels[$x]['default'] = (($channels[$x]['channel_id'] == $account['account_default_channel']) ? "1" : '');
$channels[$x]['default_links'] = '1';
@ -153,6 +158,8 @@ function manage_content(&$a) {
'$msg_make_default' => t('Make Default'),
'$links' => $links,
'$all_channels' => $channels,
'$mail_format' => t('%d new messages'),
'$intros_format' => t('%d new introductions'),
'$channel_usage_message' => $channel_usage_message,
));

View file

@ -7,7 +7,7 @@
{{/if}}
{{/if}}
<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>
<div class="channels-notifications-wrapper">{{if $channel.mail != 0}}<span style="color:#c60032;"><i class="icon-envelope"></i> {{$channel.mail}}</span>{{else}}<i class="icon-envelope"></i> &nbsp;{{/if}} {{if $channel.intros != 0}}<span style="color:#c60032;"><i class="icon-user"></i> {{$channel.intros}}</span>{{else}}<i class="icon-user"></i> &nbsp;{{/if}}</div>
<div class="channels-notifications-wrapper"><a href='manage/{{$channel.channel_id}}/message' style="{{if $channel.mail != 0}}color:#c60032;{{/if}}" title='{{$channel.mail|string_format:$mail_format}}'><i class="icon-envelope"></i> {{$channel.mail}}</a>&nbsp;<a href='manage/{{$channel.channel_id}}/connections/ifpending' style="{{if $channel.intros != 0}}color:#c60032;{{/if}}" title='{{$channel.intros|string_format:$intros_format}}'><i class="icon-user"></i> {{$channel.intros}}</a></div>
<a href="{{$channel.link}}" class="channel-selection-name-link" title="{{$channel.channel_name}}"><div class="channel-name">{{$channel.channel_name}}</div></a>
</div>