Файл: concrete5.7.5.6/concrete/controllers/dialog/page/design/css.php
Строк: 26
<?php
namespace ConcreteControllerDialogPageDesign;
use ConcreteCoreStyleCustomizerCustomCssRecord;
use Core;
class Css extends ConcreteControllerBackendUserInterfacePage {
protected $viewPath = '/dialogs/page/design/css';
public function view()
{
$this->requireAsset('ace');
$sccRecordID = 0;
$value = '';
if ($this->request->query->has('sccRecordID')) {
$sccRecord = CustomCssRecord::getByID($this->request->query->get('sccRecordID'));
if (is_object($sccRecord)) {
$value = $sccRecord->getValue();
$sccRecordID = $sccRecord->getRecordID();
}
}
$this->set('value', $value);
$this->set('sccRecordID', $sccRecordID);
}
public function canAccess()
{
return $this->permissions->canEditPageTheme();
}
public function submit()
{
if ($this->validateAction()) {
$record = new CustomCssRecord();
$record->setValue($this->request->request('value'));
$record->save();
$ax = new stdClass();
$ax->sccRecordID = $record->getRecordID();
Core::make('helper/ajax')->sendResult($ax);
}
}
}