SettingsController::avatars PHP Method

avatars() public method

Displays the current avatar and exposes the following config settings: Garden.Thumbnail.Size Garden.Profile.MaxWidth Garden.Profile.MaxHeight
public avatars ( )
    public function avatars()
    {
        $this->permission('Garden.Community.Manage');
        $this->setHighlightRoute('dashboard/settings/avatars');
        $this->addJsFile('avatars.js');
        $this->title(t('Avatars'));
        $validation = new Gdn_Validation();
        $validation->applyRule('Garden.Thumbnail.Size', 'Integer', t('Thumbnail size must be an integer.'));
        $validation->applyRule('Garden.Profile.MaxWidth', 'Integer', t('Max avatar width must be an integer.'));
        $validation->applyRule('Garden.Profile.MaxHeight', 'Integer', t('Max avatar height must be an integer.'));
        $configurationModel = new Gdn_ConfigurationModel($validation);
        $configurationModel->setField(array('Garden.Thumbnail.Size', 'Garden.Profile.MaxWidth', 'Garden.Profile.MaxHeight'));
        $this->Form->setModel($configurationModel);
        $this->setData('avatar', UserModel::getDefaultAvatarUrl());
        if (!$this->Form->authenticatedPostBack()) {
            $this->Form->setData($configurationModel->Data);
        } else {
            if ($this->Form->save() !== false) {
                $this->informMessage(t("Your settings have been saved."));
            }
        }
        $this->render();
    }