• 1.
    <?php
  • 2.
          $Session = Gdn::Session();
  • 3.
    		if ($this->Menu) {
  • 4.
    			$this->Menu->AddLink('Dashboard', T('Dashboard'), '/dashboard/settings', array('Garden.Settings.Manage'));
  • 5.
    			// $this->Menu->AddLink('Dashboard', T('Users'), '/user/browse', array('Garden.Users.Add', 'Garden.Users.Edit', 'Garden.Users.Delete'));
  • 6.
    			$this->Menu->AddLink('Activity', T('Activity'), '/activity');
  • 7.
    			if ($Session->IsValid()) {
  • 8.
    				$Name = $Session->User->Name;
  • 9.
    				$CountNotifications = $Session->User->CountNotifications;
  • 10.
    				if (is_numeric($CountNotifications) && $CountNotifications > 0)
  • 11.
    					$Name .= ' <span class="Alert">'.$CountNotifications.'</span>';
  • 12.
     
  • 13.
             if (urlencode($Session->User->Name) == $Session->User->Name)
  • 14.
                $ProfileSlug = $Session->User->Name;
  • 15.
             else
  • 16.
                $ProfileSlug = $Session->UserID.'/'.urlencode($Session->User->Name);
  • 17.
    				$this->Menu->AddLink('User', $Name, '/profile/'.$ProfileSlug, array('Garden.SignIn.Allow'), array('class' => 'UserNotifications'));
  • 18.
    				$this->Menu->AddLink('SignOut', T('Sign Out'), SignOutUrl(), FALSE, array('class' => 'NonTab SignOut'));
  • 19.
    			} else {
  • 20.
    				$Attribs = array();
  • 21.
    				if (SignInPopup() && strpos(Gdn::Request()->Url(), 'entry') === FALSE)
  • 22.
    					$Attribs['class'] = 'SignInPopup';
  • 23.
    					
  • 24.
    				$this->Menu->AddLink('Entry', T('Sign In'), SignInUrl($this->SelfUrl), FALSE, array('class' => 'NonTab'), $Attribs);
  • 25.
    			}
  • 26.
    			echo $this->Menu->ToString();
  • 27.
    		}
  • 28.
    	?>
<?php $Session = Gdn::Session(); if ($this->Menu) { $this->Menu->AddLink('Dashboard', T('Dashboard'), '/dashboard/settings', array('Garden.Settings.Manage')); // $this->Menu->AddLink('Dashboard', T('Users'), '/user/browse', array('Garden.Users.Add', 'Garden.Users.Edit', 'Garden.Users.Delete')); $this->Menu->AddLink('Activity', T('Activity'), '/activity'); if ($Session->IsValid()) { $Name = $Session->User->Name; $CountNotifications = $Session->User->CountNotifications; if (is_numeric($CountNotifications) && $CountNotifications > 0) $Name .= ' <span class="Alert">'.$CountNotifications.'</span>'; if (urlencode($Session->User->Name) == $Session->User->Name) $ProfileSlug = $Session->User->Name; else $ProfileSlug = $Session->UserID.'/'.urlencode($Session->User->Name); $this->Menu->AddLink('User', $Name, '/profile/'.$ProfileSlug, array('Garden.SignIn.Allow'), array('class' => 'UserNotifications')); $this->Menu->AddLink('SignOut', T('Sign Out'), SignOutUrl(), FALSE, array('class' => 'NonTab SignOut')); } else { $Attribs = array(); if (SignInPopup() && strpos(Gdn::Request()->Url(), 'entry') === FALSE) $Attribs['class'] = 'SignInPopup'; $this->Menu->AddLink('Entry', T('Sign In'), SignInUrl($this->SelfUrl), FALSE, array('class' => 'NonTab'), $Attribs); } echo $this->Menu->ToString(); } ?>

Copy Code to Clipboard Raw

Sign-in or Create a Free Account.

Snippi uses Twitter or Facebook to register and create accounts. Registration will enable you to keep track of your snippets. We never spam your timeline or wall. Ever.

Sign-in with Facebook Sign-in with Twitter