This commit is contained in:
Romain Neutron
2011-12-16 20:00:59 +01:00
parent 10f74f0265
commit 5941c25ae6
5 changed files with 38 additions and 19 deletions

View File

@@ -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));

View File

@@ -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();
}
}

View File

@@ -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,

View 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>

View File

@@ -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)}}