diff options
author | Mario Vavti <mario@mariovavti.com> | 2016-02-19 22:28:21 +0100 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2016-02-19 22:28:21 +0100 |
commit | 02e82e496e3ec8dbd8264248ad8550dd5e335cba (patch) | |
tree | ba88a936dff8de1333a14c5c265e0314c0a12e41 /mod/new_channel.php | |
parent | 5a7b994e59306519574ce7aaa004f08d7d47ee05 (diff) | |
download | volse-hubzilla-02e82e496e3ec8dbd8264248ad8550dd5e335cba.tar.gz volse-hubzilla-02e82e496e3ec8dbd8264248ad8550dd5e335cba.tar.bz2 volse-hubzilla-02e82e496e3ec8dbd8264248ad8550dd5e335cba.zip |
pimp up mod new_channel
Diffstat (limited to 'mod/new_channel.php')
-rw-r--r-- | mod/new_channel.php | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/mod/new_channel.php b/mod/new_channel.php index b22a5cacb..89a03714b 100644 --- a/mod/new_channel.php +++ b/mod/new_channel.php @@ -102,7 +102,6 @@ function new_channel_post(&$a) { function new_channel_content(&$a) { - $acc = $a->get_account(); if((! $acc) || $acc['account_id'] != get_account_id()) { @@ -119,29 +118,33 @@ function new_channel_content(&$a) { if($r && (! intval($r[0]['total']))) { $default_role = get_config('system','default_permissions_role'); } + + $limit = account_service_class_fetch(get_account_id(),'total_identities'); + + if($r && ($limit !== false)) { + $channel_usage_message = sprintf( t("You have created %1$.0f of %2$.0f allowed channels."), $r[0]['total'], $limit); + } + else { + $channel_usage_message = ''; + } } - $name = ((x($_REQUEST,'name')) ? $_REQUEST['name'] : "" ); - $nickname = ((x($_REQUEST,'nickname')) ? $_REQUEST['nickname'] : "" ); + $name = array('name', t('Name or caption'), ((x($_REQUEST,'name')) ? $_REQUEST['name'] : ''), t('Examples: "Bob Jameson", "Lisa and her Horses", "Soccer", "Aviation Group"')); + $nickhub = '@' . str_replace(array('http://','https://','/'), '', get_config('system','baseurl')); + $nickname = array('nickname', t('Choose a short nickname'), ((x($_REQUEST,'nickname')) ? $_REQUEST['nickname'] : ''), sprintf( t('Your nickname will be used to create an easy to remember channel address e.g. nickname%s'), $nickhub)); $privacy_role = ((x($_REQUEST,'permissions_role')) ? $_REQUEST['permissions_role'] : "" ); + $role = array('permissions_role' , t('Channel role and privacy'), ($privacy_role) ? $privacy_role : 'social', t('Select a channel role with your privacy requirements.') . ' <a href="help/roles" target="_blank">' . t('Read more about roles') . '</a>',get_roles()); $o = replace_macros(get_markup_template('new_channel.tpl'), array( - - '$title' => t('Add a Channel'), - '$desc' => t('A channel is your own collection of related web pages. A channel can be used to hold social network profiles, blogs, conversation groups and forums, celebrity pages, and much more. You may create as many channels as your service provider allows.'), - - '$label_name' => t('Name'), - '$help_name' => t('Examples: "Bob Jameson", "Lisa and her Horses", "Soccer", "Aviation Group" '), - '$label_nick' => t('Choose a short nickname'), - '$nick_hub' => '@' . str_replace(array('http://','https://','/'), '', get_config('system','baseurl')), - '$nick_desc' => t('Your nickname will be used to create an easily remembered channel address (like an email address) which you can share with others.'), + '$title' => t('Create a Channel'), + '$desc' => t('A channel is your identity on the grid. It can represent a person, a blog, or a forum to name a few. Channels can make connections with other channels to share information with highly detailed permissions.'), '$label_import' => t('Or <a href="import">import an existing channel</a> from another location'), '$name' => $name, - '$help_role' => t('Please choose a channel type (such as social networking or community forum) and privacy requirements so we can select the best permissions for you'), - '$role' => array('permissions_role' , t('Channel Type'), ($privacy_role) ? $privacy_role : 'social', '<a href="help/roles" target="_blank">'.t('Read more about roles').'</a>',get_roles()), + '$role' => $role, '$default_role' => $default_role, '$nickname' => $nickname, - '$submit' => t('Create') + '$submit' => t('Create'), + '$channel_usage_message' => $channel_usage_message )); return $o; |