public function AddSideMenu($CurrentUrl) { // Only add to the assets if this is not a view-only request if ($this->_DeliveryType == DELIVERY_TYPE_ALL) { $SideMenu = new Gdn_SideMenuModule($this); $SideMenu->HtmlId = ''; $SideMenu->HighlightRoute($CurrentUrl); $this->EventArguments['SideMenu'] =& $SideMenu; $this->FireEvent('GetAppSettingsMenuItems'); $this->AddModule($SideMenu, 'Panel'); } }
public function AddSideMenu($CurrentUrl = '') { if ($this->User !== FALSE) { $SideMenu = new Gdn_SideMenuModule($this); $SideMenu->HtmlId = ''; $Session = Gdn::Session(); $ViewingUserID = $Session->UserID; $SideMenu->AddItem('Options', ''); if ($this->User->UserID != $ViewingUserID) { // Add profile options for everyone $SideMenu->AddLink('Options', 'Change Picture', '/profile/picture/' . $this->User->Name, 'Garden.Users.Edit', array('class' => 'PictureLink')); $SideMenu->AddLink('Options', 'Edit Account', '/profile/edit/' . $this->User->Name, 'Garden.Users.Edit', array('class' => 'Popup')); } else { // Add profile options for the profile owner $SideMenu->AddLink('Options', 'Change My Picture', '/profile/picture', FALSE, array('class' => 'PictureLink')); if ($this->User->Photo != '') { $SideMenu->AddLink('Options', 'Edit My Thumbnail', '/profile/thumbnail', FALSE, array('class' => 'ThumbnailLink')); $SideMenu->AddLink('Options', 'Remove My Picture', '/profile/removepicture/' . $Session->UserID . '/' . $Session->TransientKey(), FALSE, array('class' => 'RemovePictureLink')); } $SideMenu->AddLink('Options', 'Edit My Account', '/profile/edit', FALSE, array('class' => 'Popup')); $SideMenu->AddLink('Options', 'Change My Password', '/profile/password', FALSE, array('class' => 'Popup')); if (Gdn::Config('Garden.Registration.Method') == 'Invitation') { $SideMenu->AddLink('Options', 'My Invitations', '/profile/invitations'); } } $this->EventArguments['SideMenu'] =& $SideMenu; $this->FireEvent('AfterAddSideMenu'); $this->AddModule($SideMenu, 'Panel'); } }
public function AddSideMenu($CurrentUrl = '') { if ($this->User !== FALSE) { $SideMenu = new Gdn_SideMenuModule($this); $SideMenu->HtmlId = 'UserOptions'; $Session = Gdn::Session(); $ViewingUserID = $Session->UserID; $SideMenu->AddItem('Options', ''); if ($this->User->UserID != $ViewingUserID) { // Include user js files for people with edit users permissions if ($Session->CheckPermission('Garden.Users.Edit')) { $this->AddJsFile('js/library/jquery.gardenmorepager.js'); $this->AddJsFile('user.js'); } // Add profile options for everyone if ($this->User->Photo != '') { $SideMenu->AddLink('Options', Gdn::Translate('Change Picture'), '/profile/picture/' . $this->User->UserID, 'Garden.Users.Edit', array('class' => 'PictureLink')); } $SideMenu->AddLink('Options', Gdn::Translate('Edit Account'), '/user/edit/' . $this->User->UserID, 'Garden.Users.Edit', array('class' => 'Popup')); if ($this->User->Photo != '') { $SideMenu->AddLink('Options', Gdn::Translate('Remove Picture'), '/profile/removepicture/' . $this->User->UserID . '/' . $Session->TransientKey(), 'Garden.User.Edit', array('class' => 'RemovePictureLink')); } } else { // Add profile options for the profile owner $SideMenu->AddLink('Options', Gdn::Translate('Change My Picture'), '/profile/picture', FALSE, array('class' => 'PictureLink')); if ($this->User->Photo != '') { $SideMenu->AddLink('Options', Gdn::Translate('Edit My Thumbnail'), '/profile/thumbnail', FALSE, array('class' => 'ThumbnailLink')); $SideMenu->AddLink('Options', Gdn::Translate('Remove My Picture'), '/profile/removepicture/' . $Session->UserID . '/' . $Session->TransientKey(), FALSE, array('class' => 'RemovePictureLink')); } $SideMenu->AddLink('Options', Gdn::Translate('Edit My Account'), '/profile/edit', FALSE, array('class' => 'Popup')); $SideMenu->AddLink('Options', Gdn::Translate('Change My Password'), '/profile/password', FALSE, array('class' => 'Popup')); if (Gdn::Config('Garden.Registration.Method') == 'Invitation') { $SideMenu->AddLink('Options', Gdn::Translate('My Invitations'), '/profile/invitations', FALSE, array('class' => 'Popup')); } } if ($this->User->UserID == $ViewingUserID || $Session->CheckPermission('Garden.Users.Edit')) { $SideMenu->AddLink('Options', Gdn::Translate('My Preferences'), '/profile/preferences/' . $this->User->UserID, FALSE, array('class' => 'Popup')); } $this->EventArguments['SideMenu'] =& $SideMenu; $this->FireEvent('AfterAddSideMenu'); $this->AddModule($SideMenu, 'Panel'); } }