aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Zotlabs/Module/New_channel.php8
-rwxr-xr-xview/tpl/new_channel.tpl38
2 files changed, 26 insertions, 20 deletions
diff --git a/Zotlabs/Module/New_channel.php b/Zotlabs/Module/New_channel.php
index 97a46a43e..ebdd6c37f 100644
--- a/Zotlabs/Module/New_channel.php
+++ b/Zotlabs/Module/New_channel.php
@@ -142,9 +142,12 @@ class New_channel extends \Zotlabs\Web\Controller {
}
$limit = account_service_class_fetch(get_account_id(),'total_identities');
-
+ $canadd = true;
if($r && ($limit !== false)) {
$channel_usage_message = sprintf( t("You have created %1$.0f of %2$.0f allowed channels."), $r[0]['total'], $limit);
+ if ($r[0]['total'] >= $limit) {
+ $canadd = false;
+ }
}
else {
$channel_usage_message = '';
@@ -186,7 +189,8 @@ class New_channel extends \Zotlabs\Web\Controller {
'$nickname' => $nickname,
'$validate' => t('Validate'),
'$submit' => t('Create'),
- '$channel_usage_message' => $channel_usage_message
+ '$channel_usage_message' => $channel_usage_message,
+ '$canadd' => $canadd
));
return $o;
diff --git a/view/tpl/new_channel.tpl b/view/tpl/new_channel.tpl
index 51880e1f6..8d72df55b 100755
--- a/view/tpl/new_channel.tpl
+++ b/view/tpl/new_channel.tpl
@@ -13,23 +13,25 @@
</div>
{{/if}}
{{/if}}
- <form action="new_channel" method="post" id="newchannel-form">
- {{if $default_role}}
- <input type="hidden" name="permissions_role" value="{{$default_role}}" />
- {{else}}
- {{include file="field_select_grouped.tpl" field=$role}}
- {{/if}}
-
- {{include file="field_input.tpl" field=$name}}
-
- {{include file="field_input.tpl" field=$nickname}}
- <button class="btn btn-primary" type="submit" id="newchannel-submit-button">{{$submit}}</button>
-
-
- <div id="newchannel-submit-end" class="clear"></div>
-
- <div id="newchannel-import-link" class="descriptive-paragraph" >{{$label_import}}</div>
- <div id="newchannel-import-end" class="clear"></div>
- </form>
+ {{if $canadd}}
+ <form action="new_channel" method="post" id="newchannel-form">
+ {{if $default_role}}
+ <input type="hidden" name="permissions_role" value="{{$default_role}}" />
+ {{else}}
+ {{include file="field_select_grouped.tpl" field=$role}}
+ {{/if}}
+
+ {{include file="field_input.tpl" field=$name}}
+
+ {{include file="field_input.tpl" field=$nickname}}
+ <button class="btn btn-primary" type="submit" id="newchannel-submit-button">{{$submit}}</button>
+
+
+ <div id="newchannel-submit-end" class="clear"></div>
+
+ <div id="newchannel-import-link" class="descriptive-paragraph" >{{$label_import}}</div>
+ <div id="newchannel-import-end" class="clear"></div>
+ </form>
+ {{/if}}
</div>
</div>