Ranks now use a single photo for activities

This commit is contained in:
Zachary Doll 2013-12-09 21:56:45 -06:00
parent ae24c7d8aa
commit 2fe1c87462
2 changed files with 4 additions and 4 deletions

View File

@ -189,14 +189,14 @@ class RankController extends DashboardController {
* @param int $RankID
* @param string $TransientKey
*/
public function DeletePhoto($RankID = FALSE, $TransientKey = '') {
public function DeletePhoto($TransientKey = '') {
// Check permission
$this->Permission('Garden.Ranks.Manage');
$RedirectUrl = 'yaga/rank/edit/'.$RankID;
$RedirectUrl = 'yaga/rank/settings';
if (Gdn::Session()->ValidateTransientKey($TransientKey)) {
$this->RankModel->SetField($RankID, 'Photo', NULL);
SaveToConfig('Yaga.Ranks.Photo', NULL);
$this->InformMessage(T('Yaga.RankPhotoDeleted'));
}

View File

@ -12,7 +12,7 @@ echo $this->Form->Errors();
$Photo = C('Yaga.Ranks.Photo');
if($Photo) {
echo Img(Gdn_Upload::Url($Photo));
echo '<br />'.Anchor(T('Delete Photo'), 'rank/deletephoto', 'SmallButton Danger PopConfirm');
echo '<br />'.Anchor(T('Delete Photo'), CombinePaths(array('rank/deletephoto', Gdn::Session()->TransientKey())), 'SmallButton Danger PopConfirm');
}
echo $this->Form->Input('PhotoUpload', 'file');
echo $this->Form->Close('Save');