aboutsummaryrefslogtreecommitdiff
path: root/mod
diff options
context:
space:
mode:
authornickw <nickw@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-07-14 14:33:29 +0000
committernickw <nickw@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-07-14 14:33:29 +0000
commit7600c8f5a898806e7788c9d26627f19083eb45e3 (patch)
tree54a1fb26c32538bb89536dd81126ffae8b70f64c /mod
parentff07d7f469b8f50f9ab96e040354af6bc7ccc706 (diff)
downloadelgg-7600c8f5a898806e7788c9d26627f19083eb45e3.tar.gz
elgg-7600c8f5a898806e7788c9d26627f19083eb45e3.tar.bz2
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
Diffstat (limited to 'mod')
-rw-r--r--mod/invitefriends/languages/en.php3
-rw-r--r--mod/invitefriends/views/default/invitefriends/formitems.php35
2 files changed, 27 insertions, 11 deletions
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 "<h2>".elgg_echo('friends:invite')."</h2>";
-?>
+ echo <<< HTML
+<h2>$invite</h2>
<p class="margin_top">
-<label>
- <?php echo elgg_echo('invitefriends:introduction'); ?>
-<textarea class="input_textarea" name="emails" ></textarea></label></p>
-<p><label>
- <?php echo elgg_echo('invitefriends:message'); ?>
-<textarea class="input_textarea" name="emailmessage" ><?php
- echo sprintf(elgg_echo('invitefriends:message:default'),$CONFIG->site->name);
-?></textarea></label></p>
-<?php echo elgg_view('input/submit', array('value' => elgg_echo('send'))); ?>
+ <label>
+ $introduction
+ <textarea class="input_textarea" name="emails" ></textarea>
+ </label>
+</p>
+<p>
+ <label>
+ $message
+ <textarea class="input_textarea" name="emailmessage" >$default</textarea>
+ </label>
+</p>
+HTML;
+
+ echo elgg_view('input/submit', array('value' => elgg_echo('send')));
+} else {
+ echo elgg_echo('invitefriends:registration_disabled');
+}