mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-10 11:33:17 +00:00
Fix CS
This commit is contained in:
@@ -18,71 +18,63 @@
|
||||
class module_admin
|
||||
{
|
||||
|
||||
function getTree($position=false)
|
||||
{
|
||||
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||
$session = $appbox->get_session();
|
||||
|
||||
$usr_id = $session->get_usr_id();
|
||||
|
||||
$user = User_Adapter::getInstance($usr_id, $appbox);
|
||||
|
||||
$available = array(
|
||||
'connected'
|
||||
, 'registrations'
|
||||
, 'taskmanager'
|
||||
, 'base'
|
||||
, 'bases'
|
||||
, 'collection'
|
||||
, 'user'
|
||||
, 'users'
|
||||
);
|
||||
|
||||
$feature = 'connected';
|
||||
$featured = false;
|
||||
$position = explode(':', $position);
|
||||
if (count($position) > 0)
|
||||
function getTree($position = false)
|
||||
{
|
||||
if (in_array($position[0], $available))
|
||||
{
|
||||
$feature = $position[0];
|
||||
if (isset($position[1]))
|
||||
$featured = $position[1];
|
||||
}
|
||||
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||
$session = $appbox->get_session();
|
||||
|
||||
$usr_id = $session->get_usr_id();
|
||||
|
||||
$user = User_Adapter::getInstance($usr_id, $appbox);
|
||||
|
||||
$available = array(
|
||||
'connected'
|
||||
, 'registrations'
|
||||
, 'taskmanager'
|
||||
, 'base'
|
||||
, 'bases'
|
||||
, 'collection'
|
||||
, 'user'
|
||||
, 'users'
|
||||
);
|
||||
|
||||
$feature = 'connected';
|
||||
$featured = false;
|
||||
$position = explode(':', $position);
|
||||
if (count($position) > 0) {
|
||||
if (in_array($position[0], $available)) {
|
||||
$feature = $position[0];
|
||||
if (isset($position[1]))
|
||||
$featured = $position[1];
|
||||
}
|
||||
}
|
||||
|
||||
$databoxes = $off_databoxes = array();
|
||||
foreach ($appbox->get_databoxes() as $databox) {
|
||||
try {
|
||||
if ( ! $user->ACL()->has_access_to_sbas($databox->get_sbas_id()))
|
||||
continue;
|
||||
|
||||
$connbas = $databox->get_connection();
|
||||
} catch (Exception $e) {
|
||||
$off_databoxes[] = $databox;
|
||||
continue;
|
||||
}
|
||||
$databoxes[] = $databox;
|
||||
}
|
||||
|
||||
$params = array(
|
||||
'feature' => $feature
|
||||
, 'featured' => $featured
|
||||
, 'databoxes' => $databoxes
|
||||
, 'off_databoxes' => $off_databoxes
|
||||
);
|
||||
|
||||
|
||||
$core = \bootstrap::getCore();
|
||||
$twig = $core->getTwig();
|
||||
|
||||
return $twig->render('admin/tree.html.twig', $params);
|
||||
}
|
||||
|
||||
$databoxes = $off_databoxes = array();
|
||||
foreach ($appbox->get_databoxes() as $databox)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!$user->ACL()->has_access_to_sbas($databox->get_sbas_id()))
|
||||
continue;
|
||||
|
||||
$connbas = $databox->get_connection();
|
||||
}
|
||||
catch (Exception $e)
|
||||
{
|
||||
$off_databoxes[] = $databox;
|
||||
continue;
|
||||
}
|
||||
$databoxes[] = $databox;
|
||||
}
|
||||
|
||||
$params = array(
|
||||
'feature' => $feature
|
||||
, 'featured' => $featured
|
||||
, 'databoxes' => $databoxes
|
||||
, 'off_databoxes' => $off_databoxes
|
||||
);
|
||||
|
||||
|
||||
$core = \bootstrap::getCore();
|
||||
$twig = $core->getTwig();
|
||||
|
||||
return $twig->render('admin/tree.html.twig', $params);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user