mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-12 12:33:26 +00:00
Coding standards
This commit is contained in:
@@ -14,12 +14,10 @@
|
||||
*
|
||||
*/
|
||||
|
||||
require_once __DIR__ . '/lib/Alchemy/Phrasea/Core.php';
|
||||
require_once __DIR__ . '/lib/bootstrap.php';
|
||||
|
||||
use Symfony\Component\Finder\Finder;
|
||||
|
||||
\Alchemy\Phrasea\Core::initAutoloads();
|
||||
|
||||
$fix = isset($argv[1]) && 'fix' == $argv[1];
|
||||
|
||||
$finder = new Finder();
|
||||
|
@@ -121,6 +121,7 @@ class ACL implements cache_cacheableInterface
|
||||
$key = $record->get_serialize_key();
|
||||
|
||||
if (array_key_exists($key, $this->_rights_records_document))
|
||||
|
||||
return true;
|
||||
|
||||
return false;
|
||||
@@ -188,6 +189,7 @@ class ACL implements cache_cacheableInterface
|
||||
$key = $record->get_serialize_key();
|
||||
|
||||
if (array_key_exists($key, $this->_rights_records_preview))
|
||||
|
||||
return true;
|
||||
|
||||
return false;
|
||||
@@ -241,6 +243,7 @@ class ACL implements cache_cacheableInterface
|
||||
public function apply_model(User_Interface $template_user, Array $base_ids)
|
||||
{
|
||||
if (count($base_ids) == 0)
|
||||
|
||||
return $this;
|
||||
|
||||
$sbas_ids = array();
|
||||
@@ -382,6 +385,7 @@ class ACL implements cache_cacheableInterface
|
||||
$this->load_rights_bas();
|
||||
|
||||
if (!$this->has_access_to_base($base_id))
|
||||
|
||||
return false;
|
||||
|
||||
if ($this->is_limited($base_id))
|
||||
@@ -469,6 +473,7 @@ class ACL implements cache_cacheableInterface
|
||||
$this->load_rights_bas();
|
||||
|
||||
if (!$this->has_access_to_base($base_id))
|
||||
|
||||
return false;
|
||||
|
||||
return $this->_rights_bas[$base_id]['restrict_dwnld'];
|
||||
@@ -485,6 +490,7 @@ class ACL implements cache_cacheableInterface
|
||||
$this->load_rights_bas();
|
||||
|
||||
if (!$this->has_access_to_base($base_id))
|
||||
|
||||
return false;
|
||||
|
||||
return (int) $this->_rights_bas[$base_id]['remain_dwnld'];
|
||||
@@ -502,6 +508,7 @@ class ACL implements cache_cacheableInterface
|
||||
$this->load_rights_bas();
|
||||
|
||||
if (!$this->has_access_to_base($base_id))
|
||||
|
||||
return false;
|
||||
|
||||
$this->_rights_bas[$base_id]['remain_dwnld'] =
|
||||
@@ -541,12 +548,14 @@ class ACL implements cache_cacheableInterface
|
||||
$this->load_rights_sbas();
|
||||
|
||||
if (!isset($this->_rights_sbas[$sbas_id]))
|
||||
|
||||
return false;
|
||||
|
||||
if (!isset($this->_rights_sbas[$sbas_id][$right]))
|
||||
throw new Exception('This right does not exists');
|
||||
|
||||
if ($this->_rights_sbas[$sbas_id][$right] === true)
|
||||
|
||||
return true;
|
||||
|
||||
return false;
|
||||
@@ -562,6 +571,7 @@ class ACL implements cache_cacheableInterface
|
||||
{
|
||||
$this->load_rights_bas();
|
||||
if (!$this->has_access_to_base($base_id))
|
||||
|
||||
return false;
|
||||
|
||||
return $this->_rights_bas[$base_id]['mask_and'];
|
||||
@@ -577,6 +587,7 @@ class ACL implements cache_cacheableInterface
|
||||
{
|
||||
$this->load_rights_bas();
|
||||
if (!$this->has_access_to_base($base_id))
|
||||
|
||||
return false;
|
||||
|
||||
return $this->_rights_bas[$base_id]['mask_xor'];
|
||||
@@ -718,6 +729,7 @@ class ACL implements cache_cacheableInterface
|
||||
{
|
||||
|
||||
if ($this->_rights_records_preview)
|
||||
|
||||
return $this;
|
||||
|
||||
try
|
||||
@@ -771,6 +783,7 @@ class ACL implements cache_cacheableInterface
|
||||
{
|
||||
|
||||
if ($this->_rights_sbas && $this->_global_rights)
|
||||
|
||||
return $this;
|
||||
|
||||
try
|
||||
@@ -832,6 +845,7 @@ class ACL implements cache_cacheableInterface
|
||||
protected function load_rights_bas()
|
||||
{
|
||||
if ($this->_rights_bas && $this->_global_rights && is_array($this->_limited))
|
||||
|
||||
return $this;
|
||||
|
||||
try
|
||||
@@ -1335,6 +1349,7 @@ class ACL implements cache_cacheableInterface
|
||||
$stmt->closeCursor();
|
||||
|
||||
if (!$row)
|
||||
|
||||
return $this;
|
||||
|
||||
$this->give_access_to_base(array($base_id_dest));
|
||||
@@ -1501,6 +1516,7 @@ class ACL implements cache_cacheableInterface
|
||||
{
|
||||
$this->load_rights_bas();
|
||||
if (!isset($this->_limited[$base_id]))
|
||||
|
||||
return null;
|
||||
return ($this->_limited[$base_id]);
|
||||
}
|
||||
|
@@ -93,6 +93,7 @@ class Controller_Admin_Publications implements ControllerProviderInterface
|
||||
$user = User_Adapter::getInstance($appbox->get_session()->get_usr_id(), $appbox);
|
||||
|
||||
if (!$feed->is_owner($user))
|
||||
|
||||
return $app->redirect('/admin/publications/feed/' . $id . '/?error=' . _('You are not the owner of this feed, you can not edit it'));
|
||||
|
||||
$request = $app['request'];
|
||||
@@ -121,23 +122,29 @@ class Controller_Admin_Publications implements ControllerProviderInterface
|
||||
$user = User_Adapter::getInstance($appbox->get_session()->get_usr_id(), $appbox);
|
||||
|
||||
if (!$feed->is_owner($user))
|
||||
|
||||
return new Response('ERROR:you are not allowed');
|
||||
|
||||
if ($_FILES['Filedata']['error'] !== 0)
|
||||
|
||||
return new Response('ERROR:error while upload');
|
||||
|
||||
$file = new system_file($_FILES['Filedata']['tmp_name']);
|
||||
if (!in_array($file->get_mime(), array('image/jpeg', 'image/jpg', 'image/gif')))
|
||||
|
||||
return new Response('ERROR:bad filetype');
|
||||
|
||||
if ($file->getSize() > 200000)
|
||||
|
||||
return new Response('ERROR:file too large');
|
||||
|
||||
$datas = $file->get_technical_datas();
|
||||
if (!isset($datas[system_file::TC_DATAS_WIDTH]) || !isset($datas[system_file::TC_DATAS_HEIGHT]))
|
||||
|
||||
return new Response('ERROR:file is not square');
|
||||
|
||||
if ($datas[system_file::TC_DATAS_WIDTH] != $datas[system_file::TC_DATAS_HEIGHT])
|
||||
|
||||
return new Response('ERROR:file is not square');
|
||||
|
||||
$feed->set_icon($file);
|
||||
|
@@ -100,6 +100,7 @@ class DailymotionWithoutOauth2 extends Dailymotion
|
||||
$this->timeout = null;
|
||||
$result = json_decode($this->httpRequest($result['upload_url'], array('file' => '@' . $filePath)), true);
|
||||
$this->timeout = $timeout;
|
||||
|
||||
return $result['url'];
|
||||
}
|
||||
}
|
||||
|
@@ -370,9 +370,11 @@ class Feed_XML_Cooliris extends Feed_XML_Abstract implements Feed_XML_Interface
|
||||
$medium = strtolower($content->get_record()->get_type());
|
||||
|
||||
if (!in_array($medium, array('image', 'audio', 'video')))
|
||||
|
||||
return $this;
|
||||
|
||||
if (!$preview_permalink || !$thumbnail_permalink)
|
||||
|
||||
return $this;
|
||||
|
||||
//add item node to channel node
|
||||
|
@@ -907,6 +907,7 @@ class User_Adapter implements User_Interface, cache_cacheableInterface
|
||||
public static function get_usr_id_from_email($email)
|
||||
{
|
||||
if (is_null($email))
|
||||
|
||||
return false;
|
||||
|
||||
$conn = connection::getPDOConnection();
|
||||
@@ -1277,6 +1278,7 @@ class User_Adapter implements User_Interface, cache_cacheableInterface
|
||||
protected function load_preferences()
|
||||
{
|
||||
if ($this->_prefs)
|
||||
|
||||
return $this;
|
||||
|
||||
$registry = \registry::get_instance();
|
||||
@@ -1573,6 +1575,7 @@ class User_Adapter implements User_Interface, cache_cacheableInterface
|
||||
{
|
||||
$this->load_preferences();
|
||||
if (isset($this->_prefs[$prop]) && $this->_prefs[$prop] === $value)
|
||||
|
||||
return $value;
|
||||
|
||||
$ok = true;
|
||||
@@ -1610,6 +1613,7 @@ class User_Adapter implements User_Interface, cache_cacheableInterface
|
||||
$appbox = appbox::get_instance();
|
||||
$session = $appbox->get_session();
|
||||
if (!$session->is_authenticated())
|
||||
|
||||
return;
|
||||
|
||||
$ses_id = $session->get_ses_id();
|
||||
@@ -1884,6 +1888,7 @@ class User_Adapter implements User_Interface, cache_cacheableInterface
|
||||
public function get_nonce()
|
||||
{
|
||||
if ($this->nonce)
|
||||
|
||||
return $this->nonce;
|
||||
$nonce = false;
|
||||
|
||||
|
@@ -489,6 +489,7 @@ class User_Query implements User_QueryInterface
|
||||
public function get_total()
|
||||
{
|
||||
if ($this->total)
|
||||
|
||||
return $this->total;
|
||||
|
||||
$conn = $this->appbox->get_connection();
|
||||
@@ -637,6 +638,7 @@ class User_Query implements User_QueryInterface
|
||||
public function on_base_ids(Array $base_ids = null)
|
||||
{
|
||||
if (!$base_ids)
|
||||
|
||||
return $this;
|
||||
|
||||
$this->bases_restrictions = true;
|
||||
@@ -661,6 +663,7 @@ class User_Query implements User_QueryInterface
|
||||
public function on_sbas_ids(Array $sbas_ids = null)
|
||||
{
|
||||
if (!$sbas_ids)
|
||||
|
||||
return $this;
|
||||
|
||||
$this->sbas_restrictions = true;
|
||||
|
@@ -327,6 +327,7 @@ class basket_adapter implements cache_cacheableInterface
|
||||
public function get_first_element()
|
||||
{
|
||||
foreach ($this->get_elements() as $basket_element)
|
||||
|
||||
return $basket_element;
|
||||
return null;
|
||||
}
|
||||
@@ -338,6 +339,7 @@ class basket_adapter implements cache_cacheableInterface
|
||||
public function get_validation_end_date()
|
||||
{
|
||||
if (!$this->valid || !$this->validation_end_date)
|
||||
|
||||
return null;
|
||||
return $this->validation_end_date;
|
||||
}
|
||||
@@ -349,6 +351,7 @@ class basket_adapter implements cache_cacheableInterface
|
||||
public function is_validation_finished()
|
||||
{
|
||||
if (!$this->valid || !$this->validation_end_date)
|
||||
|
||||
return null;
|
||||
$now = new DateTime();
|
||||
|
||||
@@ -362,6 +365,7 @@ class basket_adapter implements cache_cacheableInterface
|
||||
public function is_confirmed()
|
||||
{
|
||||
if (!$this->valid)
|
||||
|
||||
return null;
|
||||
|
||||
return $this->validation_is_confirmed;
|
||||
@@ -370,14 +374,17 @@ class basket_adapter implements cache_cacheableInterface
|
||||
public function is_releasable()
|
||||
{
|
||||
if (!$this->valid)
|
||||
|
||||
return false;
|
||||
|
||||
if ($this->is_confirmed())
|
||||
|
||||
return false;
|
||||
|
||||
foreach ($this->get_elements() as $element)
|
||||
{
|
||||
if ($element->get_my_agreement() == '0')
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -585,6 +592,7 @@ class basket_adapter implements cache_cacheableInterface
|
||||
public function sort($order)
|
||||
{
|
||||
if (!$this->valid || !in_array($order, array('asc', 'desc')))
|
||||
|
||||
return;
|
||||
|
||||
$this->load_elements();
|
||||
@@ -1016,6 +1024,7 @@ class basket_adapter implements cache_cacheableInterface
|
||||
public function set_read()
|
||||
{
|
||||
if (!$this->noview)
|
||||
|
||||
return true;
|
||||
$session = $this->appbox->get_session();
|
||||
|
||||
@@ -1131,15 +1140,19 @@ class basket_adapter implements cache_cacheableInterface
|
||||
if ($this->is_mine)
|
||||
{
|
||||
if ($this->is_validation_finished())
|
||||
|
||||
return sprintf(_('Vous aviez envoye cette demande a %d utilisateurs'), (count($this->validating_users) - 1));
|
||||
else
|
||||
|
||||
return sprintf(_('Vous avez envoye cette demande a %d utilisateurs'), (count($this->validating_users) - 1));
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($this->validation_see_others)
|
||||
|
||||
return sprintf(_('Processus de validation recu de %s et concernant %d utilisateurs'), User_Adapter::getInstance($this->usr_id, $this->appbox)->get_display_name(), (count($this->validating_users) - 1));
|
||||
else
|
||||
|
||||
return sprintf(_('Processus de validation recu de %s'), User_Adapter::getInstance($this->usr_id, $this->appbox)->get_display_name());
|
||||
}
|
||||
}
|
||||
@@ -1248,6 +1261,7 @@ class basket_adapter implements cache_cacheableInterface
|
||||
protected function load_elements()
|
||||
{
|
||||
if (!is_null($this->elements))
|
||||
|
||||
return;
|
||||
|
||||
$this->elements = array();
|
||||
@@ -1525,11 +1539,14 @@ class basket_adapter implements cache_cacheableInterface
|
||||
public function remove_from_ssel($sselcont_id)
|
||||
{
|
||||
if (!$this->is_mine)
|
||||
|
||||
return array('error' => 'error', 'status' => 0);
|
||||
|
||||
if ($this->is_grouping)
|
||||
|
||||
return $this->remove_grouping_elements($sselcont_id);
|
||||
else
|
||||
|
||||
return $this->remove_basket_elements($sselcont_id);
|
||||
}
|
||||
|
||||
|
@@ -60,6 +60,7 @@ class caption_record implements caption_interface, cache_cacheableInterface
|
||||
protected function retrieve_fields()
|
||||
{
|
||||
if (is_array($this->fields))
|
||||
|
||||
return $this->fields;
|
||||
|
||||
$fields = array();
|
||||
@@ -133,6 +134,7 @@ class caption_record implements caption_interface, cache_cacheableInterface
|
||||
{
|
||||
$fields = $this->retrieve_fields();
|
||||
if (isset($this->dces_elements[$label]))
|
||||
|
||||
return $fields[$this->dces_elements[$label]];
|
||||
return null;
|
||||
}
|
||||
|
@@ -175,6 +175,7 @@ class connection
|
||||
self::$_PDO_instance[$name] = null;
|
||||
unset(self::$_PDO_instance[$name]);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
@@ -451,6 +451,7 @@ class databox extends base
|
||||
$stmt->closeCursor();
|
||||
|
||||
if ($row)
|
||||
|
||||
return self::get_instance((int) $row['sbas_id']);
|
||||
|
||||
try
|
||||
@@ -575,6 +576,7 @@ class databox extends base
|
||||
public function get_meta_structure()
|
||||
{
|
||||
if ($this->meta_struct)
|
||||
|
||||
return $this->meta_struct;
|
||||
|
||||
try
|
||||
@@ -697,6 +699,7 @@ class databox extends base
|
||||
}
|
||||
}
|
||||
if ($n > $limit)
|
||||
|
||||
return true;
|
||||
|
||||
return false;
|
||||
@@ -1220,6 +1223,7 @@ class databox extends base
|
||||
public function get_structure()
|
||||
{
|
||||
if ($this->structure)
|
||||
|
||||
return $this->structure;
|
||||
$this->structure = $this->retrieve_structure();
|
||||
|
||||
@@ -1260,6 +1264,7 @@ class databox extends base
|
||||
public function get_cterms()
|
||||
{
|
||||
if ($this->cterms)
|
||||
|
||||
return $this->cterms;
|
||||
|
||||
$sql = "SELECT value FROM pref WHERE prop='cterms'";
|
||||
@@ -1426,6 +1431,7 @@ class databox extends base
|
||||
public function get_cgus()
|
||||
{
|
||||
if ($this->cgus)
|
||||
|
||||
return $this->cgus;
|
||||
|
||||
$this->load_cgus();
|
||||
|
@@ -76,6 +76,7 @@ class gatekeeper
|
||||
$session = $appbox->get_session();
|
||||
|
||||
if (http_request::is_command_line())
|
||||
|
||||
return;
|
||||
|
||||
if (isset($_SERVER['PHP_SELF']) && trim($_SERVER['PHP_SELF']))
|
||||
@@ -121,6 +122,7 @@ class gatekeeper
|
||||
if ($this->_PHP_SELF == '/thesaurus2/xmlhttp/getterm.x.php'
|
||||
|| $this->_PHP_SELF == '/thesaurus2/xmlhttp/searchcandidate.x.php'
|
||||
|| $this->_PHP_SELF == '/thesaurus2/xmlhttp/getsy.x.php')
|
||||
|
||||
return;
|
||||
phrasea::redirect('/login/?redirect=/thesaurus2');
|
||||
break;
|
||||
@@ -129,6 +131,7 @@ class gatekeeper
|
||||
break;
|
||||
case 'admin':
|
||||
if ($this->_script_name === 'runscheduler.php')
|
||||
|
||||
return;
|
||||
phrasea::redirect('/login/?redirect=' . $_SERVER['REQUEST_URI']);
|
||||
break;
|
||||
@@ -148,6 +151,7 @@ class gatekeeper
|
||||
return;
|
||||
case 'setup':
|
||||
if ($appbox->upgradeavailable())
|
||||
|
||||
return;
|
||||
else
|
||||
phrasea::redirect('/login/');
|
||||
@@ -264,6 +268,7 @@ class gatekeeper
|
||||
$parm = $request->get_parms('LOG');
|
||||
|
||||
if (is_null($parm["LOG"]))
|
||||
|
||||
return $this;
|
||||
|
||||
try
|
||||
@@ -281,6 +286,7 @@ class gatekeeper
|
||||
try
|
||||
{
|
||||
$datas = random::helloToken($parm['LOG']);
|
||||
|
||||
return phrasea::redirect("/lightbox/validate/" . $datas['datas'] . "/");
|
||||
}
|
||||
catch (Exception_NotFound $e)
|
||||
|
@@ -94,6 +94,7 @@ class geonames
|
||||
$cityName = self::clean_input($cityName);
|
||||
|
||||
if (strlen($cityName) === 0)
|
||||
|
||||
return $output;
|
||||
|
||||
$registry = registry::get_instance();
|
||||
@@ -134,6 +135,7 @@ class geonames
|
||||
public function find_geoname_from_ip($ip)
|
||||
{
|
||||
if (array_key_exists($ip, $this->cache_ips))
|
||||
|
||||
return $this->cache_ips[$ip];
|
||||
|
||||
$output = array(
|
||||
|
@@ -58,6 +58,7 @@ return call_user_func(
|
||||
{
|
||||
$browser = Browser::getInstance();
|
||||
if (!$browser->isMobile())
|
||||
|
||||
return new Response('');
|
||||
|
||||
$twig = new supertwig();
|
||||
|
@@ -70,6 +70,7 @@ return call_user_func(function()
|
||||
|
||||
return new response($twig->render('/prod/actions/Bridge/deactivated.twig', $params), 200);
|
||||
}
|
||||
|
||||
return new response($twig->render('/prod/actions/Bridge/error.twig', $params), 200);
|
||||
}
|
||||
});
|
||||
|
@@ -34,10 +34,13 @@ return call_user_func(function()
|
||||
{
|
||||
$browser = Browser::getInstance();
|
||||
if ($browser->isMobile())
|
||||
|
||||
return $app->redirect("/login/?redirect=/lightbox");
|
||||
elseif ($browser->isNewGeneration())
|
||||
|
||||
return $app->redirect("/login/?redirect=/prod");
|
||||
else
|
||||
|
||||
return $app->redirect("/login/?redirect=/client");
|
||||
});
|
||||
|
||||
@@ -70,6 +73,7 @@ return call_user_func(function()
|
||||
/**
|
||||
* Mount all aps
|
||||
*/
|
||||
|
||||
return $app;
|
||||
}
|
||||
);
|
@@ -49,8 +49,10 @@ return call_user_func(function()
|
||||
$app->get('/', function() use ($app)
|
||||
{
|
||||
if ($app['install'] === true)
|
||||
|
||||
return $app->redirect('/setup/installer/');
|
||||
if ($app['upgrade'] === true)
|
||||
|
||||
return $app->redirect('/setup/upgrader/');
|
||||
});
|
||||
|
||||
@@ -63,6 +65,7 @@ return call_user_func(function()
|
||||
$app->error(function($e) use ($app)
|
||||
{
|
||||
if ($e instanceof Exception_Setup_PhraseaAlreadyInstalled)
|
||||
|
||||
return $app->redirect('/login');
|
||||
|
||||
return new Response(
|
||||
|
@@ -77,6 +77,7 @@ class module_admin
|
||||
);
|
||||
|
||||
$twig = new supertwig();
|
||||
|
||||
return $twig->render('admin/tree.html.twig', $params);
|
||||
|
||||
}
|
||||
|
@@ -121,6 +121,7 @@ $parseRoute = function ($route, Response $response)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return array('ressource' => $ressource, 'general' => $general, 'aspect' => $aspect, 'action' => $action);
|
||||
};
|
||||
|
||||
@@ -139,6 +140,7 @@ $app->before(function($request) use ($app)
|
||||
$app['token'] = API_OAuth2_Token::load_by_oauth_token($app["appbox"], $oauth2_adapter->getToken());
|
||||
|
||||
if ($session->is_authenticated())
|
||||
|
||||
return;
|
||||
if ($oauth2_adapter->has_ses_id())
|
||||
{
|
||||
|
@@ -455,6 +455,7 @@ class module_prod_route_records_edit extends module_prod_route_records_abstract
|
||||
}
|
||||
|
||||
if (!is_array($request->get('mds')))
|
||||
|
||||
return $this;
|
||||
|
||||
$sbas_id = (int) $request->get('sbid');
|
||||
|
@@ -500,6 +500,7 @@ class module_report
|
||||
public function getOrder($k = false)
|
||||
{
|
||||
if ($k === false)
|
||||
|
||||
return $this->tab_order;
|
||||
return $this->tab_order[$k];
|
||||
}
|
||||
@@ -819,6 +820,7 @@ class module_report
|
||||
public function buildReport($tab = false, $groupby = false, $on = false)
|
||||
{
|
||||
if (sizeof($this->report) > 0)
|
||||
|
||||
return $this->report;
|
||||
$conn = connection::getPDOConnection($this->sbas_id);
|
||||
|
||||
|
@@ -1112,6 +1112,7 @@ class module_report_activity extends module_report
|
||||
$date = new DateTime($row['ddate']);
|
||||
$result[$date->format(DATE_ATOM)] = $row['activity'];
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
@@ -157,8 +157,10 @@ class module_report_dashboard implements module_report_dashboard_componentInterf
|
||||
public function isValid()
|
||||
{
|
||||
if (isset($this->dashboard) && sizeof($this->dashboard) > 0)
|
||||
|
||||
return true;
|
||||
else
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@@ -252,6 +252,7 @@ class module_report_dashboard_feed implements module_report_dashboard_componentI
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
@@ -149,8 +149,10 @@ class module_report_dashboard_sort implements module_report_dashboard_componentI
|
||||
public function isValid()
|
||||
{
|
||||
if (isset($this->arraySorted) && sizeof($this->arraySorted) > 0)
|
||||
|
||||
return true;
|
||||
else
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -162,6 +164,7 @@ class module_report_dashboard_sort implements module_report_dashboard_componentI
|
||||
public function getTop($nbtop)
|
||||
{
|
||||
if (!is_int($nbtop))
|
||||
|
||||
return array();
|
||||
|
||||
$tmp = array();
|
||||
@@ -182,6 +185,7 @@ class module_report_dashboard_sort implements module_report_dashboard_componentI
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $tmp;
|
||||
}
|
||||
|
||||
|
@@ -617,6 +617,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface
|
||||
throw new Exception_Media_SubdefNotFound ();
|
||||
|
||||
if (isset($this->subdefs[$name]))
|
||||
|
||||
return $this->subdefs[$name];
|
||||
|
||||
if (!$this->subdefs)
|
||||
@@ -756,8 +757,10 @@ class record_adapter implements record_Interface, cache_cacheableInterface
|
||||
if ($data)
|
||||
{
|
||||
if (isset($this->technical_datas[$data]))
|
||||
|
||||
return $this->technical_datas[$data];
|
||||
else
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1355,6 +1358,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface
|
||||
public function get_reg_name()
|
||||
{
|
||||
if (!$this->is_grouping())
|
||||
|
||||
return false;
|
||||
|
||||
$balisename = '';
|
||||
@@ -1551,6 +1555,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface
|
||||
{
|
||||
$hd = $this->get_subdef('document');
|
||||
if ($hd->is_physically_present())
|
||||
|
||||
return new system_file(p4string::addEndSlash($hd->get_path()) . $hd->get_file());
|
||||
return null;
|
||||
}
|
||||
@@ -1891,6 +1896,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface
|
||||
public function get_container_baskets()
|
||||
{
|
||||
if ($this->container_basket)
|
||||
|
||||
return $this->container_basket;
|
||||
|
||||
$appbox = appbox::get_instance();
|
||||
|
@@ -205,6 +205,7 @@ class record_preview extends record_adapter
|
||||
public function get_train($pos = 0, $query='', searchEngine_adapter $search_engine=null)
|
||||
{
|
||||
if ($this->train)
|
||||
|
||||
return $this->train;
|
||||
|
||||
switch ($this->env)
|
||||
@@ -267,6 +268,7 @@ class record_preview extends record_adapter
|
||||
public function get_title($highlight = '', searchEngine_adapter $search_engine=null)
|
||||
{
|
||||
if ($this->title)
|
||||
|
||||
return $this->title;
|
||||
|
||||
$this->title = collection::getLogo($this->get_base_id()) . ' ';
|
||||
@@ -323,6 +325,7 @@ class record_preview extends record_adapter
|
||||
public function get_short_history()
|
||||
{
|
||||
if (!is_null($this->short_history))
|
||||
|
||||
return $this->short_history;
|
||||
|
||||
$tab = array();
|
||||
@@ -415,6 +418,7 @@ class record_preview extends record_adapter
|
||||
public function get_view_popularity()
|
||||
{
|
||||
if (!is_null($this->view_popularity))
|
||||
|
||||
return $this->view_popularity;
|
||||
$appbox = appbox::get_instance();
|
||||
$session = $appbox->get_session();
|
||||
@@ -512,6 +516,7 @@ class record_preview extends record_adapter
|
||||
public function get_refferer_popularity()
|
||||
{
|
||||
if (!is_null($this->refferer_popularity))
|
||||
|
||||
return $this->refferer_popularity;
|
||||
$appbox = appbox::get_instance();
|
||||
$session = $appbox->get_session();
|
||||
@@ -598,6 +603,7 @@ class record_preview extends record_adapter
|
||||
{
|
||||
|
||||
if (!is_null($this->download_popularity))
|
||||
|
||||
return $this->download_popularity;
|
||||
$appbox = appbox::get_instance();
|
||||
$session = $appbox->get_session();
|
||||
|
@@ -131,8 +131,10 @@ class registry implements registryInterface
|
||||
$this->load();
|
||||
|
||||
if(!$this->cache->is_set($key) && !is_null($defaultvalue))
|
||||
|
||||
return $defaultvalue;
|
||||
else
|
||||
|
||||
return $this->cache->get($key);
|
||||
}
|
||||
|
||||
|
@@ -758,6 +758,7 @@ class set_export extends set_abstract
|
||||
return false;
|
||||
}
|
||||
if (isset($list['complete']) && $list['complete'] === true)
|
||||
|
||||
return;
|
||||
|
||||
|
||||
@@ -1007,6 +1008,7 @@ class set_export extends set_abstract
|
||||
$response->headers->set('Content-Disposition', $disposition . "; filename=" . $exportname . ";");
|
||||
$response->headers->set('Content-Length', filesize($file));
|
||||
$response->setContent(file_get_contents($file));
|
||||
|
||||
return $response;
|
||||
}
|
||||
}
|
||||
|
@@ -150,6 +150,7 @@ class task_manager
|
||||
closedir($hdir);
|
||||
}
|
||||
}
|
||||
|
||||
return $tasks;
|
||||
}
|
||||
}
|
||||
|
@@ -162,6 +162,7 @@ class task_period_outofdate extends task_abstract
|
||||
parent.calcSQL();
|
||||
</script>
|
||||
<?php
|
||||
|
||||
return("");
|
||||
}
|
||||
else // ... so we NEVER come here
|
||||
@@ -218,6 +219,7 @@ class task_period_outofdate extends task_abstract
|
||||
jQuery.map($(this).serializeArray(), function(n, i){
|
||||
json[n['name']] = n['value'];
|
||||
});
|
||||
|
||||
return json;
|
||||
};
|
||||
})( jQuery );
|
||||
@@ -309,6 +311,7 @@ class task_period_outofdate extends task_abstract
|
||||
$("#status"+fld).html(html);
|
||||
}
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -682,6 +685,7 @@ class task_period_outofdate extends task_abstract
|
||||
}
|
||||
|
||||
$ret = ($nchanged > 0 ? $nchanged : 'NORECSTODO');
|
||||
|
||||
return($ret);
|
||||
}
|
||||
|
||||
|
@@ -68,6 +68,7 @@ class task_period_upgradetov32 extends task_abstract
|
||||
{
|
||||
printf("sbas_id '" . $this->sbas_id . "' invalide\n");
|
||||
$this->return_value = self::RETURNSTATUS_STOPPED;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -369,11 +370,13 @@ class task_period_upgradetov32 extends task_abstract
|
||||
if ($n_done >= 5000)
|
||||
{
|
||||
$this->return_value = task_abstract::RETURNSTATUS_TORESTART;
|
||||
|
||||
return;
|
||||
}
|
||||
if ($memory > 100)
|
||||
{
|
||||
$this->return_value = task_abstract::RETURNSTATUS_TORESTART;
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@@ -366,6 +366,7 @@ class task_period_writemeta extends task_databoxAbstract
|
||||
|
||||
$this->log("\t" . $s);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
@@ -305,6 +305,7 @@ class Bridge_Api_Apitest extends Bridge_Api_Abstract implements Bridge_Api_Inter
|
||||
$element = new Bridge_Api_Apitest_Element();
|
||||
$element->id = $element_id;
|
||||
$element->type = $object;
|
||||
|
||||
return $element;
|
||||
}
|
||||
|
||||
@@ -313,6 +314,7 @@ class Bridge_Api_Apitest extends Bridge_Api_Abstract implements Bridge_Api_Inter
|
||||
$container = new Bridge_Api_Apitest_Containers();
|
||||
$container->id = $element_id;
|
||||
$container->type = $object;
|
||||
|
||||
return $container;
|
||||
}
|
||||
|
||||
@@ -340,6 +342,7 @@ class Bridge_Api_Apitest extends Bridge_Api_Abstract implements Bridge_Api_Inter
|
||||
$element_collection->add_element(new Bridge_Api_Apitest_Element());
|
||||
$i++;
|
||||
}
|
||||
|
||||
return $element_collection;
|
||||
}
|
||||
|
||||
@@ -352,6 +355,7 @@ class Bridge_Api_Apitest extends Bridge_Api_Abstract implements Bridge_Api_Inter
|
||||
$container_collection->add_element(new Bridge_Api_Apitest_Containers());
|
||||
$i++;
|
||||
}
|
||||
|
||||
return $container_collection;
|
||||
}
|
||||
|
||||
|
@@ -88,6 +88,7 @@ class W3CFeedUrlValidator extends W3CFeedValidator
|
||||
{
|
||||
throw new W3CFeedValidatorException("Unable to request W3C API");
|
||||
}
|
||||
|
||||
return new W3CFeedValidatorResponse($response);
|
||||
}
|
||||
|
||||
@@ -151,6 +152,7 @@ class W3CFeedRawValidator extends W3CFeedValidator
|
||||
{
|
||||
throw new W3CFeedValidatorException("Unable to request W3C API");
|
||||
}
|
||||
|
||||
return new W3CFeedValidatorResponse($response);
|
||||
}
|
||||
|
||||
@@ -209,6 +211,7 @@ class W3CFeedValidatorResponse
|
||||
$string .= $name . "=>" . $detail . "\n";
|
||||
}
|
||||
}
|
||||
|
||||
return $string;
|
||||
}
|
||||
|
||||
@@ -219,6 +222,7 @@ class W3CFeedValidatorResponse
|
||||
public function isValid()
|
||||
{
|
||||
$xPathQuery = "/env:Envelope/env:Body/m:feedvalidationresponse/m:validity";
|
||||
|
||||
return $this->DOMXpath->query($xPathQuery)->item(0)->nodeValue !== "false";
|
||||
}
|
||||
|
||||
@@ -229,6 +233,7 @@ class W3CFeedValidatorResponse
|
||||
public function hasError()
|
||||
{
|
||||
$xPathQuery = "/env:Envelope/env:Body/m:feedvalidationresponse/m:errors/m:errorcount";
|
||||
|
||||
return (int) $this->DOMXpath->query($xPathQuery)->item(0)->nodeValue !== 0;
|
||||
}
|
||||
|
||||
@@ -239,6 +244,7 @@ class W3CFeedValidatorResponse
|
||||
public function hasWarning()
|
||||
{
|
||||
$xPathQuery = "/env:Envelope/env:Body/m:feedvalidationresponse/m:warnings/m:warningcount";
|
||||
|
||||
return (int) $this->DOMXpath->query($xPathQuery)->item(0)->nodeValue !== 0;
|
||||
}
|
||||
|
||||
@@ -286,6 +292,7 @@ class W3CFeedValidatorResponse
|
||||
$warnings[] = $this->domNodeToArray($warning);
|
||||
}
|
||||
}
|
||||
|
||||
return $warnings;
|
||||
}
|
||||
|
||||
@@ -305,6 +312,7 @@ class W3CFeedValidatorResponse
|
||||
$errors[] = $this->domNodeToArray($error);
|
||||
}
|
||||
}
|
||||
|
||||
return $errors;
|
||||
}
|
||||
|
||||
|
@@ -64,6 +64,7 @@ class Module_Prod_Route_RecordFeedApp extends PhraseanetWebTestCaseAuthenticated
|
||||
public function createApplication()
|
||||
{
|
||||
$app = require __DIR__ . '/../../../../../classes/module/Prod.php';
|
||||
|
||||
return $app;
|
||||
}
|
||||
|
||||
|
@@ -331,6 +331,7 @@ class Module_RssFeedTest extends PhraseanetWebTestCaseAbstract
|
||||
{
|
||||
$current_attributes[$attribute->name] = $attribute->value;
|
||||
}
|
||||
|
||||
return $current_attributes;
|
||||
}
|
||||
|
||||
@@ -516,6 +517,7 @@ class Module_RssFeedTest extends PhraseanetWebTestCaseAbstract
|
||||
unset($item_entries[$key]); //remove
|
||||
}
|
||||
};
|
||||
|
||||
return $remove;
|
||||
}
|
||||
|
||||
|
@@ -351,6 +351,7 @@ foreach ($tasks as $t)
|
||||
{
|
||||
if(window.console)
|
||||
console.log('No task like this');
|
||||
|
||||
return(false);
|
||||
}
|
||||
|
||||
|
@@ -72,6 +72,7 @@ $qrySbas = array();
|
||||
if (is_null($parm['bas']))
|
||||
{
|
||||
echo 'vous devez selectionner des collections dans lesquelles chercher';
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
@@ -220,6 +220,7 @@ if ($request->has_post_datas())
|
||||
if ($newUsrEmail)
|
||||
{
|
||||
$user->set_mail_locked(true);
|
||||
|
||||
return phrasea::redirect('/login/sendmail-confirm.php?usr_id=' . $newid);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user