mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-18 07:23:13 +00:00
use finder component to retrieve css and fix namespace issue
This commit is contained in:
@@ -18,6 +18,7 @@ use Symfony\Component\HttpFoundation\Request,
|
|||||||
Symfony\Component\HttpFoundation\Response,
|
Symfony\Component\HttpFoundation\Response,
|
||||||
Symfony\Component\HttpFoundation\RedirectResponse,
|
Symfony\Component\HttpFoundation\RedirectResponse,
|
||||||
Symfony\Component\HttpKernel\Exception\HttpException,
|
Symfony\Component\HttpKernel\Exception\HttpException,
|
||||||
|
Symfony\Component\Finder\Finder,
|
||||||
Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||||
use Alchemy\Phrasea\Helper;
|
use Alchemy\Phrasea\Helper;
|
||||||
|
|
||||||
@@ -40,49 +41,56 @@ class Root implements ControllerProviderInterface
|
|||||||
\User_Adapter::updateClientInfos(1);
|
\User_Adapter::updateClientInfos(1);
|
||||||
|
|
||||||
$appbox = \appbox::get_instance($app['Core']);
|
$appbox = \appbox::get_instance($app['Core']);
|
||||||
|
$registry = $app['Core']->getRegistry();
|
||||||
|
$user = $app['Core']->getAuthenticatedUser();
|
||||||
|
$cssPath = $registry->get('GV_RootPath') . 'www/skins/prod/';
|
||||||
|
|
||||||
$css = array();
|
$css = array();
|
||||||
$cssfile = false;
|
$cssfile = false;
|
||||||
$registry = $app['Core']->getRegistry();
|
|
||||||
|
|
||||||
$session = $appbox->get_session();
|
$finder = new Finder();
|
||||||
$user = $app['Core']->getAuthenticatedUser();
|
|
||||||
|
|
||||||
$cssPath = $registry->get('GV_RootPath') . 'www/skins/prod/';
|
$iterator = $finder
|
||||||
|
->directories()
|
||||||
|
->depth(0)
|
||||||
|
->filter(function(\SplFileInfo $fileinfo)
|
||||||
|
{
|
||||||
|
return ctype_xdigit($fileinfo->getBasename());
|
||||||
|
})
|
||||||
|
->in($cssPath);
|
||||||
|
|
||||||
if ($hdir = opendir($cssPath))
|
foreach ($iterator as $dir)
|
||||||
{
|
{
|
||||||
while (false !== ($file = readdir($hdir)))
|
$baseName = $dir->getBaseName();
|
||||||
{
|
$css[$baseName] = $baseName;
|
||||||
if (substr($file, 0, 1) == "." || mb_strtolower($file) == "cvs")
|
|
||||||
continue;
|
|
||||||
if (is_dir($cssPath . $file) && ctype_xdigit($file))
|
|
||||||
{
|
|
||||||
$css[$file] = $file;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
closedir($hdir);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$cssfile = $user->getPrefs('css');
|
$cssfile = $user->getPrefs('css');
|
||||||
|
|
||||||
if (!$cssfile && isset($css['000000']))
|
if (!$cssfile && isset($css['000000']))
|
||||||
|
{
|
||||||
$cssfile = '000000';
|
$cssfile = '000000';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$user_feeds = \Feed_Collection::load_all($appbox, $user);
|
$user_feeds = \Feed_Collection::load_all($appbox, $user);
|
||||||
$feeds = array_merge(array($user_feeds->get_aggregate()), $user_feeds->get_feeds());
|
$feeds = array_merge(array($user_feeds->get_aggregate()), $user_feeds->get_feeds());
|
||||||
|
|
||||||
$srt = 'name asc';
|
|
||||||
|
|
||||||
|
|
||||||
$thjslist = "";
|
$thjslist = "";
|
||||||
|
|
||||||
$queries_topics = '';
|
$queries_topics = '';
|
||||||
|
|
||||||
if ($registry->get('GV_client_render_topics') == 'popups')
|
if ($registry->get('GV_client_render_topics') == 'popups')
|
||||||
$queries_topics = queries::dropdown_topics();
|
{
|
||||||
|
$queries_topics = \queries::dropdown_topics();
|
||||||
|
}
|
||||||
elseif ($registry->get('GV_client_render_topics') == 'tree')
|
elseif ($registry->get('GV_client_render_topics') == 'tree')
|
||||||
|
{
|
||||||
$queries_topics = \queries::tree_topics();
|
$queries_topics = \queries::tree_topics();
|
||||||
|
}
|
||||||
|
|
||||||
$sbas = $bas2sbas = array();
|
$sbas = $bas2sbas = array();
|
||||||
|
|
||||||
foreach ($appbox->get_databoxes() as $databox)
|
foreach ($appbox->get_databoxes() as $databox)
|
||||||
{
|
{
|
||||||
$sbas_id = $databox->get_sbas_id();
|
$sbas_id = $databox->get_sbas_id();
|
||||||
@@ -131,8 +139,6 @@ class Root implements ControllerProviderInterface
|
|||||||
'GV_bitly_key' => $registry->get('GV_bitly_key')
|
'GV_bitly_key' => $registry->get('GV_bitly_key')
|
||||||
));
|
));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return new Response($out);
|
return new Response($out);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user