mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-18 15:33:15 +00:00
fix #396 incorrect pdo_sqlite path
This commit is contained in:
@@ -24,187 +24,185 @@ require_once __DIR__ . '/../../../bootstrap.php';
|
|||||||
* @link www.phraseanet.com
|
* @link www.phraseanet.com
|
||||||
*/
|
*/
|
||||||
return call_user_func(function()
|
return call_user_func(function()
|
||||||
{
|
{
|
||||||
$app = new \Silex\Application();
|
$app = new \Silex\Application();
|
||||||
|
|
||||||
$app['Core'] = \bootstrap::getCore();
|
$app['Core'] = \bootstrap::getCore();
|
||||||
|
|
||||||
$app['install'] = false;
|
$app['install'] = false;
|
||||||
$app['upgrade'] = false;
|
$app['upgrade'] = false;
|
||||||
|
|
||||||
$app->before(function($a) use ($app)
|
$app->before(function($a) use ($app)
|
||||||
{
|
{
|
||||||
if (\setup::is_installed())
|
if (\setup::is_installed())
|
||||||
{
|
{
|
||||||
$appbox = \appbox::get_instance();
|
$appbox = \appbox::get_instance();
|
||||||
|
|
||||||
if (!$appbox->need_major_upgrade())
|
if (!$appbox->need_major_upgrade())
|
||||||
{
|
{
|
||||||
throw new \Exception_Setup_PhraseaAlreadyInstalled();
|
throw new \Exception_Setup_PhraseaAlreadyInstalled();
|
||||||
}
|
}
|
||||||
|
|
||||||
$app['upgrade'] = true;
|
$app['upgrade'] = true;
|
||||||
}
|
}
|
||||||
elseif (\setup::needUpgradeConfigurationFile())
|
elseif (\setup::needUpgradeConfigurationFile())
|
||||||
{
|
{
|
||||||
$registry = \registry::get_instance();
|
$registry = \registry::get_instance();
|
||||||
|
|
||||||
//copy config sample
|
//copy config sample
|
||||||
$configSampleFile = __DIR__ . "/../../../../config/config.sample.yml";
|
$configSampleFile = __DIR__ . "/../../../../config/config.sample.yml";
|
||||||
$configFile = __DIR__ . "/../../../../config/config.yml";
|
$configFile = __DIR__ . "/../../../../config/config.yml";
|
||||||
|
|
||||||
if (!copy($configSampleFile, $configFile))
|
if (!copy($configSampleFile, $configFile))
|
||||||
{
|
{
|
||||||
throw new \Exception(sprintf("Unable to copy %s", $configSampleFile));
|
throw new \Exception(sprintf("Unable to copy %s", $configSampleFile));
|
||||||
}
|
}
|
||||||
|
|
||||||
//copy service sample
|
//copy service sample
|
||||||
$serviceSampleFile = __DIR__ . "/../../../../config/services.sample.yml";
|
$serviceSampleFile = __DIR__ . "/../../../../config/services.sample.yml";
|
||||||
$serviceFile = __DIR__ . "/../../../../config/services.yml";
|
$serviceFile = __DIR__ . "/../../../../config/services.yml";
|
||||||
|
|
||||||
if (!copy($serviceSampleFile, $serviceFile))
|
if (!copy($serviceSampleFile, $serviceFile))
|
||||||
{
|
{
|
||||||
throw new \Exception(sprintf("Unable to copy %s", $serviceSampleFile));
|
throw new \Exception(sprintf("Unable to copy %s", $serviceSampleFile));
|
||||||
}
|
}
|
||||||
|
|
||||||
//copy connexion sample
|
//copy connexion sample
|
||||||
$connexionSampleFile = __DIR__ . "/../../../../config/connexions.sample.yml";
|
$connexionSampleFile = __DIR__ . "/../../../../config/connexions.sample.yml";
|
||||||
$connexionFile = __DIR__ . "/../../../../config/connexions.yml";
|
$connexionFile = __DIR__ . "/../../../../config/connexions.yml";
|
||||||
|
|
||||||
if (!copy($connexionSampleFile, $connexionFile))
|
if (!copy($connexionSampleFile, $connexionFile))
|
||||||
{
|
{
|
||||||
throw new \Exception(sprintf("Unable to copy %s", $connexionFile));
|
throw new \Exception(sprintf("Unable to copy %s", $connexionFile));
|
||||||
}
|
}
|
||||||
|
|
||||||
//get configuration object
|
//get configuration object
|
||||||
$appConf = new \Alchemy\Phrasea\Core\Configuration\Application();
|
$appConf = new \Alchemy\Phrasea\Core\Configuration\Application();
|
||||||
$parser = new \Alchemy\Phrasea\Core\Configuration\Parser\Yaml();
|
$parser = new \Alchemy\Phrasea\Core\Configuration\Parser\Yaml();
|
||||||
$handler = new \Alchemy\Phrasea\Core\Configuration\Handler($appConf, $parser);
|
$handler = new \Alchemy\Phrasea\Core\Configuration\Handler($appConf, $parser);
|
||||||
$configuration = new \Alchemy\Phrasea\Core\Configuration($handler);
|
$configuration = new \Alchemy\Phrasea\Core\Configuration($handler);
|
||||||
|
|
||||||
//refactor credentials
|
//refactor credentials
|
||||||
$connexionINI = array();
|
$connexionINI = array();
|
||||||
|
|
||||||
require __DIR__ . "/../../../../config/connexion.inc";
|
require __DIR__ . "/../../../../config/connexion.inc";
|
||||||
|
|
||||||
$connexionINI['host'] = $hostname;
|
$connexionINI['host'] = $hostname;
|
||||||
$connexionINI['port'] = $port;
|
$connexionINI['port'] = $port;
|
||||||
$connexionINI['user'] = $user;
|
$connexionINI['user'] = $user;
|
||||||
$connexionINI['password'] = $password;
|
$connexionINI['password'] = $password;
|
||||||
$connexionINI['dbname'] = $dbname;
|
$connexionINI['dbname'] = $dbname;
|
||||||
$connexionINI['driver'] = 'pdo_mysql';
|
$connexionINI['driver'] = 'pdo_mysql';
|
||||||
$connexionINI['charset'] = 'UTF8';
|
$connexionINI['charset'] = 'UTF8';
|
||||||
|
|
||||||
$request = $app["request"];
|
$request = $app["request"];
|
||||||
//write servername
|
//write servername
|
||||||
$serverName = $request->getScheme() . '://' . $request->getHttpHost() . '/';
|
$serverName = $request->getScheme() . '://' . $request->getHttpHost() . '/';
|
||||||
|
|
||||||
//write credentials to connexion file
|
//write credentials to connexion file
|
||||||
$connexionFile = $appConf->getConnexionFile();
|
$connexionFile = $appConf->getConnexionFile();
|
||||||
|
|
||||||
$connexion = array(
|
$connexion = array(
|
||||||
'main_connexion' => $connexionINI,
|
'main_connexion' => $connexionINI,
|
||||||
'test_connexion' => array(
|
'test_connexion' => array(
|
||||||
'driver' => 'pdo_sqlite',
|
'driver' => 'pdo_sqlite',
|
||||||
'path' => realpath($registry->get("GV_RootPath") . 'lib/unitTest/tests.sqlite'),
|
'path' => realpath(__DIR__ . '/../../../unitTest') . '/tests.sqlite',
|
||||||
'charset' => 'UTF8'
|
'charset' => 'UTF8'
|
||||||
));
|
));
|
||||||
|
|
||||||
$yaml = $configuration->getConfigurationHandler()->getParser()->dump($connexion, 2);
|
$yaml = $configuration->getConfigurationHandler()->getParser()->dump($connexion, 2);
|
||||||
|
|
||||||
if (!file_put_contents($connexionFile->getPathname(), $yaml) !== false)
|
if (!file_put_contents($connexionFile->getPathname(), $yaml) !== false)
|
||||||
{
|
{
|
||||||
throw new \Exception(sprintf(_('Impossible d\'ecrire dans le fichier %s'), $connexionFile->getPathname()));
|
throw new \Exception(sprintf(_('Impossible d\'ecrire dans le fichier %s'), $connexionFile->getPathname()));
|
||||||
}
|
}
|
||||||
|
|
||||||
$cacheService = "array_cache";
|
$cacheService = "array_cache";
|
||||||
|
|
||||||
if (extension_loaded('apc'))
|
if (extension_loaded('apc'))
|
||||||
{
|
{
|
||||||
$cacheService = "apc_cache";
|
$cacheService = "apc_cache";
|
||||||
}
|
}
|
||||||
elseif (extension_loaded('xcache'))
|
elseif (extension_loaded('xcache'))
|
||||||
{
|
{
|
||||||
$cacheService = "xcache_cache";
|
$cacheService = "xcache_cache";
|
||||||
}
|
}
|
||||||
|
|
||||||
//rewrite service file
|
//rewrite service file
|
||||||
$serviceFile = $appConf->getServiceFile();
|
$serviceFile = $appConf->getServiceFile();
|
||||||
$services = $configuration->getConfigurationHandler()->getParser()->parse($serviceFile);
|
$services = $configuration->getConfigurationHandler()->getParser()->parse($serviceFile);
|
||||||
|
|
||||||
foreach ($services as $serviceName => $service)
|
foreach ($services as $serviceName => $service)
|
||||||
{
|
{
|
||||||
if ($serviceName === "doctrine_prod")
|
if ($serviceName === "doctrine_prod")
|
||||||
{
|
{
|
||||||
|
|
||||||
$services["doctrine_prod"]["options"]["orm"]["cache"] = array(
|
$services["doctrine_prod"]["options"]["orm"]["cache"] = array(
|
||||||
"query" => $cacheService,
|
"query" => $cacheService,
|
||||||
"result" => $cacheService,
|
"result" => $cacheService,
|
||||||
"metadata" => $cacheService
|
"metadata" => $cacheService
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$yaml = $configuration->getConfigurationHandler()->getParser()->dump($services, 5);
|
$yaml = $configuration->getConfigurationHandler()->getParser()->dump($services, 5);
|
||||||
|
|
||||||
if (!file_put_contents($serviceFile->getPathname(), $yaml) !== false)
|
if (!file_put_contents($serviceFile->getPathname(), $yaml) !== false)
|
||||||
{
|
{
|
||||||
throw new \Exception(sprintf(_('Impossible d\'ecrire dans le fichier %s'), $serviceFile->getPathname()));
|
throw new \Exception(sprintf(_('Impossible d\'ecrire dans le fichier %s'), $serviceFile->getPathname()));
|
||||||
}
|
}
|
||||||
$arrayConf = $configuration->all();
|
$arrayConf = $configuration->all();
|
||||||
|
|
||||||
//rewrite main conf
|
//rewrite main conf
|
||||||
foreach ($arrayConf as $key => $value)
|
foreach ($arrayConf as $key => $value)
|
||||||
{
|
{
|
||||||
if (is_array($value) && array_key_exists('phraseanet', $value))
|
if (is_array($value) && array_key_exists('phraseanet', $value))
|
||||||
{
|
{
|
||||||
$arrayConf[$key]["phraseanet"]["servername"] = $serverName;
|
$arrayConf[$key]["phraseanet"]["servername"] = $serverName;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_array($value) && $key === 'prod')
|
if (is_array($value) && $key === 'prod')
|
||||||
{
|
{
|
||||||
$arrayConf[$key]["cache"] = $cacheService;
|
$arrayConf[$key]["cache"] = $cacheService;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$configuration->write($arrayConf);
|
$configuration->write($arrayConf);
|
||||||
|
|
||||||
$app['install'] = true;
|
$app['install'] = true;
|
||||||
// $app->redirect("/setup/installer/");
|
// $app->redirect("/setup/installer/");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$app['install'] = true;
|
$app['install'] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
$app->get('/', function() use ($app)
|
$app->get('/', function() use ($app)
|
||||||
{
|
{
|
||||||
if ($app['install'] === true)
|
if ($app['install'] === true)
|
||||||
|
return $app->redirect('/setup/installer/');
|
||||||
return $app->redirect('/setup/installer/');
|
if ($app['upgrade'] === true)
|
||||||
if ($app['upgrade'] === true)
|
return $app->redirect('/setup/upgrader/');
|
||||||
|
});
|
||||||
return $app->redirect('/setup/upgrader/');
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
$app->mount('/installer/', new Controller\Installer());
|
$app->mount('/installer/', new Controller\Installer());
|
||||||
$app->mount('/upgrader/', new Controller\Upgrader());
|
$app->mount('/upgrader/', new Controller\Upgrader());
|
||||||
$app->mount('/test', new ControllerUtils\PathFileTest());
|
$app->mount('/test', new ControllerUtils\PathFileTest());
|
||||||
$app->mount('/connection_test', new ControllerUtils\ConnectionTest());
|
$app->mount('/connection_test', new ControllerUtils\ConnectionTest());
|
||||||
|
|
||||||
$app->error(function($e) use ($app)
|
$app->error(function($e) use ($app)
|
||||||
{
|
{
|
||||||
if ($e instanceof \Exception_Setup_PhraseaAlreadyInstalled)
|
if ($e instanceof \Exception_Setup_PhraseaAlreadyInstalled)
|
||||||
{
|
{
|
||||||
return $app->redirect('/login/');
|
return $app->redirect('/login/');
|
||||||
}
|
}
|
||||||
|
|
||||||
return new Response('Internal Server Error', 500);
|
return new Response('Internal Server Error', 500);
|
||||||
});
|
});
|
||||||
|
|
||||||
return $app;
|
return $app;
|
||||||
});
|
});
|
||||||
|
@@ -38,7 +38,7 @@ class Root implements ControllerProviderInterface
|
|||||||
|
|
||||||
$controllers = new ControllerCollection();
|
$controllers = new ControllerCollection();
|
||||||
|
|
||||||
$controllers->get('/', function(Application $app)
|
$controllers->get('/', function(Application $app, Request $request)
|
||||||
{
|
{
|
||||||
|
|
||||||
$Core = $app['Core'];
|
$Core = $app['Core'];
|
||||||
@@ -47,7 +47,7 @@ class Root implements ControllerProviderInterface
|
|||||||
|
|
||||||
\User_Adapter::updateClientInfos(3);
|
\User_Adapter::updateClientInfos(3);
|
||||||
|
|
||||||
$section = $app['request']->get('section', false);
|
$section = $request->get('section', false);
|
||||||
|
|
||||||
$available = array(
|
$available = array(
|
||||||
'connected'
|
'connected'
|
||||||
@@ -98,6 +98,7 @@ class Root implements ControllerProviderInterface
|
|||||||
'module' => 'admin'
|
'module' => 'admin'
|
||||||
, 'events' => \eventsmanager_broker::getInstance($appbox, $Core)
|
, 'events' => \eventsmanager_broker::getInstance($appbox, $Core)
|
||||||
, 'module_name' => 'Admin'
|
, 'module_name' => 'Admin'
|
||||||
|
, 'notice' => $request->get("notice")
|
||||||
, 'feature' => $feature
|
, 'feature' => $feature
|
||||||
, 'featured' => $featured
|
, 'featured' => $featured
|
||||||
, 'databoxes' => $databoxes
|
, 'databoxes' => $databoxes
|
||||||
|
@@ -315,7 +315,7 @@ class Installer implements ControllerProviderInterface
|
|||||||
|
|
||||||
$appbox->get_session()->authenticate($auth);
|
$appbox->get_session()->authenticate($auth);
|
||||||
|
|
||||||
$redirection = '/admin/index.php?section=taskmanager¬ice=install_success';
|
$redirection = '/admin/?section=taskmanager¬ice=install_success';
|
||||||
|
|
||||||
return $app->redirect($redirection);
|
return $app->redirect($redirection);
|
||||||
}
|
}
|
||||||
|
@@ -138,12 +138,10 @@ class appbox extends base
|
|||||||
$custom_path.= $collection->get_base_id();
|
$custom_path.= $collection->get_base_id();
|
||||||
|
|
||||||
if (is_null($pathfile))
|
if (is_null($pathfile))
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
|
|
||||||
$datas = file_get_contents($pathfile->getPathname());
|
$datas = file_get_contents($pathfile->getPathname());
|
||||||
if (is_null($datas))
|
if (is_null($datas))
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
|
|
||||||
file_put_contents($file, $datas);
|
file_put_contents($file, $datas);
|
||||||
@@ -195,12 +193,10 @@ class appbox extends base
|
|||||||
$custom_path.= $pic_type . '_' . $databox->get_sbas_id();
|
$custom_path.= $pic_type . '_' . $databox->get_sbas_id();
|
||||||
|
|
||||||
if (is_null($pathfile))
|
if (is_null($pathfile))
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
|
|
||||||
$datas = file_get_contents($pathfile->getPathname());
|
$datas = file_get_contents($pathfile->getPathname());
|
||||||
if (is_null($datas))
|
if (is_null($datas))
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
|
|
||||||
file_put_contents($file, $datas);
|
file_put_contents($file, $datas);
|
||||||
@@ -492,7 +488,7 @@ class appbox extends base
|
|||||||
'main_connexion' => $connexionINI,
|
'main_connexion' => $connexionINI,
|
||||||
'test_connexion' => array(
|
'test_connexion' => array(
|
||||||
'driver' => 'pdo_sqlite',
|
'driver' => 'pdo_sqlite',
|
||||||
'path' => realpath($root . 'lib/unitTest/tests.sqlite'),
|
'path' => realpath($root . 'lib/unitTest') . '/tests.sqlite',
|
||||||
'charset' => 'UTF8'
|
'charset' => 'UTF8'
|
||||||
));
|
));
|
||||||
|
|
||||||
@@ -575,7 +571,7 @@ class appbox extends base
|
|||||||
}
|
}
|
||||||
catch (Exception $e)
|
catch (Exception $e)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
@@ -612,7 +608,6 @@ class appbox extends base
|
|||||||
public function get_databoxes()
|
public function get_databoxes()
|
||||||
{
|
{
|
||||||
if ($this->databoxes)
|
if ($this->databoxes)
|
||||||
|
|
||||||
return $this->databoxes;
|
return $this->databoxes;
|
||||||
|
|
||||||
$ret = array();
|
$ret = array();
|
||||||
@@ -624,7 +619,7 @@ class appbox extends base
|
|||||||
}
|
}
|
||||||
catch (Exception $e)
|
catch (Exception $e)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -641,7 +636,7 @@ class appbox extends base
|
|||||||
}
|
}
|
||||||
catch (Exception $e)
|
catch (Exception $e)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
$sql = 'SELECT sbas_id FROM sbas';
|
$sql = 'SELECT sbas_id FROM sbas';
|
||||||
|
|
||||||
|
@@ -8,205 +8,214 @@
|
|||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block stylesheet %}
|
{% block stylesheet %}
|
||||||
<link type="text/css" rel="stylesheet" href="/include/minify/f=include/jslibs/yui2.8/build/reset/reset.css,include/jslibs/jquery-ui-1.8.17/css/ui-lightness/jquery-ui-1.8.17.custom.css,include/jslibs/jquery-treeview/jquery.treeview.css,skins/common/main.css,skins/admin/admincolor.css,login/geonames.css,include/jslibs/jquery.contextmenu.css" />
|
<link type="text/css" rel="stylesheet" href="/include/minify/f=include/jslibs/yui2.8/build/reset/reset.css,include/jslibs/jquery-ui-1.8.17/css/ui-lightness/jquery-ui-1.8.17.custom.css,include/jslibs/jquery-treeview/jquery.treeview.css,skins/common/main.css,skins/admin/admincolor.css,login/geonames.css,include/jslibs/jquery.contextmenu.css" />
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|
||||||
li.selected, div.selected{
|
li.selected, div.selected{
|
||||||
background-color:#f0ad30;
|
background-color:#f0ad30;
|
||||||
color:white;
|
color:white;
|
||||||
}
|
}
|
||||||
li.selected a, div.selected a{
|
li.selected a, div.selected a{
|
||||||
background-color:#f0ad30;
|
background-color:#f0ad30;
|
||||||
color:white;
|
color:white;
|
||||||
}
|
}
|
||||||
#right-ajax.loading{
|
#right-ajax.loading{
|
||||||
background-image: url(/skins/icons/loaderFFF.gif);
|
background-image: url(/skins/icons/loaderFFF.gif);
|
||||||
background-position: center center;
|
background-position: center center;
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
|
||||||
{% block javascript %}
|
{% block javascript %}
|
||||||
|
|
||||||
|
|
||||||
<script type="text/javascript" src="/include/jslibs/jquery-1.7.1.js"></script>
|
<script type="text/javascript" src="/include/jslibs/jquery-1.7.1.js"></script>
|
||||||
<script type="text/javascript" src="/include/jslibs/jquery-ui-1.8.17/js/jquery-ui-1.8.17.custom.min.js"></script>
|
<script type="text/javascript" src="/include/jslibs/jquery-ui-1.8.17/js/jquery-ui-1.8.17.custom.min.js"></script>
|
||||||
<script type="text/javascript" src="/include/minify/g=admin"></script>
|
<script type="text/javascript" src="/include/minify/g=admin"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
var p4 = {users:{sel:[]}};
|
var p4 = {users:{sel:[]}};
|
||||||
var bodySize = {x:0,y:0};
|
var bodySize = {x:0,y:0};
|
||||||
|
|
||||||
var language = {
|
var language = {
|
||||||
serverName: '{{ registry.get('GV_ServerName') }}',
|
serverName: '{{ registry.get('GV_ServerName') }}',
|
||||||
serverError: '{% trans 'phraseanet::erreur: Une erreur est survenue, si ce probleme persiste, contactez le support technique' %}',
|
serverError: '{% trans 'phraseanet::erreur: Une erreur est survenue, si ce probleme persiste, contactez le support technique' %}',
|
||||||
serverTimeout: '{% trans 'phraseanet::erreur: La connection au serveur Phraseanet semble etre indisponible' %}',
|
serverTimeout: '{% trans 'phraseanet::erreur: La connection au serveur Phraseanet semble etre indisponible' %}',
|
||||||
serverDisconnected: '{% trans 'phraseanet::erreur: Votre session est fermee, veuillez vous re-authentifier' %}',
|
serverDisconnected: '{% trans 'phraseanet::erreur: Votre session est fermee, veuillez vous re-authentifier' %}',
|
||||||
check_all : '{% trans 'Cocher toute la colonne' %}',
|
check_all : '{% trans 'Cocher toute la colonne' %}',
|
||||||
uncheck_all : '{% trans 'Decocher toute la colonne' %}',
|
uncheck_all : '{% trans 'Decocher toute la colonne' %}',
|
||||||
create_template : '{% trans 'Creer un model' %}',
|
create_template : '{% trans 'Creer un model' %}',
|
||||||
create_user : '{% trans 'Creer un utilisateur' %}',
|
create_user : '{% trans 'Creer un utilisateur' %}',
|
||||||
annuler : '{% trans 'boutton::annuler' %}'
|
annuler : '{% trans 'boutton::annuler' %}'
|
||||||
};
|
};
|
||||||
|
|
||||||
window.onbeforeunload = function()
|
window.onbeforeunload = function()
|
||||||
{
|
|
||||||
var xhr_object = null;
|
|
||||||
if(window.XMLHttpRequest) // Firefox
|
|
||||||
xhr_object = new XMLHttpRequest();
|
|
||||||
else if(window.ActiveXObject) // Internet Explorer
|
|
||||||
xhr_object = new ActiveXObject("Microsoft.XMLHTTP");
|
|
||||||
else // XMLHttpRequest non supporte par le navigateur
|
|
||||||
|
|
||||||
return;
|
|
||||||
url= "/include/delses.php?app=3&t="+Math.random();
|
|
||||||
xhr_object.open("GET", url, false);
|
|
||||||
xhr_object.send(null);
|
|
||||||
};
|
|
||||||
|
|
||||||
function sessionactive(){
|
|
||||||
$.ajax({
|
|
||||||
type: "POST",
|
|
||||||
url: "/include/updses.php",
|
|
||||||
dataType: 'json',
|
|
||||||
data: {
|
|
||||||
app : 3,
|
|
||||||
usr : {{ session.get_usr_id() }}
|
|
||||||
},
|
|
||||||
error: function(){
|
|
||||||
window.setTimeout("sessionactive();", 10000);
|
|
||||||
},
|
|
||||||
timeout: function(){
|
|
||||||
window.setTimeout("sessionactive();", 10000);
|
|
||||||
},
|
|
||||||
success: function(data){
|
|
||||||
if(data)
|
|
||||||
manageSession(data);
|
|
||||||
var t = 120000;
|
|
||||||
if(data.apps && parseInt(data.apps)>1)
|
|
||||||
t = Math.round((Math.sqrt(parseInt(data.apps)-1) * 1.3 * 120000));
|
|
||||||
window.setTimeout("sessionactive();", t);
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
})
|
|
||||||
};
|
|
||||||
|
|
||||||
function activeTree(click)
|
|
||||||
{
|
|
||||||
$('#FNDR').treeview({
|
|
||||||
collapsed: true,
|
|
||||||
animated: "medium"
|
|
||||||
});
|
|
||||||
|
|
||||||
$.each($('#tree a[target=right]'),function(){
|
|
||||||
var dest = $(this).attr('href');
|
|
||||||
|
|
||||||
$(this).bind('click',function(){
|
|
||||||
if($(this).hasClass('ajax'))
|
|
||||||
{
|
|
||||||
$('#right-ajax').empty().addClass('loading').parent().show();
|
|
||||||
$('#right').hide();
|
|
||||||
$.get(dest, function(data) {
|
|
||||||
$('#right-ajax').removeClass('loading').html(data);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$('#right-ajax').empty().parent().hide();
|
|
||||||
$('#right').show().addClass('loading').attr('src',dest);
|
|
||||||
}
|
|
||||||
$('#tree .selected').removeClass('selected');
|
|
||||||
$(this).parent().addClass('selected');
|
|
||||||
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
|
|
||||||
$(this).removeAttr('target');
|
|
||||||
});
|
|
||||||
if(click === true)
|
|
||||||
{
|
|
||||||
if($('#tree li.selected').length > 0)
|
|
||||||
$('#tree li.selected a').trigger('click');
|
|
||||||
else
|
|
||||||
$('.zone_online_users').trigger('click');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$(document).ready(
|
|
||||||
function(){
|
|
||||||
resize();
|
|
||||||
setTimeout('sessionactive();',15000);
|
|
||||||
activeTree(true);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
function refreshBaskets()
|
|
||||||
{
|
{
|
||||||
return;
|
var xhr_object = null;
|
||||||
}
|
if(window.XMLHttpRequest) // Firefox
|
||||||
function resize()
|
xhr_object = new XMLHttpRequest();
|
||||||
{
|
else if(window.ActiveXObject) // Internet Explorer
|
||||||
$('#right').height($(this).height()-$('#mainMenu').height()-20);
|
xhr_object = new ActiveXObject("Microsoft.XMLHTTP");
|
||||||
$('#right').width($('#mainContent').width()-$('#left').width()-20);
|
else // XMLHttpRequest non supporte par le navigateur
|
||||||
bodySize.y = $(window).height() - $('#mainMenu').outerHeight();
|
|
||||||
bodySize.x = $(window).width();
|
|
||||||
}
|
|
||||||
|
|
||||||
$(window).bind('resize',function(){resize();});
|
return;
|
||||||
|
url= "/include/delses.php?app=3&t="+Math.random();
|
||||||
|
xhr_object.open("GET", url, false);
|
||||||
|
xhr_object.send(null);
|
||||||
|
};
|
||||||
|
|
||||||
function reloadTree(position, click){
|
function sessionactive(){
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: "adminFeedback.php",
|
url: "/include/updses.php",
|
||||||
|
dataType: 'json',
|
||||||
data: {
|
data: {
|
||||||
action : 'TREE',
|
app : 3,
|
||||||
position : position
|
usr : {{ session.get_usr_id() }}
|
||||||
},
|
},
|
||||||
success: function(datas){
|
error: function(){
|
||||||
$('#FNDR').empty().append(datas);
|
window.setTimeout("sessionactive();", 10000);
|
||||||
activeTree(click);
|
},
|
||||||
|
timeout: function(){
|
||||||
|
window.setTimeout("sessionactive();", 10000);
|
||||||
|
},
|
||||||
|
success: function(data){
|
||||||
|
if(data)
|
||||||
|
manageSession(data);
|
||||||
|
var t = 120000;
|
||||||
|
if(data.apps && parseInt(data.apps)>1)
|
||||||
|
t = Math.round((Math.sqrt(parseInt(data.apps)-1) * 1.3 * 120000));
|
||||||
|
window.setTimeout("sessionactive();", t);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
};
|
||||||
|
|
||||||
|
function activeTree(click)
|
||||||
|
{
|
||||||
|
$('#FNDR').treeview({
|
||||||
|
collapsed: true,
|
||||||
|
animated: "medium"
|
||||||
|
});
|
||||||
|
|
||||||
|
$.each($('#tree a[target=right]'),function(){
|
||||||
|
var dest = $(this).attr('href');
|
||||||
|
|
||||||
|
$(this).bind('click',function(){
|
||||||
|
if($(this).hasClass('ajax'))
|
||||||
|
{
|
||||||
|
$('#right-ajax').empty().addClass('loading').parent().show();
|
||||||
|
$('#right').hide();
|
||||||
|
$.get(dest, function(data) {
|
||||||
|
$('#right-ajax').removeClass('loading').html(data);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$('#right-ajax').empty().parent().hide();
|
||||||
|
$('#right').show().addClass('loading').attr('src',dest);
|
||||||
|
}
|
||||||
|
$('#tree .selected').removeClass('selected');
|
||||||
|
$(this).parent().addClass('selected');
|
||||||
|
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
|
$(this).removeAttr('target');
|
||||||
|
});
|
||||||
|
if(click === true)
|
||||||
|
{
|
||||||
|
if($('#tree li.selected').length > 0)
|
||||||
|
$('#tree li.selected a').trigger('click');
|
||||||
|
else
|
||||||
|
$('.zone_online_users').trigger('click');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
$(document).ready(
|
||||||
|
function(){
|
||||||
|
resize();
|
||||||
|
setTimeout('sessionactive();',15000);
|
||||||
|
activeTree(true);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
function refreshBaskets()
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
function resize()
|
||||||
|
{
|
||||||
|
$('#right').height($(this).height()-$('#mainMenu').height()-20);
|
||||||
|
$('#right').width($('#mainContent').width()-$('#left').width()-20);
|
||||||
|
bodySize.y = $(window).height() - $('#mainMenu').outerHeight();
|
||||||
|
bodySize.x = $(window).width();
|
||||||
|
}
|
||||||
|
|
||||||
|
$(window).bind('resize',function(){resize();});
|
||||||
|
|
||||||
|
function reloadTree(position, click){
|
||||||
|
$.ajax({
|
||||||
|
type: "POST",
|
||||||
|
url: "adminFeedback.php",
|
||||||
|
data: {
|
||||||
|
action : 'TREE',
|
||||||
|
position : position
|
||||||
|
},
|
||||||
|
success: function(datas){
|
||||||
|
$('#FNDR').empty().append(datas);
|
||||||
|
activeTree(click);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div id="left" class="PNB" style="width:250px;right:auto;">
|
<div id="left" class="PNB" style="width:250px;right:auto;">
|
||||||
<div class="PNB10" style="right:0">
|
<div class="PNB10" style="right:0">
|
||||||
<div id="FNDR">
|
<div id="FNDR">
|
||||||
{% include 'admin/tree.html.twig' %}
|
{% include 'admin/tree.html.twig' %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<iframe class="right PNB10" src="about:blank;" name="right" id="right" frameborder="1" border="0" framespacing="0" style="left:260px;border:none;right:0;"></iframe>
|
|
||||||
<div class="right PNB" style="left:250px;overflow:auto;">
|
|
||||||
<div id="right-ajax" class="PNB10"></div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="quotas_dialog"></div>
|
{% if notice %}
|
||||||
<div id="masks_dialog"></div>
|
<div class="right PNB10 notice" style="left:260px;">
|
||||||
<div id="time_dialog"></div>
|
{% if notice == "install_success" %}
|
||||||
<div id="user_add_dialog" title="{% trans 'Ajouter un nouvel utilisateur' %}">
|
{% trans %}Successful install{% endtrans %}
|
||||||
<form>
|
{% endif %}
|
||||||
<label>{% trans 'Adresse email du nouvel utilisateur' %}</label>
|
</div>
|
||||||
<input type="text" name="value" />
|
{% endif %}
|
||||||
<img src="/skins/icons/loaderFFF.gif" class="new_user_loader" style="display:none;"/>
|
|
||||||
</form>
|
<iframe class="right PNB10" src="about:blank;" name="right" id="right" frameborder="1" border="0" framespacing="0" style="left:260px;border:none;right:0;{{ notice ? "top:30px" : "top:0" }}"></iframe>
|
||||||
</div>
|
<div class="right PNB" style="left:250px;overflow:auto;">
|
||||||
<div id="template_add_dialog" title="{% trans 'Creer un modele' %}">
|
<div id="right-ajax" class="PNB10"></div>
|
||||||
<form>
|
</div>
|
||||||
<label>{% trans 'Nom du nouveau modele' %}</label>
|
|
||||||
<input type="text" name="value" />
|
<div id="quotas_dialog"></div>
|
||||||
<img src="/skins/icons/loaderFFF.gif" class="new_user_loader" style="display:none;"/>
|
<div id="masks_dialog"></div>
|
||||||
</form>
|
<div id="time_dialog"></div>
|
||||||
</div>
|
<div id="user_add_dialog" title="{% trans 'Ajouter un nouvel utilisateur' %}">
|
||||||
<div id="DIALOG" style="color:white;"></div>
|
<form>
|
||||||
|
<label>{% trans 'Adresse email du nouvel utilisateur' %}</label>
|
||||||
|
<input type="text" name="value" />
|
||||||
|
<img src="/skins/icons/loaderFFF.gif" class="new_user_loader" style="display:none;"/>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<div id="template_add_dialog" title="{% trans 'Creer un modele' %}">
|
||||||
|
<form>
|
||||||
|
<label>{% trans 'Nom du nouveau modele' %}</label>
|
||||||
|
<input type="text" name="value" />
|
||||||
|
<img src="/skins/icons/loaderFFF.gif" class="new_user_loader" style="display:none;"/>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<div id="DIALOG" style="color:white;"></div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
Reference in New Issue
Block a user