diff options
author | Haakon Meland Eriksen <haakon.eriksen@far.no> | 2016-02-24 17:44:27 +0100 |
---|---|---|
committer | Haakon Meland Eriksen <haakon.eriksen@far.no> | 2016-02-24 17:44:27 +0100 |
commit | ddeab48f9b314eed067c31086945acee33964d37 (patch) | |
tree | a814d6244991017af57ea03670d45d9ca1286cc0 /mod/new_channel.php | |
parent | cc264b2d60049a844fe17322fbcb367712a7071f (diff) | |
parent | 039eb585240a5fa106ede00a055036458a4f5393 (diff) | |
download | volse-hubzilla-ddeab48f9b314eed067c31086945acee33964d37.tar.gz volse-hubzilla-ddeab48f9b314eed067c31086945acee33964d37.tar.bz2 volse-hubzilla-ddeab48f9b314eed067c31086945acee33964d37.zip |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'mod/new_channel.php')
-rw-r--r-- | mod/new_channel.php | 43 |
1 files changed, 19 insertions, 24 deletions
diff --git a/mod/new_channel.php b/mod/new_channel.php index b22a5cacb..577137c37 100644 --- a/mod/new_channel.php +++ b/mod/new_channel.php @@ -8,7 +8,6 @@ function new_channel_init(&$a) { $cmd = ((argc() > 1) ? argv(1) : ''); - if($cmd === 'autofill.json') { require_once('library/urlify/URLify.php'); $result = array('error' => false, 'message' => ''); @@ -59,7 +58,6 @@ function new_channel_init(&$a) { } - function new_channel_post(&$a) { $arr = $_POST; @@ -94,15 +92,8 @@ function new_channel_post(&$a) { } - - - - - - function new_channel_content(&$a) { - $acc = $a->get_account(); if((! $acc) || $acc['account_id'] != get_account_id()) { @@ -119,29 +110,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.'), - '$label_import' => t('Or <a href="import">import an existing channel</a> from another location'), + '$title' => t('Create Channel'), + '$desc' => t('A channel is your identity on this network. 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; |