aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-11-01 15:45:02 -0700
committerfriendica <info@friendica.com>2012-11-01 15:45:02 -0700
commit9bf4508ffb626d1aa2c9591b700e985b00abe577 (patch)
tree4d2cbc18301ddad2bfe4447dc1a6ab5c32d99a94 /mod
parentb400e4dfad16bfb346e08f5eee737064bc172f96 (diff)
downloadvolse-hubzilla-9bf4508ffb626d1aa2c9591b700e985b00abe577.tar.gz
volse-hubzilla-9bf4508ffb626d1aa2c9591b700e985b00abe577.tar.bz2
volse-hubzilla-9bf4508ffb626d1aa2c9591b700e985b00abe577.zip
cleanup channel management
Diffstat (limited to 'mod')
-rw-r--r--mod/manage.php21
1 files changed, 17 insertions, 4 deletions
diff --git a/mod/manage.php b/mod/manage.php
index 9fbcea55d..d29830f90 100644
--- a/mod/manage.php
+++ b/mod/manage.php
@@ -11,6 +11,17 @@ function manage_content(&$a) {
$change_channel = ((argc() > 1) ? intval(argv(1)) : 0);
+ if((argc() > 2) && (argv(2) === 'primary')) {
+ q("update channel set channel_primary = 0 where channel_account_id = %d",
+ intval(get_account_id())
+ );
+ q("update channel set channel_primary = 1 where channel_id = %d and channel_account_id = %d limit 1",
+ intval($change_channel),
+ intval(get_account_id())
+ );
+ goaway(z_root() . '/manage');
+ }
+
if($change_channel) {
$r = change_channel($change_channel);
@@ -39,10 +50,12 @@ function manage_content(&$a) {
$o = replace_macros(get_markup_template('channels.tpl'), array(
- '$header' => t('Channel Manager'),
- '$desc' => t('Attach to one of your channels by selecting it.'),
- '$links' => $links,
- '$all_channels' => $channels,
+ '$header' => t('Channel Manager'),
+ '$desc' => t('Attach to one of your channels by selecting it.'),
+ '$msg_primary' => t('Default Channel'),
+ '$msg_make_primary' => t('Make Default'),
+ '$links' => $links,
+ '$all_channels' => $channels,
));