mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-16 22:43:19 +00:00
Refactor
This commit is contained in:
@@ -42,8 +42,8 @@ class basketCollection
|
||||
$baskets['baskets'] = $baskets['recept'] = $baskets['regroup'] = array();
|
||||
|
||||
|
||||
$kernel = bootstrap::getKernel();
|
||||
$em = $kernel->getEntityManager();
|
||||
$core = bootstrap::getCore();
|
||||
$em = $core->getEntityManager();
|
||||
|
||||
$baskets['baskets'] = $em->getRepository('Entities\Basket')
|
||||
->findBy(array('usr_id' => $usr_id, 'pusher_id' => null));
|
||||
|
@@ -16,46 +16,46 @@
|
||||
* @link www.phraseanet.com
|
||||
*/
|
||||
|
||||
require_once __DIR__ . '/../Alchemy/Phrasea/Kernel.php';
|
||||
require_once __DIR__ . '/../Alchemy/Phrasea/Core.php';
|
||||
|
||||
class bootstrap
|
||||
{
|
||||
|
||||
protected static $kernel;
|
||||
protected static $core;
|
||||
|
||||
public static function set_php_configuration()
|
||||
{
|
||||
return Alchemy\Phrasea\Kernel::initPHPConf();
|
||||
return Alchemy\Phrasea\Core::initPHPConf();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return Alchemy\Phrasea\Kernel
|
||||
* @return Alchemy\Phrasea\Core
|
||||
*/
|
||||
public static function execute()
|
||||
{
|
||||
if(static::$kernel)
|
||||
if(static::$core)
|
||||
{
|
||||
return static::$kernel;
|
||||
return static::$core;
|
||||
}
|
||||
|
||||
static::$kernel = new Alchemy\Phrasea\Kernel();
|
||||
static::$core = new Alchemy\Phrasea\Core();
|
||||
|
||||
return static::$kernel;
|
||||
return static::$core;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return Alchemy\Phrasea\Kernel
|
||||
* @return Alchemy\Phrasea\Core
|
||||
*/
|
||||
public static function getKernel()
|
||||
public static function getCore()
|
||||
{
|
||||
return static::$kernel;
|
||||
return static::$core;
|
||||
}
|
||||
|
||||
public static function register_autoloads()
|
||||
{
|
||||
return Alchemy\Phrasea\Kernel::initAutoloads();
|
||||
return Alchemy\Phrasea\Core::initAutoloads();
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -243,13 +243,13 @@ class supertwig
|
||||
$user = User_Adapter::getInstance($session->get_usr_id(), $appbox);
|
||||
}
|
||||
|
||||
$kernel = bootstrap::getKernel();
|
||||
$core = bootstrap::getCore();
|
||||
|
||||
$this->default_vars = array(
|
||||
'session' => $session,
|
||||
'version_number' => $kernel->getVersion()->getNumber(),
|
||||
'version_name' => $kernel->getVersion()->getName(),
|
||||
'kernel' => $kernel,
|
||||
'version_number' => $core->getVersion()->getNumber(),
|
||||
'version_name' => $core->getVersion()->getName(),
|
||||
'core' => $core,
|
||||
'browser' => $browser,
|
||||
'request' => $request,
|
||||
'display_chrome_frame' => $registry->is_set('GV_display_gcf') ? $registry->get('GV_display_gcf') : true,
|
||||
|
19
templates/web/prod/Baskets/Create.html.twig
Normal file
19
templates/web/prod/Baskets/Create.html.twig
Normal file
@@ -0,0 +1,19 @@
|
||||
<form method="POST" action="/prod/baskets/" callback="refreshBaskets">
|
||||
|
||||
<label for="add_sel">{% trans 'Ajouter ma selection courrante' %}</label>
|
||||
<input type="checkbox" id="bask_create_sel" name="lst" value=""/>
|
||||
|
||||
<label>{% trans 'Nom du nouveau panier' %}</label>
|
||||
<input name="name" value="" type="text"/>
|
||||
|
||||
<label>{% trans 'paniers::description du nouveau panier' %}</label>
|
||||
<textarea name="description"></textarea>
|
||||
|
||||
<button>{% trans 'boutton::valider' %}</button>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
$('#bask_create_sel').val(p4.sel.join(';'));
|
||||
});
|
||||
</script>
|
||||
</form>
|
@@ -1,2 +1,2 @@
|
||||
{% import 'prod/baskets_macro.html' as baskets %}
|
||||
{{baskets.make_bloc(basket_collection, selected_ssel, srt)}}
|
||||
{{baskets.make_bloc(WorkZone, selected_type, selected_id, srt)}}
|
||||
|
Reference in New Issue
Block a user