Файл: concrete5.7.5.6/concrete/controllers/backend/editor_data.php
Строк: 44
<?php
namespace ConcreteControllerBackend;
use Controller;
use Loader;
use stdClass;
use User;
use Page;
use Permissions;
class EditorData extends Controller {
public function view()
{
if (Loader::helper('validation/token')->validate('editor')) {
$obj = new stdClass;
$obj->snippets = array();
$u = new User();
if ($u->isRegistered()) {
$snippets = ConcreteCoreEditorSnippet::getActiveList();
foreach($snippets as $sns) {
$menu = new stdClass;
$menu->scsHandle = $sns->getSystemContentEditorSnippetHandle();
$menu->scsName = $sns->getSystemContentEditorSnippetName();
$obj->snippets[] = $menu;
}
}
$c = Page::getByID($_REQUEST['cID']);
$obj->classes = array();
if (is_object($c) && !$c->isError()) {
$cp = new Permissions($c);
if ($cp->canViewPage()) {
$pt = $c->getCollectionThemeObject();
if (is_object($pt)) {
$obj->classes = $pt->getThemeEditorClasses();
}
}
}
print Loader::helper('json')->encode($obj);
exit;
}
}
}