]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Disabling friend invite form when site has disabled new user registration.
authornickw <nickw@36083f99-b078-4883-b0ff-0f9b5a30f544>
Wed, 14 Jul 2010 14:33:29 +0000 (14:33 +0000)
committernickw <nickw@36083f99-b078-4883-b0ff-0f9b5a30f544>
Wed, 14 Jul 2010 14:33:29 +0000 (14:33 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@6703 36083f99-b078-4883-b0ff-0f9b5a30f544

mod/invitefriends/languages/en.php
mod/invitefriends/views/default/invitefriends/formitems.php

index ad64e4fd840529bd973f70bc6dcaf17d65dca161..d7dbd4c8fa20ddd905f0d5578dc32f445a4d8e21 100644 (file)
@@ -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',
index ce9a840734ad80b7bddbafc3b5df1762e20fa768..ae04b78f722c471086a588641c5f98cd6b554bd1 100644 (file)
  * @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');
+}