Файл: concrete5.7.5.6/concrete/controllers/dialog/area/layout/presets/manage.php
Строк: 25
<?php
namespace ConcreteControllerDialogAreaLayoutPresets;
use ConcreteControllerDialogAreaLayoutPresets;
use ConcreteCoreAreaLayoutLayout;
use ConcreteCoreAreaLayoutPresetUserPreset;
use ConcreteCorePageEditResponse;
use Exception;
class Manage extends Presets
{
protected $viewPath = '/dialogs/area/layout/presets/manage';
public function view()
{
$presets = UserPreset::getList();
$this->set('presets', $presets);
}
public function delete()
{
if ($this->validateAction()) {
$preset = UserPreset::getByID($this->request->request('arLayoutPresetID'));
if (!is_object($preset)) {
throw new Exception(t('Invalid layout preset object.'));
}
$preset->delete();
$pr = new EditResponse();
$pr->setAdditionalDataAttribute('arLayoutPresetID', $preset->getAreaLayoutPresetID());
$pr->outputJSON();
}
}
}