mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-18 15:33:15 +00:00
Fix export caption
This commit is contained in:
@@ -93,7 +93,7 @@ class set_export extends set_abstract
|
|||||||
{
|
{
|
||||||
$record = new record_adapter($basrec[0], $basrec[1]);
|
$record = new record_adapter($basrec[0], $basrec[1]);
|
||||||
}
|
}
|
||||||
catch(Exception_Record_AdapterNotFound $e)
|
catch (Exception_Record_AdapterNotFound $e)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -407,7 +407,7 @@ class set_export extends set_abstract
|
|||||||
* @param boolean $rename_title
|
* @param boolean $rename_title
|
||||||
* @return Array
|
* @return Array
|
||||||
*/
|
*/
|
||||||
public function prepare_export(Array $subdefs, $rename_title=false)
|
public function prepare_export(Array $subdefs, $rename_title = false)
|
||||||
{
|
{
|
||||||
if (!is_array($subdefs))
|
if (!is_array($subdefs))
|
||||||
{
|
{
|
||||||
@@ -430,6 +430,7 @@ class set_export extends set_abstract
|
|||||||
|
|
||||||
foreach ($this->elements as $download_element)
|
foreach ($this->elements as $download_element)
|
||||||
{
|
{
|
||||||
|
echo "eleme";
|
||||||
$id = count($files);
|
$id = count($files);
|
||||||
|
|
||||||
$files[$id] = array(
|
$files[$id] = array(
|
||||||
@@ -486,10 +487,6 @@ class set_export extends set_abstract
|
|||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (!isset($sd[$name]))
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
set_time_limit(100);
|
set_time_limit(100);
|
||||||
$subdef_export = $subdef_alive = false;
|
$subdef_export = $subdef_alive = false;
|
||||||
@@ -685,7 +682,9 @@ class set_export extends set_abstract
|
|||||||
system_file::mkdir($caption_dir);
|
system_file::mkdir($caption_dir);
|
||||||
|
|
||||||
$desc = self::get_caption(
|
$desc = self::get_caption(
|
||||||
$download_element->get_base_id(), $download_element->get_record_id(), $session->get_ses_id()
|
$download_element->get_base_id()
|
||||||
|
, $download_element->get_record_id()
|
||||||
|
, $session->get_ses_id()
|
||||||
);
|
);
|
||||||
|
|
||||||
$file = $files[$id]["export_name"]
|
$file = $files[$id]["export_name"]
|
||||||
@@ -713,7 +712,11 @@ class set_export extends set_abstract
|
|||||||
|
|
||||||
|
|
||||||
$desc = self::get_caption(
|
$desc = self::get_caption(
|
||||||
$download_element->get_base_id(), $download_element->get_record_id(), $session->get_ses_id(), true, 'yaml'
|
$download_element->get_base_id()
|
||||||
|
, $download_element->get_record_id()
|
||||||
|
, $session->get_ses_id()
|
||||||
|
, true
|
||||||
|
, 'yaml'
|
||||||
);
|
);
|
||||||
|
|
||||||
$file = $files[$id]["export_name"]
|
$file = $files[$id]["export_name"]
|
||||||
@@ -732,6 +735,7 @@ class set_export extends set_abstract
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->list = array(
|
$this->list = array(
|
||||||
'files' => $files,
|
'files' => $files,
|
||||||
'names' => $file_names,
|
'names' => $file_names,
|
||||||
@@ -739,6 +743,7 @@ class set_export extends set_abstract
|
|||||||
'count' => $n_files
|
'count' => $n_files
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
return $this->list;
|
return $this->list;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -758,7 +763,6 @@ class set_export extends set_abstract
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (isset($list['complete']) && $list['complete'] === true)
|
if (isset($list['complete']) && $list['complete'] === true)
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
||||||
@@ -835,7 +839,7 @@ class set_export extends set_abstract
|
|||||||
* @param boolean $check_rights
|
* @param boolean $check_rights
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public static function get_caption($bas, $rec, $check_rights=true, $format = 'xml')
|
public static function get_caption($bas, $rec, $check_rights = true, $format = 'xml')
|
||||||
{
|
{
|
||||||
$dom = new DOMDocument();
|
$dom = new DOMDocument();
|
||||||
$dom->formatOutput = true;
|
$dom->formatOutput = true;
|
||||||
@@ -950,7 +954,7 @@ class set_export extends set_abstract
|
|||||||
* @return Void
|
* @return Void
|
||||||
*/
|
*/
|
||||||
public static function stream_file(
|
public static function stream_file(
|
||||||
$file, $exportname, $mime, $disposition='attachment')
|
$file, $exportname, $mime, $disposition = 'attachment')
|
||||||
{
|
{
|
||||||
require_once dirname(__FILE__) . "/../../../lib/vendor/Silex/autoload.php";
|
require_once dirname(__FILE__) . "/../../../lib/vendor/Silex/autoload.php";
|
||||||
$registry = registry::get_instance();
|
$registry = registry::get_instance();
|
||||||
@@ -999,7 +1003,7 @@ class set_export extends set_abstract
|
|||||||
* @todo : merge this shitty fix with Response object.
|
* @todo : merge this shitty fix with Response object.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
if(!headers_sent())
|
if (!headers_sent())
|
||||||
{
|
{
|
||||||
header("Pragma: public");
|
header("Pragma: public");
|
||||||
}
|
}
|
||||||
@@ -1024,7 +1028,7 @@ class set_export extends set_abstract
|
|||||||
* @param String $disposition
|
* @param String $disposition
|
||||||
* @return Void
|
* @return Void
|
||||||
*/
|
*/
|
||||||
public static function stream_data($data, $exportname, $mime, $disposition='attachment')
|
public static function stream_data($data, $exportname, $mime, $disposition = 'attachment')
|
||||||
{
|
{
|
||||||
|
|
||||||
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
|
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
|
||||||
|
Reference in New Issue
Block a user