Merge branch '3.6' of github.com:alchemy-fr/Phraseanet into 3.6

This commit is contained in:
Nicolas Le Goff
2012-02-07 12:01:45 +01:00
25 changed files with 3876 additions and 3895 deletions

View File

@@ -27,6 +27,8 @@ $finder
->name('.gitmodules')
->name('.gitignore')
->name('check_cs.php')
->name('launchpadToLocales.php')
->name('localesToLaunchpad.php')
->name('pom.xml')
->name('vendors.php')
->name('builder.php')

View File

@@ -45,6 +45,7 @@ $finder
->notName(basename(__FILE__))
->exclude('.git')
->exclude('vendor')
->exclude('Doctrine/Proxies')
;
$count = 0;

66
launchpadToLocales.php Executable file
View File

@@ -0,0 +1,66 @@
#!/usr/bin/env php
<?php
/*
* Upgrade current locale files to the latest launchpad version :
*
* You first need to download the latest launchpad version, untar the file, then
* launch this command with the name of the directory where the po files are as
* argument.
*
* @example ./launchpadToLocales.php phraseanet
*
* @see https://translations.launchpad.net/phraseanettranslation/trunk/+pots/phraseanettrunktemplate
*
*/
require_once __DIR__ . '/lib/Alchemy/Phrasea/Core.php';
use Symfony\Component\Finder\Finder;
\Alchemy\Phrasea\Core::initAutoloads();
if (!isset($argv[1]) || !is_dir(__DIR__ . '/' . $argv[1]))
{
echo "You need to specify a directory with the latest launchpad locales" . PHP_EOL;
exit(1);
}
chdir(__DIR__);
$finder = new Finder();
$finder
->files()
->name('phraseanet-*.po')
->in(
array(
__DIR__ . '/' . $argv[1],
)
)
;
$count = 0;
foreach ($finder as $file)
{
preg_match('/phraseanet-(.*)\.po/', $file->getFileName(), $matches);
$current_file = $file->getRealPath();
$locale = $matches[1];
$dest_file = __DIR__ . '/locale/' . $locale . '/LC_MESSAGES/phraseanet.po';
if (!file_exists($dest_file))
{
echo "Destination $dest_file does not exists" . PHP_EOL;
continue;
}
system(sprintf('cp %s %s', $current_file, $dest_file));
$count++;
}
echo "$count files upgraded" . PHP_EOL;
exit($count ? 1 : 0);

View File

@@ -365,7 +365,7 @@ class Core extends \Pimple
{
// require_once __DIR__ . '/../../vendor/symfony/src/Symfony/Component/ClassLoader/UniversalClassLoader.php';
require_once __DIR__ . '/Loader/Autoloader.php';
$loader = new Loader\Autoloader();
$loader->registerPrefixes(array('Twig' => realpath(__DIR__ . '/../../vendor/Twig/lib')));
@@ -384,7 +384,7 @@ class Core extends \Pimple
'Doctrine\\Logger' => realpath(__DIR__ . '/../../'),
'Monolog' => realpath(__DIR__ . '/../../vendor/Silex/vendor/monolog/src'),
));
$loader->register();
require_once __DIR__ . '/../../vendor/Silex/autoload.php';

View File

@@ -67,4 +67,4 @@ Class ApcAutoloader extends Autoloader implements CacheStrategy
spl_autoload_register(array($this, 'loadClass'), true, $prepend);
}
}
}

View File

@@ -42,4 +42,4 @@ class Autoloader extends UniversalClassLoader
return $file;
}
}
}

View File

@@ -55,4 +55,4 @@ class CacheAutoloader extends Autoloader
$this->cache->register($prepend);
}
}
}

View File

@@ -19,6 +19,6 @@ namespace Alchemy\Phrasea\Loader;
interface LoaderStrategy
{
public function isAvailable();
public function register();
}
}

View File

@@ -66,4 +66,4 @@ Class XcacheAutoloader extends Autoloader implements CacheStrategy
spl_autoload_register(array($this, 'loadClass'), true, $prepend);
}
}
}

View File

@@ -39,15 +39,15 @@ class bootstrap
{
return static::$core;
}
static::$core = new Core($env);
if (\setup::is_installed())
{
$gatekeeper = \gatekeeper::getInstance();
$gatekeeper->check_directory();
}
return static::$core;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

47
localesToLaunchPad.php Executable file
View File

@@ -0,0 +1,47 @@
#!/usr/bin/env php
<?php
/*
* Prepare the file to be uploaded on launchpad
*
* Fetch every translation at the root of ./locale, next to the main pot file
*
* @see https://translations.launchpad.net/phraseanettranslation/trunk/+pots/phraseanettrunktemplate
*
*/
require_once __DIR__ . '/lib/Alchemy/Phrasea/Core.php';
use Symfony\Component\Finder\Finder;
\Alchemy\Phrasea\Core::initAutoloads();
chdir(__DIR__);
$finder = new Finder();
$finder
->files()
->name('phraseanet.po')
->in(
array(
__DIR__ . '/locale',
)
)
;
$count = 0;
foreach ($finder as $file)
{
$cmd = sprintf(
'cp %s ./locale/phraseanet-%s.po'
, $file->getRealPath()
, basename(dirname(dirname($file->getRealPath())))
) . PHP_EOL;
system($cmd);
$count++;
}
echo "$count files copied" . PHP_EOL;
exit($count ? 1 : 0);

View File

@@ -159,8 +159,8 @@
<table style="border:none;width:100%" cellspacing="0" cellpadding="0">
<tr>
<td style="text-align:left;">
{% trans 'phraseanet:: language' %}
{% trans 'phraseanet:: language' %}
<select name="lng" id="lng-select" onchange="setLanguage();">
{% for code, language in core.getAvailableLanguages() %}
<option value="{{ code }}" {% if code == session.get_locale() %}selected="selected"{% endif %}>
@@ -168,7 +168,7 @@
</option>
{% endfor %}
</select>
</td>
<td style="text-align:right;"><span> &copy; Copyright Alchemy 2005-2010</span></td>
</tr>

View File

@@ -11,12 +11,12 @@
<script type="text/javascript">
$(document).ready(function(){
var $dialog = p4.Dialog.get(1);
var $dialogBox = $dialog.getDomElement();
$('input[name="lst"]', $dialogBox).val(p4.Results.Selection.serialize());
var buttons = $dialog.getOption('buttons');
buttons[language.create] = function(){$('form', $dialogBox).trigger('submit')};
$dialog.setOption('buttons', buttons);

View File

@@ -6,7 +6,7 @@
<option value="{{ collection.get_base_id() }}">{{ collection.get_databox().get_viewname() }} / {{ collection.get_name() }}</option>
{% endfor %}
</select>
<label>{% trans 'Story name' %}</label>
<input name="name" value="" type="text"/>
@@ -22,11 +22,11 @@
var $dialogBox = $dialog.getDomElement();
$('input[name="lst"]', $dialogBox).val(p4.Results.Selection.serialize());
var buttons = $dialog.getOption('buttons');
buttons[language.create] = function(){$('form', $dialogBox).trigger('submit')};
$dialog.setOption('buttons', buttons);
$('form', $dialogBox).bind('submit', function(event){
var $form = $(this);

View File

@@ -22,7 +22,7 @@ var p4 = p4 || {};
};
var phraseaDialog = function (options, level) {
c
var createDialog = function(level) {
var $dialog = $('#' + getId(level));