本文整理汇总了PHP中Gdn_UploadImage::canUploadImages方法的典型用法代码示例。如果您正苦于以下问题:PHP Gdn_UploadImage::canUploadImages方法的具体用法?PHP Gdn_UploadImage::canUploadImages怎么用?PHP Gdn_UploadImage::canUploadImages使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gdn_UploadImage
的用法示例。
在下文中一共展示了Gdn_UploadImage::canUploadImages方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: buildEditMenu
/**
* @param SideMenuModule $Module
* @param string $CurrentUrl
*/
public function buildEditMenu(&$Module, $CurrentUrl = '')
{
if (!$this->User) {
return;
}
$Module->HtmlId = 'UserOptions';
$Module->AutoLinkGroups = false;
$Session = Gdn::session();
$ViewingUserID = $Session->UserID;
$Module->addItem('Options', '', false, array('class' => 'SideMenu'));
// Check that we have the necessary tools to allow image uploading
$AllowImages = c('Garden.Profile.EditPhotos', true) && Gdn_UploadImage::canUploadImages();
// Is the photo hosted remotely?
$RemotePhoto = isUrl($this->User->Photo);
if ($this->User->UserID != $ViewingUserID) {
// Include user js files for people with edit users permissions
if (checkPermission('Garden.Users.Edit') || checkPermission('Moderation.Profiles.Edit')) {
// $this->addJsFile('jquery.gardenmorepager.js');
$this->addJsFile('user.js');
}
$Module->addLink('Options', sprite('SpProfile') . ' ' . t('Edit Profile'), userUrl($this->User, '', 'edit'), array('Garden.Users.Edit', 'Moderation.Profiles.Edit'), array('class' => 'Popup EditAccountLink'));
$Module->addLink('Options', sprite('SpProfile') . ' ' . t('Edit Account'), '/user/edit/' . $this->User->UserID, 'Garden.Users.Edit', array('class' => 'Popup EditAccountLink'));
$Module->addLink('Options', sprite('SpDelete') . ' ' . t('Delete Account'), '/user/delete/' . $this->User->UserID, 'Garden.Users.Delete', array('class' => 'Popup DeleteAccountLink'));
if ($this->User->Photo != '' && $AllowImages) {
$Module->addLink('Options', sprite('SpDelete') . ' ' . t('Remove Picture'), userUrl($this->User, '', 'removepicture') . '?tk=' . $Session->transientKey(), array('Garden.Users.Edit', 'Moderation.Profiles.Edit'), array('class' => 'RemovePictureLink'));
}
$Module->addLink('Options', sprite('SpPreferences') . ' ' . t('Edit Preferences'), userUrl($this->User, '', 'preferences'), array('Garden.Users.Edit', 'Moderation.Profiles.Edit'), array('class' => 'Popup PreferencesLink'));
// Add profile options for everyone
$Module->addLink('Options', sprite('SpPicture') . ' ' . t('Change Picture'), userUrl($this->User, '', 'picture'), array('Garden.Users.Edit', 'Moderation.Profiles.Edit'), array('class' => 'PictureLink'));
if ($this->User->Photo != '' && $AllowImages && !$RemotePhoto) {
$Module->addLink('Options', sprite('SpThumbnail') . ' ' . t('Edit Thumbnail'), userUrl($this->User, '', 'thumbnail'), array('Garden.Users.Edit', 'Moderation.Profiles.Edit'), array('class' => 'ThumbnailLink'));
}
} else {
if (hasEditProfile($this->User->UserID)) {
$Module->addLink('Options', sprite('SpEdit') . ' ' . t('Edit Profile'), '/profile/edit', false, array('class' => 'Popup EditAccountLink'));
}
// Add profile options for the profile owner
// Don't allow account editing if it has been turned off.
// Don't allow password editing if using SSO Connect ONLY.
// This is for security. We encountered the case where a customer charges
// for membership using their external application and use SSO to let
// their customers into Vanilla. If you allow those people to change their
// password in Vanilla, they will then be able to log into Vanilla using
// Vanilla's login form regardless of the state of their membership in the
// external app.
if (c('Garden.UserAccount.AllowEdit') && c('Garden.Registration.Method') != 'Connect') {
// No password may have been set if they have only signed in with a connect plugin
$PasswordLabel = t('Change My Password');
if ($this->User->HashMethod && $this->User->HashMethod != "Vanilla") {
$PasswordLabel = t('Set A Password');
}
$Module->addLink('Options', sprite('SpPassword') . ' ' . $PasswordLabel, '/profile/password', false, array('class' => 'Popup PasswordLink'));
}
$Module->addLink('Options', sprite('SpPreferences') . ' ' . t('Notification Preferences'), userUrl($this->User, '', 'preferences'), false, array('class' => 'Popup PreferencesLink'));
if ($AllowImages) {
$Module->addLink('Options', sprite('SpPicture') . ' ' . t('Change My Picture'), '/profile/picture', array('Garden.Profiles.Edit', 'Garden.ProfilePicture.Edit'), array('class' => 'PictureLink'));
}
if ($this->User->Photo != '' && $AllowImages && !$RemotePhoto) {
$Module->addLink('Options', sprite('SpThumbnail') . ' ' . t('Edit My Thumbnail'), '/profile/thumbnail', array('Garden.Profiles.Edit', 'Garden.ProfilePicture.Edit'), array('class' => 'ThumbnailLink'));
}
if ($this->User->Photo != '' && $AllowImages) {
$Module->addLink('Options', sprite('SpDelete') . ' ' . t('Remove Picture'), userUrl($this->User, '', 'removepicture') . '?tk=' . $Session->transientKey(), array('Garden.Profiles.Edit', 'Garden.ProfilePicture.Edit'), array('class' => 'RemovePictureLink'));
}
}
if ($this->User->UserID == $ViewingUserID || $Session->checkPermission('Garden.Users.Edit')) {
$this->setData('Connections', array());
$this->EventArguments['User'] = $this->User;
$this->fireEvent('GetConnections');
if (count($this->data('Connections')) > 0) {
$Module->addLink('Options', sprite('SpConnection') . ' ' . t('Social'), '/profile/connections', 'Garden.SignIn.Allow', array('class' => 'link-social'));
}
}
}