Merge branch '3.7'

This commit is contained in:
Romain Neutron
2012-12-17 15:30:05 +01:00
25 changed files with 269 additions and 161 deletions

View File

@@ -789,12 +789,15 @@ class Browser
protected function checkBrowserChrome()
{
if (stripos($this->_agent, 'Chrome') !== false) {
$aresult = explode('/', stristr($this->_agent, 'Chrome'));
$aversion = explode(' ', $aresult[1]);
$this->setVersion($aversion[0]);
$this->setBrowser(self::BROWSER_CHROME);
if (preg_match('/chrome\/([\.0-9]+) (mobile)?/i', $this->_agent, $matches)) {
$this->setVersion($matches[1]);
$this->setBrowser(self::BROWSER_CHROME);
if (isset($matches[2])) {
$this->setMobile(true);
}
return true;
return true;
}
}
return false;

View File

@@ -32,6 +32,7 @@ class User_Adapter implements User_Interface, cache_cacheableInterface
public static $locales = array(
'ar_SA' => 'العربية'
, 'de_DE' => 'Deutsch'
, 'nl_NL' => 'Dutch'
, 'en_GB' => 'English'
, 'es_ES' => 'Español'
, 'fr_FR' => 'Français'

View File

@@ -408,9 +408,9 @@ class appbox extends base
$upgrader->add_steps_complete(1);
if (version_compare($from_version, '3.1') < 0) {
$upgrader->addRecommendation(_('Your install requires data migration, please execute the following command'), 'bin/upgrader --from=3.1');
$upgrader->addRecommendation(_('Your install requires data migration, please execute the following command'), 'bin/setup system:upgrade-datas --from=3.1');
} elseif (version_compare($from_version, '3.5') < 0) {
$upgrader->addRecommendation(_('Your install requires data migration, please execute the following command'), 'bin/upgrader --from=3.5');
$upgrader->addRecommendation(_('Your install requires data migration, please execute the following command'), 'bin/setup system:upgrade-datas --from=3.5');
}
if (version_compare($from_version, '3.7') < 0) {

View File

@@ -304,7 +304,19 @@ class databox_subdef
*/
protected function buildAudioSubdef(SimpleXMLElement $sd)
{
return new Audio();
$audio = new Audio();
if ($sd->acodec) {
$audio->setOptionValue(Audio::OPTION_ACODEC, (string) $sd->acodec);
}
if ($sd->bitrate) {
$audio->setOptionValue(Audio::OPTION_BITRATE, (int) $sd->bitrate);
}
if ($sd->audiosamplerate) {
$audio->setOptionValue(Audio::OPTION_AUDIOSAMPLERATE, (int) $sd->audiosamplerate);
}
return $audio;
}
/**
@@ -363,6 +375,12 @@ class databox_subdef
if ($sd->bitrate) {
$video->setOptionValue(Video::OPTION_BITRATE, (int) $sd->bitrate);
}
if ($sd->audiosamplerate) {
$video->setOptionValue(Video::OPTION_AUDIOSAMPLERATE, (int) $sd->audiosamplerate);
}
if ($sd->GOPsize) {
$video->setOptionValue(Video::OPTION_GOPSIZE, (int) $sd->GOPsize);
}
return $video;
}

View File

@@ -12,6 +12,7 @@
use Alchemy\Phrasea\Application;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\HttpFoundation\ResponseHeaderBag;
use Symfony\Component\HttpFoundation\Response;
/**
*
@@ -406,8 +407,6 @@ class set_export extends set_abstract
$includeBusinessFields = !!$includeBusinessFields;
$unicode = new unicode();
$files = array();
$n_files = 0;
@@ -452,7 +451,7 @@ class set_export extends set_abstract
if ($rename_title) {
$title = strip_tags($download_element->get_title(null, null, true));
$files[$id]['export_name'] = $unicode->remove_nonazAZ09($title, true);
$files[$id]['export_name'] = $this->app['unicode']->remove_nonazAZ09($title, true);
$rename_done = true;
} else {
$files[$id]["export_name"] = $infos['filename'];
@@ -610,8 +609,8 @@ class set_export extends set_abstract
$file_names[] = mb_strtolower($name);
$files[$id]["export_name"] = $name;
$files[$id]["export_name"] = $unicode->remove_nonazAZ09($files[$id]["export_name"]);
$files[$id]["original_name"] = $unicode->remove_nonazAZ09($files[$id]["original_name"]);
$files[$id]["export_name"] = $this->app['unicode']->remove_nonazAZ09($files[$id]["export_name"]);
$files[$id]["original_name"] = $this->app['unicode']->remove_nonazAZ09($files[$id]["original_name"]);
$i = 0;
$name = utf8_decode($files[$id]["export_name"]);
@@ -712,8 +711,6 @@ class set_export extends set_abstract
random::updateToken($app, $token, serialize($list));
$unicode = new \unicode();
$toRemove = array();
foreach ($files as $record) {
@@ -726,7 +723,7 @@ class set_export extends set_abstract
. $obj["ajout"]
. '.' . $obj["exportExt"];
$name = $unicode->remove_diacritics($name);
$name = $app['unicode']->remove_diacritics($name);
$zip->addFile($path, $name);
@@ -744,7 +741,6 @@ class set_export extends set_abstract
$zip->close();
$list['complete'] = true;
$unicode = null;
random::updateToken($app, $token, serialize($list));
@@ -764,10 +760,10 @@ class set_export extends set_abstract
*/
public static function stream_file(\registry $registry, $file, $exportname, $mime, $disposition = 'inline')
{
$response = new Symfony\Component\HttpFoundation\Response();
$response = new Response();
$disposition = $disposition === 'attachment' ? ResponseHeaderBag::DISPOSITION_ATTACHMENT : ResponseHeaderBag::DISPOSITION_INLINE;
$headerDisposition = $response->headers->makeDisposition($disposition, $exportname);
$headerDisposition = $response->headers->makeDisposition($disposition, $exportname, $this->app['unicode']->remove_nonazAZ09($exportname));
if (is_file($file)) {
if ($registry->get('GV_modxsendfile')) {