mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-15 14:03:27 +00:00
Refactor Appbox
This commit is contained in:
@@ -50,7 +50,7 @@ class databox_cgu
|
|||||||
private static function getUnvalidated($home=false)
|
private static function getUnvalidated($home=false)
|
||||||
{
|
{
|
||||||
$terms = array();
|
$terms = array();
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
$session = $appbox->get_session();
|
$session = $appbox->get_session();
|
||||||
|
|
||||||
if(!$home)
|
if(!$home)
|
||||||
|
@@ -125,7 +125,7 @@ class databox_status
|
|||||||
|
|
||||||
return self::$_statuses;
|
return self::$_statuses;
|
||||||
|
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
$session = $appbox->get_session();
|
$session = $appbox->get_session();
|
||||||
$user = User_Adapter::getInstance($session->get_usr_id(), $appbox);
|
$user = User_Adapter::getInstance($session->get_usr_id(), $appbox);
|
||||||
|
|
||||||
@@ -152,7 +152,7 @@ class databox_status
|
|||||||
|
|
||||||
public static function getSearchStatus()
|
public static function getSearchStatus()
|
||||||
{
|
{
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
$session = $appbox->get_session();
|
$session = $appbox->get_session();
|
||||||
$user = User_Adapter::getInstance($session->get_usr_id(), $appbox);
|
$user = User_Adapter::getInstance($session->get_usr_id(), $appbox);
|
||||||
|
|
||||||
@@ -263,7 +263,7 @@ class databox_status
|
|||||||
|
|
||||||
public static function deleteStatus($sbas_id, $bit)
|
public static function deleteStatus($sbas_id, $bit)
|
||||||
{
|
{
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
$session = $appbox->get_session();
|
$session = $appbox->get_session();
|
||||||
$user = User_Adapter::getInstance($session->get_usr_id(), $appbox);
|
$user = User_Adapter::getInstance($session->get_usr_id(), $appbox);
|
||||||
|
|
||||||
@@ -323,7 +323,7 @@ class databox_status
|
|||||||
|
|
||||||
public static function updateStatus($sbas_id, $bit, $properties)
|
public static function updateStatus($sbas_id, $bit, $properties)
|
||||||
{
|
{
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
$session = $appbox->get_session();
|
$session = $appbox->get_session();
|
||||||
$user = User_Adapter::getInstance($session->get_usr_id(), $appbox);
|
$user = User_Adapter::getInstance($session->get_usr_id(), $appbox);
|
||||||
|
|
||||||
@@ -414,7 +414,7 @@ class databox_status
|
|||||||
|
|
||||||
public static function deleteIcon($sbas_id, $bit, $switch)
|
public static function deleteIcon($sbas_id, $bit, $switch)
|
||||||
{
|
{
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
$session = $appbox->get_session();
|
$session = $appbox->get_session();
|
||||||
$user = User_Adapter::getInstance($session->get_usr_id(), $appbox);
|
$user = User_Adapter::getInstance($session->get_usr_id(), $appbox);
|
||||||
|
|
||||||
@@ -444,7 +444,7 @@ class databox_status
|
|||||||
|
|
||||||
public static function updateIcon($sbas_id, $bit, $switch, $file)
|
public static function updateIcon($sbas_id, $bit, $switch, $file)
|
||||||
{
|
{
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
$session = $appbox->get_session();
|
$session = $appbox->get_session();
|
||||||
|
|
||||||
$user = User_Adapter::getInstance($session->get_usr_id(), $appbox);
|
$user = User_Adapter::getInstance($session->get_usr_id(), $appbox);
|
||||||
|
@@ -17,7 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
function giveMeBases($usr=null)
|
function giveMeBases($usr=null)
|
||||||
{
|
{
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
$conn = $appbox->get_connection();
|
$conn = $appbox->get_connection();
|
||||||
|
|
||||||
$inscriptions = null;
|
$inscriptions = null;
|
||||||
@@ -197,7 +197,7 @@ function giveMeBaseUsr($usr, $lng)
|
|||||||
{
|
{
|
||||||
|
|
||||||
$noDemand = true;
|
$noDemand = true;
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
|
|
||||||
$out = '<table border="0" style="table-layout:fixed;font-size:11px;" cellspacing=0 width="100%">' .
|
$out = '<table border="0" style="table-layout:fixed;font-size:11px;" cellspacing=0 width="100%">' .
|
||||||
'<tr>' .
|
'<tr>' .
|
||||||
@@ -344,7 +344,7 @@ function giveMeBaseUsr($usr, $lng)
|
|||||||
|
|
||||||
function giveModInscript($usr, $lng)
|
function giveModInscript($usr, $lng)
|
||||||
{
|
{
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
$session = $appbox->get_session();
|
$session = $appbox->get_session();
|
||||||
$out = '<html lang="' . $session->get_I18n() . '">' .
|
$out = '<html lang="' . $session->get_I18n() . '">' .
|
||||||
'<head>' .
|
'<head>' .
|
||||||
@@ -383,7 +383,7 @@ function giveModInscript($usr, $lng)
|
|||||||
|
|
||||||
function giveInscript($lng, $demandes=null)
|
function giveInscript($lng, $demandes=null)
|
||||||
{
|
{
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
|
|
||||||
$out = '<table border="0" style="table-layout:fixed" cellspacing=0 width="590">' .
|
$out = '<table border="0" style="table-layout:fixed" cellspacing=0 width="590">' .
|
||||||
'<tr>' .
|
'<tr>' .
|
||||||
|
@@ -21,7 +21,7 @@ function deleteRecord($lst, $del_children)
|
|||||||
$em = $Core->getEntityManager();
|
$em = $Core->getEntityManager();
|
||||||
$BE_repository = $em->getRepository('\Entities\BasketElement');
|
$BE_repository = $em->getRepository('\Entities\BasketElement');
|
||||||
|
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
$session = $appbox->get_session();
|
$session = $appbox->get_session();
|
||||||
$registry = $Core->getRegistry();
|
$registry = $Core->getRegistry();
|
||||||
|
|
||||||
@@ -121,7 +121,7 @@ function deleteRecord($lst, $del_children)
|
|||||||
function whatCanIDelete($lst)
|
function whatCanIDelete($lst)
|
||||||
{
|
{
|
||||||
|
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
$session = $appbox->get_session();
|
$session = $appbox->get_session();
|
||||||
|
|
||||||
$usr_id = $session->get_usr_id();
|
$usr_id = $session->get_usr_id();
|
||||||
|
@@ -170,7 +170,7 @@ class eventsmanager_broker
|
|||||||
|
|
||||||
function get_json_notifications($page=0)
|
function get_json_notifications($page=0)
|
||||||
{
|
{
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
$session = $appbox->get_session();
|
$session = $appbox->get_session();
|
||||||
|
|
||||||
$unread = 0;
|
$unread = 0;
|
||||||
@@ -248,7 +248,7 @@ class eventsmanager_broker
|
|||||||
|
|
||||||
function get_unread_notifications_number()
|
function get_unread_notifications_number()
|
||||||
{
|
{
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
$session = $appbox->get_session();
|
$session = $appbox->get_session();
|
||||||
|
|
||||||
$total = 0;
|
$total = 0;
|
||||||
@@ -271,7 +271,7 @@ class eventsmanager_broker
|
|||||||
|
|
||||||
function get_notifications()
|
function get_notifications()
|
||||||
{
|
{
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
$session = $appbox->get_session();
|
$session = $appbox->get_session();
|
||||||
|
|
||||||
$unread = 0;
|
$unread = 0;
|
||||||
|
@@ -254,8 +254,7 @@ class eventsmanager_notify_order extends eventsmanager_notifyAbstract
|
|||||||
function is_available()
|
function is_available()
|
||||||
{
|
{
|
||||||
$bool = false;
|
$bool = false;
|
||||||
$appbox = appbox::get_instance();
|
$session = $this->appbox->get_session();
|
||||||
$session = $appbox->get_session();
|
|
||||||
if (!$session->is_authenticated())
|
if (!$session->is_authenticated())
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
@@ -289,8 +289,7 @@ class eventsmanager_notify_register extends eventsmanager_notifyAbstract
|
|||||||
{
|
{
|
||||||
$bool = false;
|
$bool = false;
|
||||||
|
|
||||||
$appbox = appbox::get_instance();
|
$session = $this->appbox->get_session();
|
||||||
$session = $appbox->get_session();
|
|
||||||
if (!$session->is_authenticated() || !login::register_enabled())
|
if (!$session->is_authenticated() || !login::register_enabled())
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
@@ -230,8 +230,7 @@ class eventsmanager_notify_validationdone extends eventsmanager_notifyAbstract
|
|||||||
{
|
{
|
||||||
$bool = false;
|
$bool = false;
|
||||||
|
|
||||||
$appbox = appbox::get_instance();
|
$session = $this->appbox->get_session();
|
||||||
$session = $appbox->get_session();
|
|
||||||
if (!$session->is_authenticated())
|
if (!$session->is_authenticated())
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
@@ -26,7 +26,7 @@ abstract class eventsmanager_notifyAbstract extends eventsmanager_eventAbstract
|
|||||||
|
|
||||||
protected function get_prefs($class, $usr_id)
|
protected function get_prefs($class, $usr_id)
|
||||||
{
|
{
|
||||||
$user = User_Adapter::getInstance($usr_id, appbox::get_instance());
|
$user = User_Adapter::getInstance($usr_id, appbox::get_instance(\bootstrap::getCore()));
|
||||||
|
|
||||||
return $user->getPrefs('notification_' . $class);
|
return $user->getPrefs('notification_' . $class);
|
||||||
}
|
}
|
||||||
|
@@ -20,7 +20,7 @@ class module_admin
|
|||||||
|
|
||||||
function getTree($position=false)
|
function getTree($position=false)
|
||||||
{
|
{
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
$session = $appbox->get_session();
|
$session = $appbox->get_session();
|
||||||
|
|
||||||
$usr_id = $session->get_usr_id();
|
$usr_id = $session->get_usr_id();
|
||||||
|
@@ -245,7 +245,7 @@ class module_report
|
|||||||
*/
|
*/
|
||||||
public function __construct($d1, $d2, $sbas_id, $collist)
|
public function __construct($d1, $d2, $sbas_id, $collist)
|
||||||
{
|
{
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
$session = $appbox->get_session();
|
$session = $appbox->get_session();
|
||||||
$this->dmin = $d1;
|
$this->dmin = $d1;
|
||||||
$this->dmax = $d2;
|
$this->dmax = $d2;
|
||||||
|
@@ -371,7 +371,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface
|
|||||||
{
|
{
|
||||||
$dstatus = databox_status::getDisplayStatus();
|
$dstatus = databox_status::getDisplayStatus();
|
||||||
$sbas_id = $this->get_sbas_id();
|
$sbas_id = $this->get_sbas_id();
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
$session = $appbox->get_session();
|
$session = $appbox->get_session();
|
||||||
$user = User_Adapter::getInstance($session->get_usr_id(), $appbox);
|
$user = User_Adapter::getInstance($session->get_usr_id(), $appbox);
|
||||||
|
|
||||||
@@ -906,7 +906,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
$title = '';
|
$title = '';
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
$session = $appbox->get_session();
|
$session = $appbox->get_session();
|
||||||
|
|
||||||
$fields = $this->get_databox()->get_meta_structure();
|
$fields = $this->get_databox()->get_meta_structure();
|
||||||
@@ -1001,7 +1001,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface
|
|||||||
*/
|
*/
|
||||||
protected static function load_regfields()
|
protected static function load_regfields()
|
||||||
{
|
{
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
self::$_regfields = array();
|
self::$_regfields = array();
|
||||||
foreach ($appbox->get_databoxes() as $databox)
|
foreach ($appbox->get_databoxes() as $databox)
|
||||||
{
|
{
|
||||||
@@ -1175,7 +1175,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
$appbox = \appbox::get_instance();
|
$appbox = \appbox::get_instance(\bootstrap::getCore());
|
||||||
$session = $appbox->get_session();
|
$session = $appbox->get_session();
|
||||||
|
|
||||||
$connbas = connection::getPDOConnection($this->get_sbas_id());
|
$connbas = connection::getPDOConnection($this->get_sbas_id());
|
||||||
@@ -1584,7 +1584,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
$session = $appbox->get_session();
|
$session = $appbox->get_session();
|
||||||
$log_id = $session->get_logger($databox)->get_id();
|
$log_id = $session->get_logger($databox)->get_id();
|
||||||
|
|
||||||
@@ -1745,7 +1745,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface
|
|||||||
{
|
{
|
||||||
$connbas = $this->get_databox()->get_connection();
|
$connbas = $this->get_databox()->get_connection();
|
||||||
$sbas_id = $this->get_databox()->get_sbas_id();
|
$sbas_id = $this->get_databox()->get_sbas_id();
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
$registry = $appbox->get_registry();
|
$registry = $appbox->get_registry();
|
||||||
$conn = $appbox->get_connection();
|
$conn = $appbox->get_connection();
|
||||||
|
|
||||||
@@ -2115,7 +2115,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface
|
|||||||
if (!$this->is_grouping())
|
if (!$this->is_grouping())
|
||||||
throw new Exception('This record is not a grouping');
|
throw new Exception('This record is not a grouping');
|
||||||
|
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
|
|
||||||
$sql = 'SELECT record_id
|
$sql = 'SELECT record_id
|
||||||
FROM regroup g
|
FROM regroup g
|
||||||
@@ -2158,7 +2158,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface
|
|||||||
*/
|
*/
|
||||||
public function get_grouping_parents()
|
public function get_grouping_parents()
|
||||||
{
|
{
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
|
|
||||||
$sql = 'SELECT r.record_id
|
$sql = 'SELECT r.record_id
|
||||||
FROM regroup g
|
FROM regroup g
|
||||||
|
@@ -73,7 +73,7 @@ class record_exportElement extends record_adapter
|
|||||||
$this->downloadable = $downloadable = array();
|
$this->downloadable = $downloadable = array();
|
||||||
$this->orderable = $orderable = array();
|
$this->orderable = $orderable = array();
|
||||||
|
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
$session = $appbox->get_session();
|
$session = $appbox->get_session();
|
||||||
|
|
||||||
$sd = $this->get_subdefs();
|
$sd = $this->get_subdefs();
|
||||||
|
@@ -56,7 +56,7 @@ class record_orderElement extends record_adapter
|
|||||||
{
|
{
|
||||||
if ($this->order_master_id)
|
if ($this->order_master_id)
|
||||||
{
|
{
|
||||||
$user = User_Adapter::getInstance($this->order_master_id, appbox::get_instance());
|
$user = User_Adapter::getInstance($this->order_master_id, appbox::get_instance(\bootstrap::getCore()));
|
||||||
|
|
||||||
return $user->get_display_name();
|
return $user->get_display_name();
|
||||||
}
|
}
|
||||||
|
@@ -88,7 +88,7 @@ class record_preview extends record_adapter
|
|||||||
*/
|
*/
|
||||||
public function __construct($env, $pos, $contId, $reload_train, searchEngine_adapter $search_engine = null, $query = '')
|
public function __construct($env, $pos, $contId, $reload_train, searchEngine_adapter $search_engine = null, $query = '')
|
||||||
{
|
{
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
$Core = bootstrap::getCore();
|
$Core = bootstrap::getCore();
|
||||||
$number = null;
|
$number = null;
|
||||||
$this->env = $env;
|
$this->env = $env;
|
||||||
@@ -331,12 +331,13 @@ class record_preview extends record_adapter
|
|||||||
public function get_short_history()
|
public function get_short_history()
|
||||||
{
|
{
|
||||||
if (!is_null($this->short_history))
|
if (!is_null($this->short_history))
|
||||||
|
{
|
||||||
return $this->short_history;
|
return $this->short_history;
|
||||||
|
}
|
||||||
|
|
||||||
$tab = array();
|
$tab = array();
|
||||||
|
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
$session = $appbox->get_session();
|
$session = $appbox->get_session();
|
||||||
$registry = $appbox->get_registry();
|
$registry = $appbox->get_registry();
|
||||||
$user = User_Adapter::getInstance($session->get_usr_id(), $appbox);
|
$user = User_Adapter::getInstance($session->get_usr_id(), $appbox);
|
||||||
@@ -424,9 +425,11 @@ class record_preview extends record_adapter
|
|||||||
public function get_view_popularity()
|
public function get_view_popularity()
|
||||||
{
|
{
|
||||||
if (!is_null($this->view_popularity))
|
if (!is_null($this->view_popularity))
|
||||||
|
{
|
||||||
return $this->view_popularity;
|
return $this->view_popularity;
|
||||||
$appbox = appbox::get_instance();
|
}
|
||||||
|
|
||||||
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
$session = $appbox->get_session();
|
$session = $appbox->get_session();
|
||||||
|
|
||||||
$user = User_Adapter::getInstance($session->get_usr_id(), $appbox);
|
$user = User_Adapter::getInstance($session->get_usr_id(), $appbox);
|
||||||
@@ -522,9 +525,11 @@ class record_preview extends record_adapter
|
|||||||
public function get_refferer_popularity()
|
public function get_refferer_popularity()
|
||||||
{
|
{
|
||||||
if (!is_null($this->refferer_popularity))
|
if (!is_null($this->refferer_popularity))
|
||||||
|
{
|
||||||
return $this->refferer_popularity;
|
return $this->refferer_popularity;
|
||||||
$appbox = appbox::get_instance();
|
}
|
||||||
|
|
||||||
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
$session = $appbox->get_session();
|
$session = $appbox->get_session();
|
||||||
|
|
||||||
$user = User_Adapter::getInstance($session->get_usr_id(), $appbox);
|
$user = User_Adapter::getInstance($session->get_usr_id(), $appbox);
|
||||||
@@ -609,9 +614,11 @@ class record_preview extends record_adapter
|
|||||||
{
|
{
|
||||||
|
|
||||||
if (!is_null($this->download_popularity))
|
if (!is_null($this->download_popularity))
|
||||||
|
{
|
||||||
return $this->download_popularity;
|
return $this->download_popularity;
|
||||||
$appbox = appbox::get_instance();
|
}
|
||||||
|
|
||||||
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
$session = $appbox->get_session();
|
$session = $appbox->get_session();
|
||||||
|
|
||||||
$user = User_Adapter::getInstance($session->get_usr_id(), $appbox);
|
$user = User_Adapter::getInstance($session->get_usr_id(), $appbox);
|
||||||
|
@@ -392,7 +392,7 @@ class recordutils_image extends recordutils
|
|||||||
*/
|
*/
|
||||||
public static function watermark($bas, $rec, $hd=false)
|
public static function watermark($bas, $rec, $hd=false)
|
||||||
{
|
{
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
$registry = $appbox->get_registry();
|
$registry = $appbox->get_registry();
|
||||||
|
|
||||||
$sbas_id = phrasea::sbasFromBas($bas);
|
$sbas_id = phrasea::sbasFromBas($bas);
|
||||||
|
@@ -247,7 +247,7 @@ class searchEngine_adapter_phrasea_engine extends searchEngine_adapter_abstract
|
|||||||
$query .= ' AND recordtype=' . $this->opt_record_type;
|
$query .= ' AND recordtype=' . $this->opt_record_type;
|
||||||
}
|
}
|
||||||
|
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
$session = $appbox->get_session();
|
$session = $appbox->get_session();
|
||||||
|
|
||||||
$sql = 'SELECT query, query_time FROM cache WHERE session_id = :ses_id';
|
$sql = 'SELECT query, query_time FROM cache WHERE session_id = :ses_id';
|
||||||
@@ -325,7 +325,7 @@ class searchEngine_adapter_phrasea_engine extends searchEngine_adapter_abstract
|
|||||||
*/
|
*/
|
||||||
public function reset_cache()
|
public function reset_cache()
|
||||||
{
|
{
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
$session = $appbox->get_session();
|
$session = $appbox->get_session();
|
||||||
phrasea_clear_cache($session->get_ses_id());
|
phrasea_clear_cache($session->get_ses_id());
|
||||||
$this->reseted = true;
|
$this->reseted = true;
|
||||||
@@ -375,7 +375,7 @@ class searchEngine_adapter_phrasea_engine extends searchEngine_adapter_abstract
|
|||||||
*/
|
*/
|
||||||
protected function query()
|
protected function query()
|
||||||
{
|
{
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
$session = $appbox->get_session();
|
$session = $appbox->get_session();
|
||||||
$registry = $appbox->get_registry();
|
$registry = $appbox->get_registry();
|
||||||
|
|
||||||
@@ -472,7 +472,7 @@ class searchEngine_adapter_phrasea_engine extends searchEngine_adapter_abstract
|
|||||||
*/
|
*/
|
||||||
protected function singleParse($sbas)
|
protected function singleParse($sbas)
|
||||||
{
|
{
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
$session = $appbox->get_session();
|
$session = $appbox->get_session();
|
||||||
$this->qp[$sbas] = new searchEngine_adapter_phrasea_queryParser(Session_Handler::get_locale());
|
$this->qp[$sbas] = new searchEngine_adapter_phrasea_queryParser(Session_Handler::get_locale());
|
||||||
$this->qp[$sbas]->debug = false;
|
$this->qp[$sbas]->debug = false;
|
||||||
@@ -504,7 +504,7 @@ class searchEngine_adapter_phrasea_engine extends searchEngine_adapter_abstract
|
|||||||
$qry .= trim($query);
|
$qry .= trim($query);
|
||||||
}
|
}
|
||||||
|
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
|
|
||||||
foreach ($appbox->get_databoxes() as $databox)
|
foreach ($appbox->get_databoxes() as $databox)
|
||||||
{
|
{
|
||||||
@@ -620,7 +620,7 @@ class searchEngine_adapter_phrasea_engine extends searchEngine_adapter_abstract
|
|||||||
{
|
{
|
||||||
$ret = array();
|
$ret = array();
|
||||||
|
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
$session = $appbox->get_session();
|
$session = $appbox->get_session();
|
||||||
$res = phrasea_fetch_results(
|
$res = phrasea_fetch_results(
|
||||||
$session->get_ses_id(), ($record->get_number() + 1), 1, true, "[[em]]", "[[/em]]"
|
$session->get_ses_id(), ($record->get_number() + 1), 1, true, "[[em]]", "[[/em]]"
|
||||||
|
@@ -262,7 +262,7 @@ class searchEngine_adapter_sphinx_engine extends searchEngine_adapter_abstract i
|
|||||||
assert(is_int($offset));
|
assert(is_int($offset));
|
||||||
assert($offset >= 0);
|
assert($offset >= 0);
|
||||||
assert(is_int($perPage));
|
assert(is_int($perPage));
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
$session = $appbox->get_session();
|
$session = $appbox->get_session();
|
||||||
|
|
||||||
$page = ceil($offset / $perPage) + 1;
|
$page = ceil($offset / $perPage) + 1;
|
||||||
@@ -511,7 +511,7 @@ class searchEngine_adapter_sphinx_engine extends searchEngine_adapter_abstract i
|
|||||||
if (!$this->current_index)
|
if (!$this->current_index)
|
||||||
$this->current_index = '*';
|
$this->current_index = '*';
|
||||||
|
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
$supposed_qry = mb_strtolower($this->query);
|
$supposed_qry = mb_strtolower($this->query);
|
||||||
$pieces = explode(" ", str_replace(array("all", "last", "et", "ou", "sauf", "and", "or", "except", "in", "dans", "'", '"', "(", ")", "_", "-"), ' ', $supposed_qry));
|
$pieces = explode(" ", str_replace(array("all", "last", "et", "ou", "sauf", "and", "or", "except", "in", "dans", "'", '"', "(", ")", "_", "-"), ' ', $supposed_qry));
|
||||||
|
|
||||||
@@ -689,7 +689,7 @@ class searchEngine_adapter_sphinx_engine extends searchEngine_adapter_abstract i
|
|||||||
*/
|
*/
|
||||||
public function build_excerpt($query, array $fields, record_adapter $record)
|
public function build_excerpt($query, array $fields, record_adapter $record)
|
||||||
{
|
{
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
$session = $appbox->get_session();
|
$session = $appbox->get_session();
|
||||||
$selected_sbas_id = $record->get_sbas_id();
|
$selected_sbas_id = $record->get_sbas_id();
|
||||||
|
|
||||||
|
@@ -121,7 +121,7 @@ class searchEngine_results
|
|||||||
*/
|
*/
|
||||||
public function get_suggestions()
|
public function get_suggestions()
|
||||||
{
|
{
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
$session = $appbox->get_session();
|
$session = $appbox->get_session();
|
||||||
|
|
||||||
return $this->engine->get_suggestions($session);
|
return $this->engine->get_suggestions($session);
|
||||||
|
@@ -38,7 +38,7 @@ class set_export extends set_abstract
|
|||||||
{
|
{
|
||||||
$Core = bootstrap::getCore();
|
$Core = bootstrap::getCore();
|
||||||
|
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance($Core);
|
||||||
$session = $appbox->get_session();
|
$session = $appbox->get_session();
|
||||||
$registry = $appbox->get_registry();
|
$registry = $appbox->get_registry();
|
||||||
|
|
||||||
@@ -424,7 +424,7 @@ class set_export extends set_abstract
|
|||||||
{
|
{
|
||||||
throw new Exception('No subdefs given');
|
throw new Exception('No subdefs given');
|
||||||
}
|
}
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
$session = $appbox->get_session();
|
$session = $appbox->get_session();
|
||||||
$registry = $appbox->get_registry();
|
$registry = $appbox->get_registry();
|
||||||
|
|
||||||
@@ -866,7 +866,7 @@ class set_export extends set_abstract
|
|||||||
$sbas_id = phrasea::sbasFromBas($bas);
|
$sbas_id = phrasea::sbasFromBas($bas);
|
||||||
$record = new record_adapter($sbas_id, $rec);
|
$record = new record_adapter($sbas_id, $rec);
|
||||||
$desc = $record->get_xml();
|
$desc = $record->get_xml();
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
$session = $appbox->get_session();
|
$session = $appbox->get_session();
|
||||||
|
|
||||||
$databox = databox::get_instance($sbas_id);
|
$databox = databox::get_instance($sbas_id);
|
||||||
@@ -1075,7 +1075,7 @@ class set_export extends set_abstract
|
|||||||
public static function log_download(Array $list, $type, $anonymous = false, $comment = '')
|
public static function log_download(Array $list, $type, $anonymous = false, $comment = '')
|
||||||
{
|
{
|
||||||
//download
|
//download
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
$session = $appbox->get_session();
|
$session = $appbox->get_session();
|
||||||
$user = false;
|
$user = false;
|
||||||
if ($anonymous)
|
if ($anonymous)
|
||||||
@@ -1084,7 +1084,7 @@ class set_export extends set_abstract
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$user = User_Adapter::getInstance($session->get_usr_id(), appbox::get_instance());
|
$user = User_Adapter::getInstance($session->get_usr_id(), appbox::get_instance(\bootstrap::getCore()));
|
||||||
}
|
}
|
||||||
|
|
||||||
$tmplog = array();
|
$tmplog = array();
|
||||||
|
@@ -33,7 +33,7 @@ class set_exportftp extends set_export
|
|||||||
*/
|
*/
|
||||||
public function export_ftp($usr_to, $host, $login, $password, $ssl, $retry, $passif, $destfolder, $makedirectory, $logfile)
|
public function export_ftp($usr_to, $host, $login, $password, $ssl, $retry, $passif, $destfolder, $makedirectory, $logfile)
|
||||||
{
|
{
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
$session = $appbox->get_session();
|
$session = $appbox->get_session();
|
||||||
$user_f = User_Adapter::getInstance($session->get_usr_id(), $appbox);
|
$user_f = User_Adapter::getInstance($session->get_usr_id(), $appbox);
|
||||||
$conn = $appbox->get_connection();
|
$conn = $appbox->get_connection();
|
||||||
|
@@ -91,7 +91,7 @@ class set_exportorder extends set_export
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$evt_mngr = eventsmanager_broker::getInstance(appbox::get_instance(), $Core);
|
$evt_mngr = eventsmanager_broker::getInstance(appbox::get_instance($Core), $Core);
|
||||||
|
|
||||||
$params = array(
|
$params = array(
|
||||||
'order_id' => $order_id,
|
'order_id' => $order_id,
|
||||||
@@ -132,7 +132,7 @@ class set_exportorder extends set_export
|
|||||||
*/
|
*/
|
||||||
public static function set_order_admins($admins, $base_id)
|
public static function set_order_admins($admins, $base_id)
|
||||||
{
|
{
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
$conn = $appbox->get_connection();
|
$conn = $appbox->get_connection();
|
||||||
$conn->beginTransaction();
|
$conn->beginTransaction();
|
||||||
try
|
try
|
||||||
|
@@ -66,7 +66,7 @@ class set_order extends set_abstract
|
|||||||
*/
|
*/
|
||||||
public function __construct($id)
|
public function __construct($id)
|
||||||
{
|
{
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
$session = $appbox->get_session();
|
$session = $appbox->get_session();
|
||||||
$conn = $appbox->get_connection();
|
$conn = $appbox->get_connection();
|
||||||
|
|
||||||
@@ -202,7 +202,7 @@ class set_order extends set_abstract
|
|||||||
*/
|
*/
|
||||||
public function send_elements(Array $elements_ids, $force)
|
public function send_elements(Array $elements_ids, $force)
|
||||||
{
|
{
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
$session = $appbox->get_session();
|
$session = $appbox->get_session();
|
||||||
$conn = $appbox->get_connection();
|
$conn = $appbox->get_connection();
|
||||||
$pusher = User_Adapter::getInstance($session->get_usr_id(), $appbox);
|
$pusher = User_Adapter::getInstance($session->get_usr_id(), $appbox);
|
||||||
@@ -322,7 +322,7 @@ class set_order extends set_abstract
|
|||||||
public function deny_elements(Array $elements_ids)
|
public function deny_elements(Array $elements_ids)
|
||||||
{
|
{
|
||||||
$Core = bootstrap::getCore();
|
$Core = bootstrap::getCore();
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
$session = $appbox->get_session();
|
$session = $appbox->get_session();
|
||||||
$conn = $appbox->get_connection();
|
$conn = $appbox->get_connection();
|
||||||
|
|
||||||
|
@@ -37,7 +37,7 @@ class set_ordermanager extends set_abstract
|
|||||||
*/
|
*/
|
||||||
public function __construct($sort = false, $page = 1)
|
public function __construct($sort = false, $page = 1)
|
||||||
{
|
{
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
$session = $appbox->get_session();
|
$session = $appbox->get_session();
|
||||||
$conn = $appbox->get_connection();
|
$conn = $appbox->get_connection();
|
||||||
|
|
||||||
|
@@ -51,7 +51,7 @@ class set_selection extends set_abstract
|
|||||||
*/
|
*/
|
||||||
public function grep_authorized(Array $rights = array(), Array $sbas_rights = array())
|
public function grep_authorized(Array $rights = array(), Array $sbas_rights = array())
|
||||||
{
|
{
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
$session = $appbox->get_session();
|
$session = $appbox->get_session();
|
||||||
|
|
||||||
$user = User_Adapter::getInstance($session->get_usr_id(), $appbox);
|
$user = User_Adapter::getInstance($session->get_usr_id(), $appbox);
|
||||||
|
@@ -54,7 +54,7 @@ class task_Scheduler
|
|||||||
{
|
{
|
||||||
require_once __DIR__ . '/../../bootstrap.php';
|
require_once __DIR__ . '/../../bootstrap.php';
|
||||||
$this->output = $output;
|
$this->output = $output;
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
$registry = $appbox->get_registry();
|
$registry = $appbox->get_registry();
|
||||||
|
|
||||||
$system = system_server::get_platform();
|
$system = system_server::get_platform();
|
||||||
|
@@ -66,7 +66,7 @@ abstract class task_appboxAbstract extends task_abstract
|
|||||||
if (!$this->running)
|
if (!$this->running)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
$this->load_settings(simplexml_load_string($row['settings']));
|
$this->load_settings(simplexml_load_string($row['settings']));
|
||||||
|
Reference in New Issue
Block a user