mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-18 15:33:15 +00:00
Use short array declaration
This commit is contained in:
@@ -69,7 +69,7 @@ class record_exportElement extends record_adapter
|
||||
}
|
||||
|
||||
$this->remain_hd = $remain_hd;
|
||||
$this->size = array();
|
||||
$this->size = [];
|
||||
parent::__construct($app, $sbas_id, $record_id);
|
||||
|
||||
$this->get_actions($remain_hd);
|
||||
@@ -83,8 +83,8 @@ class record_exportElement extends record_adapter
|
||||
*/
|
||||
protected function get_actions()
|
||||
{
|
||||
$this->downloadable = $downloadable = array();
|
||||
$this->orderable = $orderable = array();
|
||||
$this->downloadable = $downloadable = [];
|
||||
$this->orderable = $orderable = [];
|
||||
|
||||
$sd = $this->get_subdefs();
|
||||
|
||||
@@ -92,7 +92,7 @@ class record_exportElement extends record_adapter
|
||||
|
||||
$subdefgroups = $this->app['phraseanet.appbox']->get_databox($sbas_id)->get_subdef_structure();
|
||||
|
||||
$subdefs = array();
|
||||
$subdefs = [];
|
||||
|
||||
foreach ($subdefgroups as $subdef_type => $subdefs_obj) {
|
||||
if ($subdef_type == $this->get_type()) {
|
||||
@@ -101,11 +101,11 @@ class record_exportElement extends record_adapter
|
||||
}
|
||||
}
|
||||
|
||||
$go_dl = array(
|
||||
$go_dl = [
|
||||
'document' => false,
|
||||
'preview' => false,
|
||||
'thumbnail' => true
|
||||
);
|
||||
];
|
||||
|
||||
if ($this->app['acl']->get($this->app['authentication']->getUser())->has_right_on_base($this->get_base_id(), 'candwnldhd')) {
|
||||
$go_dl['document'] = true;
|
||||
@@ -123,8 +123,8 @@ class record_exportElement extends record_adapter
|
||||
|
||||
$query = new User_Query($this->app);
|
||||
|
||||
$masters = $query->on_base_ids(array($this->base_id))
|
||||
->who_have_right(array('order_master'))
|
||||
$masters = $query->on_base_ids([$this->base_id])
|
||||
->who_have_right(['order_master'])
|
||||
->execute()->get_results();
|
||||
|
||||
$go_cmd = (count($masters) > 0 && $this->app['acl']->get($this->app['authentication']->getUser())->has_right_on_base($this->base_id, 'cancmd'));
|
||||
@@ -137,15 +137,15 @@ class record_exportElement extends record_adapter
|
||||
if ($this->app['acl']->get($this->app['authentication']->getUser())->is_restricted_download($this->base_id)) {
|
||||
$this->remain_hd --;
|
||||
if ($this->remain_hd >= 0)
|
||||
$downloadable['document'] = array(
|
||||
$downloadable['document'] = [
|
||||
'class' => 'document',
|
||||
'label' => _('document original')
|
||||
);
|
||||
];
|
||||
} else
|
||||
$downloadable['document'] = array(
|
||||
$downloadable['document'] = [
|
||||
'class' => 'document',
|
||||
'label' => _('document original')
|
||||
);
|
||||
];
|
||||
}
|
||||
if ($go_cmd === true) {
|
||||
$orderable['document'] = true;
|
||||
@@ -185,20 +185,20 @@ class record_exportElement extends record_adapter
|
||||
if ($this->app['acl']->get($this->app['authentication']->getUser())->is_restricted_download($this->base_id)) {
|
||||
$this->remain_hd --;
|
||||
if ($this->remain_hd >= 0)
|
||||
$downloadable[$name] = array(
|
||||
$downloadable[$name] = [
|
||||
'class' => $class,
|
||||
'label' => $subdef_label
|
||||
);
|
||||
];
|
||||
} else
|
||||
$downloadable[$name] = array(
|
||||
$downloadable[$name] = [
|
||||
'class' => $class,
|
||||
'label' => $subdef_label
|
||||
);
|
||||
];
|
||||
} else {
|
||||
$downloadable[$name] = array(
|
||||
$downloadable[$name] = [
|
||||
'class' => $class,
|
||||
'label' => $subdef_label
|
||||
);
|
||||
];
|
||||
}
|
||||
|
||||
$this->add_count($name, $sd[$name]->get_size());
|
||||
@@ -209,15 +209,15 @@ class record_exportElement extends record_adapter
|
||||
$xml = $this->get_caption()->serialize(caption_record::SERIALIZE_XML);
|
||||
|
||||
if ($xml) {
|
||||
$downloadable['caption'] = array(
|
||||
$downloadable['caption'] = [
|
||||
'class' => 'caption',
|
||||
'label' => _('caption XML')
|
||||
);
|
||||
];
|
||||
$this->add_count('caption', strlen($xml));
|
||||
$downloadable['caption-yaml'] = array(
|
||||
$downloadable['caption-yaml'] = [
|
||||
'class' => 'caption',
|
||||
'label' => _('caption YAML')
|
||||
);
|
||||
];
|
||||
$this->add_count('caption-yaml', strlen(strip_tags($xml)));
|
||||
}
|
||||
|
||||
@@ -236,7 +236,7 @@ class record_exportElement extends record_adapter
|
||||
private function add_count($name, $size)
|
||||
{
|
||||
if (! $this->size) {
|
||||
$objectsize = array();
|
||||
$objectsize = [];
|
||||
} else
|
||||
$objectsize = $this->size;
|
||||
|
||||
|
Reference in New Issue
Block a user