From 7600c8f5a898806e7788c9d26627f19083eb45e3 Mon Sep 17 00:00:00 2001
From: nickw
Date: Wed, 14 Jul 2010 14:33:29 +0000
Subject: Disabling friend invite form when site has disabled new user
registration.
git-svn-id: http://code.elgg.org/elgg/trunk@6703 36083f99-b078-4883-b0ff-0f9b5a30f544
---
mod/invitefriends/languages/en.php | 3 ++
.../views/default/invitefriends/formitems.php | 35 +++++++++++++++-------
2 files changed, 27 insertions(+), 11 deletions(-)
(limited to 'mod')
diff --git a/mod/invitefriends/languages/en.php b/mod/invitefriends/languages/en.php
index ad64e4fd8..d7dbd4c8f 100644
--- a/mod/invitefriends/languages/en.php
+++ b/mod/invitefriends/languages/en.php
@@ -13,6 +13,9 @@
$english = array(
'friends:invite' => 'Invite friends',
+
+ 'invitefriends:registration_disabled' => 'New user registration has been disabled on this site; you are unable to invite new users.',
+
'invitefriends:introduction' => 'To invite friends to join you on this network, enter their email addresses below (one per line):',
'invitefriends:message' => 'Enter a message they will receive with your invitation:',
'invitefriends:subject' => 'Invitation to join %s',
diff --git a/mod/invitefriends/views/default/invitefriends/formitems.php b/mod/invitefriends/views/default/invitefriends/formitems.php
index ce9a84073..ae04b78f7 100644
--- a/mod/invitefriends/views/default/invitefriends/formitems.php
+++ b/mod/invitefriends/views/default/invitefriends/formitems.php
@@ -10,16 +10,29 @@
* @link http://elgg.org/
*/
+if ($CONFIG->allow_registration) {
+ $invite = elgg_echo('friends:invite');
+ $introduction = elgg_echo('invitefriends:introduction');
+ $message = elgg_echo('invitefriends:message');
+ $default = sprintf(elgg_echo('invitefriends:message:default'), $CONFIG->site->name);
-echo "".elgg_echo('friends:invite')."
";
-?>
+ echo <<< HTML
+$invite
-
-
- elgg_echo('send'))); ?>
+
+
+
+
+
+HTML;
+
+ echo elgg_view('input/submit', array('value' => elgg_echo('send')));
+} else {
+ echo elgg_echo('invitefriends:registration_disabled');
+}
--
cgit v1.2.3