mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 15:03:25 +00:00
New Admin Controllers
This commit is contained in:
@@ -30,42 +30,53 @@ class Fields implements ControllerProviderInterface
|
||||
|
||||
public function connect(Application $app)
|
||||
{
|
||||
$appbox = \appbox::get_instance();
|
||||
$appbox = \appbox::get_instance();
|
||||
$session = $appbox->get_session();
|
||||
// $session->close_storage();
|
||||
|
||||
$controllers = new ControllerCollection();
|
||||
|
||||
|
||||
$controllers->get('/checkmulti/', function() use ($app, $appbox)
|
||||
{
|
||||
$request = $app['request'];
|
||||
$multi = ($request->get('multi') === 'true');
|
||||
{
|
||||
$request = $app['request'];
|
||||
$multi = ($request->get('multi') === 'true');
|
||||
|
||||
$metadata = \databox_field::load_class_from_xpath($request->get('source'));
|
||||
$metadata = \databox_field::load_class_from_xpath($request->get('source'));
|
||||
|
||||
$datas = array(
|
||||
'result' => ($multi === $metadata->is_multi())
|
||||
, 'is_multi' => $metadata->is_multi()
|
||||
);
|
||||
$datas = array(
|
||||
'result' => ($multi === $metadata->is_multi())
|
||||
, 'is_multi' => $metadata->is_multi()
|
||||
);
|
||||
|
||||
return new Response(\p4string::jsonencode($datas));
|
||||
});
|
||||
$Serializer = $app['Core']['Serializer'];
|
||||
|
||||
return new Response(
|
||||
$Serializer->serialize($datas, 'json')
|
||||
, 200
|
||||
, array('Content-Type' => 'application/json')
|
||||
);
|
||||
});
|
||||
|
||||
$controllers->get('/checkreadonly/', function() use ($app, $appbox)
|
||||
{
|
||||
$request = $app['request'];
|
||||
$readonly = ($request->get('readonly') === 'true');
|
||||
{
|
||||
$request = $app['request'];
|
||||
$readonly = ($request->get('readonly') === 'true');
|
||||
|
||||
$metadata = \databox_field::load_class_from_xpath($request->get('source'));
|
||||
$metadata = \databox_field::load_class_from_xpath($request->get('source'));
|
||||
|
||||
$datas = array(
|
||||
'result' => ($readonly === $metadata->is_readonly())
|
||||
, 'is_readonly' => $metadata->is_readonly()
|
||||
);
|
||||
$datas = array(
|
||||
'result' => ($readonly === $metadata->is_readonly())
|
||||
, 'is_readonly' => $metadata->is_readonly()
|
||||
);
|
||||
|
||||
return new Response(\p4string::jsonencode($datas));
|
||||
});
|
||||
$Serializer = $app['Core']['Serializer'];
|
||||
|
||||
return new Response(
|
||||
$Serializer->serialize($datas, 'json')
|
||||
, 200
|
||||
, array('Content-Type' => 'application/json')
|
||||
);
|
||||
});
|
||||
|
||||
return $controllers;
|
||||
}
|
||||
|
Reference in New Issue
Block a user