]> dev.renevier.net Git - syj.git/commitdiff
my account link appears when logging from main page
authorarno <arno@renevier.net>
Sat, 7 Aug 2010 20:27:46 +0000 (22:27 +0200)
committerarno <arno@renevier.net>
Fri, 13 Aug 2010 11:55:04 +0000 (13:55 +0200)
application/forms/Geom.php
application/layouts/scripts/footer.phtml
application/views/helpers/FooterLink.php
public/js/syj.js

index cad18a777b413a242715a113236abae2d3617770..2ae949b2606217939dcc7f0d0ce85eb8c7688efe 100644 (file)
@@ -29,7 +29,7 @@ class Syj_Form_Geom extends Zend_Form
                             'decorators' => array(
                                   'ViewHelper',
                                   'label',
-                                  array('HtmlTag', array('tag' => 'div', 'id' => 'geom_accept_container')))));
+                                  array('HtmlTag', array('tag' => 'div', 'id' => 'geom_accept_container', 'class' => 'logged-hide')))));
 
         $submit = array('Submit', 'geom_submit', array('label' => __("save")));
 
index 57678579a13e84612ba057093c207313e61e1206..08b2ff95e67124410037a5aa61b731706c0167f5 100644 (file)
@@ -29,24 +29,30 @@ echo $this->footerLink(array(
     isset($this->redirectLinks) ? $this->redirectLinks : true);
 
 /*
- * login, logout, account links
+ * account link
  */
-if ($this->loggedUser) {
+if ($mainpage or $this->loggedUser) {
     echo $this->footerLink(array(
             'route' => 'account',
             'action'     => 'index',
             'controller' => 'account'),
-        $this->translate("my account"));
-    if (!$mainpage) {
+        $this->translate("my account"), true,
+        'logged-show');
+}
+
+/*
+ * login or logout links
+ */
+if (!$mainpage) {
+    if ($this->loggedUser) {
+
         echo $this->footerLink(array(
             'route' => 'logout',
             'action'     => 'logout',
             'controller' => 'login'),
         $this->translate("logout"),
         false);
-    }
-} else {
-    if (!$mainpage) {
+    } else {
         echo $this->footerLink(array(
             'route' => 'login',
             'action'     => 'login',
index 529221d8a081a1975731532189d9ec142d348b28..46788c6a63fab9e4f48a5c7b7db5814aab25e185 100644 (file)
@@ -4,7 +4,7 @@
 
 class Syj_View_Helper_FooterLink extends Zend_View_Helper_Abstract
 {
-    public function FooterLink($routeoptions, $text, $redirect=true) {
+    public function FooterLink($routeoptions, $text, $redirect=true, $extraclass=null) {
         $page = new Zend_Navigation_Page_Mvc($routeoptions);
         if ($page->isActive()) {
             $link = $this->view->escape($text);
@@ -19,7 +19,11 @@ class Syj_View_Helper_FooterLink extends Zend_View_Helper_Abstract
             }
             $link = $this->view->anchor($href, $text, array('class' => 'footer-anchor'));
         }
-        return '<div class="footer-link">' . $link . '</div>' . PHP_EOL;
+        $class = "footer-link";
+        if (isset($extraclass)) {
+            $class = "$class $extraclass";
+        }
+        return '<div class="' . $class . '">' . $link . '</div>' . PHP_EOL;
     }
 }
 
index 65f6897fbd40f9d6d38f0ef922a1cfdd7029d71c..b5121d4752a5a56fda3605ae5f1fa26674cb374b 100644 (file)
@@ -780,10 +780,12 @@ var loginMgr = Object.extend(gLoggedInfo, {
         }
         if (this.logged) {
             this.controlsdeck.setIndex(1);
-            $("geom_accept_container").hide();
+            $$(".logged-hide").invoke('hide');
+            $$(".logged-show").invoke('show');
         } else {
             this.controlsdeck.setIndex(0);
-            $("geom_accept_container").show();
+            $$(".logged-hide").invoke('show');
+            $$(".logged-show").invoke('hide');
         }
 
         if (this.iscreator) {