Ranks now use a single photo for activities
This commit is contained in:
parent
ae24c7d8aa
commit
2fe1c87462
@ -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'));
|
||||
}
|
||||
|
||||
|
@ -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');
|
||||
|
Loading…
x
Reference in New Issue
Block a user