Файл: concrete5.7.5.6/concrete/controllers/dialog/file/thumbnails/edit.php
Строк: 50
<?php
namespace ConcreteControllerDialogFileThumbnails;
use ConcreteControllerBackendUserInterfaceFile as BackendInterfaceFileController;
use ConcreteCoreFileEditResponse as FileEditResponse;
use ConcreteCoreFileTypeType;
use Exception;
use Permissions;
class Edit extends BackendInterfaceFileController {
protected $viewPath = '/dialogs/file/thumbnails/edit';
protected function canAccess() {
$type = $this->file->getTypeObject();
return $this->permissions->canEditFileContents() && $type->getGenericType() == Type::T_IMAGE;
}
public function view() {
}
public function update_thumbnail() {
if ($this->validateAction()) {
$fp = new Permissions($this->file);
if ($fp->canEditFileProperties()) {
$this->file->getVersionToModify();
$sr = new FileEditResponse();
$sr->setFile($this->file);
$sr->setMessage(t('File updated successfully.'));
$sr->outputJSON();
} else {
throw new Exception(t('Access Denied.'));
}
} else {
throw new Exception(t('Access Denied.'));
}
}
}