]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Refs #2693 walled garden code is functional. Push back a thorough clean up until...
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Sun, 6 Mar 2011 21:15:02 +0000 (21:15 +0000)
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Sun, 6 Mar 2011 21:15:02 +0000 (21:15 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@8614 36083f99-b078-4883-b0ff-0f9b5a30f544

_graphics/walled_garden_background_top.gif
engine/lib/elgglib.php
views/default/core/account/login_walled_garden.php
views/default/css/walled_garden.php
views/default/page/elements/footer.php
views/default/page/walled_garden.php

index ffe7d9229b8471cb179d3f6e26fda6c61635b6be..20d551e2fddc53b111a33625e7a5f847a86bc2ca 100644 (file)
Binary files a/_graphics/walled_garden_background_top.gif and b/_graphics/walled_garden_background_top.gif differ
index 69c56275dbbc1f355ac33cfbb6c42225de4b1a84..3cc4ddb1ddd388f20017025d697b3f266999634d 100644 (file)
@@ -1758,7 +1758,7 @@ function elgg_is_valid_options_for_batch_operation($options, $type) {
  *
  * @link http://docs.elgg.org/Tutorials/WalledGarden
  * @elgg_plugin_hook index system
- * @return void
+ * @return boolean
  */
 function elgg_walled_garden_index() {
        elgg_register_css('/pg/css/walled_garden.css');
@@ -1766,8 +1766,8 @@ function elgg_walled_garden_index() {
 
        echo elgg_view_page('', $login, 'walled_garden');
 
-       // @hack Index must exit to keep plugins from continuing to extend
-       exit;
+       // return true to prevent other plugins from adding a front page
+       return true;
 }
 
 /**
index 93aa877823b991ccc762c10f371077f41301153a..dbb9f866fb82dd0fee02674a25035cdad5522704 100644 (file)
@@ -1,96 +1,98 @@
 <?php
 /**
-* Walled Garden Login Form
-*/
+ * Walled Garden Login Form
+ *
+ * @todo still requires clean up
+ */
+
+$reg_url = elgg_normalize_url('pg/register/');
+$forgot_url = elgg_normalize_url('pages/account/forgotten_password.php');
+$cancel_button = elgg_view('input/button', array(
+       'value' => elgg_echo('cancel'),
+       'class' => 'elgg-button-cancel mlm',
+));
 
 $form_body = elgg_view('forms/login');
-$form_body .= elgg_view('input/hidden', array('name' => 'returntoreferer', 'value' => 'true'));
+$form_body .= elgg_view('input/hidden', array(
+       'name' => 'returntoreferer',
+       'value' => 'true',
+));
 
 $login_url = elgg_get_site_url();
 if (elgg_get_config('https_login')) {
        $login_url = str_replace("http", "https", elgg_get_site_url());
 }
+
 ?>
 <h2><?php echo elgg_echo('login'); ?></h2>
 <?php
-       //@todo Forms 1.8: Convert to use elgg_view_form()
-       echo elgg_view('input/form', array('body' => $form_body, 'action' => "{$login_url}action/login"));
-       echo elgg_view('login/extend'); // view for plugins to extend
-?>
+//@todo Forms 1.8: Convert to use elgg_view_form()
+echo elgg_view('input/form', array(
+       'body' => $form_body,
+       'action' => "{$login_url}action/login",
+));
 
-<?php
 if (elgg_get_config('allow_registration')) {
        $title = elgg_echo('register');
-       $body = elgg_view("account/forms/register", array(
+       $body = elgg_view_form('register', array(), array(
                'friend_guid' => (int) get_input('friend_guid', 0),
                'invitecode' => get_input('invitecode'),
        ));
 
        echo <<<__HTML
-<div id="registration_form" class="hidden clearfix">
-<div id="hiddenform_body" class="clearfix">
-       <h2>$title</h2>
-       $body
-</div><div id="hiddenform_bottom"></div></div>
+<div id="elgg-walledgarden-registration" class="hidden clearfix">
+       <div class="elgg-hiddenform-body" class="clearfix">
+               <h2>$title</h2>
+               $body
+       </div>
+       <div class="elgg-hiddenform-bottom"></div>
+</div>
 __HTML;
 }
+
+$title = elgg_echo('user:password:lost');
+$body = elgg_view_form('user/requestnewpassword');
+echo <<<__HTML
+<div id="elgg-walledgarden-lostpassword" class="hidden clearfix">
+       <div class="elgg-hiddenform-body" class="clearfix">
+               <h2>$title</h2>
+               $body
+       </div>
+       <div class="elgg-hiddenform-bottom"></div>
+</div>
+__HTML;
+
+//@todo JS 1.8: no
 ?>
-       <?php
-       $lostpassword_form_body = "<div>" . elgg_echo('user:password:text') . "</div>";
-       $lostpassword_form_body .= "<div class='margin-none'><label>". elgg_echo('username') . " "
-               . elgg_view('input/text', array('name' => 'username', 'class' => 'login-textarea lostusername')) . "</label></div>";
-       $lostpassword_form_body .= elgg_view('input/captcha');
-       $lostpassword_form_body .= "<div>" . elgg_view('input/submit', array('value' => elgg_echo('request'))) . "<input class='elgg-button-action elgg-state-disabled cancel_request' type='reset' value='Cancel'></div>";
-       
-       ?>
-<div id="lostpassword_form" class="hidden clearfix">
-       <div id="hiddenform_body" class="clearfix">
-               <h2><?php echo elgg_echo('user:password:lost'); ?></h2>
-               <?php
-                       //@todo Forms 1.8: Use elgg_view_form()
-                       echo elgg_view('input/form', array(
-                               'action' => "action/user/requestnewpassword",
-                               'body' => $lostpassword_form_body
-                       ));
-               ?>
-</div><div id="hiddenform_bottom"></div></div>
-<?php //@todo JS 1.8: no ?>
 <script type="text/javascript"> 
 $(document).ready(function() {
        $('input.username').focus();
        
-       // add cancel button to inline register form
-       $('#registration_form').find('input.elgg-button-submit').after("<input class='elgg-button-action elgg-state-disabled cancel_request' type='reset' value='Cancel'>");
+       // add cancel button to inline forms
+       $('#elgg-walledgarden-registration').find('input.elgg-button-submit').after('<?php echo $cancel_button; ?>');
+       $('#elgg-walledgarden-lostpassword').find('input.elgg-button-submit').after('<?php echo $cancel_button; ?>');
        
        function elgg_slide_hiddenform(activateLink, parentElement, toggleElement) {
-               $(activateLink).closest(parentElement).find(toggleElement).animate({"width": "563px", duration: 400});
-               $(activateLink).closest(parentElement).animate({"height": "256px", duration: 400}, function() {
-                       // ewwww dirty.  Webkit has problems when showing images that were hidden.
-                       // forcing a reload of all the images.
-                       $('.visual_captcha img').each(function() { $(this).attr('src', $(this).attr('src')); });
-               });
-               return false;
+               $(activateLink).closest(parentElement).find(toggleElement).fadeToggle('medium');
        }
 
-       $('a.registration_link').click(function(e) {
+       $('a[href="<?php echo $reg_url; ?>"]').click(function(e) {
                e.preventDefault();
-               elgg_slide_hiddenform(this, '.walledgardenlogin', '#registration_form');
+               elgg_slide_hiddenform(this, '#elgg-walledgarden-login', '#elgg-walledgarden-registration');
                $('input.name').focus();
        });
        
-       $('a.forgotten_password_link').click(function(e) {
+       $('a[href="<?php echo $forgot_url; ?>"]').click(function(e) {
                e.preventDefault();
-               elgg_slide_hiddenform(this, '.walledgardenlogin', '#lostpassword_form');
+               elgg_slide_hiddenform(this, '#elgg-walledgarden-login', '#elgg-walledgarden-lostpassword');
                $('input.lostusername').focus();
        });
        
-       $('input.cancel_request').click(function() {
-               if ($('#lostpassword_form').is(':visible')) {
-                       $('#lostpassword_form').fadeOut(400);
-                       location.reload();
-               } else if ($('#registration_form').is(':visible')) {
-                       $('#registration_form').fadeOut(400);
-                       location.reload();
+       $('input.elgg-button-cancel').click(function() {
+               if ($('#elgg-walledgarden-lostpassword').is(':visible')) {
+                       $('a[href="<?php echo $forgot_url; ?>"]').click();
+               } else if ($('#elgg-walledgarden-registration').is(':visible')) {
+                       $('a[href="<?php echo $reg_url; ?>"]').click();
                }
                return false;
        });
index 7ba6141d4fd655e00b0252cddc180097d386a30a..75bf0f29e186b708c24692762d3517cc0be4db38 100644 (file)
@@ -2,29 +2,64 @@
 /**
  * Walled garden CSS
  */
+
+$url = elgg_get_site_url();
+
 ?>
-.elgg-grid-walledgarden {
-       margin:100px auto 0 auto;
-       padding:0;
-       width:600px;
-       text-align: left;
-       word-wrap:break-word;
-       background: gray;
+#elgg-walledgarden {
+       margin: 100px auto 0 auto;
+       width: 563px;
+       min-height: 230px;
+       background: url(<?php echo $url; ?>_graphics/walled_garden_background_top.gif) no-repeat left top;
+       padding: 0;
+       position: relative;
+}
+
+#elgg-walledgarden-bottom {
+       margin:0 auto;
+       background: url(<?php echo $url; ?>_graphics/walled_garden_background_bottom.gif) no-repeat left bottom;
+       width:563px;
+       height:54px;
+}
+
+#elgg-walledgarden-intro {
+       width: 230px;
+       float: left;
+       margin: 35px 15px 15px 35px;
 }
 
-.elgg-grid-walledgarden > .elgg-col {
-       background: white;
+#elgg-walledgarden-login {
+       width: 230px;
+       float: left;
+       margin: 30px 15px 45px 19px;
 }
 
 .elgg-heading-walledgarden {
-       color:#666666;
-       margin-top:80px;
+       color: #666666;
+       margin-top: 60px;
        line-height: 1.1em;
 }
 
-.walledgardenlogin h2 {
-       color:#666666;
-       border-bottom:1px solid #CCCCCC;
-       margin-bottom:5px;
-       padding-bottom:5px;
-}
\ No newline at end of file
+#elgg-walledgarden-lostpassword,
+#elgg-walledgarden-registration {
+       position: absolute;
+       right: 0;
+       top: 0;
+       width: 563px;
+       background-color: white;
+       padding: 0;
+       background: url(<?php echo $url; ?>_graphics/walled_garden_backgroundfull_top.gif) no-repeat left top;
+       height: auto;
+}
+
+.elgg-hiddenform-body {
+       padding: 30px 40px 0 40px;
+       height: auto;
+}
+.elgg-hiddenform-bottom {
+       margin: 0 auto;
+       background: url(<?php echo $url; ?>_graphics/walled_garden_backgroundfull_bottom.gif) no-repeat left bottom;
+       width: 563px;
+       height: 54px;
+       position: relative;
+}
index 06fdb84a590154d7314e4bee7afd9d8d0a891d2e..96afa5d38674c126f67eda476dfa8fee02f0e6e9 100644 (file)
@@ -19,3 +19,10 @@ echo elgg_view('output/url', array(
        'class' => '',
 ));
 echo '</div>';
+
+?>
+<script>
+<?php
+echo elgg_view('js/lightbox');
+?>
+</script>
index 0dcc8a9d76158fedf9431998c9cfc9b966e6ff62..662e90f45c3c2524ad88e420ea51f193cfaa9ef2 100644 (file)
@@ -22,22 +22,21 @@ $title = $site->name;
                <?php echo elgg_view('page/elements/messages', array('object' => $vars['sysmessages'])); ?>
        </div>
        <div class="elgg-page-body">
-               <div class="elgg-inner">
-                       <div class="elgg-grid elgg-grid-walledgarden">
-                               <div class="elgg-col elgg-col-1of2">
-                                       <h1 class="elgg-heading-walledgarden">
-                                               <?php
-                                                       echo elgg_echo('walled_garden:welcome');
-                                                       echo ': <br/>';
-                                                       echo $title;
-                                               ?>
-                                       </h1>
-                               </div>
-                               <div class="elgg-col elgg-col-1of2">
-                                       <?php echo $vars['body']; ?>
-                               </div>
+               <div id="elgg-walledgarden">
+                       <div id="elgg-walledgarden-intro">
+                               <h1 class="elgg-heading-walledgarden">
+                                       <?php
+                                               echo elgg_echo('walled_garden:welcome');
+                                               echo ': <br/>';
+                                               echo $title;
+                                       ?>
+                               </h1>
+                       </div>
+                       <div id="elgg-walledgarden-login">
+                               <?php echo $vars['body']; ?>
                        </div>
                </div>
+               <div id="elgg-walledgarden-bottom"></div>
        </div>
 </div>
 <?php echo elgg_view('footer/analytics'); ?>