mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 15:03:25 +00:00
Remove phraseanet registry
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
"alchemy/google-plus-api-client" : "~0.6.2",
|
||||
"alchemy/geonames-api-consumer" : "~0.1.0",
|
||||
"guzzle/guzzle" : "~3.6",
|
||||
"igorw/get-in" : "dev-master",
|
||||
"imagine/imagine" : "0.6.x-dev@dev",
|
||||
"jms/serializer" : "~0.10",
|
||||
"justinrainbow/json-schema" : "~1.3",
|
||||
|
44
composer.lock
generated
44
composer.lock
generated
@@ -3,7 +3,7 @@
|
||||
"This file locks the dependencies of your project to a known state",
|
||||
"Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file"
|
||||
],
|
||||
"hash": "c8348e356ce79bc133510a11279d48c9",
|
||||
"hash": "2c0ef0f8f4568b105cf63028188d6b82",
|
||||
"packages": [
|
||||
{
|
||||
"name": "alchemy-fr/tcpdf-clone",
|
||||
@@ -1294,6 +1294,47 @@
|
||||
],
|
||||
"time": "2013-10-02 20:47:00"
|
||||
},
|
||||
{
|
||||
"name": "igorw/get-in",
|
||||
"version": "dev-master",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/igorw/get-in.git",
|
||||
"reference": "f265eb25569891e1888d7773c72a81c2f96c8982"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/igorw/get-in/zipball/f265eb25569891e1888d7773c72a81c2f96c8982",
|
||||
"reference": "f265eb25569891e1888d7773c72a81c2f96c8982",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.4"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"files": [
|
||||
"src/get_in.php"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Igor Wiedler",
|
||||
"email": "igor@wiedler.ch",
|
||||
"homepage": "http://wiedler.ch/igor/"
|
||||
}
|
||||
],
|
||||
"description": "Functions for for hash map (assoc array) traversal.",
|
||||
"keywords": [
|
||||
"assoc-array",
|
||||
"hash-map"
|
||||
],
|
||||
"time": "2013-12-16 23:26:47"
|
||||
},
|
||||
{
|
||||
"name": "imagine/imagine",
|
||||
"version": "dev-develop",
|
||||
@@ -4231,6 +4272,7 @@
|
||||
],
|
||||
"minimum-stability": "stable",
|
||||
"stability-flags": {
|
||||
"igorw/get-in": 20,
|
||||
"imagine/imagine": 20,
|
||||
"silex/silex": 20,
|
||||
"doctrine/migrations": 20,
|
||||
|
@@ -1,7 +1,9 @@
|
||||
servername: 'http://local.phrasea/'
|
||||
languages:
|
||||
available: []
|
||||
default: 'fr'
|
||||
main:
|
||||
servername: 'http://local.phrasea/'
|
||||
maintenance: false
|
||||
languages: []
|
||||
database:
|
||||
host: 127.0.0.1
|
||||
port: 3306
|
||||
@@ -26,25 +28,48 @@ main:
|
||||
search-engine:
|
||||
type: Alchemy\Phrasea\SearchEngine\Phrasea\PhraseaEngine
|
||||
options: []
|
||||
binaries:
|
||||
ghostscript_binary: null
|
||||
php_binary: null
|
||||
swf_extract_binary: null
|
||||
pdf2swf_binary: null
|
||||
swf_render_binary: null
|
||||
unoconv_binary: null
|
||||
ffmpeg_binary: null
|
||||
ffprobe_binary: null
|
||||
mp4box_binary: null
|
||||
pdftotext_binary: null
|
||||
recess_binary: null
|
||||
phraseanet_indexer: null
|
||||
ffmpeg_timeout: 3600
|
||||
ffprobe_timeout: 60
|
||||
gs_timeout: 60
|
||||
mp4box_timeout: 60
|
||||
swftools_timeout: 60
|
||||
unoconv_timeout: 60
|
||||
binaries:
|
||||
ghostscript_binary: null
|
||||
php_binary: null
|
||||
swf_extract_binary: null
|
||||
pdf2swf_binary: null
|
||||
swf_render_binary: null
|
||||
unoconv_binary: null
|
||||
ffmpeg_binary: null
|
||||
ffprobe_binary: null
|
||||
mp4box_binary: null
|
||||
pdftotext_binary: null
|
||||
recess_binary: null
|
||||
phraseanet_indexer: null
|
||||
ffmpeg_timeout: 3600
|
||||
ffprobe_timeout: 60
|
||||
gs_timeout: 60
|
||||
mp4box_timeout: 60
|
||||
swftools_timeout: 60
|
||||
unoconv_timeout: 60
|
||||
task-manager:
|
||||
status: started
|
||||
listener:
|
||||
protocol: tcp
|
||||
host: 127.0.0.1
|
||||
port: 6700
|
||||
storage:
|
||||
subdefs:
|
||||
default-dir: null
|
||||
bridge:
|
||||
youtube:
|
||||
enabled: false
|
||||
client_id: null
|
||||
client_secret: null
|
||||
developer_key: null
|
||||
flickr:
|
||||
enabled: false
|
||||
client_id: null
|
||||
client_secret: null
|
||||
dailymotion:
|
||||
enabled: false
|
||||
client_id: null
|
||||
client_secret: null
|
||||
border-manager:
|
||||
enabled: true
|
||||
checkers:
|
||||
@@ -127,12 +152,6 @@ registration-fields:
|
||||
-
|
||||
name: geonameid
|
||||
required: true
|
||||
task-manager:
|
||||
status: started
|
||||
listener:
|
||||
protocol: tcp
|
||||
host: 127.0.0.1
|
||||
port: 6700
|
||||
xsendfile:
|
||||
enabled: false
|
||||
type: nginx
|
||||
|
@@ -80,9 +80,9 @@ define('GV_autoselectDB', true);
|
||||
define('GV_autoregister', false);
|
||||
define('GV_validation_reminder', '2');
|
||||
define('GV_val_expiration', '10');
|
||||
define('GV_homeTitle', 'Phraseanet');
|
||||
define('GV_homeTitle', 'SuperPhraseanet');
|
||||
define('GV_metaKeywords', '');
|
||||
define('GV_metaDescription', '');
|
||||
define('GV_googleAnalytics', '');
|
||||
define('GV_allow_search_engine', true);
|
||||
define('GV_display_gcf', true);
|
||||
define('GV_display_gcf', true);
|
||||
|
@@ -105,8 +105,10 @@ use Alchemy\Phrasea\Core\Provider\SearchEngineServiceProvider;
|
||||
use Alchemy\Phrasea\Core\Provider\TasksServiceProvider;
|
||||
use Alchemy\Phrasea\Core\Provider\TemporaryFilesystemServiceProvider;
|
||||
use Alchemy\Phrasea\Core\Provider\TokensServiceProvider;
|
||||
use Alchemy\Phrasea\Core\Provider\TranslationServiceProvider;
|
||||
use Alchemy\Phrasea\Core\Provider\UnicodeServiceProvider;
|
||||
use Alchemy\Phrasea\Exception\InvalidArgumentException;
|
||||
use Alchemy\Phrasea\Form\Extension\HelpTypeExtension;
|
||||
use Alchemy\Phrasea\Twig\JSUniqueID;
|
||||
use Alchemy\Phrasea\Twig\Camelize;
|
||||
use Alchemy\Phrasea\Twig\BytesConverter;
|
||||
@@ -130,7 +132,6 @@ use Silex\Application\TranslationTrait;
|
||||
use Silex\Provider\FormServiceProvider;
|
||||
use Silex\Provider\MonologServiceProvider;
|
||||
use Silex\Provider\SessionServiceProvider;
|
||||
use Alchemy\Phrasea\Core\Provider\TranslationServiceProvider;
|
||||
use Silex\Provider\TwigServiceProvider;
|
||||
use Silex\Provider\SwiftmailerServiceProvider;
|
||||
use Silex\Provider\UrlGeneratorServiceProvider;
|
||||
@@ -225,7 +226,7 @@ class Application extends SilexApplication
|
||||
$this->register(new FtpServiceProvider());
|
||||
$this->register(new GeonamesServiceProvider());
|
||||
$this['geonames.server-uri'] = $this->share(function (Application $app) {
|
||||
return $app['phraseanet.registry']->get('GV_i18n_service', 'https://geonames.alchemyasp.com/');
|
||||
return $app['conf']->get(['registry', 'webservices', 'geonames-server'], 'http://geonames.alchemyasp.com/');
|
||||
});
|
||||
|
||||
$this->register(new MediaAlchemystServiceProvider());
|
||||
@@ -253,9 +254,9 @@ class Application extends SilexApplication
|
||||
}
|
||||
}
|
||||
|
||||
$imagineDriver = $app['phraseanet.registry']->get('GV_imagine_driver');
|
||||
$imagineDriver = $app['conf']->get(['registry', 'executables', 'imagine-driver']);
|
||||
|
||||
$configuration['ffmpeg.threads'] = $app['phraseanet.registry']->get('GV_ffmpeg_threads');
|
||||
$configuration['ffmpeg.threads'] = $app['conf']->get(['registry', 'executables', 'ffmpeg-threads']);
|
||||
$configuration['imagine.driver'] = $imagineDriver ?: null;
|
||||
|
||||
return $configuration;
|
||||
@@ -281,13 +282,13 @@ class Application extends SilexApplication
|
||||
$this->register(new ReCaptchaServiceProvider());
|
||||
|
||||
$this['recaptcha.public-key'] = $this->share(function (Application $app) {
|
||||
if ($app['phraseanet.registry']->get('GV_captchas')) {
|
||||
return $app['phraseanet.registry']->get('GV_captcha_public_key');
|
||||
if ($app['conf']->get(['registry', 'webservices', 'captcha-enabled'])) {
|
||||
return $app['conf']->get(['registry', 'webservices', 'recaptcha-public-key']);
|
||||
}
|
||||
});
|
||||
$this['recaptcha.private-key'] = $this->share(function (Application $app) {
|
||||
if ($app['phraseanet.registry']->get('GV_captchas')) {
|
||||
return $app['phraseanet.registry']->get('GV_captcha_private_key');
|
||||
if ($app['conf']->get(['registry', 'webservices', 'captcha-enabled'])) {
|
||||
return $app['conf']->get(['registry', 'webservices', 'recaptcha-private-key']);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -329,6 +330,12 @@ class Application extends SilexApplication
|
||||
|
||||
$this->register(new FormServiceProvider());
|
||||
|
||||
$this['form.type.extensions'] = $this->share($this->extend('form.type.extensions', function ($extensions) {
|
||||
$extensions[] = new HelpTypeExtension();
|
||||
|
||||
return $extensions;
|
||||
}));
|
||||
|
||||
$this->setupTwig();
|
||||
$this->register(new UnoconvServiceProvider());
|
||||
$this->register(new UrlGeneratorServiceProvider());
|
||||
@@ -348,7 +355,7 @@ class Application extends SilexApplication
|
||||
});
|
||||
|
||||
$this['swiftmailer.transport'] = $this->share(function ($app) {
|
||||
if ($app['phraseanet.registry']->get('GV_smtp')) {
|
||||
if ($app['conf']->get(['registry', 'email', 'smtp-enabled'])) {
|
||||
$transport = new \Swift_Transport_EsmtpTransport(
|
||||
$app['swiftmailer.transport.buffer'],
|
||||
[$app['swiftmailer.transport.authhandler']],
|
||||
@@ -357,15 +364,15 @@ class Application extends SilexApplication
|
||||
|
||||
$encryption = null;
|
||||
|
||||
if (in_array($app['phraseanet.registry']->get('GV_smtp_secure'), ['ssl', 'tls'])) {
|
||||
$encryption = $app['phraseanet.registry']->get('GV_smtp_secure');
|
||||
if (in_array($app['conf']->get(['registry', 'email', 'smtp-secure-mode']), ['ssl', 'tls'])) {
|
||||
$encryption = $app['conf']->get(['registry', 'email', 'smtp-secure-mode']);
|
||||
}
|
||||
|
||||
$options = $app['swiftmailer.options'] = array_replace([
|
||||
'host' => $app['phraseanet.registry']->get('GV_smtp_host'),
|
||||
'port' => $app['phraseanet.registry']->get('GV_smtp_port'),
|
||||
'username' => $app['phraseanet.registry']->get('GV_smtp_user'),
|
||||
'password' => $app['phraseanet.registry']->get('GV_smtp_password'),
|
||||
'host' => $app['conf']->get(['registry', 'email', 'smtp-host']),
|
||||
'port' => $app['conf']->get(['registry', 'email', 'smtp-port']),
|
||||
'username' => $app['conf']->get(['registry', 'email', 'smtp-user']),
|
||||
'password' => $app['conf']->get(['registry', 'email', 'smtp-password']),
|
||||
'encryption' => $encryption,
|
||||
'auth_mode' => null,
|
||||
], $app['swiftmailer.options']);
|
||||
@@ -375,7 +382,7 @@ class Application extends SilexApplication
|
||||
// tls or ssl
|
||||
$transport->setEncryption($options['encryption']);
|
||||
|
||||
if ($app['phraseanet.registry']->get('GV_smtp_auth')) {
|
||||
if ($app['conf']->get(['registry', 'email', 'smtp-auth-enabled'])) {
|
||||
$transport->setUsername($options['username']);
|
||||
$transport->setPassword($options['password']);
|
||||
$transport->setAuthMode($options['auth_mode']);
|
||||
@@ -391,8 +398,8 @@ class Application extends SilexApplication
|
||||
});
|
||||
|
||||
$this['imagine.factory'] = $this->share(function (Application $app) {
|
||||
if ($app['phraseanet.registry']->get('GV_imagine_driver') != '') {
|
||||
return $app['phraseanet.registry']->get('GV_imagine_driver');
|
||||
if ($app['conf']->get(['registry', 'executables', 'imagine-driver']) != '') {
|
||||
return $app['conf']->get(['registry', 'executables', 'imagine-driver']);
|
||||
}
|
||||
if (class_exists('\Gmagick')) {
|
||||
return 'gmagick';
|
||||
@@ -422,8 +429,8 @@ class Application extends SilexApplication
|
||||
|
||||
$this['xpdf.pdftotext'] = $this->share(
|
||||
$this->extend('xpdf.pdftotext', function (PdfToText $pdftotext, Application $app) {
|
||||
if ($app['phraseanet.registry']->get('GV_pdfmaxpages')) {
|
||||
$pdftotext->setPageQuantity($app['phraseanet.registry']->get('GV_pdfmaxpages'));
|
||||
if ($app['conf']->get(['registry', 'executables', 'pdf-max-pages'])) {
|
||||
$pdftotext->setPageQuantity($app['conf']->get(['registry', 'executables', 'pdf-max-pages']));
|
||||
}
|
||||
|
||||
return $pdftotext;
|
||||
@@ -729,7 +736,7 @@ class Application extends SilexApplication
|
||||
*/
|
||||
public function requireCaptcha()
|
||||
{
|
||||
if ($this['phraseanet.registry']->get('GV_captchas')) {
|
||||
if ($this['conf']->get(['registry', 'webservices', 'captcha-enabled'])) {
|
||||
$this['session']->set('require_captcha', true);
|
||||
}
|
||||
|
||||
|
@@ -40,9 +40,9 @@ return call_user_func(function ($environment = PhraseaApplication::ENV_PROD) {
|
||||
$result = new \API_V1_result($app, $request, $apiAdapter);
|
||||
|
||||
return $result->set_datas([
|
||||
'name' => $app['phraseanet.registry']->get('GV_homeTitle'),
|
||||
'name' => $app['conf']->get(['registry', 'general', 'title']),
|
||||
'type' => 'phraseanet',
|
||||
'description' => $app['phraseanet.registry']->get('GV_metaDescription'),
|
||||
'description' => $app['conf']->get(['registry', 'general', 'description']),
|
||||
'documentation' => 'https://docs.phraseanet.com/Devel',
|
||||
'versions' => [
|
||||
'1' => [
|
||||
|
@@ -0,0 +1,178 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2013 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Alchemy\Phrasea\Command\Developer\Utils;
|
||||
|
||||
use JMS\TranslationBundle\Exception\RuntimeException;
|
||||
use JMS\TranslationBundle\Model\FileSource;
|
||||
use JMS\TranslationBundle\Model\Message;
|
||||
use JMS\TranslationBundle\Annotation\Meaning;
|
||||
use JMS\TranslationBundle\Annotation\Desc;
|
||||
use JMS\TranslationBundle\Annotation\Ignore;
|
||||
use Doctrine\Common\Annotations\DocParser;
|
||||
use JMS\TranslationBundle\Model\MessageCatalogue;
|
||||
use JMS\TranslationBundle\Translation\Extractor\FileVisitorInterface;
|
||||
use JMS\TranslationBundle\Logger\LoggerAwareInterface;
|
||||
use Symfony\Component\HttpKernel\Log\LoggerInterface;
|
||||
|
||||
class HelpMessageExtractor implements FileVisitorInterface, \PHPParser_NodeVisitor
|
||||
{
|
||||
private $docParser;
|
||||
private $traverser;
|
||||
private $file;
|
||||
private $catalogue;
|
||||
private $logger;
|
||||
private $defaultDomain;
|
||||
private $defaultDomainMessages;
|
||||
|
||||
public function __construct(DocParser $docParser)
|
||||
{
|
||||
$this->docParser = $docParser;
|
||||
|
||||
$this->traverser = new \PHPParser_NodeTraverser();
|
||||
$this->traverser->addVisitor($this);
|
||||
}
|
||||
|
||||
|
||||
public function enterNode(\PHPParser_Node $node)
|
||||
{
|
||||
if ($node instanceof \PHPParser_Node_Stmt_Class) {
|
||||
$this->defaultDomain = null;
|
||||
$this->defaultDomainMessages = [];
|
||||
}
|
||||
|
||||
if ($node instanceof \PHPParser_Node_Expr_Array) {
|
||||
// first check if a translation_domain is set for this field
|
||||
$domain = null;
|
||||
foreach ($node->items as $item) {
|
||||
if (!$item->key instanceof \PHPParser_Node_Scalar_String) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ('translation_domain' === $item->key->value) {
|
||||
if (!$item->value instanceof \PHPParser_Node_Scalar_String) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$domain = $item->value->value;
|
||||
}
|
||||
}
|
||||
|
||||
// look for options containing a message
|
||||
foreach ($node->items as $item) {
|
||||
if (!$item->key instanceof \PHPParser_Node_Scalar_String) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ('help_message' !== $item->key->value) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$this->parseItem($item, $domain);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function parseItem($item, $domain = null)
|
||||
{
|
||||
// get doc comment
|
||||
$ignore = false;
|
||||
$desc = $meaning = null;
|
||||
$docComment = $item->key->getDocComment();
|
||||
$docComment = $docComment ? $docComment : $item->value->getDocComment();
|
||||
if ($docComment) {
|
||||
foreach ($this->docParser->parse($docComment, 'file '.$this->file.' near line '.$item->value->getLine()) as $annot) {
|
||||
if ($annot instanceof Ignore) {
|
||||
$ignore = true;
|
||||
} else if ($annot instanceof Desc) {
|
||||
$desc = $annot->text;
|
||||
} else if ($annot instanceof Meaning) {
|
||||
$meaning = $annot->text;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!$item->value instanceof \PHPParser_Node_Scalar_String) {
|
||||
if ($ignore) {
|
||||
return;
|
||||
}
|
||||
|
||||
$message = sprintf('Unable to extract translation id for form label from non-string values, but got "%s" in %s on line %d. Please refactor your code to pass a string, or add "/** @Ignore */".', get_class($item->value), $this->file, $item->value->getLine());
|
||||
if ($this->logger) {
|
||||
$this->logger->err($message);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
throw new RuntimeException($message);
|
||||
}
|
||||
|
||||
$source = new FileSource((string) $this->file, $item->value->getLine());
|
||||
$id = $item->value->value;
|
||||
|
||||
if (null === $domain) {
|
||||
$this->defaultDomainMessages[] = [
|
||||
'id' => $id,
|
||||
'source' => $source,
|
||||
'desc' => $desc,
|
||||
'meaning' => $meaning
|
||||
];
|
||||
} else {
|
||||
$this->addToCatalogue($id, $source, $domain, $desc, $meaning);
|
||||
}
|
||||
}
|
||||
|
||||
private function addToCatalogue($id, $source, $domain = null, $desc = null, $meaning = null)
|
||||
{
|
||||
if (null === $domain) {
|
||||
$message = new Message($id);
|
||||
} else {
|
||||
$message = new Message($id, $domain);
|
||||
}
|
||||
|
||||
$message->addSource($source);
|
||||
|
||||
if ($desc) {
|
||||
$message->setDesc($desc);
|
||||
}
|
||||
|
||||
if ($meaning) {
|
||||
$message->setMeaning($meaning);
|
||||
}
|
||||
|
||||
$this->catalogue->add($message);
|
||||
}
|
||||
|
||||
public function visitPhpFile(\SplFileInfo $file, MessageCatalogue $catalogue, array $ast)
|
||||
{
|
||||
$this->file = $file;
|
||||
$this->catalogue = $catalogue;
|
||||
$this->traverser->traverse($ast);
|
||||
|
||||
if ($this->defaultDomainMessages) {
|
||||
foreach ($this->defaultDomainMessages as $message) {
|
||||
$this->addToCatalogue($message['id'], $message['source'], $this->defaultDomain, $message['desc'], $message['meaning']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function leaveNode(\PHPParser_Node $node) { }
|
||||
|
||||
public function beforeTraverse(array $nodes) { }
|
||||
public function afterTraverse(array $nodes) { }
|
||||
public function visitFile(\SplFileInfo $file, MessageCatalogue $catalogue) { }
|
||||
public function visitTwigFile(\SplFileInfo $file, MessageCatalogue $catalogue, \Twig_Node $ast) { }
|
||||
|
||||
public function setLogger(LoggerInterface $logger)
|
||||
{
|
||||
$this->logger = $logger;
|
||||
}
|
||||
}
|
@@ -168,7 +168,7 @@ class Databoxes implements ControllerProviderInterface
|
||||
}
|
||||
|
||||
try {
|
||||
$base = \databox::create($app, $connbas, $dataTemplate, $app['phraseanet.registry']);
|
||||
$base = \databox::create($app, $connbas, $dataTemplate);
|
||||
$base->registerAdmin($app['authentication']->getUser());
|
||||
$app['acl']->get($app['authentication']->getUser())->delete_data_from_cache();
|
||||
|
||||
@@ -190,7 +190,7 @@ class Databoxes implements ControllerProviderInterface
|
||||
$data_template = new \SplFileInfo($app['root.path'] . '/lib/conf.d/data_templates/' . $dataTemplate . '.xml');
|
||||
$connbas = new \connection_pdo('databox_creation', $hostname, $port, $userDb, $passwordDb, $dbName, [], $app['debug']);
|
||||
try {
|
||||
$base = \databox::create($app, $connbas, $data_template, $app['phraseanet.registry']);
|
||||
$base = \databox::create($app, $connbas, $data_template);
|
||||
$base->registerAdmin($app['authentication']->getUser());
|
||||
|
||||
return $app->redirectPath('admin_database', ['databox_id' => $base->get_sbas_id(), 'success' => 1, 'reload-tree' => 1]);
|
||||
@@ -230,7 +230,7 @@ class Databoxes implements ControllerProviderInterface
|
||||
$password = $connexion['password'];
|
||||
|
||||
$app['phraseanet.appbox']->get_connection()->beginTransaction();
|
||||
$base = \databox::mount($app, $hostname, $port, $user, $password, $dbName, $app['phraseanet.registry']);
|
||||
$base = \databox::mount($app, $hostname, $port, $user, $password, $dbName);
|
||||
$base->registerAdmin($app['authentication']->getUser());
|
||||
$app['phraseanet.appbox']->get_connection()->commit();
|
||||
|
||||
@@ -251,7 +251,7 @@ class Databoxes implements ControllerProviderInterface
|
||||
|
||||
try {
|
||||
$app['phraseanet.appbox']->get_connection()->beginTransaction();
|
||||
$base = \databox::mount($app, $hostname, $port, $userDb, $passwordDb, $dbName, $app['phraseanet.registry']);
|
||||
$base = \databox::mount($app, $hostname, $port, $userDb, $passwordDb, $dbName);
|
||||
$base->registerAdmin($app['authentication']->getUser());
|
||||
$app['phraseanet.appbox']->get_connection()->commit();
|
||||
|
||||
|
@@ -14,9 +14,7 @@ namespace Alchemy\Phrasea\Controller\Admin;
|
||||
use Alchemy\Phrasea\Application;
|
||||
use Silex\Application as SilexApplication;
|
||||
use Silex\ControllerProviderInterface;
|
||||
use Symfony\Component\HttpFoundation\RedirectResponse;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
|
||||
class Setup implements ControllerProviderInterface
|
||||
{
|
||||
@@ -30,58 +28,28 @@ class Setup implements ControllerProviderInterface
|
||||
$app['firewall']->requireAdmin();
|
||||
});
|
||||
|
||||
$controllers->get('/', 'controller.admin.setup:getGlobals')
|
||||
->bind('setup_display_globals');
|
||||
|
||||
$controllers->post('/', 'controller.admin.setup:postGlobals')
|
||||
->bind('setup_submit_globals');
|
||||
$controllers->match('/', 'controller.admin.setup:getGlobals')
|
||||
->bind('setup_display_globals')
|
||||
->method('GET|POST');
|
||||
|
||||
return $controllers;
|
||||
}
|
||||
|
||||
/**
|
||||
* Display global values
|
||||
*
|
||||
* @param Application $app
|
||||
* @param Request $request
|
||||
* @return Response
|
||||
*/
|
||||
public function getGlobals(Application $app, Request $request)
|
||||
{
|
||||
$GV = require_once __DIR__ . "/../../../../conf.d/_GV_template.inc";
|
||||
$form = $app['registry.manipulator']->createForm($app['conf']);
|
||||
|
||||
if (null !== $update = $request->query->get('update')) {
|
||||
if (!!$update) {
|
||||
$update = $app->trans('Update succeed');
|
||||
} else {
|
||||
$update = $app->trans('Update failed');
|
||||
if ('POST' === $request->getMethod()) {
|
||||
$form->bind($request);
|
||||
if ($form->isValid()) {
|
||||
$app['conf']->set('registry', $app['registry.manipulator']->getRegistryData($form));
|
||||
|
||||
return $app->redirectPath('setup_display_globals');
|
||||
}
|
||||
}
|
||||
|
||||
return $app['twig']->render('admin/setup.html.twig', [
|
||||
'GV' => $GV,
|
||||
'update_post_datas' => $update,
|
||||
'listTimeZone' => \DateTimeZone::listAbbreviations()
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Submit global values
|
||||
*
|
||||
* @param Application $app
|
||||
* @param Request $request
|
||||
* @return RedirectResponse
|
||||
*/
|
||||
public function postGlobals(Application $app, Request $request)
|
||||
{
|
||||
if (\setup::create_global_values($app, $request->request->all())) {
|
||||
return $app->redirectPath('setup_display_globals', [
|
||||
'success' => 1
|
||||
]);
|
||||
}
|
||||
|
||||
return $app->redirectPath('setup_display_globals', [
|
||||
'success' => 0
|
||||
'form' => $form->createView(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
@@ -67,12 +67,12 @@ class V1 implements ControllerProviderInterface
|
||||
/* @var $oAuth2App \API_OAuth2_Application */
|
||||
|
||||
if ($oAuth2App->get_client_id() == \API_OAuth2_Application_Navigator::CLIENT_ID
|
||||
&& !$app['phraseanet.registry']->get('GV_client_navigator')) {
|
||||
&& !$app['conf']->get(['registry', 'api-clients', 'navigator-enabled'])) {
|
||||
throw new \API_V1_exception_forbidden('The use of phraseanet Navigator is not allowed');
|
||||
}
|
||||
|
||||
if ($oAuth2App->get_client_id() == \API_OAuth2_Application_OfficePlugin::CLIENT_ID
|
||||
&& ! $app['phraseanet.registry']->get('GV_client_officeplugin')) {
|
||||
&& ! $app['conf']->get(['registry', 'api-clients', 'office-enabled'])) {
|
||||
throw new \API_V1_exception_forbidden('The use of Office Plugin is not allowed.');
|
||||
}
|
||||
|
||||
|
@@ -215,7 +215,7 @@ class Root implements ControllerProviderInterface
|
||||
$out['chuNameEmpty'] = $app->trans('paniers:: Quel nom souhaitez vous donner a votre panier ?');
|
||||
$out['noDLok'] = $app->trans('export:: aucun document n\'est disponible au telechargement');
|
||||
$out['confirmRedirectAuth'] = $app->trans('invite:: Redirection vers la zone d\'authentification, cliquez sur OK pour continuer ou annulez');
|
||||
$out['serverName'] = $app['phraseanet.registry']->get('GV_ServerName');
|
||||
$out['serverName'] = $app['conf']->get('servername');
|
||||
$out['serverError'] = $app->trans('phraseanet::erreur: Une erreur est survenue, si ce probleme persiste, contactez le support technique');
|
||||
$out['serverTimeout'] = $app->trans('phraseanet::erreur: La connection au serveur Phraseanet semble etre indisponible');
|
||||
$out['serverDisconnected'] = $app->trans('phraseanet::erreur: Votre session est fermee, veuillez vous re-authentifier');
|
||||
@@ -245,9 +245,9 @@ class Root implements ControllerProviderInterface
|
||||
}
|
||||
$renderTopics = '';
|
||||
|
||||
if ($app['phraseanet.registry']->get('GV_client_render_topics') == 'popups') {
|
||||
if ($app['conf']->get(['registry', 'classic', 'render-topics']) == 'popups') {
|
||||
$renderTopics = \queries::dropdown_topics($app['translator'], $app['locale']);
|
||||
} elseif ($app['phraseanet.registry']->get('GV_client_render_topics') == 'tree') {
|
||||
} elseif ($app['conf']->get(['registry', 'classic', 'render-topics']) == 'tree') {
|
||||
$renderTopics = \queries::tree_topics($app['locale']);
|
||||
}
|
||||
|
||||
@@ -322,9 +322,9 @@ class Root implements ControllerProviderInterface
|
||||
private function getTabSetup(Application $app)
|
||||
{
|
||||
$tong = [
|
||||
$app['phraseanet.registry']->get('GV_ong_search') => 1,
|
||||
$app['phraseanet.registry']->get('GV_ong_advsearch') => 2,
|
||||
$app['phraseanet.registry']->get('GV_ong_topics') => 3
|
||||
$app['conf']->get(['registry', 'classic', 'search-tab']) => 1,
|
||||
$app['conf']->get(['registry', 'classic', 'adv-search-tab']) => 2,
|
||||
$app['conf']->get(['registry', 'classic', 'topics-tab']) => 3
|
||||
];
|
||||
|
||||
unset($tong[0]);
|
||||
@@ -459,7 +459,7 @@ class Root implements ControllerProviderInterface
|
||||
$queryParameters["opAdv"] = [];
|
||||
$queryParameters["status"] = [];
|
||||
$queryParameters["recordtype"] = SearchEngineOptions::TYPE_ALL;
|
||||
$queryParameters["sort"] = $app['phraseanet.registry']->get('GV_phrasea_sort', '');
|
||||
$queryParameters["sort"] = '';
|
||||
$queryParameters["infield"] = [];
|
||||
$queryParameters["ord"] = SearchEngineOptions::SORT_MODE_DESC;
|
||||
|
||||
|
@@ -71,8 +71,8 @@ class Export implements ControllerProviderInterface
|
||||
'download' => $download,
|
||||
'ssttid' => $request->request->get('ssel'),
|
||||
'lst' => $download->serialize_list(),
|
||||
'default_export_title' => $app['phraseanet.registry']->get('GV_default_export_title'),
|
||||
'choose_export_title' => $app['phraseanet.registry']->get('GV_choose_export_title')
|
||||
'default_export_title' => $app['conf']->get(['registry', 'actions', 'default-export-title']),
|
||||
'choose_export_title' => $app['conf']->get(['registry', 'actions', 'export-title-choice'])
|
||||
]));
|
||||
}
|
||||
|
||||
|
@@ -28,7 +28,7 @@ class Language implements ControllerProviderInterface
|
||||
$out['thesaurusBasesChanged'] = $app->trans('prod::recherche: Attention : la liste des bases selectionnees pour la recherche a ete changee.');
|
||||
$out['confirmDel'] = $app->trans('paniers::Vous etes sur le point de supprimer ce panier. Cette action est irreversible. Souhaitez-vous continuer ?');
|
||||
$out['serverError'] = $app->trans('phraseanet::erreur: Une erreur est survenue, si ce probleme persiste, contactez le support technique');
|
||||
$out['serverName'] = $app['phraseanet.registry']->get('GV_ServerName');
|
||||
$out['serverName'] = $app['conf']->get('servername');
|
||||
$out['serverTimeout'] = $app->trans('phraseanet::erreur: La connection au serveur Phraseanet semble etre indisponible');
|
||||
$out['serverDisconnected'] = $app->trans('phraseanet::erreur: Votre session est fermee, veuillez vous re-authentifier');
|
||||
$out['hideMessage'] = $app->trans('phraseanet::Ne plus afficher ce message');
|
||||
|
@@ -76,9 +76,9 @@ class Root implements ControllerProviderInterface
|
||||
|
||||
$queries_topics = '';
|
||||
|
||||
if ($app['phraseanet.registry']->get('GV_client_render_topics') == 'popups') {
|
||||
if ($app['conf']->get(['registry', 'classic', 'render-topics']) == 'popups') {
|
||||
$queries_topics = \queries::dropdown_topics($app['translator'], $app['locale']);
|
||||
} elseif ($app['phraseanet.registry']->get('GV_client_render_topics') == 'tree') {
|
||||
} elseif ($app['conf']->get(['registry', 'classic', 'render-topics']) == 'tree') {
|
||||
$queries_topics = \queries::tree_topics($app['locale']);
|
||||
}
|
||||
|
||||
@@ -107,14 +107,14 @@ class Root implements ControllerProviderInterface
|
||||
'cssfile' => $cssfile,
|
||||
'module' => 'prod',
|
||||
'events' => $app['events-manager'],
|
||||
'GV_defaultQuery_type' => $app['phraseanet.registry']->get('GV_defaultQuery_type'),
|
||||
'GV_multiAndReport' => $app['phraseanet.registry']->get('GV_multiAndReport'),
|
||||
'GV_thesaurus' => $app['phraseanet.registry']->get('GV_thesaurus'),
|
||||
'GV_defaultQuery_type' => $app['conf']->get(['registry', 'searchengine', 'default-query-type']),
|
||||
'GV_multiAndReport' => $app['conf']->get(['registry', 'modules', 'stories']),
|
||||
'GV_thesaurus' => $app['conf']->get(['registry', 'modules', 'thesaurus']),
|
||||
'cgus_agreement' => \databox_cgu::askAgreement($app),
|
||||
'css' => $css,
|
||||
'feeds' => $feeds,
|
||||
'aggregate' => $aggregate,
|
||||
'GV_google_api' => $app['phraseanet.registry']->get('GV_google_api'),
|
||||
'GV_google_api' => $app['conf']->get(['registry', 'webservices', 'google-charts-enabled']),
|
||||
'queries_topics' => $queries_topics,
|
||||
'search_status' => \databox_status::getSearchStatus($app),
|
||||
'queries_history' => \queries::history($app, $app['authentication']->getUser()->get_id()),
|
||||
|
@@ -763,7 +763,7 @@ class Activity implements ControllerProviderInterface
|
||||
*/
|
||||
private function doReport(Application $app, Request $request, \module_report $report, $conf, $what = false)
|
||||
{
|
||||
if ($app['phraseanet.registry']->get('GV_anonymousReport') == true) {
|
||||
if ($app['conf']->get(['registry', 'modules', 'anonymous-report'])) {
|
||||
if (isset($conf['user'])) {
|
||||
unset($conf['user']);
|
||||
}
|
||||
|
@@ -93,7 +93,7 @@ class Informations implements ControllerProviderInterface
|
||||
$app->abort(400);
|
||||
}
|
||||
|
||||
if ('' !== $on && $app['phraseanet.registry']->get('GV_anonymousReport') == true) {
|
||||
if ('' !== $on && $app['conf']->get(['registry', 'modules', 'anonymous-report']) == true) {
|
||||
$conf['conf'] = [
|
||||
$on => [$on, 0, 0, 0, 0],
|
||||
'nb' => [$app->trans('report:: nombre'), 0, 0, 0, 0]
|
||||
@@ -220,7 +220,7 @@ class Informations implements ControllerProviderInterface
|
||||
$on
|
||||
);
|
||||
|
||||
if (false == $app['phraseanet.registry']->get('GV_anonymousReport')) {
|
||||
if (false == $app['conf']->get(['registry', 'modules', 'anonymous-report'])) {
|
||||
$html_info = $app['twig']->render('report/ajax_data_content.html.twig', [
|
||||
'result' => isset($infoArray['report']) ? $infoArray['report'] : $infoArray,
|
||||
'is_infouser' => false,
|
||||
@@ -456,7 +456,7 @@ class Informations implements ControllerProviderInterface
|
||||
]);
|
||||
}
|
||||
|
||||
if ($app['phraseanet.registry']->get('GV_anonymousReport') == false && $from !== 'DOC' && $from !== 'DASH' && $from !== 'GEN' && $from !== 'PUSHDOC') {
|
||||
if ($app['conf']->get(['registry', 'modules', 'anonymous-report']) == false && $from !== 'DOC' && $from !== 'DASH' && $from !== 'GEN' && $from !== 'PUSHDOC') {
|
||||
$conf = [
|
||||
'identifiant' => [$app->trans('report:: identifiant'), 0, 0, 0, 0],
|
||||
'nom' => [$app->trans('report:: nom'), 0, 0, 0, 0],
|
||||
|
@@ -77,11 +77,11 @@ class Root implements ControllerProviderInterface
|
||||
return $app['twig']->render('report/report_layout_child.html.twig', [
|
||||
'ajax_dash' => true,
|
||||
'dashboard' => $dashboard,
|
||||
'home_title' => $app['phraseanet.registry']->get('GV_homeTitle'),
|
||||
'home_title' => $app['conf']->get(['registry', 'general', 'title']),
|
||||
'module' => 'report',
|
||||
'module_name' => 'Report',
|
||||
'anonymous' => $app['phraseanet.registry']->get('GV_anonymousReport'),
|
||||
'g_anal' => $app['phraseanet.registry']->get('GV_googleAnalytics'),
|
||||
'anonymous' => $app['conf']->get(['registry', 'modules', 'anonymous-report']),
|
||||
'g_anal' => $app['conf']->get(['registry', 'general', 'analytics']),
|
||||
'ajax' => false,
|
||||
'ajax_chart' => false
|
||||
]);
|
||||
@@ -144,7 +144,7 @@ class Root implements ControllerProviderInterface
|
||||
|
||||
return $app['twig']->render('report/ajax_report_content.html.twig', [
|
||||
'selection' => $selection,
|
||||
'anonymous' => $app['phraseanet.registry']->get('GV_anonymousReport'),
|
||||
'anonymous' => $app['conf']->get(['registry', 'modules', 'anonymous-report']),
|
||||
'ajax' => true,
|
||||
'dmin' => $dmin->format('Y-m-d H:i:s'),
|
||||
'dmax' => $dmax->format('Y-m-d H:i:s'),
|
||||
@@ -514,7 +514,7 @@ class Root implements ControllerProviderInterface
|
||||
*/
|
||||
private function doReport(Application $app, Request $request, \module_report $report, $conf, $what = false)
|
||||
{
|
||||
if ($app['phraseanet.registry']->get('GV_anonymousReport') == true) {
|
||||
if ($app['conf']->get(['registry', 'modules', 'anonymous-report']) == true) {
|
||||
if (isset($conf['user'])) {
|
||||
unset($conf['user']);
|
||||
}
|
||||
|
@@ -66,10 +66,10 @@ class Login implements ControllerProviderInterface
|
||||
|
||||
return [
|
||||
'last_publication_items' => $items,
|
||||
'instance_title' => $app['phraseanet.registry']->get('GV_homeTitle'),
|
||||
'instance_title' => $app['conf']->get(['registry', 'general', 'title']),
|
||||
'has_terms_of_use' => $app->hasTermsOfUse(),
|
||||
'meta_description' => $app['phraseanet.registry']->get('GV_metaDescription'),
|
||||
'meta_keywords' => $app['phraseanet.registry']->get('GV_metakeywords'),
|
||||
'meta_description' => $app['conf']->get(['registry', 'general', 'description']),
|
||||
'meta_keywords' => $app['conf']->get(['registry', 'general', 'keywords']),
|
||||
'browser_name' => $app['browser']->getBrowser(),
|
||||
'browser_version' => $app['browser']->getVersion(),
|
||||
'available_language' => $app['locales.available'],
|
||||
@@ -80,7 +80,7 @@ class Login implements ControllerProviderInterface
|
||||
'unlock_usr_id' => $app->getUnlockAccountData(),
|
||||
'guest_allowed' => $app->isGuestAllowed(),
|
||||
'register_enable' => $app['registration.enabled'],
|
||||
'display_layout' => $app['phraseanet.registry']->get('GV_home_publi'),
|
||||
'display_layout' => $app['conf']->get(['registry', 'general', 'home-presentation-mode']),
|
||||
'authentication_providers' => $app['authentication.providers'],
|
||||
'registration_fields' => $app['registration.fields'],
|
||||
'registration_optional_fields' => $app['registration.optional-fields']
|
||||
@@ -302,13 +302,13 @@ class Login implements ControllerProviderInterface
|
||||
if ($form->isValid()) {
|
||||
$captcha = $app['recaptcha']->bind($request);
|
||||
|
||||
if ($app['phraseanet.registry']->get('GV_captchas') && !$captcha->isValid()) {
|
||||
if ($app['conf']->get(['registry', 'webservices', 'captcha-enabled']) && !$captcha->isValid()) {
|
||||
throw new FormProcessingException($app->trans('Invalid captcha answer.'));
|
||||
}
|
||||
|
||||
require_once $app['root.path'] . '/lib/classes/deprecated/inscript.api.php';
|
||||
|
||||
if ($app['phraseanet.registry']->get('GV_autoselectDB')) {
|
||||
if ($app['conf']->get(['registry', 'registration', 'auto-select-collections'])) {
|
||||
$selected = null;
|
||||
} else {
|
||||
$selected = isset($data['collections']) ? $data['collections'] : null;
|
||||
@@ -367,7 +367,7 @@ class Login implements ControllerProviderInterface
|
||||
|
||||
$demandOK = [];
|
||||
|
||||
if ($app['phraseanet.registry']->get('GV_autoregister')) {
|
||||
if ($app['conf']->get(['registry', 'registration', 'auto-register-enabled'])) {
|
||||
|
||||
$template_user_id = \User_Adapter::get_usr_id_from_login($app, 'autoregister');
|
||||
|
||||
@@ -829,7 +829,7 @@ class Login implements ControllerProviderInterface
|
||||
// move this in an event
|
||||
public function postAuthProcess(PhraseaApplication $app, \User_Adapter $user)
|
||||
{
|
||||
$date = new \DateTime('+' . (int) $app['phraseanet.registry']->get('GV_validation_reminder') . ' days');
|
||||
$date = new \DateTime('+' . (int) $app['conf']->get(['registry', 'actions', 'validation-reminder-days']) . ' days');
|
||||
|
||||
foreach ($app['EM']
|
||||
->getRepository('Alchemy\Phrasea\Model\Entities\ValidationParticipant')
|
||||
|
@@ -46,7 +46,7 @@ class Root implements ControllerProviderInterface
|
||||
|
||||
public function getRobots(Application $app, Request $request)
|
||||
{
|
||||
if ($app['phraseanet.registry']->get('GV_allow_search_engine') === true) {
|
||||
if ($app['conf']->get(['registry', 'general', 'allow-indexation']) === true) {
|
||||
$buffer = "User-Agent: *\n" . "Allow: /\n";
|
||||
} else {
|
||||
$buffer = "User-Agent: *\n" . "Disallow: /\n";
|
||||
|
@@ -114,8 +114,8 @@ class Session implements ControllerProviderInterface
|
||||
$ret['message'] .= $app->trans('The application is going down for maintenance, please logout.');
|
||||
}
|
||||
|
||||
if ($app['phraseanet.registry']->get('GV_message_on')) {
|
||||
$ret['message'] .= strip_tags($app['phraseanet.registry']->get('GV_message'));
|
||||
if ($app['conf']->get(['registry', 'maintenance', 'enabled'])) {
|
||||
$ret['message'] .= strip_tags($app['conf']->get(['registry', 'maintenance', 'message']));
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -45,7 +45,7 @@ class TaskManagerServiceProvider implements ServiceProviderInterface
|
||||
});
|
||||
|
||||
$app['task-manager.task-list'] = $app->share(function (Application $app) {
|
||||
$conf = $app['phraseanet.registry']->get('GV_PHP_INI', null);
|
||||
$conf = $app['conf']->get(['registry', 'executables', 'php-conf-path']);
|
||||
$finder = new PhpExecutableFinder();
|
||||
$php = $finder->find();
|
||||
|
||||
|
@@ -12,6 +12,7 @@
|
||||
namespace Alchemy\Phrasea\Core\CLIProvider;
|
||||
|
||||
use Alchemy\Phrasea\Command\Developer\Utils\ConstraintExtractor;
|
||||
use Alchemy\Phrasea\Command\Developer\Utils\HelpMessageExtractor;
|
||||
use Doctrine\Common\Annotations\DocParser;
|
||||
use Doctrine\Common\Annotations\AnnotationRegistry;
|
||||
use Gedmo\SoftDeleteable\Mapping\Driver\Annotation;
|
||||
@@ -53,6 +54,7 @@ class TranslationExtractorServiceProvider implements ServiceProviderInterface
|
||||
new DefaultPhpFileExtractor($app['translation-extractor.doc-parser']),
|
||||
new TwigFileExtractor($app['twig']),
|
||||
new FormExtractor($app['translation-extractor.doc-parser']),
|
||||
new HelpMessageExtractor($app['translation-extractor.doc-parser']),
|
||||
];
|
||||
});
|
||||
$app['translation-extractor.file-extractor'] = $app->share(function (Application $app) {
|
||||
|
@@ -27,7 +27,7 @@ class Configuration implements ConfigurationInterface
|
||||
private $autoReload;
|
||||
|
||||
/**
|
||||
* @param Yaml $yaml The Yaml Parser
|
||||
* @param Yaml $yaml The Yaml Parser
|
||||
* @param Compiler $compiler The PHP Compiler
|
||||
* @param $config The path to the yaml configuration path
|
||||
* @param $compiled The path to the compiled configuration path
|
||||
|
@@ -38,9 +38,7 @@ class PropertyAccess
|
||||
*/
|
||||
public function get($props, $default = null)
|
||||
{
|
||||
$conf = $this->conf->getConfig();
|
||||
|
||||
return $this->doGet($conf, $this->arrayize($props), $default);
|
||||
return \igorw\get_in($this->conf->getConfig(), $this->arrayize($props), $default);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -52,9 +50,18 @@ class PropertyAccess
|
||||
*/
|
||||
public function has($props)
|
||||
{
|
||||
$conf = $this->conf->getConfig();
|
||||
$current = $this->conf->getConfig();
|
||||
$props = $this->arrayize($props);
|
||||
|
||||
return $this->doHas($conf, $this->arrayize($props));
|
||||
foreach ($props as $prop) {
|
||||
if (!isset($current[$prop])) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$current = $current[$prop];
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -67,9 +74,7 @@ class PropertyAccess
|
||||
*/
|
||||
public function set($props, $value)
|
||||
{
|
||||
$conf = $this->conf->getConfig();
|
||||
$this->doSet($conf, $this->arrayize($props), $value);
|
||||
$this->conf->setConfig($conf);
|
||||
$this->conf->setConfig(\igorw\assoc_in($this->conf->getConfig(), $this->arrayize($props), $value));
|
||||
|
||||
return $value;
|
||||
}
|
||||
@@ -109,48 +114,6 @@ class PropertyAccess
|
||||
return $value;
|
||||
}
|
||||
|
||||
private function doGet(array $conf, array $props, $default)
|
||||
{
|
||||
$prop = array_shift($props);
|
||||
if (!array_key_exists($prop, $conf)) {
|
||||
return $default;
|
||||
}
|
||||
if (count($props) === 0) {
|
||||
return $conf[$prop];
|
||||
}
|
||||
if (!is_array($conf[$prop])) {
|
||||
return $default;
|
||||
}
|
||||
|
||||
return $this->doGet($conf[$prop], $props, $default);
|
||||
}
|
||||
|
||||
private function doHas(array $conf, array $props)
|
||||
{
|
||||
$prop = array_shift($props);
|
||||
if (! array_key_exists($prop, $conf)) {
|
||||
return false;
|
||||
}
|
||||
if (count($props) === 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return $this->doHas($conf[$prop], $props);
|
||||
}
|
||||
|
||||
private function doSet(array &$conf, array $props, $value)
|
||||
{
|
||||
$prop = array_shift($props);
|
||||
if (count($props) === 0) {
|
||||
$conf[$prop] = $value;
|
||||
} else {
|
||||
if (! array_key_exists($prop, $conf)) {
|
||||
$conf[$prop] = [];
|
||||
}
|
||||
$this->doSet($conf[$prop], $props, $value);
|
||||
}
|
||||
}
|
||||
|
||||
private function doMerge(array &$conf, array $props, array $value)
|
||||
{
|
||||
$prop = array_shift($props);
|
||||
|
178
lib/Alchemy/Phrasea/Core/Configuration/RegistryManipulator.php
Normal file
178
lib/Alchemy/Phrasea/Core/Configuration/RegistryManipulator.php
Normal file
@@ -0,0 +1,178 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2013 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Alchemy\Phrasea\Core\Configuration;
|
||||
|
||||
use Alchemy\Phrasea\Exception\RuntimeException;
|
||||
use Alchemy\Phrasea\Form\Configuration\MainConfigurationFormType;
|
||||
use Symfony\Component\Form\FormFactoryInterface;
|
||||
use Symfony\Component\Form\FormInterface;
|
||||
use Symfony\Component\Translation\TranslatorInterface;
|
||||
|
||||
class RegistryManipulator
|
||||
{
|
||||
private $factory;
|
||||
private $languages;
|
||||
private $translator;
|
||||
|
||||
public function __construct(FormFactoryInterface $factory, TranslatorInterface $translator, array $languages)
|
||||
{
|
||||
$this->factory = $factory;
|
||||
$this->languages = $languages;
|
||||
$this->translator = $translator;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a setup form. Set data if a configuration is given.
|
||||
*
|
||||
* @param PropertyAccess $conf
|
||||
*
|
||||
* @return FormInterface
|
||||
*/
|
||||
public function createForm(PropertyAccess $conf = null)
|
||||
{
|
||||
$form = $this->factory->create(new MainConfigurationFormType($this->translator, $this->languages));
|
||||
$currentConf = $conf ? ($conf->get('registry') ?: []) : [];
|
||||
$data = array_replace_recursive($this->getDefaultData(), $currentConf);
|
||||
$form->setData($data);
|
||||
|
||||
return $form;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the registry data given a submitted form.
|
||||
* Default configuration is returned if no form provided.
|
||||
*
|
||||
* @param FormInterface $form
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public function getRegistryData(FormInterface $form = null)
|
||||
{
|
||||
$data = [];
|
||||
|
||||
if (null !== $form) {
|
||||
if (!$form->isSubmitted()) {
|
||||
throw new RuntimeException('Form must have been submitted');
|
||||
}
|
||||
$newData = $form->getData();
|
||||
$data = $this->filterNullValues($newData);
|
||||
}
|
||||
|
||||
return array_replace_recursive($this->getDefaultData(), $data);
|
||||
}
|
||||
|
||||
private function filterNullValues(array &$array)
|
||||
{
|
||||
return array_filter($array, function (&$value) {
|
||||
if (is_array($value)) {
|
||||
$value = $this->filterNullValues($value);
|
||||
}
|
||||
|
||||
return null !== $value;
|
||||
});
|
||||
}
|
||||
|
||||
private function getDefaultData()
|
||||
{
|
||||
return [
|
||||
'general' => [
|
||||
'title' => 'Phraseanet',
|
||||
'keywords' => null,
|
||||
'description' => null,
|
||||
'analytics' => null,
|
||||
'allow-indexation' => true,
|
||||
'home-presentation-mode' => 'GALLERIA',
|
||||
],
|
||||
'modules' => [
|
||||
'thesaurus' => true,
|
||||
'stories' => true,
|
||||
'doc-substitution' => true,
|
||||
'thumb-substitution' => true,
|
||||
'anonymous-report' => false,
|
||||
],
|
||||
'actions' => [
|
||||
'download-max-size' => 120,
|
||||
'validation-reminder-days' => 2,
|
||||
'validation-expiration-days' => 10,
|
||||
'auth-required-for-export' => true,
|
||||
'tou-validation-required-for-export' => false,
|
||||
'export-title-choice' => false,
|
||||
'default-export-title' => 'title',
|
||||
'social-tools' => 'none',
|
||||
],
|
||||
'ftp' => [
|
||||
'ftp-enabled' => false,
|
||||
'ftp-user-access' => false,
|
||||
],
|
||||
'registration' => [
|
||||
'auto-select-collections' => true,
|
||||
'auto-register-enabled' => false,
|
||||
],
|
||||
'classic' => [
|
||||
'search-tab' => 1,
|
||||
'adv-search-tab' => 2,
|
||||
'topics-tab' => 0,
|
||||
'active-tab' => 1,
|
||||
'render-topics' => 'tree',
|
||||
'stories-preview' => true,
|
||||
'basket-rollover' => true,
|
||||
'collection-presentation' => 'checkbox',
|
||||
'basket-size-display' => true,
|
||||
'auto-show-proposals' => true,
|
||||
'collection-display' => true,
|
||||
],
|
||||
'maintenance' => [
|
||||
'message' => 'The application is down for maintenance',
|
||||
'enabled' => false,
|
||||
],
|
||||
'api-clients' => [
|
||||
'navigator-enabled' => true,
|
||||
'office-enabled' => true,
|
||||
],
|
||||
'webservices' => [
|
||||
'google-charts-enabled' => true,
|
||||
'geonames-server' => 'http://geonames.alchemyasp.com/',
|
||||
'captchas-enabled' => false,
|
||||
'recaptcha-public-key' => '',
|
||||
'recaptcha-private-key' => '',
|
||||
],
|
||||
'executables' => [
|
||||
'h264-streaming-enabled' => false,
|
||||
'auth-token-directory' => null,
|
||||
'auth-token-directory-path' => null,
|
||||
'auth-token-passphrase' => null,
|
||||
'php-conf-path' => null,
|
||||
'imagine-driver' => '',
|
||||
'ffmpeg-threads' => 2,
|
||||
'pdf-max-pages' => 5,
|
||||
],
|
||||
'searchengine' => [
|
||||
'min-letters-truncation' => 1,
|
||||
'default-query' => 'all',
|
||||
'default-query-type' => 0,
|
||||
],
|
||||
'email' => [
|
||||
'emitter-email' => 'phraseanet@example.com',
|
||||
'prefix' => null,
|
||||
'smtp-enabled' => false,
|
||||
'smtp-auth-enabled' => false,
|
||||
'smtp-host' => null,
|
||||
'smtp-port' => null,
|
||||
'smtp-secure-mode' => 'tls',
|
||||
'smtp-user' => null,
|
||||
'smtp-password' => null,
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
@@ -72,13 +72,10 @@ class PhraseaLocaleSubscriber implements EventSubscriberInterface
|
||||
);
|
||||
|
||||
$this->app['locale'] = $this->app->share(function (Application $app) use ($event) {
|
||||
if (isset($app['phraseanet.registry'])) {
|
||||
$event->getRequest()->setDefaultLocale(
|
||||
$app['phraseanet.registry']->get('GV_default_lng', 'en')
|
||||
);
|
||||
$event->getRequest()->setLocale(
|
||||
$app['phraseanet.registry']->get('GV_default_lng', 'en')
|
||||
);
|
||||
if (isset($app['conf'])) {
|
||||
$locale = $app['conf']->get(['languages', 'default'], 'en');
|
||||
$event->getRequest()->setDefaultLocale($locale);
|
||||
$event->getRequest()->setLocale($locale);
|
||||
}
|
||||
|
||||
$languages = $app['locales.available'];
|
||||
@@ -101,7 +98,7 @@ class PhraseaLocaleSubscriber implements EventSubscriberInterface
|
||||
}
|
||||
|
||||
if (!$localeSet) {
|
||||
$event->getRequest()->setLocale($app['phraseanet.registry']->get('GV_default_lng'));
|
||||
$event->getRequest()->setLocale($app['conf']->get(['languages', 'default'], 'en_GB'));
|
||||
}
|
||||
|
||||
return $event->getRequest()->getLocale();
|
||||
|
@@ -69,7 +69,7 @@ class AuthenticationManagerServiceProvider implements ServiceProviderInterface
|
||||
}
|
||||
}, $authConf['auto-create']['templates']));
|
||||
|
||||
$enabled = $app['phraseanet.registry']->get('GV_autoregister') && $app['registration.enabled'];
|
||||
$enabled = $app['conf']->get(['registry', 'registration', 'auto-register-enabled']) && $app['registration.enabled'];
|
||||
|
||||
return new AccountCreator($app['tokens'], $app['phraseanet.appbox'], $enabled, $templates);
|
||||
});
|
||||
|
@@ -15,6 +15,7 @@ use Alchemy\Phrasea\Core\Configuration\Configuration;
|
||||
use Alchemy\Phrasea\Core\Configuration\DisplaySettingService;
|
||||
use Alchemy\Phrasea\Core\Configuration\PropertyAccess;
|
||||
use Alchemy\Phrasea\Core\Configuration\Compiler;
|
||||
use Alchemy\Phrasea\Core\Configuration\RegistryManipulator;
|
||||
use Silex\Application as SilexApplication;
|
||||
use Silex\ServiceProviderInterface;
|
||||
use Symfony\Component\Yaml\Yaml;
|
||||
@@ -43,6 +44,10 @@ class ConfigurationServiceProvider implements ServiceProviderInterface
|
||||
);
|
||||
});
|
||||
|
||||
$app['registry.manipulator'] = $app->share(function (SilexApplication $app) {
|
||||
return new RegistryManipulator($app['form.factory'], $app['translator'], $app['locales.available']);
|
||||
});
|
||||
|
||||
$app['conf'] = $app->share(function (SilexApplication $app) {
|
||||
return new PropertyAccess($app['configuration.store']);
|
||||
});
|
||||
|
@@ -20,14 +20,18 @@ class LocaleServiceProvider implements ServiceProviderInterface
|
||||
public function register(Application $app)
|
||||
{
|
||||
$app['locale'] = $app->share(function (Application $app) {
|
||||
return $app['phraseanet.registry']->get('GV_default_lng', 'en');
|
||||
if (!$app['configuration.store']->isSetup()) {
|
||||
return 'en';
|
||||
}
|
||||
|
||||
return $app['conf']->get(['languages', 'default'], 'en');
|
||||
});
|
||||
|
||||
$app['locales.available'] = $app->share(function (Application $app) {
|
||||
$availableLanguages = PhraseaApplication::getAvailableLanguages();
|
||||
|
||||
if ($app['configuration.store']->isSetup() && 0 < count((array) $app['conf']->get('languages', []))) {
|
||||
$languages = $app['conf']->get('languages');
|
||||
if ($app['configuration.store']->isSetup() && 0 < count((array) $app['conf']->get(['languages', 'available']))) {
|
||||
$languages = $app['conf']->get(['languages', 'available']);
|
||||
$enabledLanguages = $availableLanguages;
|
||||
|
||||
foreach ($enabledLanguages as $code => $language) {
|
||||
|
@@ -22,13 +22,13 @@ class NotificationDelivererServiceProvider implements ServiceProviderInterface
|
||||
{
|
||||
$app['notification.default.emitter'] = $app->share(function (Application $app) {
|
||||
return new Emitter(
|
||||
$app['phraseanet.registry']->get('GV_homeTitle', 'Phraseanet'),
|
||||
$app['phraseanet.registry']->get('GV_defaulmailsenderaddr', 'no-reply@phraseanet.com')
|
||||
$app['conf']->get(['registry', 'general', 'title']),
|
||||
$app['conf']->get(['registry', 'email', 'emitter-email'], 'no-reply@phraseanet.com')
|
||||
);
|
||||
});
|
||||
|
||||
$app['notification.prefix'] = $app->share(function (Application $app) {
|
||||
return $app['phraseanet.registry']->get('GV_email_prefix');
|
||||
return $app['conf']->get(['registry', 'email', 'prefix']);
|
||||
});
|
||||
|
||||
$app['notification.deliverer'] = $app->share(function ($app) {
|
||||
|
@@ -24,10 +24,6 @@ class PhraseanetServiceProvider implements ServiceProviderInterface
|
||||
return new \appbox($app);
|
||||
});
|
||||
|
||||
$app['phraseanet.registry'] = $app->share(function (SilexApplication $app) {
|
||||
return new \registry($app);
|
||||
});
|
||||
|
||||
$app['firewall'] = $app->share(function (SilexApplication $app) {
|
||||
return new Firewall($app);
|
||||
});
|
||||
|
@@ -13,7 +13,7 @@ namespace Alchemy\Phrasea\Core;
|
||||
|
||||
class Version
|
||||
{
|
||||
protected static $number = '3.9.0-alpha.9';
|
||||
protected static $number = '3.9.0-alpha.10';
|
||||
protected static $name = 'Epanterias';
|
||||
|
||||
public static function getNumber()
|
||||
|
@@ -11,18 +11,21 @@
|
||||
|
||||
namespace Alchemy\Phrasea\Form\Configuration;
|
||||
|
||||
use Alchemy\Phrasea\Model\Entities\Task;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
||||
class StorageFormType extends AbstractType
|
||||
class APIClientsFormType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$builder->add('GV_base_datapath_noweb', 'text', array(
|
||||
'label' => _('Default path for datas'),
|
||||
));
|
||||
$builder->add('navigator-enabled', 'checkbox', [
|
||||
'label' => 'Authorize *Phraseanet Navigator*',
|
||||
'help_message' => '*Phraseanet Navigator* is a smartphone application that allow user to connect on this instance',
|
||||
]);
|
||||
|
||||
$builder->add('office-enabled', 'checkbox', [
|
||||
'label' => 'Authorize Microsoft Office Plugin to connect.',
|
||||
]);
|
||||
}
|
||||
|
||||
public function getName()
|
56
lib/Alchemy/Phrasea/Form/Configuration/ActionsFormType.php
Normal file
56
lib/Alchemy/Phrasea/Form/Configuration/ActionsFormType.php
Normal file
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2013 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Alchemy\Phrasea\Form\Configuration;
|
||||
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
class ActionsFormType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$builder->add('download-max-size', 'integer', [
|
||||
'label' => 'Maximum megabytes allowed for download',
|
||||
'help_message' => 'If request is bigger, then mail is still available',
|
||||
]);
|
||||
$builder->add('validation-reminder-days', 'integer', [
|
||||
'label' => 'Number of days before the end of the validation to send a reminder email',
|
||||
]);
|
||||
$builder->add('validation-expiration-days', 'integer', [
|
||||
'label' => 'Default validation links duration',
|
||||
'help_message' => 'If set to 0, duration is permanent',
|
||||
]);
|
||||
$builder->add('auth-required-for-export', 'checkbox', [
|
||||
'label' => 'Require authentication to download documents',
|
||||
'help_message' => 'Used for guest account',
|
||||
]);
|
||||
$builder->add('tou-validation-required-for-export', 'checkbox', [
|
||||
'label' => 'Users must accept Terms of Use for each export',
|
||||
]);
|
||||
$builder->add('export-title-choice', 'checkbox', [
|
||||
'label' => 'Choose the title of the document to export',
|
||||
]);
|
||||
$builder->add('default-export-title', 'choice', [
|
||||
'label' => 'Default export title',
|
||||
'choices' => ['title' => 'Document title', 'original' => 'Original name'],
|
||||
]);
|
||||
$builder->add('social-tools', 'choice', [
|
||||
'label' => 'Enable this setting to share on Facebook and Twitter',
|
||||
'choices' => ['none' => 'Disabled', 'publishers' => 'Publishers', 'all' => 'Enabled'],
|
||||
]);
|
||||
}
|
||||
|
||||
public function getName()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
66
lib/Alchemy/Phrasea/Form/Configuration/ClassicFormType.php
Normal file
66
lib/Alchemy/Phrasea/Form/Configuration/ClassicFormType.php
Normal file
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2013 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Alchemy\Phrasea\Form\Configuration;
|
||||
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
class ClassicFormType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$builder->add('search-tab', 'integer', [
|
||||
'label' => 'Search tab position',
|
||||
]);
|
||||
$builder->add('adv-search-tab', 'integer', [
|
||||
'label' => 'Advanced search tab position',
|
||||
]);
|
||||
$builder->add('topics-tab', 'integer', [
|
||||
'label' => 'Topics tab position',
|
||||
]);
|
||||
$builder->add('active-tab', 'integer', [
|
||||
'label' => 'Active tab position',
|
||||
]);
|
||||
|
||||
$builder->add('render-topics', 'choice', [
|
||||
'label' => 'Topics display mode',
|
||||
'choices' => ['tree' => 'Trees', 'popups' => 'Drop-down'],
|
||||
]);
|
||||
|
||||
$builder->add('stories-preview', 'checkbox', [
|
||||
'label' => 'Enable roll-over on stories',
|
||||
]);
|
||||
$builder->add('basket-rollover', 'checkbox', [
|
||||
'label' => 'Enable roll-over on basket elements',
|
||||
]);
|
||||
|
||||
$builder->add('collection-presentation', 'choice', [
|
||||
'label' => 'Collections display mode',
|
||||
'choices' => ['popup' => 'Drop-down', 'checkbox' => 'Check-box'],
|
||||
]);
|
||||
|
||||
$builder->add('basket-size-display', 'checkbox', [
|
||||
'label' => 'Display the total size of the document basket',
|
||||
]);
|
||||
$builder->add('auto-show-proposals', 'checkbox', [
|
||||
'label' => 'Display proposals tab',
|
||||
]);
|
||||
$builder->add('collection-display', 'checkbox', [
|
||||
'label' => 'Display the name of databases and collections',
|
||||
]);
|
||||
}
|
||||
|
||||
public function getName()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
@@ -1,91 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2013 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Alchemy\Phrasea\Form\Configuration;
|
||||
|
||||
use Alchemy\Phrasea\Model\Entities\Task;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\Routing\Generator\UrlGenerator;
|
||||
use Symfony\Component\Routing\Exception\RouteNotFoundException;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
||||
class ClientFormType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$builder->add('GV_download_max', 'integer', array(
|
||||
'label' => _('Maximum megabytes allowed for download'),
|
||||
'data' => 120,
|
||||
'help_message' => _('If request is bigger, then mail is still available'),
|
||||
));
|
||||
$builder->add('GV_ong_search', 'integer', array(
|
||||
'label' => _('Search tab position'),
|
||||
'data' => 1,
|
||||
));
|
||||
$builder->add('GV_ong_advsearch', 'integer', array(
|
||||
'label' => _('Advanced search tab position'),
|
||||
'data' => 2,
|
||||
));
|
||||
$builder->add('GV_ong_topics', 'integer', array(
|
||||
'label' => _('Topics tab position'),
|
||||
'data' => 0,
|
||||
));
|
||||
$builder->add('GV_ong_actif', 'integer', array(
|
||||
'label' => _('Active tab position'),
|
||||
'data' => 1,
|
||||
));
|
||||
|
||||
$builder->add('GV_client_render_topics', 'choice', array(
|
||||
'label' => _('Topics display mode'),
|
||||
'data' => 'tree',
|
||||
'choices' => array('tree' => _('Trees'), 'popups' => _('Drop-down')),
|
||||
));
|
||||
|
||||
$builder->add('GV_rollover_reg_preview', 'checkbox', array(
|
||||
'label' => _('Enable roll-over on stories'),
|
||||
'data' => true,
|
||||
));
|
||||
$builder->add('GV_rollover_chu', 'checkbox', array(
|
||||
'label' => _('Enable roll-over on basket elements'),
|
||||
'data' => true,
|
||||
));
|
||||
|
||||
$builder->add('GV_client_coll_ckbox', 'choice', array(
|
||||
'label' => _('Collections display mode'),
|
||||
'data' => 'checkbox',
|
||||
'choices' => array('popup' => _('Drop-down'), 'checkbox' => _('Check-box')),
|
||||
));
|
||||
|
||||
$builder->add('GV_viewSizeBaket', 'checkbox', array(
|
||||
'label' => _('Display the total size of the document basket'),
|
||||
'data' => true,
|
||||
));
|
||||
$builder->add('GV_clientAutoShowProposals', 'checkbox', array(
|
||||
'label' => _('Display proposals tab'),
|
||||
'data' => true,
|
||||
));
|
||||
$builder->add('GV_needAuth2DL', 'checkbox', array(
|
||||
'label' => _('Require authentication to download documents'),
|
||||
'data' => true,
|
||||
'help_message' => _('Used for guest account'),
|
||||
));
|
||||
$builder->add('GV_requireTOUValidationForExport', 'checkbox', array(
|
||||
'label' => _('Users must accept Terms of Use for each export'),
|
||||
'data' => false,
|
||||
));
|
||||
}
|
||||
|
||||
public function getName()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
@@ -1,60 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2013 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Alchemy\Phrasea\Form\Configuration;
|
||||
|
||||
use Alchemy\Phrasea\Model\Entities\Task;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\Routing\Generator\UrlGenerator;
|
||||
use Symfony\Component\Routing\Exception\RouteNotFoundException;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
||||
class DailymotionFormType extends AbstractType
|
||||
{
|
||||
/** @var UrlGenerator */
|
||||
private $generator;
|
||||
|
||||
public function __construct(UrlGenerator $generator)
|
||||
{
|
||||
$this->generator = $generator;
|
||||
}
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$create_api_dailymotion = '<a href="http://www.dailymotion.com/profile/developer" target="_blank">http://www.dailymotion.com/profile/developer</a>';
|
||||
|
||||
try {
|
||||
$dailymotion_callback = $this->generator->generate('prod_bridge_callback', array('api_name' => 'dailymotion'), UrlGenerator::ABSOLUTE_URL);
|
||||
} catch (RouteNotFoundException $e) {
|
||||
$dailymotion_callback = null;
|
||||
}
|
||||
|
||||
|
||||
$builder->add('GV_dailymotion_api', 'checkbox', array(
|
||||
'label' => _('Use Dailymotion API'),
|
||||
'data' => false,
|
||||
'help_message' => sprintf(_('Create API account at %s, then use %s as callback URL value'), $create_api_dailymotion, $dailymotion_callback),
|
||||
));
|
||||
|
||||
$builder->add('GV_dailymotion_client_id', 'text', array(
|
||||
'label' => _('Dailymotion public key'),
|
||||
));
|
||||
$builder->add('GV_dailymotion_client_secret', 'text', array(
|
||||
'label' => _('Dailymotion secret key'),
|
||||
));
|
||||
}
|
||||
|
||||
public function getName()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
@@ -1,52 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2013 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Alchemy\Phrasea\Form\Configuration;
|
||||
|
||||
use Alchemy\Phrasea\Model\Entities\Task;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\Routing\Generator\UrlGenerator;
|
||||
use Symfony\Component\Routing\Exception\RouteNotFoundException;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
||||
class DisplayFormType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$builder->add('GV_adminMail', 'text', array(
|
||||
'label' => _('Admin email'),
|
||||
));
|
||||
$builder->add('GV_view_bas_and_coll', 'checkbox', array(
|
||||
'label' => _('Display the name of databases and collections'),
|
||||
'data' => true,
|
||||
));
|
||||
$builder->add('GV_choose_export_title', 'checkbox', array(
|
||||
'label' => _('Choose the title of the document to export'),
|
||||
'data' => false,
|
||||
));
|
||||
$builder->add('GV_default_export_title', 'choice', array(
|
||||
'label' => _('Default export title'),
|
||||
'data' => 'title',
|
||||
'choices' => array('title' => _('Document title'), 'original' => _('Original name')),
|
||||
));
|
||||
$builder->add('GV_social_tools', 'choice', array(
|
||||
'label' => _('Enable this setting to share on Facebook and Twitter'),
|
||||
'data' => 'none',
|
||||
'choices' => array('none' => _('Disabled'), 'publishers' => _('Publishers'), 'all' => _('Enabled')),
|
||||
));
|
||||
}
|
||||
|
||||
public function getName()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
@@ -11,47 +11,41 @@
|
||||
|
||||
namespace Alchemy\Phrasea\Form\Configuration;
|
||||
|
||||
use Alchemy\Phrasea\Model\Entities\Task;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\Routing\Generator\UrlGenerator;
|
||||
use Symfony\Component\Routing\Exception\RouteNotFoundException;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
||||
class EmailFormType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$builder->add('GV_defaulmailsenderaddr', 'text', array(
|
||||
'label' => _('Default mail sender address'),
|
||||
'data' => 'phraseanet@example.com',
|
||||
));
|
||||
$builder->add('GV_email_prefix', 'text', array(
|
||||
'label' => _('Prefix for notification emails'),
|
||||
));
|
||||
$builder->add('GV_smtp', 'checkbox', array(
|
||||
'label' => _('Use a SMTP server'),
|
||||
));
|
||||
$builder->add('GV_smtp_auth', 'checkbox', array(
|
||||
'label' => _('Enable SMTP authentication'),
|
||||
));
|
||||
$builder->add('GV_smtp_host', 'text', array(
|
||||
'label' => _('SMTP host'),
|
||||
));
|
||||
$builder->add('GV_smtp_port', 'text', array(
|
||||
'label' => _('SMTP port'),
|
||||
));
|
||||
$builder->add('GV_smtp_secure', 'choice', array(
|
||||
'label' => _('SMTP encryption'),
|
||||
'data' => 'tls',
|
||||
'choices' => array('none' => _('None'), 'ssl' => 'SSL', 'tls' => 'TLS'),
|
||||
));
|
||||
$builder->add('GV_smtp_user', 'text', array(
|
||||
'label' => _('SMTP user'),
|
||||
));
|
||||
$builder->add('GV_smtp_password', 'text', array(
|
||||
'label' => _('SMTP password'),
|
||||
));
|
||||
$builder->add('emitter-email', 'text', [
|
||||
'label' => 'Default mail sender address',
|
||||
]);
|
||||
$builder->add('prefix', 'text', [
|
||||
'label' => 'Prefix for notification emails',
|
||||
]);
|
||||
$builder->add('smtp-enabled', 'checkbox', [
|
||||
'label' => 'Use a SMTP server',
|
||||
]);
|
||||
$builder->add('smtp-auth-enabled', 'checkbox', [
|
||||
'label' => 'Enable SMTP authentication',
|
||||
]);
|
||||
$builder->add('smtp-host', 'text', [
|
||||
'label' => 'SMTP host',
|
||||
]);
|
||||
$builder->add('smtp-port', 'text', [
|
||||
'label' => 'SMTP port',
|
||||
]);
|
||||
$builder->add('smtp-secure-mode', 'choice', [
|
||||
'label' => 'SMTP encryption',
|
||||
'choices' => ['none' => 'None', 'ssl' => 'SSL', 'tls' => 'TLS'],
|
||||
]);
|
||||
$builder->add('smtp-user', 'text', [
|
||||
'label' => 'SMTP user',
|
||||
]);
|
||||
$builder->add('smtp-password', 'text', [
|
||||
'label' => 'SMTP password',
|
||||
]);
|
||||
}
|
||||
|
||||
public function getName()
|
||||
|
@@ -11,53 +11,56 @@
|
||||
|
||||
namespace Alchemy\Phrasea\Form\Configuration;
|
||||
|
||||
use Alchemy\Phrasea\Model\Entities\Task;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\Routing\Generator\UrlGenerator;
|
||||
use Symfony\Component\Routing\Exception\RouteNotFoundException;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
use Symfony\Component\Translation\TranslatorInterface;
|
||||
|
||||
class ExecutablesFormType extends AbstractType
|
||||
{
|
||||
private $translator;
|
||||
|
||||
public function __construct(TranslatorInterface $translator)
|
||||
{
|
||||
$this->translator = $translator;
|
||||
}
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$builder->add('GV_h264_streaming', 'checkbox', array(
|
||||
'label' => _('Enable H264 stream mode'),
|
||||
'data' => false,
|
||||
'help_message' => _('Use with mod_token. Attention requires the apache modules and mod_h264_streaming mod_auth_token'),
|
||||
));
|
||||
$builder->add('GV_mod_auth_token_directory', 'text', array(
|
||||
'label' => _('Auth_token mount point'),
|
||||
));
|
||||
$builder->add('GV_mod_auth_token_directory_path', 'text', array(
|
||||
'label' => _('Auth_token directory path'),
|
||||
));
|
||||
$builder->add('GV_mod_auth_token_passphrase', 'text', array(
|
||||
'label' => _('Auth_token passphrase'),
|
||||
'help_message' => _('Defined in Apache configuration'),
|
||||
));
|
||||
$builder->add('GV_PHP_INI', 'text', array(
|
||||
'label' => _('php.ini path'),
|
||||
'help_message' => _('Empty if not used'),
|
||||
));
|
||||
$builder->add('h264-streaming-enabled', 'checkbox', [
|
||||
'label' => 'Enable H264 stream mode',
|
||||
'help_message' => 'Use with mod_token. Attention requires the apache modules and mod_h264_streaming mod_auth_token',
|
||||
]);
|
||||
$builder->add('auth-token-directory', 'text', [
|
||||
'label' => 'Auth_token mount point',
|
||||
]);
|
||||
$builder->add('auth-token-directory-path', 'text', [
|
||||
'label' => 'Auth_token directory path',
|
||||
]);
|
||||
$builder->add('auth-token-passphrase', 'text', [
|
||||
'label' => 'Auth_token passphrase',
|
||||
'help_message' => 'Defined in Apache configuration',
|
||||
]);
|
||||
$builder->add('php-conf-path', 'text', [
|
||||
'label' => 'php.ini path',
|
||||
'help_message' => 'Empty if not used',
|
||||
]);
|
||||
|
||||
$imagineDoc = '<a href="http://imagine.readthedocs.org/en/latest/usage/introduction.html">http://imagine.readthedocs.org/en/latest/usage/introduction.html</a>';
|
||||
$builder->add('GV_imagine_driver', 'choice', array(
|
||||
'label' => _('Imagine driver'),
|
||||
'data' => '',
|
||||
'help_message' => _(sprintf('See documentation at %s', $imagineDoc)),
|
||||
'choices' => array('' => 'Auto', 'gmagick' => 'GraphicsMagick', 'imagick' => 'ImageMagick', 'gd' => 'GD')
|
||||
));
|
||||
$help = $this->translator->trans('See documentation at %url%', ['%url%' => $imagineDoc]);
|
||||
|
||||
$builder->add('GV_ffmpeg_threads', 'integer', array(
|
||||
'label' => _('Number of threads to use for FFMpeg'),
|
||||
'data' => 2,
|
||||
));
|
||||
$builder->add('GV_pdfmaxpages', 'integer', array(
|
||||
'label' => _('Maximum number of pages to be extracted from PDF'),
|
||||
'data' => 5,
|
||||
));
|
||||
$builder->add('imagine-driver', 'choice', [
|
||||
'label' => 'Imagine driver',
|
||||
/** @Ignore */
|
||||
'help_message' => $help,
|
||||
'choices' => ['' => 'Auto', 'gmagick' => 'GraphicsMagick', 'imagick' => 'ImageMagick', 'gd' => 'GD']
|
||||
]);
|
||||
|
||||
$builder->add('ffmpeg-threads', 'integer', [
|
||||
'label' => 'Number of threads to use for FFMpeg',
|
||||
]);
|
||||
$builder->add('pdf-max-pages', 'integer', [
|
||||
'label' => 'Maximum number of pages to be extracted from PDF',
|
||||
]);
|
||||
}
|
||||
|
||||
public function getName()
|
||||
|
@@ -1,61 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2013 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Alchemy\Phrasea\Form\Configuration;
|
||||
|
||||
use Alchemy\Phrasea\Model\Entities\Task;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\Routing\Generator\UrlGenerator;
|
||||
use Symfony\Component\Routing\Exception\RouteNotFoundException;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
||||
class FlickrFormType extends AbstractType
|
||||
{
|
||||
/** @var UrlGenerator */
|
||||
private $generator;
|
||||
|
||||
public function __construct(UrlGenerator $generator)
|
||||
{
|
||||
$this->generator = $generator;
|
||||
}
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$create_api_flickr = '<a href="https://secure.flickr.com/services/apps/create/" target="_blank">https://secure.flickr.com/services/apps/create/</a>';
|
||||
|
||||
try {
|
||||
$flickr_callback = $this->generator->generate('prod_bridge_callback', array('api_name' => 'flickr'), UrlGenerator::ABSOLUTE_URL);
|
||||
} catch (RouteNotFoundException $e) {
|
||||
$flickr_callback = null;
|
||||
}
|
||||
|
||||
|
||||
$builder->add('GV_flickr_api', 'checkbox', array(
|
||||
'label' => _('Use Flickr API'),
|
||||
'data' => false,
|
||||
'help_message' => sprintf(_('Create API account at %s, then use %s as callback URL value'), $create_api_flickr, $flickr_callback),
|
||||
));
|
||||
|
||||
|
||||
$builder->add('GV_flickr_client_id', 'text', array(
|
||||
'label' => _('Flickr public key'),
|
||||
));
|
||||
$builder->add('GV_flickr_client_secret', 'text', array(
|
||||
'label' => _('Flickr secret key'),
|
||||
));
|
||||
}
|
||||
|
||||
public function getName()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
@@ -11,27 +11,21 @@
|
||||
|
||||
namespace Alchemy\Phrasea\Form\Configuration;
|
||||
|
||||
use Alchemy\Phrasea\Model\Entities\Task;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\Routing\Generator\UrlGenerator;
|
||||
use Symfony\Component\Routing\Exception\RouteNotFoundException;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
||||
class FtpExportFormType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$builder->add('GV_activeFTP', 'checkbox', array(
|
||||
'label' => _('Enable FTP export'),
|
||||
'data' => false,
|
||||
'help_message' => _('Available in multi-export tab'),
|
||||
));
|
||||
$builder->add('GV_ftp_for_user', 'checkbox', array(
|
||||
'label' => _('Enable FTP for users'),
|
||||
'data' => false,
|
||||
'help_message' => _('By default it is available for admins'),
|
||||
));
|
||||
$builder->add('ftp-enabled', 'checkbox', [
|
||||
'label' => 'Enable FTP export',
|
||||
'help_message' => 'Available in multi-export tab',
|
||||
]);
|
||||
$builder->add('ftp-user-access', 'checkbox', [
|
||||
'label' => 'Enable FTP for users',
|
||||
'help_message' => 'By default it is available for admins',
|
||||
]);
|
||||
}
|
||||
|
||||
public function getName()
|
||||
|
59
lib/Alchemy/Phrasea/Form/Configuration/GeneralFormType.php
Normal file
59
lib/Alchemy/Phrasea/Form/Configuration/GeneralFormType.php
Normal file
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2013 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Alchemy\Phrasea\Form\Configuration;
|
||||
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
class GeneralFormType extends AbstractType
|
||||
{
|
||||
private $availableLanguages;
|
||||
|
||||
public function __construct(array $availableLanguages)
|
||||
{
|
||||
$this->availableLanguages = $availableLanguages;
|
||||
}
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$builder->add('title', 'text', [
|
||||
'label' => 'Application title',
|
||||
]);
|
||||
$builder->add('keywords', 'text', [
|
||||
'label' => 'Keywords used for indexing purposes by search engines robots',
|
||||
]);
|
||||
$builder->add('description', 'textarea', [
|
||||
'label' => 'Application description',
|
||||
]);
|
||||
$builder->add('analytics', 'text', [
|
||||
'label' => 'Google Analytics identifier',
|
||||
]);
|
||||
$builder->add('allow-indexation', 'checkbox', [
|
||||
'label' => 'Allow the website to be indexed by search engines like Google',
|
||||
]);
|
||||
$builder->add('home-presentation-mode', 'choice', [
|
||||
'label' => 'Homepage slideshow',
|
||||
'choices' => [
|
||||
'DISPLAYx1' => 'Single image',
|
||||
'SCROLL' => 'Slide show',
|
||||
'COOLIRIS' => 'Cooliris',
|
||||
'CAROUSEL' => 'Carousel',
|
||||
'GALLERIA' => 'Gallery',
|
||||
],
|
||||
]);
|
||||
}
|
||||
|
||||
public function getName()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
@@ -1,36 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2013 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Alchemy\Phrasea\Form\Configuration;
|
||||
|
||||
use Alchemy\Phrasea\Model\Entities\Task;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\Routing\Generator\UrlGenerator;
|
||||
use Symfony\Component\Routing\Exception\RouteNotFoundException;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
||||
class HomepageFormType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$builder->add('GV_home_publi', 'choice', array(
|
||||
'label' => _('Homepage slideshow'),
|
||||
'data' => 'GALLERIA',
|
||||
'choices' => array('DISPLAYx1' => _('Single image'), 'SCROLL' => _('Slide show'), 'COOLIRIS' => 'Cooliris', 'CAROUSEL' => _('Carousel'), 'GALLERIA' => _('Gallery')),
|
||||
));
|
||||
}
|
||||
|
||||
public function getName()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
@@ -1,43 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2013 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Alchemy\Phrasea\Form\Configuration;
|
||||
|
||||
use Alchemy\Phrasea\Model\Entities\Task;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
||||
class HttpServerFormType extends AbstractType
|
||||
{
|
||||
private $availableLanguages;
|
||||
|
||||
public function __construct(array $availableLanguages)
|
||||
{
|
||||
$this->availableLanguages = $availableLanguages;
|
||||
}
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$builder->add('GV_default_lng', 'choice', array(
|
||||
'multiple' => false,
|
||||
'expanded' => false,
|
||||
'choices' => $this->availableLanguages,
|
||||
'label' => _('Default language'),
|
||||
'data' => 'fr_FR',
|
||||
));
|
||||
}
|
||||
|
||||
public function getName()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
@@ -11,105 +11,69 @@
|
||||
|
||||
namespace Alchemy\Phrasea\Form\Configuration;
|
||||
|
||||
use Alchemy\Phrasea\Model\Entities\Task;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\Form\FormEvents;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
|
||||
use Symfony\Component\Routing\Generator\UrlGenerator;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
use Symfony\Component\Translation\TranslatorInterface;
|
||||
|
||||
class MainConfigurationFormType extends AbstractType
|
||||
{
|
||||
private $languages;
|
||||
private $generator;
|
||||
private $translator;
|
||||
|
||||
public function __construct(array $languages, UrlGenerator $generator)
|
||||
public function __construct(TranslatorInterface $translator, array $languages)
|
||||
{
|
||||
$this->languages = $languages;
|
||||
$this->generator = $generator;
|
||||
$this->translator = $translator;
|
||||
}
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$builder->add('http', new HttpServerFormType($this->languages), array(
|
||||
'label' => _('HTTP Server'),
|
||||
$builder->add('general', new GeneralFormType($this->languages), [
|
||||
'label' => 'General configuration',
|
||||
]);
|
||||
$builder->add('modules', new ModulesFormType(), [
|
||||
'label' => 'Additionnal modules',
|
||||
]);
|
||||
$builder->add('actions', new ActionsFormType(), [
|
||||
'label' => 'Push configuration',
|
||||
]);
|
||||
$builder->add('ftp', new FtpExportFormType(), [
|
||||
'label' => 'FTP Export',
|
||||
]);
|
||||
$builder->add('registration', new RegistrationFormType(), [
|
||||
'label' => 'Registration',
|
||||
]);
|
||||
$builder->add('classic', new ClassicFormType(), [
|
||||
'label' => 'Client',
|
||||
]);
|
||||
$builder->add('maintenance', new MaintenanceFormType(), [
|
||||
'label' => 'Maintenance state',
|
||||
]);
|
||||
$builder->add('api-clients', new APIClientsFormType(), [
|
||||
'label' => 'Phraseanet client API',
|
||||
]);
|
||||
$builder->add('webservices', new WebservicesFormType($this->translator), [
|
||||
'label' => 'Webservices connectivity',
|
||||
]);
|
||||
$builder->add('executables', new ExecutablesFormType($this->translator), [
|
||||
'label' => 'Executables settings',
|
||||
]);
|
||||
$builder->add('searchengine', new SearchEngineFormType(), [
|
||||
'label' => 'Search engine',
|
||||
]);
|
||||
$builder->add('email', new EmailFormType(), [
|
||||
'label' => 'Emails',
|
||||
]);
|
||||
}
|
||||
|
||||
public function setDefaultOptions(OptionsResolverInterface $resolver)
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
'required' => false,
|
||||
));
|
||||
$builder->add('maintenance', new MaintenanceFormType(), array(
|
||||
'label' => _('Maintenance state'),
|
||||
'required' => false,
|
||||
));
|
||||
$builder->add('webservices', new WebservicesFormType(), array(
|
||||
'label' => _('Webservices connectivity'),
|
||||
'required' => false,
|
||||
));
|
||||
$builder->add('youtube-api', new YoutubeFormType($this->generator), array(
|
||||
'label' => _('Youtube connectivity'),
|
||||
'required' => false,
|
||||
));
|
||||
$builder->add('flickr-api', new FlickrFormType($this->generator), array(
|
||||
'label' => _('FlickR connectivity'),
|
||||
'required' => false,
|
||||
));
|
||||
$builder->add('dailymotion-api', new DailymotionFormType($this->generator), array(
|
||||
'label' => _('Dailymotion connectivity'),
|
||||
'required' => false,
|
||||
));
|
||||
$builder->add('phraseanet-client', new PhraseanetClientAPIFormType(), array(
|
||||
'label' => _('Phraseanet client API'),
|
||||
'required' => false,
|
||||
));
|
||||
$builder->add('storage', new StorageFormType(), array(
|
||||
'label' => _('Documents storage'),
|
||||
'required' => false,
|
||||
));
|
||||
$builder->add('executables', new ExecutablesFormType(), array(
|
||||
'label' => _('Executables settings'),
|
||||
'required' => false,
|
||||
));
|
||||
$builder->add('homepage', new HomepageFormType(), array(
|
||||
'label' => _('Main configuration'),
|
||||
'required' => false,
|
||||
));
|
||||
$builder->add('display', new DisplayFormType(), array(
|
||||
'label' => _('Homepage'),
|
||||
'required' => false,
|
||||
));
|
||||
$builder->add('searchengine', new SearchEngineFormType(), array(
|
||||
'label' => _('Search engine'),
|
||||
'required' => false,
|
||||
));
|
||||
$builder->add('report', new ReportFormType(), array(
|
||||
'label' => _('Report'),
|
||||
'required' => false,
|
||||
));
|
||||
$builder->add('modules', new ModulesFormType(), array(
|
||||
'label' => _('Additionnal modules'),
|
||||
'required' => false,
|
||||
));
|
||||
$builder->add('email', new EmailFormType(), array(
|
||||
'label' => _('Emails'),
|
||||
'required' => false,
|
||||
));
|
||||
$builder->add('client', new FtpExportFormType(), array(
|
||||
'label' => _('FTP Export'),
|
||||
'required' => false,
|
||||
));
|
||||
$builder->add('client', new ClientFormType(), array(
|
||||
'label' => _('Client'),
|
||||
'required' => false,
|
||||
));
|
||||
$builder->add('registration', new RegistrationFormType(), array(
|
||||
'label' => _('Registration'),
|
||||
'required' => false,
|
||||
));
|
||||
$builder->add('push', new PushFormType(), array(
|
||||
'label' => _('Push configuration'),
|
||||
'required' => false,
|
||||
));
|
||||
$builder->add('robots', new RobotsFormType(), array(
|
||||
'label' => _('Robot indexing'),
|
||||
'required' => false,
|
||||
));
|
||||
]);
|
||||
}
|
||||
|
||||
public function getName()
|
||||
|
@@ -11,27 +11,19 @@
|
||||
|
||||
namespace Alchemy\Phrasea\Form\Configuration;
|
||||
|
||||
use Alchemy\Phrasea\Model\Entities\Task;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
||||
class MaintenanceFormType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$builder->add('GV_message', 'text', array(
|
||||
'label' => _('Maintenance message'),
|
||||
'data' => 'The application is down for maintenance',
|
||||
));
|
||||
$builder->add('GV_message_on', 'checkbox', array(
|
||||
'label' => _('Enable maintenance message broadcast'),
|
||||
'data' => false,
|
||||
));
|
||||
$builder->add('GV_log_errors', 'checkbox', array(
|
||||
'label' => _('Log errors'),
|
||||
'data' => false,
|
||||
));
|
||||
$builder->add('message', 'text', [
|
||||
'label' => 'Maintenance message',
|
||||
]);
|
||||
$builder->add('enabled', 'checkbox', [
|
||||
'label' => 'Enable maintenance message broadcast',
|
||||
]);
|
||||
}
|
||||
|
||||
public function getName()
|
||||
|
@@ -11,33 +11,29 @@
|
||||
|
||||
namespace Alchemy\Phrasea\Form\Configuration;
|
||||
|
||||
use Alchemy\Phrasea\Model\Entities\Task;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\Routing\Generator\UrlGenerator;
|
||||
use Symfony\Component\Routing\Exception\RouteNotFoundException;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
||||
class ModulesFormType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$builder->add('GV_thesaurus', 'checkbox', array(
|
||||
'label' => _('Enable thesaurus'),
|
||||
'data' => true,
|
||||
));
|
||||
$builder->add('GV_multiAndReport', 'checkbox', array(
|
||||
'label' => _('Enable multi-doc mode'),
|
||||
'data' => true,
|
||||
));
|
||||
$builder->add('GV_seeOngChgDoc', 'checkbox', array(
|
||||
'label' => _('Enable HD substitution'),
|
||||
'data' => true,
|
||||
));
|
||||
$builder->add('GV_seeNewThumb', 'checkbox', array(
|
||||
'label' => _('Enable thumbnail substitution'),
|
||||
'data' => true,
|
||||
));
|
||||
$builder->add('thesaurus', 'checkbox', [
|
||||
'label' => 'Enable thesaurus',
|
||||
]);
|
||||
$builder->add('stories', 'checkbox', [
|
||||
'label' => 'Enable multi-doc mode',
|
||||
]);
|
||||
$builder->add('doc-substitution', 'checkbox', [
|
||||
'label' => 'Enable HD substitution',
|
||||
]);
|
||||
$builder->add('thumb-substitution', 'checkbox', [
|
||||
'label' => 'Enable thumbnail substitution',
|
||||
]);
|
||||
$builder->add('anonymous-report', 'checkbox', [
|
||||
'label' => 'Anonymous report',
|
||||
'help_message' => 'Hide information about users',
|
||||
]);
|
||||
}
|
||||
|
||||
public function getName()
|
||||
|
@@ -1,41 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2013 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Alchemy\Phrasea\Form\Configuration;
|
||||
|
||||
use Alchemy\Phrasea\Model\Entities\Task;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\Routing\Generator\UrlGenerator;
|
||||
use Symfony\Component\Routing\Exception\RouteNotFoundException;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
||||
class PhraseanetClientAPIFormType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$builder->add('GV_client_navigator', 'checkbox', array(
|
||||
'label' => _('Authorize *Phraseanet Navigator*'),
|
||||
'data' => true,
|
||||
'help_message' => _('*Phraseanet Navigator* is a smartphone application that allow user to connect on this instance'),
|
||||
));
|
||||
|
||||
$builder->add('GV_client_officeplugin', 'checkbox', array(
|
||||
'label' => _('Authorize Microsoft Office Plugin to connect.'),
|
||||
'data' => true,
|
||||
));
|
||||
}
|
||||
|
||||
public function getName()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
@@ -1,38 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2013 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Alchemy\Phrasea\Form\Configuration;
|
||||
|
||||
use Alchemy\Phrasea\Model\Entities\Task;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
||||
class PushFormType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$builder->add('GV_validation_reminder', 'integer', array(
|
||||
'label' => _('Number of days before the end of the validation to send a reminder email'),
|
||||
'data' => 2,
|
||||
));
|
||||
$builder->add('GV_val_expiration', 'integer', array(
|
||||
'label' => _('Default validation links duration'),
|
||||
'data' => 10,
|
||||
'help_message' => _('If set to 0, duration is permanent'),
|
||||
));
|
||||
}
|
||||
|
||||
public function getName()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
@@ -11,26 +11,20 @@
|
||||
|
||||
namespace Alchemy\Phrasea\Form\Configuration;
|
||||
|
||||
use Alchemy\Phrasea\Model\Entities\Task;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\Routing\Generator\UrlGenerator;
|
||||
use Symfony\Component\Routing\Exception\RouteNotFoundException;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
||||
class RegistrationFormType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$builder->add('GV_autoselectDB', 'checkbox', array(
|
||||
'label' => _('Auto select databases'),
|
||||
'data' => true,
|
||||
'help_message' => _('This option disables the selecting of the databases on which a user can register himself, and registration is made on all granted databases.'),
|
||||
));
|
||||
$builder->add('GV_autoregister', 'checkbox', array(
|
||||
'label' => _('Enable auto registration'),
|
||||
'data' => false,
|
||||
));
|
||||
$builder->add('auto-select-collections', 'checkbox', [
|
||||
'label' => 'Auto select databases',
|
||||
'help_message' => 'This option disables the selecting of the databases on which a user can register himself, and registration is made on all granted databases.',
|
||||
]);
|
||||
$builder->add('auto-register-enabled', 'checkbox', [
|
||||
'label' => 'Enable auto registration',
|
||||
]);
|
||||
}
|
||||
|
||||
public function getName()
|
||||
|
@@ -1,36 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2013 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Alchemy\Phrasea\Form\Configuration;
|
||||
|
||||
use Alchemy\Phrasea\Model\Entities\Task;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\Routing\Generator\UrlGenerator;
|
||||
use Symfony\Component\Routing\Exception\RouteNotFoundException;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
||||
class ReportFormType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$builder->add('GV_anonymousReport', 'checkbox', array(
|
||||
'label' => _('Anonymous report'),
|
||||
'data' => false,
|
||||
'help_message' => _('Hide information about users'),
|
||||
));
|
||||
}
|
||||
|
||||
public function getName()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
@@ -1,46 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2013 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Alchemy\Phrasea\Form\Configuration;
|
||||
|
||||
use Alchemy\Phrasea\Model\Entities\Task;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
||||
class RobotsFormType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$builder->add('GV_homeTitle', 'text', array(
|
||||
'label' => _('Application title'),
|
||||
'data' => 'Phraseanet',
|
||||
));
|
||||
$builder->add('GV_metaKeywords', 'text', array(
|
||||
'label' => _('Keywords used for indexing purposes by search engines robots'),
|
||||
));
|
||||
$builder->add('GV_metaDescription', 'textarea', array(
|
||||
'label' => _('Application description'),
|
||||
));
|
||||
$builder->add('GV_googleAnalytics', 'text', array(
|
||||
'label' => _('Google Analytics identifier'),
|
||||
));
|
||||
$builder->add('GV_allow_search_engine', 'checkbox', array(
|
||||
'label' => _('Allow the website to be indexed by search engines like Google'),
|
||||
'data' => true,
|
||||
));
|
||||
}
|
||||
|
||||
public function getName()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
@@ -11,32 +11,25 @@
|
||||
|
||||
namespace Alchemy\Phrasea\Form\Configuration;
|
||||
|
||||
use Alchemy\Phrasea\Model\Entities\Task;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\Routing\Generator\UrlGenerator;
|
||||
use Symfony\Component\Routing\Exception\RouteNotFoundException;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
||||
class SearchEngineFormType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$builder->add('GV_min_letters_truncation', 'integer', array(
|
||||
'label' => _('Minimum number of letters before truncation'),
|
||||
'data' => 1,
|
||||
'help_message' => _('Used in search engine'),
|
||||
));
|
||||
$builder->add('GV_defaultQuery', 'text', array(
|
||||
'label' => _('Default query'),
|
||||
'data' => 'all',
|
||||
));
|
||||
$builder->add('GV_defaultQuery_type', 'choice', array(
|
||||
'label' => _('Default searched type'),
|
||||
'data' => 0,
|
||||
'help_message' => _('Used when opening the application'),
|
||||
'choices' => array('0' => _('Documents'), '1' => _('Stories')),
|
||||
));
|
||||
$builder->add('min-letters-truncation', 'integer', [
|
||||
'label' => 'Minimum number of letters before truncation',
|
||||
'help_message' => 'Used in search engine',
|
||||
]);
|
||||
$builder->add('default-query', 'text', [
|
||||
'label' => 'Default query',
|
||||
]);
|
||||
$builder->add('default-query-type', 'choice', [
|
||||
'label' => 'Default searched type',
|
||||
'help_message' => 'Used when opening the application',
|
||||
'choices' => ['0' => 'Documents', '1' => 'Stories'],
|
||||
]);
|
||||
}
|
||||
|
||||
public function getName()
|
||||
|
@@ -11,38 +11,43 @@
|
||||
|
||||
namespace Alchemy\Phrasea\Form\Configuration;
|
||||
|
||||
use Alchemy\Phrasea\Model\Entities\Task;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
use Symfony\Component\Translation\TranslatorInterface;
|
||||
|
||||
class WebservicesFormType extends AbstractType
|
||||
{
|
||||
private $translator;
|
||||
|
||||
public function __construct(TranslatorInterface $translator)
|
||||
{
|
||||
$this->translator = $translator;
|
||||
}
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$recaptchaDoc = '<a href="http://www.google.com/recaptcha">http://www.google.com/recaptcha</a>';
|
||||
|
||||
$builder->add('GV_google_api', 'checkbox', array(
|
||||
'label' => _('Use Google Chart API'),
|
||||
'data' => true,
|
||||
));
|
||||
$builder->add('GV_i18n_service', 'text', array(
|
||||
'label' => _('Geonames server address'),
|
||||
'data' => 'https://geonames.alchemyasp.com/',
|
||||
));
|
||||
$builder->add('GV_captchas', 'checkbox', array(
|
||||
'label' => _('Use recaptcha API'),
|
||||
'data' => false,
|
||||
'help_message' => _(sprintf('See documentation at %s', $recaptchaDoc)),
|
||||
));
|
||||
$builder->add('GV_captcha_public_key', 'text', array(
|
||||
'label' => _('Recaptcha public key'),
|
||||
'data' => '',
|
||||
));
|
||||
$builder->add('GV_captcha_private_key', 'text', array(
|
||||
'label' => _('Recaptcha private key'),
|
||||
'data' => '',
|
||||
));
|
||||
$builder->add('google-charts-enabled', 'checkbox', [
|
||||
'label' => 'Use Google Chart API',
|
||||
]);
|
||||
$builder->add('geonames-server', 'text', [
|
||||
'label' => 'Geonames server address',
|
||||
]);
|
||||
|
||||
$help = $this->translator->trans('See documentation at %url%', ['%url%' => $recaptchaDoc]);
|
||||
|
||||
$builder->add('captchas-enabled', 'checkbox', [
|
||||
'label' => 'Use recaptcha API',
|
||||
/** @Ignore */
|
||||
'help_message' => $help
|
||||
]);
|
||||
$builder->add('recaptcha-public-key', 'text', [
|
||||
'label' => 'Recaptcha public key',
|
||||
]);
|
||||
$builder->add('recaptcha-private-key', 'text', [
|
||||
'label' => 'Recaptcha private key',
|
||||
]);
|
||||
}
|
||||
|
||||
public function getName()
|
||||
|
@@ -1,65 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2013 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Alchemy\Phrasea\Form\Configuration;
|
||||
|
||||
use Alchemy\Phrasea\Model\Entities\Task;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\Routing\Generator\UrlGenerator;
|
||||
use Symfony\Component\Routing\Exception\RouteNotFoundException;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
||||
class YoutubeFormType extends AbstractType
|
||||
{
|
||||
/** @var UrlGenerator */
|
||||
private $generator;
|
||||
|
||||
public function __construct(UrlGenerator $generator)
|
||||
{
|
||||
$this->generator = $generator;
|
||||
}
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$dashboard_youtube = '<a href="https://code.google.com/apis/youtube/dashboard/" target="_blank">https://code.google.com/apis/youtube/dashboard/</a>';
|
||||
$youtube_console_url = '<a href="https://code.google.com/apis/console/" target="_blank">https://code.google.com/apis/console/</a>';
|
||||
|
||||
try {
|
||||
$youtube_callback = $this->generator->generate('prod_bridge_callback', array('api_name' => 'youtube'), UrlGenerator::ABSOLUTE_URL);
|
||||
} catch (RouteNotFoundException $e) {
|
||||
$youtube_callback = null;
|
||||
}
|
||||
|
||||
$builder->add('GV_youtube_api', 'checkbox', array(
|
||||
'label' => _('Use youtube API'),
|
||||
'data' => false,
|
||||
'help_message' => sprintf(_('Create API account at %s, then use %s as callback URL value'), $youtube_console_url, $youtube_callback),
|
||||
));
|
||||
|
||||
|
||||
$builder->add('GV_youtube_client_id', 'text', array(
|
||||
'label' => _('Youtube public key'),
|
||||
));
|
||||
$builder->add('GV_youtube_client_secret', 'text', array(
|
||||
'label' => _('Youtube secret key'),
|
||||
));
|
||||
$builder->add('GV_youtube_dev_key', 'text', array(
|
||||
'label' => _('Youtube developer key'),
|
||||
'help_message' => sprintf(_('See %s'), $dashboard_youtube),
|
||||
));
|
||||
}
|
||||
|
||||
public function getName()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
39
lib/Alchemy/Phrasea/Form/Extension/HelpTypeExtension.php
Normal file
39
lib/Alchemy/Phrasea/Form/Extension/HelpTypeExtension.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace Alchemy\Phrasea\Form\Extension;
|
||||
|
||||
use Symfony\Component\Form\AbstractTypeExtension;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
|
||||
use Symfony\Component\Form\FormView;
|
||||
use Symfony\Component\Form\FormInterface;
|
||||
|
||||
class HelpTypeExtension extends AbstractTypeExtension
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getExtendedType()
|
||||
{
|
||||
return 'form';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function setDefaultOptions(OptionsResolverInterface $resolver)
|
||||
{
|
||||
$resolver->setOptional(['help_message']);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function buildView(FormView $view, FormInterface $form, array $options)
|
||||
{
|
||||
$message = null;
|
||||
if (array_key_exists('help_message', $options)) {
|
||||
$message = $options['help_message'];
|
||||
}
|
||||
$view->vars['help_message'] = $message;
|
||||
}
|
||||
}
|
@@ -107,7 +107,7 @@ class PhraseaRegisterForm extends AbstractType
|
||||
}
|
||||
}
|
||||
|
||||
if (!$this->app['phraseanet.registry']->get('GV_autoselectDB')) {
|
||||
if (!$this->app['conf']->get(['registry', 'registration', 'auto-select-collections'])) {
|
||||
$builder->add('collections', 'choice', [
|
||||
'choices' => $choices,
|
||||
'multiple' => true,
|
||||
|
@@ -67,7 +67,7 @@ abstract class AbstractMail implements MailInterface
|
||||
*/
|
||||
public function getPhraseanetTitle()
|
||||
{
|
||||
return $this->app['phraseanet.registry']->get('GV_homeTitle');
|
||||
return $this->app['conf']->get(['registry', 'general', 'title']);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -46,7 +46,7 @@ class MailInfoValidationReminder extends AbstractMailWithLink
|
||||
public function getMessage()
|
||||
{
|
||||
return $this->app->trans('Il ne vous reste plus que %quantity% jours pour terminer votre validation', [
|
||||
'%quantity%' => $this->app['phraseanet.registry']->get('GV_validation_reminder')
|
||||
'%quantity%' => $this->app['conf']->get(['registry', 'actions', 'validation-reminder-days'])
|
||||
]);
|
||||
}
|
||||
|
||||
|
@@ -34,7 +34,7 @@ class MailSuccessEmailConfirmationRegistered extends AbstractMailWithLink
|
||||
*/
|
||||
public function getButtonText()
|
||||
{
|
||||
return $this->app->trans('Your access on %application%', ['%application%' => $this->app['phraseanet.registry']->get('GV_homeTile')]);
|
||||
return $this->app->trans('Your access on %application%', ['%application%' => $this->app['conf']->get(['registry', 'general', 'title'])]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -1586,10 +1586,10 @@ class PhraseaEngineQueryParser
|
||||
for ($i = 0; $i < $length; $i++) {
|
||||
$c = substr($w, $i, 1);
|
||||
if ($c == "?" || $c == "*") {
|
||||
if ($nok < $this->app['phraseanet.registry']->get('GV_min_letters_truncation')) {
|
||||
if ($nok < $this->app['conf']->get(['registry', 'searchengine', 'min-letters-truncation'])) {
|
||||
if ($this->errmsg != "")
|
||||
$this->errmsg .= sprintf("\\n");
|
||||
$this->errmsg .= $this->app->trans('qparser:: Formulation incorrecte, necessite plus de caractere :') . "<br>" . $this->app['phraseanet.registry']->get('GV_min_letters_truncation');
|
||||
$this->errmsg .= $this->app->trans('qparser:: Formulation incorrecte, necessite plus de caractere :') . "<br>" . $this->app['conf']->get(['registry', 'searchengine', 'min-letters-truncation']);
|
||||
|
||||
return(null);
|
||||
}
|
||||
|
@@ -13,6 +13,7 @@ namespace Alchemy\Phrasea\Setup;
|
||||
|
||||
use Alchemy\Phrasea\Application;
|
||||
use Doctrine\ORM\Tools\SchemaTool;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
class Installer
|
||||
{
|
||||
@@ -52,32 +53,21 @@ class Installer
|
||||
|
||||
private function populateRegistryData($serverName, $dataPath)
|
||||
{
|
||||
// required to load GV template
|
||||
$app = $this->app;
|
||||
$GV = require __DIR__ . '/../../../../lib/conf.d/_GV_template.inc';
|
||||
|
||||
foreach ($GV as $section) {
|
||||
foreach ($section['vars'] as $var) {
|
||||
if (isset($var['default'])) {
|
||||
$this->app['phraseanet.registry']->set($var['name'], $var['default'], $var['type']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (null === realpath($dataPath)) {
|
||||
throw new \InvalidArgumentException(sprintf('Path %s does not exist.', $dataPath));
|
||||
}
|
||||
|
||||
$dataPath = realpath($dataPath) . DIRECTORY_SEPARATOR;
|
||||
|
||||
$this->app['phraseanet.registry']->set('GV_base_datapath_noweb', $dataPath, \registry::TYPE_STRING);
|
||||
$this->app['phraseanet.registry']->set('GV_ServerName', $serverName, \registry::TYPE_STRING);
|
||||
$this->app['conf']->set(['main', 'storage', 'subdefs', 'default-dir'], $dataPath);
|
||||
$this->app['conf']->set('servername', $serverName);
|
||||
$this->app['conf']->set('registry', $this->app['registry.manipulator']->getRegistryData());
|
||||
}
|
||||
|
||||
private function createDB(\connection_interface $dbConn = null, $template)
|
||||
{
|
||||
$template = new \SplFileInfo(__DIR__ . '/../../../conf.d/data_templates/' . $template . '-simple.xml');
|
||||
$databox = \databox::create($this->app, $dbConn, $template, $this->app['phraseanet.registry']);
|
||||
$databox = \databox::create($this->app, $dbConn, $template);
|
||||
$this->app['acl']->get($this->app['authentication']->getUser())
|
||||
->give_access_to_sbas([$databox->get_sbas_id()])
|
||||
->update_rights_to_sbas(
|
||||
@@ -170,8 +160,6 @@ class Installer
|
||||
$tool->dropSchema($metadatas);
|
||||
$tool->createSchema($metadatas);
|
||||
}
|
||||
|
||||
$this->app['phraseanet.registry'] = new \registry($this->app);
|
||||
}
|
||||
|
||||
private function createConfigFile($abConn, $serverName, $binaryData)
|
||||
@@ -191,7 +179,6 @@ class Installer
|
||||
$config['servername'] = $serverName;
|
||||
$config['main']['key'] = md5(mt_rand(100000000, 999999999));
|
||||
|
||||
$this->app['phraseanet.registry']->setKey($config['main']['key']);
|
||||
$this->app['configuration.store']->setConfig($config);
|
||||
}
|
||||
}
|
||||
|
@@ -12,11 +12,12 @@
|
||||
namespace Alchemy\Phrasea\Setup\Probe;
|
||||
|
||||
use Alchemy\Phrasea\Application;
|
||||
use Alchemy\Phrasea\Core\Configuration\PropertyAccess;
|
||||
use Alchemy\Phrasea\Setup\Requirements\FilesystemRequirements;
|
||||
|
||||
class FilesystemProbe extends FilesystemRequirements implements ProbeInterface
|
||||
{
|
||||
public function __construct(\registryInterface $registry)
|
||||
public function __construct(PropertyAccess $conf)
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
@@ -34,10 +35,8 @@ class FilesystemProbe extends FilesystemRequirements implements ProbeInterface
|
||||
);
|
||||
}
|
||||
|
||||
$path = [];
|
||||
|
||||
if ($registry->is_set('GV_base_datapath_noweb')) {
|
||||
$paths[] = $registry->get('GV_base_datapath_noweb');
|
||||
if ($conf->has(['main', 'storage', 'subdefs', 'default-dir'])) {
|
||||
$paths[] = $conf->get(['main', 'storage', 'subdefs', 'default-dir']);
|
||||
}
|
||||
|
||||
foreach ($paths as $path) {
|
||||
@@ -56,6 +55,6 @@ class FilesystemProbe extends FilesystemRequirements implements ProbeInterface
|
||||
*/
|
||||
public static function create(Application $app)
|
||||
{
|
||||
return new static($app['phraseanet.registry']);
|
||||
return new static($app['conf']);
|
||||
}
|
||||
}
|
||||
|
@@ -24,16 +24,403 @@ class Migration31 implements MigrationInterface
|
||||
|
||||
public function migrate()
|
||||
{
|
||||
if (!file_exists(__DIR__ . '/../../../../../../config/_GV.php')
|
||||
|| !file_exists(__DIR__ . '/../../../../../../lib/conf.d/_GV_template.inc')) {
|
||||
if (!file_exists(__DIR__ . '/../../../../../../config/_GV.php')) {
|
||||
throw new \LogicException('Required config files not found');
|
||||
}
|
||||
|
||||
// required to load GV template
|
||||
$app = $this->app;
|
||||
|
||||
require __DIR__ . '/../../../../../../config/_GV.php';
|
||||
$GV = require __DIR__ . '/../../../../../../lib/conf.d/_GV_template.inc';
|
||||
$GV = [
|
||||
[
|
||||
'type' => 'string',
|
||||
'name' => 'GV_default_lng',
|
||||
'default' => 'fr_FR',
|
||||
],
|
||||
[
|
||||
'type' => 'string',
|
||||
'name' => 'GV_STATIC_URL',
|
||||
'default' => '',
|
||||
],
|
||||
[
|
||||
'type' => 'string',
|
||||
'name' => 'GV_message',
|
||||
'default' => "May the force be with you"
|
||||
],
|
||||
[
|
||||
'type' => 'boolean',
|
||||
'name' => 'GV_message_on',
|
||||
'default' => false
|
||||
],
|
||||
[
|
||||
'type' => 'boolean',
|
||||
'name' => 'GV_log_errors',
|
||||
'default' => false
|
||||
],
|
||||
[
|
||||
'type' => 'boolean',
|
||||
'name' => 'GV_google_api',
|
||||
'default' => true,
|
||||
],
|
||||
[
|
||||
'type' => 'string',
|
||||
'name' => 'GV_i18n_service',
|
||||
'default' => 'https://geonames.alchemyasp.com/',
|
||||
],
|
||||
[
|
||||
'type' => 'boolean',
|
||||
'name' => 'GV_captchas',
|
||||
'default' => false,
|
||||
],
|
||||
[
|
||||
'type' => 'string',
|
||||
'name' => 'GV_captcha_public_key',
|
||||
'default' => ''
|
||||
],
|
||||
[
|
||||
'type' => 'string',
|
||||
'name' => 'GV_captcha_private_key',
|
||||
'default' => ''
|
||||
],
|
||||
[
|
||||
'type' => 'boolean',
|
||||
'name' => 'GV_youtube_api',
|
||||
'default' => false,
|
||||
],
|
||||
[
|
||||
'type' => 'string',
|
||||
'name' => 'GV_youtube_client_id',
|
||||
'default' => ''
|
||||
],
|
||||
[
|
||||
'type' => 'string',
|
||||
'name' => 'GV_youtube_client_secret',
|
||||
'default' => ''
|
||||
],
|
||||
[
|
||||
'type' => 'string',
|
||||
'name' => 'GV_youtube_dev_key',
|
||||
'default' => ''
|
||||
],
|
||||
[
|
||||
'type' => 'boolean',
|
||||
'name' => 'GV_flickr_api',
|
||||
'default' => false,
|
||||
],
|
||||
[
|
||||
'type' => 'string',
|
||||
'name' => 'GV_flickr_client_id',
|
||||
'default' => ''
|
||||
],
|
||||
[
|
||||
'type' => 'string',
|
||||
'name' => 'GV_flickr_client_secret',
|
||||
'default' => ''
|
||||
],
|
||||
[
|
||||
'type' => 'boolean',
|
||||
'name' => 'GV_dailymotion_api',
|
||||
'default' => false,
|
||||
],
|
||||
[
|
||||
'type' => 'string',
|
||||
'name' => 'GV_dailymotion_client_id',
|
||||
'default' => ''
|
||||
],
|
||||
[
|
||||
'type' => 'string',
|
||||
'name' => 'GV_dailymotion_client_secret',
|
||||
'default' => ''
|
||||
],
|
||||
[
|
||||
'type' => 'boolean',
|
||||
'name' => 'GV_client_navigator',
|
||||
'default' => true,
|
||||
],
|
||||
[
|
||||
'type' => 'boolean',
|
||||
'name' => 'GV_client_officeplugin',
|
||||
'default' => true,
|
||||
],
|
||||
[
|
||||
'type' => 'string',
|
||||
'name' => 'GV_base_datapath_noweb',
|
||||
'default' => '',
|
||||
],
|
||||
[
|
||||
'type' => 'boolean',
|
||||
'name' => 'GV_h264_streaming',
|
||||
'default' => false
|
||||
],
|
||||
[
|
||||
'type' => 'string',
|
||||
'name' => 'GV_mod_auth_token_directory',
|
||||
'default' => false
|
||||
],
|
||||
[
|
||||
'type' => 'string',
|
||||
'name' => 'GV_mod_auth_token_directory_path',
|
||||
'default' => false
|
||||
],
|
||||
[
|
||||
'type' => 'string',
|
||||
'name' => 'GV_mod_auth_token_passphrase',
|
||||
'default' => false
|
||||
],
|
||||
[
|
||||
'type' => 'string',
|
||||
'name' => 'GV_PHP_INI',
|
||||
'default' => ''
|
||||
],
|
||||
[
|
||||
'type' => 'string',
|
||||
'name' => 'GV_imagine_driver',
|
||||
'default' => '',
|
||||
],
|
||||
[
|
||||
'type' => 'integer',
|
||||
'name' => 'GV_ffmpeg_threads',
|
||||
'default' => 2
|
||||
],
|
||||
[
|
||||
'type' => 'integer',
|
||||
'name' => 'GV_pdfmaxpages',
|
||||
'default' => 5
|
||||
],
|
||||
[
|
||||
'type' => 'string',
|
||||
'name' => 'GV_adminMail',
|
||||
'default' => 'support@alchemy.fr'
|
||||
],
|
||||
[
|
||||
'type' => 'boolean',
|
||||
'name' => 'GV_view_bas_and_coll',
|
||||
'default' => true,
|
||||
],
|
||||
[
|
||||
'type' => 'boolean',
|
||||
'name' => 'GV_choose_export_title',
|
||||
'default' => false,
|
||||
],
|
||||
[
|
||||
'type' => 'string',
|
||||
'name' => 'GV_default_export_title',
|
||||
'default' => 'title',
|
||||
],
|
||||
[
|
||||
'type' => 'string',
|
||||
'name' => 'GV_social_tools',
|
||||
'default' => 'none',
|
||||
],
|
||||
[
|
||||
'type' => 'string',
|
||||
'name' => 'GV_home_publi',
|
||||
'default' => 'COOLIRIS',
|
||||
],
|
||||
[
|
||||
'type' => 'integer',
|
||||
'name' => 'GV_min_letters_truncation',
|
||||
'default' => 1
|
||||
],
|
||||
[
|
||||
'type' => 'string',
|
||||
'name' => 'GV_defaultQuery',
|
||||
'default' => 'all'
|
||||
],
|
||||
[
|
||||
'type' => 'string',
|
||||
'name' => 'GV_defaultQuery_type',
|
||||
'default' => '0'
|
||||
],
|
||||
[
|
||||
'type' => 'boolean',
|
||||
'name' => 'GV_anonymousReport',
|
||||
'default' => false,
|
||||
],
|
||||
[
|
||||
'type' => 'boolean',
|
||||
'name' => 'GV_thesaurus',
|
||||
'default' => true
|
||||
],
|
||||
[
|
||||
'type' => 'boolean',
|
||||
'name' => 'GV_multiAndReport',
|
||||
'default' => true
|
||||
],
|
||||
[
|
||||
'type' => 'boolean',
|
||||
'name' => 'GV_seeOngChgDoc',
|
||||
'default' => false
|
||||
],
|
||||
[
|
||||
'type' => 'boolean',
|
||||
'name' => 'GV_seeNewThumb',
|
||||
'default' => false
|
||||
],
|
||||
[
|
||||
'type' => 'string',
|
||||
'name' => 'GV_defaulmailsenderaddr',
|
||||
'default' => 'phraseanet@example.com'
|
||||
],
|
||||
[
|
||||
'type' => 'string',
|
||||
'name' => 'GV_email_prefix',
|
||||
'default' => ''
|
||||
],
|
||||
[
|
||||
'type' => 'boolean',
|
||||
'name' => 'GV_smtp',
|
||||
'default' => false
|
||||
],
|
||||
[
|
||||
'type' => 'boolean',
|
||||
'name' => 'GV_smtp_auth',
|
||||
'default' => false
|
||||
],
|
||||
[
|
||||
'type' => 'string',
|
||||
'name' => 'GV_smtp_host',
|
||||
'default' => ''
|
||||
],
|
||||
[
|
||||
'type' => 'string',
|
||||
'name' => 'GV_smtp_port',
|
||||
'default' => ''
|
||||
],
|
||||
[
|
||||
'type' => 'string',
|
||||
'name' => 'GV_smtp_secure',
|
||||
'default' => 'tls',
|
||||
],
|
||||
[
|
||||
'type' => 'string',
|
||||
'name' => 'GV_smtp_user',
|
||||
'default' => ''
|
||||
],
|
||||
[
|
||||
'type' => 'string',
|
||||
'name' => 'GV_smtp_password',
|
||||
'default' => ''
|
||||
],
|
||||
[
|
||||
'type' => 'boolean',
|
||||
'name' => 'GV_activeFTP',
|
||||
'default' => false
|
||||
],
|
||||
[
|
||||
'type' => 'boolean',
|
||||
'name' => 'GV_ftp_for_user',
|
||||
'default' => false
|
||||
],
|
||||
[
|
||||
'type' => 'integer',
|
||||
'name' => 'GV_download_max',
|
||||
'default' => 120
|
||||
],
|
||||
[
|
||||
'type' => 'integer',
|
||||
'name' => 'GV_ong_search',
|
||||
'default' => 1
|
||||
],
|
||||
[
|
||||
'type' => 'integer',
|
||||
'name' => 'GV_ong_advsearch',
|
||||
'default' => 2
|
||||
],
|
||||
[
|
||||
'type' => 'integer',
|
||||
'name' => 'GV_ong_topics',
|
||||
'default' => 0
|
||||
],
|
||||
[
|
||||
'type' => 'integer',
|
||||
'name' => 'GV_ong_actif',
|
||||
'default' => 1
|
||||
],
|
||||
[
|
||||
'type' => 'string',
|
||||
'name' => 'GV_client_render_topics',
|
||||
'default' => 'tree'
|
||||
],
|
||||
[
|
||||
'type' => 'boolean',
|
||||
'name' => 'GV_rollover_reg_preview',
|
||||
'default' => true
|
||||
],
|
||||
[
|
||||
'type' => 'boolean',
|
||||
'name' => 'GV_rollover_chu',
|
||||
'default' => true
|
||||
],
|
||||
[
|
||||
'type' => 'string',
|
||||
'name' => 'GV_client_coll_ckbox',
|
||||
'default' => 'checkbox',
|
||||
],
|
||||
[
|
||||
'type' => 'boolean',
|
||||
'name' => 'GV_viewSizeBaket',
|
||||
'default' => true
|
||||
],
|
||||
[
|
||||
'type' => 'boolean',
|
||||
'name' => 'GV_clientAutoShowProposals',
|
||||
'default' => true
|
||||
],
|
||||
[
|
||||
'type' => 'boolean',
|
||||
'name' => 'GV_needAuth2DL',
|
||||
'default' => true
|
||||
],
|
||||
[
|
||||
'type' => 'boolean',
|
||||
'name' => 'GV_requireTOUValidationForExport',
|
||||
'default' => false
|
||||
],
|
||||
[
|
||||
'type' => 'boolean',
|
||||
'name' => 'GV_autoselectDB',
|
||||
'default' => true
|
||||
],
|
||||
[
|
||||
'type' => 'boolean',
|
||||
'name' => 'GV_autoregister',
|
||||
'default' => false
|
||||
],
|
||||
[
|
||||
'type' => 'integer',
|
||||
'name' => 'GV_validation_reminder',
|
||||
'default' => 2
|
||||
],
|
||||
[
|
||||
'type' => 'integer',
|
||||
'name' => 'GV_val_expiration',
|
||||
'default' => 10
|
||||
],
|
||||
[
|
||||
'type' => 'string',
|
||||
'name' => 'GV_homeTitle',
|
||||
'default' => 'Phraseanet'
|
||||
],
|
||||
[
|
||||
'type' => 'string',
|
||||
'name' => 'GV_metaKeywords',
|
||||
'default' => ''
|
||||
],
|
||||
[
|
||||
'type' => 'string',
|
||||
'name' => 'GV_metaDescription',
|
||||
'default' => ''
|
||||
],
|
||||
[
|
||||
'type' => 'string',
|
||||
'name' => 'GV_googleAnalytics',
|
||||
'default' => ''
|
||||
],
|
||||
[
|
||||
'type' => 'boolean',
|
||||
'name' => 'GV_allow_search_engine',
|
||||
'default' => true
|
||||
],
|
||||
];
|
||||
|
||||
$retrieve_old_credentials = function () {
|
||||
require __DIR__ . '/../../../../../../config/connexion.inc';
|
||||
@@ -58,8 +445,6 @@ class Migration31 implements MigrationInterface
|
||||
character_set_connection = 'utf8', character_set_database = 'utf8',
|
||||
character_set_server = 'utf8'");
|
||||
|
||||
define('GV_STATIC_URL', '');
|
||||
|
||||
$connection->exec("CREATE TABLE IF NOT EXISTS `registry` (
|
||||
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`key` char(32) CHARACTER SET ascii COLLATE ascii_bin NOT NULL,
|
||||
@@ -73,66 +458,52 @@ class Migration31 implements MigrationInterface
|
||||
VALUES (null, :key, :value, :type)';
|
||||
$stmt = $connection->prepare($sql);
|
||||
|
||||
foreach ($GV as $section => $datas_section) {
|
||||
foreach ($datas_section['vars'] as $datas) {
|
||||
if (defined($datas["name"])) {
|
||||
$val = constant($datas["name"]);
|
||||
} elseif (isset($datas['default'])) {
|
||||
$val = $datas['default'];
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
|
||||
$val = $val === true ? '1' : $val;
|
||||
$val = $val === false ? '0' : $val;
|
||||
|
||||
$type = $datas['type'];
|
||||
switch ($datas['type']) {
|
||||
case \registry::TYPE_ENUM_MULTI:
|
||||
$val = serialize($val);
|
||||
break;
|
||||
case \registry::TYPE_INTEGER:
|
||||
$val = (int) $val;
|
||||
break;
|
||||
case \registry::TYPE_BOOLEAN:
|
||||
$val = $val ? '1' : '0';
|
||||
break;
|
||||
case \registry::TYPE_STRING:
|
||||
case \registry::TYPE_BINARY:
|
||||
case \registry::TYPE_TEXT:
|
||||
case \registry::TYPE_TIMEZONE:
|
||||
case \registry::TYPE_ENUM:
|
||||
$val = (string) $val;
|
||||
break;
|
||||
default:
|
||||
$val = (string) $val;
|
||||
$type = \registry::TYPE_STRING;
|
||||
break;
|
||||
}
|
||||
|
||||
$stmt->execute([
|
||||
':key' => $datas['name'],
|
||||
':value' => $val,
|
||||
':type' => $type,
|
||||
]);
|
||||
foreach ($GV as $datas) {
|
||||
if (defined($datas["name"])) {
|
||||
$val = constant($datas["name"]);
|
||||
} elseif (isset($datas['default'])) {
|
||||
$val = $datas['default'];
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
|
||||
$val = $val === true ? '1' : $val;
|
||||
$val = $val === false ? '0' : $val;
|
||||
|
||||
$type = $datas['type'];
|
||||
switch ($datas['type']) {
|
||||
case 'integer':
|
||||
$val = (int) $val;
|
||||
break;
|
||||
case 'boolean':
|
||||
$val = $val ? '1' : '0';
|
||||
break;
|
||||
case 'string':
|
||||
$val = (string) $val;
|
||||
break;
|
||||
default:
|
||||
$val = (string) $val;
|
||||
$type = 'string';
|
||||
break;
|
||||
}
|
||||
|
||||
$stmt->execute([
|
||||
':key' => $datas['name'],
|
||||
':value' => $val,
|
||||
':type' => $type,
|
||||
]);
|
||||
}
|
||||
|
||||
$stmt->execute([
|
||||
':key' => 'GV_sit',
|
||||
':value' => GV_sit,
|
||||
':type' => \registry::TYPE_STRING,
|
||||
':type' => 'string',
|
||||
]);
|
||||
|
||||
$stmt->closeCursor();
|
||||
|
||||
rename(__DIR__ . '/../../../../../../config/_GV.php', __DIR__ . '/../../../../../../config/_GV.php.old');
|
||||
|
||||
$servername = '';
|
||||
if (defined('GV_ServerName')) {
|
||||
$servername = GV_ServerName;
|
||||
}
|
||||
|
||||
$servername = defined('GV_ServerName') ? constant('GV_ServerName') : '';
|
||||
file_put_contents(__DIR__ . '/../../../../../../config/config.inc', "<?php\n\$servername = \"" . str_replace('"', '\"', $servername) . "\";\n");
|
||||
|
||||
return;
|
||||
|
@@ -329,84 +329,74 @@ class API_V1_adapter extends API_V1_Abstract
|
||||
|
||||
return [
|
||||
'global_values' => [
|
||||
'serverName' => $app['phraseanet.registry']->get('GV_ServerName'),
|
||||
'title' => $app['phraseanet.registry']->get('GV_homeTitle'),
|
||||
'keywords' => $app['phraseanet.registry']->get('GV_metaKeywords'),
|
||||
'description' => $app['phraseanet.registry']->get('GV_metaDescription'),
|
||||
'serverName' => $app['conf']->get('servername'),
|
||||
'title' => $app['conf']->get(['registry', 'general', 'title']),
|
||||
'keywords' => $app['conf']->get(['registry', 'general', 'keywords']),
|
||||
'description' => $app['conf']->get(['registry', 'general', 'description']),
|
||||
'httpServer' => [
|
||||
'logErrors' => $app['phraseanet.registry']->get('GV_log_errors'),
|
||||
'phpTimezone' => ini_get('date.timezone'),
|
||||
'siteId' => $app['conf']->get(['main', 'key']),
|
||||
'staticUrl' => $app['phraseanet.registry']->get('GV_STATIC_URL'),
|
||||
'defaultLanguage' => $app['phraseanet.registry']->get('id_GV_default_lng'),
|
||||
'allowIndexing' => $app['phraseanet.registry']->get('GV_allow_search_engine'),
|
||||
'defaultLanguage' => $app['conf']->get(['languages', 'default']),
|
||||
'allowIndexing' => $app['conf']->get(['registry', 'general', 'allow-indexation']),
|
||||
'modes' => [
|
||||
'XsendFile' => $app['conf']->get(['xsendfile', 'enabled']),
|
||||
'XsendFileMapping' => $app['conf']->get(['xsendfile', 'mapping']),
|
||||
'h264Streaming' => $app['phraseanet.registry']->get('GV_h264_streaming'),
|
||||
'authTokenDirectory' => $app['phraseanet.registry']->get('GV_mod_auth_token_directory'),
|
||||
'authTokenDirectoryPath' => $app['phraseanet.registry']->get('GV_mod_auth_token_directory_path'),
|
||||
'authTokenPassphrase' => $app['phraseanet.registry']->get('GV_mod_auth_token_passphrase'),
|
||||
'h264Streaming' => $app['conf']->get(['registry', 'executables', 'h264-streaming-enabled']),
|
||||
'authTokenDirectory' => $app['conf']->get(['registry', 'executables', 'auth-token-directory']),
|
||||
'authTokenDirectoryPath' => $app['conf']->get(['registry', 'executables', 'auth-token-directory-path']),
|
||||
'authTokenPassphrase' => $app['conf']->get(['registry', 'executables', 'auth-token-passphrase']),
|
||||
]
|
||||
],
|
||||
'maintenance' => [
|
||||
'alertMessage' => $app['phraseanet.registry']->get('GV_message'),
|
||||
'displayMessage' => $app['phraseanet.registry']->get('GV_message_on'),
|
||||
'alertMessage' => $app['conf']->get(['registry', 'maintenance', 'message']),
|
||||
'displayMessage' => $app['conf']->get(['registry', 'maintenance', 'enabled']),
|
||||
],
|
||||
'webServices' => [
|
||||
'googleApi' => $app['phraseanet.registry']->get('GV_google_api'),
|
||||
'googleAnalyticsId' => $app['phraseanet.registry']->get('GV_googleAnalytics'),
|
||||
'i18nWebService' => $app['phraseanet.registry']->get('GV_i18n_service'),
|
||||
'googleApi' => $app['conf']->get(['registry', 'webservices', 'google-charts-enabled']),
|
||||
'googleAnalyticsId' => $app['conf']->get(['registry', 'general', 'analytics']),
|
||||
'i18nWebService' => $app['conf']->get(['registry', 'webservices', 'geonames-server']),
|
||||
'recaptacha' => [
|
||||
'active' => $app['phraseanet.registry']->get('GV_captchas'),
|
||||
'publicKey' => $app['phraseanet.registry']->get('GV_captcha_public_key'),
|
||||
'privateKey' => $app['phraseanet.registry']->get('GV_captcha_private_key'),
|
||||
'active' => $app['conf']->get(['registry', 'webservices', 'captcha-enabled']),
|
||||
'publicKey' => $app['conf']->get(['registry', 'webservices', 'recaptcha-public-key']),
|
||||
'privateKey' => $app['conf']->get(['registry', 'webservices', 'recaptcha-private-key']),
|
||||
],
|
||||
'youtube' => [
|
||||
'active' => $app['phraseanet.registry']->get('GV_youtube_api'),
|
||||
'clientId' => $app['phraseanet.registry']->get('GV_youtube_client_id'),
|
||||
'clientSecret' => $app['phraseanet.registry']->get('GV_youtube_client_secret'),
|
||||
'devKey' => $app['phraseanet.registry']->get('GV_youtube_dev_key'),
|
||||
'active' => $app['conf']->get(['main', 'bridge', 'youtube', 'enabled']),
|
||||
'clientId' => $app['conf']->get(['main', 'bridge', 'youtube', 'client_id']),
|
||||
'clientSecret' => $app['conf']->get(['main', 'bridge', 'youtube', 'client_secret']),
|
||||
'devKey' => $app['conf']->get(['main', 'bridge', 'youtube', 'developer_key']),
|
||||
],
|
||||
'flickr' => [
|
||||
'active' => $app['phraseanet.registry']->get('GV_flickr_api'),
|
||||
'clientId' => $app['phraseanet.registry']->get('GV_flickr_client_id'),
|
||||
'clientSecret' => $app['phraseanet.registry']->get('GV_flickr_client_secret'),
|
||||
'active' => $app['conf']->get(['main', 'bridge', 'flickr', 'enabled']),
|
||||
'clientId' => $app['conf']->get(['main', 'bridge', 'flickr', 'client_id']),
|
||||
'clientSecret' => $app['conf']->get(['main', 'bridge', 'flickr', 'client_secret']),
|
||||
],
|
||||
'dailymtotion' => [
|
||||
'active' => $app['phraseanet.registry']->get('GV_dailymotion_api'),
|
||||
'clientId' => $app['phraseanet.registry']->get('GV_dailymotion_client_id'),
|
||||
'clientSecret' => $app['phraseanet.registry']->get('GV_dailymotion_client_secret'),
|
||||
'active' => $app['conf']->get(['main', 'bridge', 'dailymotion', 'enabled']),
|
||||
'clientId' => $app['conf']->get(['main', 'bridge', 'dailymotion', 'client_id']),
|
||||
'clientSecret' => $app['conf']->get(['main', 'bridge', 'dailymotion', 'client_secret']),
|
||||
]
|
||||
],
|
||||
'navigator' => [
|
||||
'active' => $app['phraseanet.registry']->get('GV_client_navigator'),
|
||||
'active' => $app['conf']->get(['registry', 'api-clients', 'navigator-enabled']),
|
||||
],
|
||||
'office-plugin' => [
|
||||
'active' => $app['phraseanet.registry']->get('GV_client_navigator'),
|
||||
'active' => $app['conf']->get(['registry', 'api-clients', 'office-enabled']),
|
||||
],
|
||||
'homepage' => [
|
||||
'viewType' => $app['phraseanet.registry']->get('GV_home_publi'),
|
||||
'viewType' => $app['conf']->get(['registry', 'general', 'home-presentation-mode']),
|
||||
],
|
||||
'report' => [
|
||||
'anonymous' => $app['phraseanet.registry']->get('GV_anonymousReport'),
|
||||
],
|
||||
'events' => [
|
||||
'events' => $app['phraseanet.registry']->get('GV_events'),
|
||||
'notifications' => $app['phraseanet.registry']->get('GV_notifications'),
|
||||
],
|
||||
'upload' => [
|
||||
'allowedFileExtension' => $app['phraseanet.registry']->get('GV_appletAllowedFileEx'),
|
||||
'anonymous' => $app['conf']->get(['registry', 'modules', 'anonymous-report']),
|
||||
],
|
||||
'filesystem' => [
|
||||
'noWeb' => $app['phraseanet.registry']->get('GV_base_datapath_noweb'),
|
||||
'noWeb' => $app['conf']->get(['main', 'storage', 'subdefs', 'default-dir']),
|
||||
],
|
||||
'searchEngine' => [
|
||||
'configuration' => [
|
||||
'defaultQuery' => $app['phraseanet.registry']->get('GV_defaultQuery'),
|
||||
'defaultQueryType' => $app['phraseanet.registry']->get('GV_defaultQuery_type'),
|
||||
'minChar' => $app['phraseanet.registry']->get('GV_min_letters_truncation'),
|
||||
'sort' => $app['phraseanet.registry']->get('GV_phrasea_sort'),
|
||||
'defaultQuery' => $app['conf']->get(['registry', 'searchengine', 'default-query']),
|
||||
'defaultQueryType' => $app['conf']->get(['registry', 'searchengine', 'default-query-type']),
|
||||
'minChar' => $app['conf']->get(['registry', 'searchengine', 'min-letters-truncation']),
|
||||
],
|
||||
'engine' => [
|
||||
'type' => $app['phraseanet.SE']->getName(),
|
||||
@@ -416,7 +406,7 @@ class API_V1_adapter extends API_V1_Abstract
|
||||
],
|
||||
'binary' => [
|
||||
'phpCli' => isset($binaries['php_binary']) ? $binaries['php_binary'] : null,
|
||||
'phpIni' => $app['phraseanet.registry']->get('GV_PHP_INI'),
|
||||
'phpIni' => $app['conf']->get(['registry', 'executables', 'php-conf-path']),
|
||||
'swfExtract' => isset($binaries['swf_extract_binary']) ? $binaries['swf_extract_binary'] : null,
|
||||
'pdf2swf' => isset($binaries['pdf2swf_binary']) ? $binaries['pdf2swf_binary'] : null,
|
||||
'swfRender' => isset($binaries['swf_render_binary']) ? $binaries['swf_render_binary'] : null,
|
||||
@@ -426,53 +416,52 @@ class API_V1_adapter extends API_V1_Abstract
|
||||
'mp4box' => isset($binaries['mp4box_binary']) ? $binaries['mp4box_binary'] : null,
|
||||
'pdftotext' => isset($binaries['pdftotext_binary']) ? $binaries['pdftotext_binary'] : null,
|
||||
'recess' => isset($binaries['recess_binary']) ? $binaries['recess_binary'] : null,
|
||||
'pdfmaxpages' => $app['phraseanet.registry']->get('GV_pdfmaxpages'),],
|
||||
'pdfmaxpages' => $app['conf']->get(['registry', 'executables', 'pdf-max-pages']),],
|
||||
'mainConfiguration' => [
|
||||
'adminMail' => $app['phraseanet.registry']->get('GV_adminMail'),
|
||||
'viewBasAndCollName' => $app['phraseanet.registry']->get('GV_view_bas_and_coll'),
|
||||
'chooseExportTitle' => $app['phraseanet.registry']->get('GV_choose_export_title'),
|
||||
'defaultExportTitle' => $app['phraseanet.registry']->get('GV_default_export_title'),
|
||||
'socialTools' => $app['phraseanet.registry']->get('GV_social_tools'),],
|
||||
'viewBasAndCollName' => $app['conf']->get(['registry', 'actions', 'collection-display']),
|
||||
'chooseExportTitle' => $app['conf']->get(['registry', 'actions', 'export-title-choice']),
|
||||
'defaultExportTitle' => $app['conf']->get(['registry', 'actions', 'default-export-title']),
|
||||
'socialTools' => $app['conf']->get(['registry', 'actions', 'social-tools']),],
|
||||
'modules' => [
|
||||
'thesaurus' => $app['phraseanet.registry']->get('GV_thesaurus'),
|
||||
'storyMode' => $app['phraseanet.registry']->get('GV_multiAndReport'),
|
||||
'docSubsitution' => $app['phraseanet.registry']->get('GV_seeOngChgDoc'),
|
||||
'subdefSubstitution' => $app['phraseanet.registry']->get('GV_seeNewThumb'),],
|
||||
'thesaurus' => $app['conf']->get(['registry', 'modules', 'thesaurus']),
|
||||
'storyMode' => $app['conf']->get(['registry', 'modules', 'stories']),
|
||||
'docSubsitution' => $app['conf']->get(['registry', 'modules', 'doc-substitution']),
|
||||
'subdefSubstitution' => $app['conf']->get(['registry', 'modules', 'thumb-substitution']),],
|
||||
'email' => [
|
||||
'defaultMailAddress' => $app['phraseanet.registry']->get('GV_defaulmailsenderaddr'),
|
||||
'defaultMailAddress' => $app['conf']->get(['registry', 'email', 'emitter-email']),
|
||||
'smtp' => [
|
||||
'active' => $app['phraseanet.registry']->get('GV_smtp'),
|
||||
'auth' => $app['phraseanet.registry']->get('GV_smtp_auth'),
|
||||
'host' => $app['phraseanet.registry']->get('GV_smtp_host'),
|
||||
'port' => $app['phraseanet.registry']->get('GV_smtp_port'),
|
||||
'secure' => $app['phraseanet.registry']->get('GV_smtp_secure'),
|
||||
'user' => $app['phraseanet.registry']->get('GV_smtp_user'),
|
||||
'password' => $app['phraseanet.registry']->get('GV_smtp_password'),
|
||||
'active' => $app['conf']->get(['registry', 'email', 'smtp-enabled']),
|
||||
'auth' => $app['conf']->get(['registry', 'email', 'smtp-auth-enabled']),
|
||||
'host' => $app['conf']->get(['registry', 'email', 'smtp-host']),
|
||||
'port' => $app['conf']->get(['registry', 'email', 'smtp-port']),
|
||||
'secure' => $app['conf']->get(['registry', 'email', 'smtp-secure-mode']),
|
||||
'user' => $app['conf']->get(['registry', 'email', 'smtp-user']),
|
||||
'password' => $app['conf']->get(['registry', 'email', 'smtp-password']),
|
||||
],
|
||||
],
|
||||
'ftp' => [
|
||||
'active' => $app['phraseanet.registry']->get('GV_activeFTP'),
|
||||
'activeForUser' => $app['phraseanet.registry']->get('GV_ftp_for_user'),],
|
||||
'active' => $app['conf']->get(['registry', 'ftp', 'ftp-enabled']),
|
||||
'activeForUser' => $app['conf']->get(['registry', 'ftp', 'ftp-user-access']),],
|
||||
'client' => [
|
||||
'maxSizeDownload' => $app['phraseanet.registry']->get('GV_download_max'),
|
||||
'tabSearchMode' => $app['phraseanet.registry']->get('GV_ong_search'),
|
||||
'tabAdvSearchPosition' => $app['phraseanet.registry']->get('GV_ong_advsearch'),
|
||||
'tabTopicsPosition' => $app['phraseanet.registry']->get('GV_ong_topics'),
|
||||
'tabOngActifPosition' => $app['phraseanet.registry']->get('GV_ong_actif'),
|
||||
'renderTopicsMode' => $app['phraseanet.registry']->get('GV_client_render_topics'),
|
||||
'displayRolloverPreview' => $app['phraseanet.registry']->get('GV_rollover_reg_preview'),
|
||||
'displayRolloverBasket' => $app['phraseanet.registry']->get('GV_rollover_chu'),
|
||||
'collRenderMode' => $app['phraseanet.registry']->get('GV_client_coll_ckbox'),
|
||||
'viewSizeBaket' => $app['phraseanet.registry']->get('GV_viewSizeBaket'),
|
||||
'clientAutoShowProposals' => $app['phraseanet.registry']->get('GV_clientAutoShowProposals'),
|
||||
'needAuth2DL' => $app['phraseanet.registry']->get('GV_needAuth2DL'),],
|
||||
'maxSizeDownload' => $app['conf']->get(['registry', 'actions', 'download-max-size']),
|
||||
'tabSearchMode' => $app['conf']->get(['registry', 'classic', 'search-tab']),
|
||||
'tabAdvSearchPosition' => $app['conf']->get(['registry', 'classic', 'adv-search-tab']),
|
||||
'tabTopicsPosition' => $app['conf']->get(['registry', 'classic', 'topics-tab']),
|
||||
'tabOngActifPosition' => $app['conf']->get(['registry', 'classic', 'active-tab']),
|
||||
'renderTopicsMode' => $app['conf']->get(['registry', 'classic', 'render-topics']),
|
||||
'displayRolloverPreview' => $app['conf']->get(['registry', 'classic', 'stories-preview']),
|
||||
'displayRolloverBasket' => $app['conf']->get(['registry', 'classic', 'basket-rollover']),
|
||||
'collRenderMode' => $app['conf']->get(['registry', 'classic', 'collection-presentation']),
|
||||
'viewSizeBaket' => $app['conf']->get(['registry', 'classic', 'basket-size-display']),
|
||||
'clientAutoShowProposals' => $app['conf']->get(['registry', 'classic', 'auto-show-proposals']),
|
||||
'needAuth2DL' => $app['conf']->get(['registry', 'actions', 'auth-required-for-export']),],
|
||||
'inscription' => [
|
||||
'autoSelectDB' => $app['phraseanet.registry']->get('GV_autoselectDB'),
|
||||
'autoRegister' => $app['phraseanet.registry']->get('GV_autoregister'),
|
||||
'autoSelectDB' => $app['conf']->get(['registry', 'registration', 'auto-select-collections']),
|
||||
'autoRegister' => $app['conf']->get(['registry', 'registration', 'auto-register-enabled']),
|
||||
],
|
||||
'push' => [
|
||||
'validationReminder' => $app['phraseanet.registry']->get('GV_validation_reminder'),
|
||||
'expirationValue' => $app['phraseanet.registry']->get('GV_val_expiration'),
|
||||
'validationReminder' => $app['conf']->get(['registry', 'actions', 'validation-reminder-days']),
|
||||
'expirationValue' => $app['conf']->get(['registry', 'actions', 'validation-expiration-days']),
|
||||
],
|
||||
]
|
||||
];
|
||||
@@ -1034,8 +1023,8 @@ class API_V1_adapter extends API_V1_Abstract
|
||||
$devices = $request->get('devices', []);
|
||||
$mimes = $request->get('mimes', []);
|
||||
|
||||
foreach ($record->get_embedable_medias($devices, $mimes) as $name => $media) {
|
||||
if (null !== $embed = $this->list_embedable_media($media, $this->app['phraseanet.registry'])) {
|
||||
foreach ($record->get_embedable_medias($devices, $mimes) as $media) {
|
||||
if (null !== $embed = $this->list_embedable_media($media)) {
|
||||
$ret[] = $embed;
|
||||
}
|
||||
}
|
||||
@@ -1068,8 +1057,8 @@ class API_V1_adapter extends API_V1_Abstract
|
||||
$devices = $request->get('devices', []);
|
||||
$mimes = $request->get('mimes', []);
|
||||
|
||||
foreach ($record->get_embedable_medias($devices, $mimes) as $name => $media) {
|
||||
if (null !== $embed = $this->list_embedable_media($media, $this->app['phraseanet.registry'])) {
|
||||
foreach ($record->get_embedable_medias($devices, $mimes) as $media) {
|
||||
if (null !== $embed = $this->list_embedable_media($media)) {
|
||||
$ret[] = $embed;
|
||||
}
|
||||
}
|
||||
@@ -1670,14 +1659,14 @@ class API_V1_adapter extends API_V1_Abstract
|
||||
* @param media_subdef $media
|
||||
* @return array
|
||||
*/
|
||||
protected function list_embedable_media(media_subdef $media, registryInterface $registry)
|
||||
protected function list_embedable_media(media_subdef $media)
|
||||
{
|
||||
if (!$media->is_physically_present()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if ($media->get_permalink() instanceof media_Permalink_Adapter) {
|
||||
$permalink = $this->list_permalink($media->get_permalink(), $registry);
|
||||
$permalink = $this->list_permalink($media->get_permalink());
|
||||
} else {
|
||||
$permalink = null;
|
||||
}
|
||||
@@ -1697,11 +1686,11 @@ class API_V1_adapter extends API_V1_Abstract
|
||||
/**
|
||||
* Retrieve detailled information about one permalink
|
||||
*
|
||||
* @param media_Permalink_Adapter $permalink
|
||||
* @param registryInterface $registry
|
||||
* @param media_Permalink_Adapter $permalink
|
||||
*
|
||||
* @return type
|
||||
*/
|
||||
protected function list_permalink(media_Permalink_Adapter $permalink, registryInterface $registry)
|
||||
protected function list_permalink(media_Permalink_Adapter $permalink)
|
||||
{
|
||||
return [
|
||||
'created_on' => $permalink->get_created_on()->format(DATE_ATOM),
|
||||
@@ -1856,7 +1845,7 @@ class API_V1_adapter extends API_V1_Abstract
|
||||
'created_on' => $record->get_creation_date()->format(DATE_ATOM),
|
||||
'collection_id' => phrasea::collFromBas($this->app, $record->get_base_id()),
|
||||
'sha256' => $record->get_sha256(),
|
||||
'thumbnail' => $this->list_embedable_media($record->get_thumbnail(), $this->app['phraseanet.registry']),
|
||||
'thumbnail' => $this->list_embedable_media($record->get_thumbnail()),
|
||||
'technical_informations' => $technicalInformation,
|
||||
'phrasea_type' => $record->get_type(),
|
||||
'uuid' => $record->get_uuid(),
|
||||
@@ -1901,7 +1890,7 @@ class API_V1_adapter extends API_V1_Abstract
|
||||
'updated_on' => $story->get_modification_date()->format(DATE_ATOM),
|
||||
'created_on' => $story->get_creation_date()->format(DATE_ATOM),
|
||||
'collection_id' => phrasea::collFromBas($this->app, $story->get_base_id()),
|
||||
'thumbnail' => $this->list_embedable_media($story->get_thumbnail(), $this->app['phraseanet.registry']),
|
||||
'thumbnail' => $this->list_embedable_media($story->get_thumbnail()),
|
||||
'uuid' => $story->get_uuid(),
|
||||
'metadatas' => [
|
||||
'@entity@' => self::OBJECT_TYPE_STORY_METADATA_BAG,
|
||||
|
@@ -450,9 +450,8 @@ class Bridge_Api
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param registryInterface $registry
|
||||
* @param string $api_name
|
||||
* @param UrlGenerator $generator
|
||||
* @param string $api_name
|
||||
* @return string
|
||||
*/
|
||||
public static function generate_callback_url(UrlGenerator $generator, $api_name)
|
||||
@@ -461,9 +460,8 @@ class Bridge_Api
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param registryInterface $registry
|
||||
* @param string $api_name
|
||||
* @param UrlGenerator $generator
|
||||
* @param string $api_name
|
||||
* @return string
|
||||
*/
|
||||
public static function generate_login_url(UrlGenerator $generator, $api_name)
|
||||
@@ -489,7 +487,7 @@ class Bridge_Api
|
||||
$auth_classname = 'Bridge_Api_Auth_' . $classname::AUTH_TYPE;
|
||||
$auth = new $auth_classname;
|
||||
|
||||
return new $classname($app['url_generator'], $app['phraseanet.registry'], $auth, $app['translator']);
|
||||
return new $classname($app['url_generator'], $app['conf'], $auth, $app['translator']);
|
||||
}
|
||||
|
||||
public static function get_by_api_name(Application $app, $name)
|
||||
|
@@ -9,6 +9,7 @@
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
use Alchemy\Phrasea\Core\Configuration\PropertyAccess;
|
||||
use Symfony\Component\Routing\Generator\UrlGenerator;
|
||||
use Symfony\Component\Translation\TranslatorInterface;
|
||||
|
||||
@@ -26,19 +27,22 @@ abstract class Bridge_Api_Abstract
|
||||
*/
|
||||
protected $locale = 'en_US';
|
||||
protected $generator;
|
||||
/** @var PropertyAccess */
|
||||
protected $conf;
|
||||
protected $translator;
|
||||
|
||||
/**
|
||||
* @param UrlGenerator $generator
|
||||
* @param PropertyAccess $conf
|
||||
* @param TranslatorInterface $translator
|
||||
*
|
||||
* @param registryInterface $registry
|
||||
* @param Bridge_Api_Auth_Interface $auth
|
||||
* @return Bridge_Api_Abstract
|
||||
* @param Bridge_Api_Auth_Interface $auth
|
||||
*/
|
||||
public function __construct(UrlGenerator $generator, registryInterface $registry, Bridge_Api_Auth_Interface $auth, TranslatorInterface $translator)
|
||||
public function __construct(UrlGenerator $generator, PropertyAccess $conf, Bridge_Api_Auth_Interface $auth, TranslatorInterface $translator)
|
||||
{
|
||||
$this->translator = $translator;
|
||||
$this->conf = $conf;
|
||||
$this->generator = $generator;
|
||||
$this->registry = $registry;
|
||||
$this->_auth = $auth;
|
||||
$this->initialize_transport();
|
||||
$this->set_auth_params();
|
||||
|
@@ -33,12 +33,6 @@ class Bridge_Api_Dailymotion extends Bridge_Api_Abstract implements Bridge_Api_I
|
||||
const UPLOAD_STATE_REJECTED = 'rejected';
|
||||
const UPLOAD_STATE_ENCODING_ERROR = 'encoding_error';
|
||||
|
||||
/**
|
||||
*
|
||||
* @var registryInterface
|
||||
*/
|
||||
protected $registry;
|
||||
|
||||
/**
|
||||
*
|
||||
* @var DailymotionWithoutOauth2
|
||||
@@ -272,7 +266,7 @@ class Bridge_Api_Dailymotion extends Bridge_Api_Abstract implements Bridge_Api_I
|
||||
break;
|
||||
|
||||
default:
|
||||
throw new Bridge_Exception_ElementUnknown('Unknown element ' . $type);
|
||||
throw new Bridge_Exception_ElementUnknown('Unknown element ' . $object);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -372,7 +366,7 @@ class Bridge_Api_Dailymotion extends Bridge_Api_Abstract implements Bridge_Api_I
|
||||
$this->_api->call($url, $params, $this->oauth_token);
|
||||
break;
|
||||
default:
|
||||
throw new Bridge_Exception_ElementUnknown('Unknown element ' . $type);
|
||||
throw new Bridge_Exception_ElementUnknown('Unknown element ' . $object);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -396,7 +390,7 @@ class Bridge_Api_Dailymotion extends Bridge_Api_Abstract implements Bridge_Api_I
|
||||
return $playlist["id"];
|
||||
break;
|
||||
default:
|
||||
throw new Bridge_Exception_ElementUnknown('Unknown element ' . $type);
|
||||
throw new Bridge_Exception_ElementUnknown('Unknown element ' . $container_type);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -431,7 +425,7 @@ class Bridge_Api_Dailymotion extends Bridge_Api_Abstract implements Bridge_Api_I
|
||||
return $this->get_container_from_id(self::CONTAINER_TYPE_PLAYLIST, $container_id);
|
||||
break;
|
||||
default:
|
||||
throw new Bridge_Exception_ContainerUnknown('Unknown element ' . $container);
|
||||
throw new Bridge_Exception_ContainerUnknown('Unknown element ' . $destination);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
@@ -658,15 +652,15 @@ class Bridge_Api_Dailymotion extends Bridge_Api_Abstract implements Bridge_Api_I
|
||||
|
||||
public function is_configured()
|
||||
{
|
||||
if ( ! $this->registry->get('GV_dailymotion_api')) {
|
||||
if (!$this->conf->get(['main', 'bridge', 'dailymotion', 'enabled'])) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (trim($this->registry->get('GV_dailymotion_client_id')) === '') {
|
||||
if ('' === trim($this->conf->get(['main', 'bridge', 'dailymotion', 'client_id']))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (trim($this->registry->get('GV_dailymotion_client_secret')) === '') {
|
||||
if ('' === trim($this->conf->get(['main', 'bridge', 'dailymotion', 'client_secret']))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -681,8 +675,8 @@ class Bridge_Api_Dailymotion extends Bridge_Api_Abstract implements Bridge_Api_I
|
||||
{
|
||||
$this->_auth->set_parameters(
|
||||
[
|
||||
'client_id' => $this->registry->get('GV_dailymotion_client_id')
|
||||
, 'client_secret' => $this->registry->get('GV_dailymotion_client_secret')
|
||||
'client_id' => $this->conf->get(['main', 'bridge', 'dailymotion', 'client_id'])
|
||||
, 'client_secret' => $this->conf->get(['main', 'bridge', 'dailymotion', 'client_secret'])
|
||||
, 'redirect_uri' => Bridge_Api::generate_callback_url($this->generator, $this->get_name())
|
||||
, 'scope' => ''
|
||||
, 'response_type' => 'code'
|
||||
|
@@ -19,12 +19,6 @@ class Bridge_Api_Flickr extends Bridge_Api_Abstract implements Bridge_Api_Interf
|
||||
*/
|
||||
protected $_api;
|
||||
|
||||
/**
|
||||
*
|
||||
* @var registryInterface
|
||||
*/
|
||||
protected $registry;
|
||||
|
||||
const ELEMENT_TYPE_PHOTO = 'photo';
|
||||
const CONTAINER_TYPE_PHOTOSET = 'photoset';
|
||||
const AUTH_TYPE = 'Flickr';
|
||||
@@ -199,9 +193,9 @@ class Bridge_Api_Flickr extends Bridge_Api_Abstract implements Bridge_Api_Interf
|
||||
throw new Bridge_Exception_ApiConnectorRequestFailed('Unable to retrieve photoset infos for ' . $object);
|
||||
|
||||
$xml = $response->getXml();
|
||||
$primary_photo = $this->get_element_from_id((string) $child['primary'], self::ELEMENT_TYPE_PHOTO);
|
||||
$primary_photo = $this->get_element_from_id((string) $xml['primary'], self::ELEMENT_TYPE_PHOTO);
|
||||
|
||||
return new Bridge_Api_Flickr_Container($xml, $this->get_user_id(), $type, $primary_photo->get_thumbnail());
|
||||
return new Bridge_Api_Flickr_Container($xml, $this->get_user_id(), $object, $primary_photo->get_thumbnail());
|
||||
break;
|
||||
default:
|
||||
throw new Bridge_Exception_ElementUnknown('Unknown element ' . $object);
|
||||
@@ -282,7 +276,7 @@ class Bridge_Api_Flickr extends Bridge_Api_Abstract implements Bridge_Api_Interf
|
||||
|
||||
break;
|
||||
default:
|
||||
throw new Bridge_Exception_ElementUnknown('Unknown element ' . $type);
|
||||
throw new Bridge_Exception_ElementUnknown('Unknown element ' . $object);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -621,16 +615,13 @@ class Bridge_Api_Flickr extends Bridge_Api_Abstract implements Bridge_Api_Interf
|
||||
|
||||
public function is_configured()
|
||||
{
|
||||
|
||||
if ( ! $this->registry->get('GV_flickr_api')) {
|
||||
if (!$this->conf->get(['main', 'bridge', 'flickr', 'enabled'])) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (trim($this->registry->get('GV_flickr_client_id')) === '') {
|
||||
if ('' === trim($this->conf->get(['main', 'bridge', 'flickr', 'client_id']))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (trim($this->registry->get('GV_flickr_client_secret')) === '') {
|
||||
if ('' === trim($this->conf->get(['main', 'bridge', 'flickr', 'client_secret']))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -644,8 +635,8 @@ class Bridge_Api_Flickr extends Bridge_Api_Abstract implements Bridge_Api_Interf
|
||||
protected function initialize_transport()
|
||||
{
|
||||
$this->_api = new Phlickr_Api(
|
||||
$this->registry->get('GV_flickr_client_id'),
|
||||
$this->registry->get('GV_flickr_client_secret')
|
||||
$this->conf->get(['main', 'bridge', 'flickr', 'client_id']),
|
||||
$this->conf->get(['main', 'bridge', 'flickr', 'client_secret'])
|
||||
);
|
||||
|
||||
return $this;
|
||||
@@ -673,8 +664,8 @@ class Bridge_Api_Flickr extends Bridge_Api_Abstract implements Bridge_Api_Interf
|
||||
{
|
||||
$this->_auth->set_parameters(
|
||||
[
|
||||
'flickr_client_id' => $this->registry->get('GV_flickr_client_id')
|
||||
, 'flickr_client_secret' => $this->registry->get('GV_flickr_client_secret')
|
||||
'flickr_client_id' => $this->conf->get(['main', 'bridge', 'flickr', 'client_id'])
|
||||
, 'flickr_client_secret' => $this->conf->get(['main', 'bridge', 'flickr', 'client_secret'])
|
||||
, 'permissions' => 'delete'
|
||||
]
|
||||
);
|
||||
|
@@ -13,12 +13,6 @@ use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
class Bridge_Api_Youtube extends Bridge_Api_Abstract implements Bridge_Api_Interface
|
||||
{
|
||||
/**
|
||||
*
|
||||
* @var registryInterface
|
||||
*/
|
||||
protected $registry;
|
||||
|
||||
/**
|
||||
*
|
||||
* @var Zend_Gdata_YouTube
|
||||
@@ -321,7 +315,7 @@ class Bridge_Api_Youtube extends Bridge_Api_Abstract implements Bridge_Api_Inter
|
||||
break;
|
||||
|
||||
default:
|
||||
throw new Bridge_Exception_ElementUnknown('Unknown element ' . $type);
|
||||
throw new Bridge_Exception_ElementUnknown('Unknown element ' . $object);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -342,7 +336,7 @@ class Bridge_Api_Youtube extends Bridge_Api_Abstract implements Bridge_Api_Inter
|
||||
$container_title = $request->get('f_container_title');
|
||||
|
||||
$new_playlist = $this->_api->newPlaylistListEntry();
|
||||
if (trim($description) !== '')
|
||||
if (trim($container_desc) !== '')
|
||||
$new_playlist->description = $this->_api->newDescription()->setText($container_desc);
|
||||
$new_playlist->title = $this->_api->newTitle()->setText($container_title);
|
||||
|
||||
@@ -353,7 +347,7 @@ class Bridge_Api_Youtube extends Bridge_Api_Abstract implements Bridge_Api_Inter
|
||||
|
||||
break;
|
||||
default:
|
||||
throw new Bridge_Exception_ElementUnknown('Unknown element ' . $type);
|
||||
throw new Bridge_Exception_ElementUnknown('Unknown element ' . $container_type);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -383,7 +377,7 @@ class Bridge_Api_Youtube extends Bridge_Api_Abstract implements Bridge_Api_Inter
|
||||
return new Bridge_Api_Youtube_Container($playlistEntry, $destination, null);
|
||||
break;
|
||||
default:
|
||||
throw new Bridge_Exception_ContainerUnknown('Unknown element ' . $container);
|
||||
throw new Bridge_Exception_ContainerUnknown('Unknown element ' . $destination);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
@@ -787,15 +781,16 @@ class Bridge_Api_Youtube extends Bridge_Api_Abstract implements Bridge_Api_Inter
|
||||
|
||||
public function is_configured()
|
||||
{
|
||||
if ( ! $this->registry->get('GV_youtube_api')) {
|
||||
if (!$this->conf->get(['main', 'bridge', 'youtube', 'enabled'])) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (trim($this->registry->get('GV_youtube_client_id')) === '') {
|
||||
if ('' === trim($this->conf->get(['main', 'bridge', 'youtube', 'client_id']))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (trim($this->registry->get('GV_youtube_dev_key')) === '') {
|
||||
if ('' === trim($this->conf->get(['main', 'bridge', 'youtube', 'client_secret']))) {
|
||||
return false;
|
||||
}
|
||||
if ('' === trim($this->conf->get(['main', 'bridge', 'youtube', 'developer_key']))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -810,8 +805,8 @@ class Bridge_Api_Youtube extends Bridge_Api_Abstract implements Bridge_Api_Inter
|
||||
{
|
||||
$this->_auth->set_parameters(
|
||||
[
|
||||
'client_id' => $this->registry->get('GV_youtube_client_id')
|
||||
, 'client_secret' => $this->registry->get('GV_youtube_client_secret')
|
||||
'client_id' => $this->conf->get(['main', 'bridge', 'youtube', 'client_id'])
|
||||
, 'client_secret' => $this->conf->get(['main', 'bridge', 'youtube', 'client_secret'])
|
||||
, 'redirect_uri' => Bridge_Api::generate_callback_url($this->generator, $this->get_name())
|
||||
, 'scope' => 'http://gdata.youtube.com'
|
||||
, 'response_type' => 'code'
|
||||
@@ -835,8 +830,8 @@ class Bridge_Api_Youtube extends Bridge_Api_Abstract implements Bridge_Api_Inter
|
||||
$this->_api = new Zend_Gdata_YouTube(
|
||||
$http_client,
|
||||
uuid::generate_v4(),
|
||||
$this->registry->get('GV_youtube_client_id'),
|
||||
$this->registry->get('GV_youtube_dev_key'));
|
||||
$this->conf->get(['main', 'bridge', 'youtube', 'client_id']),
|
||||
$this->conf->get(['main', 'bridge', 'youtube', 'developer_key']));
|
||||
$this->_api->setMajorProtocolVersion(2);
|
||||
|
||||
return $this;
|
||||
|
@@ -1035,8 +1035,8 @@ class User_Adapter implements User_Interface, cache_cacheableInterface
|
||||
|
||||
foreach (self::$def_values as $k => $v) {
|
||||
if (!isset($this->_prefs[$k])) {
|
||||
if ($k == 'start_page_query' && $this->app['phraseanet.registry']->get('GV_defaultQuery')) {
|
||||
$v = $this->app['phraseanet.registry']->get('GV_defaultQuery');
|
||||
if ($k == 'start_page_query' && $this->app['conf']->get(['registry', 'searchengine', 'default-query'])) {
|
||||
$v = $this->app['conf']->get(['registry', 'searchengine', 'default-query']);
|
||||
}
|
||||
|
||||
$this->_prefs[$k] = $v;
|
||||
@@ -1244,7 +1244,7 @@ class User_Adapter implements User_Interface, cache_cacheableInterface
|
||||
|
||||
public function get_locale()
|
||||
{
|
||||
return $this->locale ?: $this->app['phraseanet.registry']->get('GV_default_lng', 'en');
|
||||
return $this->locale ?: $this->app['conf']->get(['languages', 'default'], 'en');
|
||||
}
|
||||
|
||||
public function set_locale($locale)
|
||||
|
12
lib/classes/cache/databox.php
vendored
12
lib/classes/cache/databox.php
vendored
@@ -56,7 +56,7 @@ class cache_databox
|
||||
|
||||
$sql = 'SELECT type, value FROM memcached WHERE site_id = :site_id';
|
||||
$stmt = $connsbas->prepare($sql);
|
||||
$stmt->execute([':site_id' => $app['phraseanet.registry']->get('GV_ServerName')]);
|
||||
$stmt->execute([':site_id' => $app['conf']->get('servername')]);
|
||||
$rs = $stmt->fetchAll(\PDO::FETCH_ASSOC);
|
||||
$stmt->closeCursor();
|
||||
|
||||
@@ -84,7 +84,7 @@ class cache_databox
|
||||
WHERE site_id = :site_id AND type="record" AND value = :value';
|
||||
|
||||
$params = [
|
||||
':site_id' => $app['phraseanet.registry']->get('GV_ServerName')
|
||||
':site_id' => $app['conf']->get('servername')
|
||||
, ':value' => $row['value']
|
||||
];
|
||||
|
||||
@@ -108,7 +108,7 @@ class cache_databox
|
||||
WHERE site_id = :site_id AND type="structure" AND value = :value';
|
||||
|
||||
$params = [
|
||||
':site_id' => $app['phraseanet.registry']->get('GV_ServerName')
|
||||
':site_id' => $app['conf']->get('servername')
|
||||
, ':value' => $row['value']
|
||||
];
|
||||
|
||||
@@ -152,7 +152,7 @@ class cache_databox
|
||||
WHERE site_id != :site_id';
|
||||
|
||||
$stmt = $connbas->prepare($sql);
|
||||
$stmt->execute([':site_id' => $app['phraseanet.registry']->get('GV_ServerName')]);
|
||||
$stmt->execute([':site_id' => $app['conf']->get('servername')]);
|
||||
$rs = $stmt->fetchAll(\PDO::FETCH_ASSOC);
|
||||
$stmt->closeCursor();
|
||||
|
||||
@@ -176,7 +176,7 @@ class cache_databox
|
||||
|
||||
$sql = 'SELECT site_id FROM clients WHERE site_id = :site_id';
|
||||
$stmt = $connbas->prepare($sql);
|
||||
$stmt->execute([':site_id' => $app['phraseanet.registry']->get('GV_ServerName')]);
|
||||
$stmt->execute([':site_id' => $app['conf']->get('servername')]);
|
||||
$rowCount = $stmt->rowCount();
|
||||
$stmt->closeCursor();
|
||||
|
||||
@@ -186,7 +186,7 @@ class cache_databox
|
||||
|
||||
$sql = 'INSERT INTO clients (site_id) VALUES (:site_id)';
|
||||
$stmt = $connbas->prepare($sql);
|
||||
$stmt->execute([':site_id' => $app['phraseanet.registry']->get('GV_ServerName')]);
|
||||
$stmt->execute([':site_id' => $app['conf']->get('servername')]);
|
||||
$stmt->closeCursor();
|
||||
|
||||
return;
|
||||
|
@@ -669,8 +669,7 @@ class collection implements cache_cacheableInterface
|
||||
if (is_file($app['root.path'] . '/config/minilogos/' . $base_id)) {
|
||||
$name = phrasea::bas_labels($base_id, $app);
|
||||
self::$_logos[$base_id_key] = '<img title="' . $name
|
||||
. '" src="' . $app['phraseanet.registry']->get('GV_STATIC_URL')
|
||||
. '/custom/minilogos/' . $base_id . '" />';
|
||||
. '" src="/custom/minilogos/' . $base_id . '" />';
|
||||
} elseif ($printname) {
|
||||
self::$_logos[$base_id_key] = phrasea::bas_labels($base_id, $app);
|
||||
}
|
||||
|
@@ -491,7 +491,7 @@ class databox extends base
|
||||
return;
|
||||
}
|
||||
|
||||
public static function create(Application $app, connection_pdo $connection, \SplFileInfo $data_template, registryInterface $registry)
|
||||
public static function create(Application $app, connection_pdo $connection, \SplFileInfo $data_template)
|
||||
{
|
||||
if ( ! file_exists($data_template->getRealPath())) {
|
||||
throw new \InvalidArgumentException($data_template->getRealPath() . " does not exist");
|
||||
@@ -569,7 +569,7 @@ class databox extends base
|
||||
$databox = $app['phraseanet.appbox']->get_databox($sbas_id);
|
||||
$databox->insert_datas();
|
||||
$databox->setNewStructure(
|
||||
$data_template, $registry->get('GV_base_datapath_noweb')
|
||||
$data_template, $app['conf']->get(['main', 'storage', 'subdefs', 'default-dir'])
|
||||
);
|
||||
|
||||
return $databox;
|
||||
@@ -586,7 +586,7 @@ class databox extends base
|
||||
* @param registry $registry
|
||||
* @return databox
|
||||
*/
|
||||
public static function mount(Application $app, $host, $port, $user, $password, $dbname, registry $registry)
|
||||
public static function mount(Application $app, $host, $port, $user, $password, $dbname)
|
||||
{
|
||||
new connection_pdo('test', $host, $port, $user, $password, $dbname, [], $app['debug']);
|
||||
|
||||
|
@@ -156,7 +156,7 @@ class eventsmanager_notify_validationreminder extends eventsmanager_notifyAbstra
|
||||
. $basket_name . '</a>';
|
||||
|
||||
$ret = [
|
||||
'text' => $this->app->trans('Rappel : Il vous reste %number% jours pour valider %title% de %user%', ['%number%' => $this->app['phraseanet.registry']->get('GV_validation_reminder'), '%title%' => $bask_link, '%user%' => $sender])
|
||||
'text' => $this->app->trans('Rappel : Il vous reste %number% jours pour valider %title% de %user%', ['%number%' => $this->app['conf']->get(['registry', 'actions', 'validation-reminder-days']), '%title%' => $bask_link, '%user%' => $sender])
|
||||
, 'class' => ($unread == 1 ? 'reload_baskets' : '')
|
||||
];
|
||||
|
||||
|
@@ -733,7 +733,7 @@ class media_subdef extends media_abstract implements cache_cacheableInterface
|
||||
}
|
||||
|
||||
if (in_array($this->mime, ['video/mp4'])) {
|
||||
$token = p4file::apache_tokenize($this->app['phraseanet.registry'], $this->get_pathfile());
|
||||
$token = p4file::apache_tokenize($this->app['conf'], $this->get_pathfile());
|
||||
if ($token) {
|
||||
$this->url = $token;
|
||||
|
||||
|
@@ -631,7 +631,7 @@ class module_report
|
||||
$this->report['dbname'] = $this->dbname;
|
||||
$this->report['dmin'] = $this->dmin;
|
||||
$this->report['dmax'] = $this->dmax;
|
||||
$this->report['server'] = $this->app['phraseanet.registry']->get('GV_ServerName');
|
||||
$this->report['server'] = $this->app['conf']->get('servername');
|
||||
$this->report['filter'] = $this->tab_filter;
|
||||
$this->report['posting_filter'] = $this->posting_filter;
|
||||
$this->report['active_column'] = $this->active_column;
|
||||
|
@@ -141,7 +141,7 @@ class module_report_dashboard_feed implements module_report_dashboard_componentI
|
||||
$this->report['nb_conn'] = module_report_connexion::getNbConn(
|
||||
$this->app, $this->dminsql, $this->dmaxsql, $this->sbasid, $this->collection
|
||||
);
|
||||
if ($this->app['phraseanet.registry']->get('GV_anonymousReport') == false) {
|
||||
if ($this->app['conf']->get(['registry', 'modules', 'anonymous-report']) == false) {
|
||||
/**
|
||||
* get Top ten user of
|
||||
* number of dl doc, prev
|
||||
@@ -176,7 +176,7 @@ class module_report_dashboard_feed implements module_report_dashboard_componentI
|
||||
$this->report['top_dl_preview'] = $topdl['preview'];
|
||||
$this->report['top_dl_document'] = $topdl['document'];
|
||||
|
||||
if ($this->app['phraseanet.registry']->get('GV_anonymousReport') == false) {
|
||||
if ($this->app['conf']->get(['registry', 'modules', 'anonymous-report']) == false) {
|
||||
// get users that ask the most questions
|
||||
$this->report['ask'] = module_report_activity::activityQuestion(
|
||||
$this->app, $this->dminsql, $this->dmaxsql, $this->sbasid, $this->collection
|
||||
@@ -200,7 +200,7 @@ class module_report_dashboard_feed implements module_report_dashboard_componentI
|
||||
$this->report['activity_edited'] = module_report_activity::activiteEditedDocument(
|
||||
$this->app, $this->dminsql, $this->dmaxsql, $this->sbasid, $this->collection
|
||||
);
|
||||
if ($this->app['phraseanet.registry']->get('GV_anonymousReport') == false) {
|
||||
if ($this->app['conf']->get(['registry', 'modules', 'anonymous-report']) == false) {
|
||||
//get users that add the most documents
|
||||
$this->report['top_ten_added'] = module_report_activity::activiteAddedTopTenUser(
|
||||
$this->app, $this->dminsql, $this->dmaxsql, $this->sbasid, $this->collection
|
||||
|
@@ -9,25 +9,27 @@
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
use Alchemy\Phrasea\Core\Configuration\PropertyAccess;
|
||||
|
||||
class p4file
|
||||
{
|
||||
|
||||
public static function apache_tokenize(\registry $registry, $file)
|
||||
public static function apache_tokenize(PropertyAccess $conf, $file)
|
||||
{
|
||||
$ret = false;
|
||||
|
||||
if ($registry->get('GV_h264_streaming') && is_file($file)) {
|
||||
if (mb_strpos($file, $registry->get('GV_mod_auth_token_directory_path')) === false) {
|
||||
if ($conf->get(['registry', 'executables', 'h264-streaming-enabled']) && is_file($file)) {
|
||||
if (mb_strpos($file, $conf->get(['registry', 'executables', 'auth-token-directory-path'])) === false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$server = new system_server();
|
||||
|
||||
if ($server->is_nginx()) {
|
||||
$fileToProtect = mb_substr($file, mb_strlen($registry->get('GV_mod_auth_token_directory_path')));
|
||||
$fileToProtect = mb_substr($file, mb_strlen($conf->get(['registry', 'executables', 'auth-token-directory-path'])));
|
||||
|
||||
$secret = $registry->get('GV_mod_auth_token_passphrase');
|
||||
$protectedPath = p4string::addFirstSlash(p4string::delEndSlash($registry->get('GV_mod_auth_token_directory')));
|
||||
$secret = $conf->get(['registry', 'executables', 'auth-token-passphrase']);
|
||||
$protectedPath = p4string::addFirstSlash(p4string::delEndSlash($conf->get(['registry', 'executables', 'auth-token-directory'])));
|
||||
|
||||
$hexTime = strtoupper(dechex(time() + 3600));
|
||||
|
||||
@@ -37,10 +39,10 @@ class p4file
|
||||
|
||||
$ret = $url;
|
||||
} elseif ($server->is_apache()) {
|
||||
$fileToProtect = mb_substr($file, mb_strlen($registry->get('GV_mod_auth_token_directory_path')));
|
||||
$fileToProtect = mb_substr($file, mb_strlen($conf->get(['registry', 'executables', 'auth-token-directory-path'])));
|
||||
|
||||
$secret = $registry->get('GV_mod_auth_token_passphrase'); // Same as AuthTokenSecret
|
||||
$protectedPath = p4string::addEndSlash(p4string::delFirstSlash($registry->get('GV_mod_auth_token_directory'))); // Same as AuthTokenPrefix
|
||||
$secret = $conf->get(['registry', 'executables', 'auth-token-passphrase']); // Same as AuthTokenSecret
|
||||
$protectedPath = p4string::addEndSlash(p4string::delFirstSlash($conf->get(['registry', 'executables', 'auth-token-directory']))); // Same as AuthTokenPrefix
|
||||
$hexTime = dechex(time()); // Time in Hexadecimal
|
||||
|
||||
$token = md5($secret . $fileToProtect . $hexTime);
|
||||
|
@@ -56,12 +56,31 @@ class patch_380alpha13a implements patchInterface
|
||||
*/
|
||||
public function apply(base $appbox, Application $app)
|
||||
{
|
||||
$xsendfilePath = $app['phraseanet.registry']->get('GV_X_Accel_Redirect');
|
||||
$xsendfileMountPoint = $app['phraseanet.registry']->get('GV_X_Accel_Redirect_mount_point');
|
||||
$sql = 'SELECT `key`, `value` FROM `registry`
|
||||
WHERE `key` = "GV_X_Accel_Redirect"
|
||||
OR `key` = "GV_X_Accel_Redirect_mount_point"
|
||||
OR `key` = "GV_modxsendfile"';
|
||||
$stmt = $appbox->get_connection()->prepare($sql);
|
||||
$stmt->execute();
|
||||
$rows = $stmt->fetchAll(\PDO::FETCH_ASSOC);
|
||||
$stmt->closeCursor();
|
||||
|
||||
$registry = [
|
||||
'GV_X_Accel_Redirect' => null,
|
||||
'GV_X_Accel_Redirect_mount_point' => null,
|
||||
'GV_modxsendfile' => null,
|
||||
];
|
||||
|
||||
foreach ($rows as $row) {
|
||||
$registry[$row['key']] = $row['value'];
|
||||
}
|
||||
|
||||
$xsendfilePath = $registry['GV_X_Accel_Redirect'];
|
||||
$xsendfileMountPoint = $registry['GV_X_Accel_Redirect_mount_point'];
|
||||
|
||||
$config = $app['configuration.store']->setDefault('xsendfile')->getConfig();
|
||||
|
||||
$config['xsendfile']['enabled'] = (Boolean) $app['phraseanet.registry']->get('GV_modxsendfile', false);
|
||||
$config['xsendfile']['enabled'] = (Boolean) $registry['GV_modxsendfile'];
|
||||
$config['xsendfile']['type'] = $config['xsendfile']['enabled'] ? 'nginx' : '';
|
||||
|
||||
if (null !== $xsendfilePath && null !== $xsendfileMountPoint) {
|
||||
|
@@ -73,7 +73,7 @@ class patch_380alpha8a implements patchInterface
|
||||
$sxe = simplexml_load_string($row['settings']);
|
||||
$indexer = $sxe->binpath . '/phraseanet_indexer';
|
||||
|
||||
$app['conf']->set(['binaries', 'phraseanet_indexer'], $indexer);
|
||||
$app['conf']->set(['main', 'binaries', 'phraseanet_indexer'], $indexer);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@@ -54,10 +54,19 @@ class patch_381alpha2a implements patchInterface
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function apply(base $databox, Application $app)
|
||||
public function apply(base $appbox, Application $app)
|
||||
{
|
||||
if (false !== strpos($app['phraseanet.registry']->get('GV_i18n_service'), 'localization.webservice.alchemyasp.com')) {
|
||||
$app['phraseanet.registry']->set('GV_i18n_service', 'http://geonames.alchemyasp.com/', \registry::TYPE_STRING);
|
||||
$sql = 'SELECT `value` FROM `registry` WHERE `key` = "GV_i18n_service"';
|
||||
$stmt = $appbox->get_connection()->prepare($sql);
|
||||
$stmt->execute();
|
||||
$row = $stmt->fetch(\PDO::FETCH_ASSOC);
|
||||
$stmt->closeCursor();
|
||||
|
||||
if (null !== $row && false !== strpos($row['value'], 'localization.webservice.alchemyasp.com')) {
|
||||
$sql = 'UPDATE `registry` SET `value` = "http://geonames.alchemyasp.com/" WHERE `key` = "GV_i18n_service"';
|
||||
$stmt = $appbox->get_connection()->prepare($sql);
|
||||
$stmt->execute();
|
||||
$stmt->closeCursor();
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@@ -18,7 +18,7 @@ class patch_390alpha10a implements patchInterface
|
||||
private $release = '3.9.0-alpha.10';
|
||||
|
||||
/** @var array */
|
||||
private $concern = array(base::APPLICATION_BOX);
|
||||
private $concern = [base::APPLICATION_BOX];
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
@@ -69,7 +69,7 @@ class patch_390alpha10a implements patchInterface
|
||||
$rows = $stmt->fetchAll(\PDO::FETCH_ASSOC);
|
||||
$stmt->closeCursor();
|
||||
|
||||
$registry = array();
|
||||
$oldRegistry = [];
|
||||
|
||||
foreach ($rows as $row) {
|
||||
switch ($row['type']) {
|
||||
@@ -79,6 +79,7 @@ class patch_390alpha10a implements patchInterface
|
||||
case 'integer':
|
||||
$value = (int) $row['value'];
|
||||
break;
|
||||
default:
|
||||
case 'enum':
|
||||
case 'string':
|
||||
case 'text':
|
||||
@@ -91,37 +92,123 @@ class patch_390alpha10a implements patchInterface
|
||||
break;
|
||||
}
|
||||
|
||||
$registry[$row['key']] = $value;
|
||||
$oldRegistry[$row['key']] = $value;
|
||||
}
|
||||
|
||||
$config = $app['configuration']->getConfig();
|
||||
$config = $app['configuration.store']->getConfig();
|
||||
$config['languages']['default'] = isset($oldRegistry['GV_default_lng']) ? $oldRegistry['GV_default_lng'] : 'fr';
|
||||
$config['registry'] = $app['registry.manipulator']->getRegistryData();
|
||||
$app['configuration.store']->setConfig($config);
|
||||
|
||||
$config['languages']['default'] = isset($registry['GV_default_lng']) ? $registry['GV_default_lng'] : 'fr_FR';
|
||||
$mapping = [
|
||||
'GV_homeTitle' => ['registry', 'general', 'title'],
|
||||
'GV_metaKeywords' => ['registry', 'general', 'keywords'],
|
||||
'GV_metaDescription' => ['registry', 'general', 'description'],
|
||||
'GV_googleAnalytics' => ['registry', 'general', 'analytics'],
|
||||
'GV_allow_search_engine' => ['registry', 'general', 'allow-indexation'],
|
||||
'GV_home_publi' => ['registry', 'general', 'home-presentation-mode'],
|
||||
'GV_thesaurus' => ['registry', 'modules', 'thesaurus'],
|
||||
'GV_multiAndReport' => ['registry', 'modules', 'stories'],
|
||||
'GV_seeOngChgDoc' => ['registry', 'modules', 'doc-substitution'],
|
||||
'GV_seeNewThumb' => ['registry', 'modules', 'thumb-substitution'],
|
||||
'GV_anonymousReport' => ['registry', 'modules', 'anonymous-report'],
|
||||
'GV_download_max' => ['registry', 'actions', 'download-max-size'],
|
||||
'GV_validation_reminder' => ['registry', 'actions', 'validation-reminder-days'],
|
||||
'GV_val_expiration' => ['registry', 'actions', 'validation-expiration-days'],
|
||||
'GV_needAuth2DL' => ['registry', 'actions', 'auth-required-for-export'],
|
||||
'GV_requireTOUValidationForExport' => ['registry', 'actions', 'tou-validation-required-for-export'],
|
||||
'GV_choose_export_title' => ['registry', 'actions', 'export-title-choice'],
|
||||
'GV_default_export_title' => ['registry', 'actions', 'default-export-title'],
|
||||
'GV_social_tools' => ['registry', 'actions', 'social-tools'],
|
||||
'GV_activeFTP' => ['registry', 'ftp', 'ftp-enabled'],
|
||||
'GV_ftp_for_user' => ['registry', 'ftp', 'ftp-user-access'],
|
||||
'GV_autoselectDB' => ['registry', 'registration', 'auto-select-collections'],
|
||||
'GV_autoregister' => ['registry', 'registration', 'auto-register-enabled'],
|
||||
'GV_ong_search' => ['registry', 'classic', 'search-tab'],
|
||||
'GV_ong_advsearch' => ['registry', 'classic', 'adv-search-tab'],
|
||||
'GV_ong_topics' => ['registry', 'classic', 'topics-tab'],
|
||||
'GV_ong_actif' => ['registry', 'classic', 'active-tab'],
|
||||
'GV_client_render_topics' => ['registry', 'classic', 'render-topics'],
|
||||
'GV_rollover_reg_preview' => ['registry', 'classic', 'stories-preview'],
|
||||
'GV_rollover_chu' => ['registry', 'classic', 'basket-rollover'],
|
||||
'GV_client_coll_ckbox' => ['registry', 'classic', 'collection-presentation'],
|
||||
'GV_viewSizeBaket' => ['registry', 'classic', 'basket-size-display'],
|
||||
'GV_clientAutoShowProposals' => ['registry', 'classic', 'auto-show-proposals'],
|
||||
'GV_view_bas_and_coll' => ['registry', 'classic', 'collection-display'],
|
||||
'GV_message' => ['registry', 'maintenance', 'message'],
|
||||
'GV_message_on' => ['registry', 'maintenance', 'enabled'],
|
||||
'GV_client_navigator' => ['registry', 'api-clients', 'navigator-enabled'],
|
||||
'GV_client_officeplugin' => ['registry', 'api-clients', 'office-enabled'],
|
||||
'GV_google_api' => ['registry', 'webservices', 'google-charts-enabled'],
|
||||
'GV_i18n_service' => ['registry', 'webservices', 'geonames-server'],
|
||||
'GV_captchas' => ['registry', 'webservices', 'captcha-enabled'],
|
||||
'GV_captcha_public_key' => ['registry', 'webservices', 'recaptcha-public-key'],
|
||||
'GV_captcha_private_key' => ['registry', 'webservices', 'recaptcha-private-key'],
|
||||
'GV_h264_streaming' => ['registry', 'executables', 'h264-streaming-enabled'],
|
||||
'GV_mod_auth_token_directory' => ['registry', 'executables', 'auth-token-directory'],
|
||||
'GV_mod_auth_token_directory_path' => ['registry', 'executables', 'auth-token-directory-path'],
|
||||
'GV_mod_auth_token_passphrase' => ['registry', 'executables', 'auth-token-passphrase'],
|
||||
'GV_PHP_INI' => ['registry', 'executables', 'php-conf-path'],
|
||||
'GV_imagine_driver' => ['registry', 'executables', 'imagine-driver'],
|
||||
'GV_ffmpeg_threads' => ['registry', 'executables', 'ffmpeg-threads'],
|
||||
'GV_pdfmaxpages' => ['registry', 'executables', 'pdf-max-pages'],
|
||||
'GV_min_letters_truncation' => ['registry', 'searchengine', 'min-letters-truncation'],
|
||||
'GV_defaultQuery' => ['registry', 'searchengine', 'default-query'],
|
||||
'GV_defaultQuery_type' => ['registry', 'searchengine', 'default-query-type'],
|
||||
'GV_adminMail' => ['registry', 'email', 'admin-email'],
|
||||
'GV_defaulmailsenderaddr' => ['registry', 'email', 'emitter-email'],
|
||||
'GV_email_prefix' => ['registry', 'email', 'prefix'],
|
||||
'GV_smtp' => ['registry', 'email', 'smtp-enabled'],
|
||||
'GV_smtp_auth' => ['registry', 'email', 'smtp-auth-enabled'],
|
||||
'GV_smtp_host' => ['registry', 'email', 'smtp-host'],
|
||||
'GV_smtp_port' => ['registry', 'email', 'smtp-port'],
|
||||
'GV_smtp_secure' => ['registry', 'email', 'smtp-secure-mode'],
|
||||
'GV_smtp_user' => ['registry', 'email', 'smtp-user'],
|
||||
'GV_smtp_password' => ['registry', 'email', 'smtp-password'],
|
||||
'GV_base_datapath_noweb' => ['main', 'storage', 'subdefs', 'default-dir'],
|
||||
'GV_youtube_api' => ['main', 'bridge', 'youtube', 'enabled'],
|
||||
'GV_youtube_client_id' => ['main', 'bridge', 'youtube', 'client_id'],
|
||||
'GV_youtube_client_secret' => ['main', 'bridge', 'youtube', 'client_secret'],
|
||||
'GV_youtube_dev_key' => ['main', 'bridge', 'youtube', 'developer_key'],
|
||||
'GV_flickr_api' => ['main', 'bridge', 'flickr', 'enabled'],
|
||||
'GV_flickr_client_id' => ['main', 'bridge', 'flickr', 'client_id'],
|
||||
'GV_flickr_client_secret' => ['main', 'bridge', 'flickr', 'client_secret'],
|
||||
'GV_dailymotion_api' => ['main', 'bridge', 'dailymotion', 'enabled'],
|
||||
'GV_dailymotion_client_id' => ['main', 'bridge', 'dailymotion', 'client_id'],
|
||||
'GV_dailymotion_client_secret' => ['main', 'bridge', 'dailymotion', 'client_secret'],
|
||||
];
|
||||
|
||||
$app['configuration']->setConfig($config);
|
||||
foreach ($mapping as $source => $target) {
|
||||
if (!isset($oldRegistry[$source])) {
|
||||
continue;
|
||||
}
|
||||
$app['conf']->set($target, $oldRegistry[$source]);
|
||||
}
|
||||
}
|
||||
|
||||
private function upgradeConf(Application $app)
|
||||
{
|
||||
$config = $app['configuration']->getConfig();
|
||||
$config = $app['configuration.store']->getConfig();
|
||||
|
||||
if (isset($config['main']['languages'])) {
|
||||
$config = array_merge(array('languages' => array('available' => $config['main']['languages'])), $config);
|
||||
$config = array_merge(['languages' => ['available' => $config['main']['languages']]], $config);
|
||||
unset($config['main']['languages']);
|
||||
}
|
||||
|
||||
$config = array_merge(array('servername' => $config['main']['servername']), $config);
|
||||
$config = array_merge(['servername' => $config['main']['servername']], $config);
|
||||
unset($config['main']['servername']);
|
||||
|
||||
$config['main']['task-manager'] = $config['task-manager'];
|
||||
unset($config['task-manager']);
|
||||
if (isset($config['task-manager'])) {
|
||||
$config['main']['task-manager'] = $config['task-manager'];
|
||||
unset($config['task-manager']);
|
||||
}
|
||||
|
||||
if (isset($config['binaries'])) {
|
||||
$binaries = isset($config['main']['binaries']) ? $config['main']['binaries'] : array();
|
||||
$binaries = isset($config['main']['binaries']) ? $config['main']['binaries'] : [];
|
||||
$config['main']['binaries'] = array_merge($binaries, $config['binaries']);
|
||||
unset($config['binaries']);
|
||||
}
|
||||
|
||||
$app['configuration']->setConfig($config);
|
||||
$app['configuration.store']->setConfig($config);
|
||||
}
|
||||
}
|
||||
|
@@ -64,8 +64,18 @@ class patch_390alpha9a implements patchInterface
|
||||
|
||||
private function updateRegistry(Application $app)
|
||||
{
|
||||
$locale = $app['phraseanet.registry']->get('GV_default_lng', 'fr_FR');
|
||||
$app['phraseanet.registry']->set('GV_default_lng', $this->extractLocale($locale), \registry::TYPE_STRING);
|
||||
$sql = 'SELECT `value` FROM registry WHERE `key` = :key';
|
||||
$stmt = $app['phraseanet.appbox']->get_connection()->prepare($sql);
|
||||
$stmt->execute([':key' => 'GV_default_lng']);
|
||||
$row = $stmt->fetch(\PDO::FETCH_ASSOC);
|
||||
$stmt->closeCursor();
|
||||
|
||||
$locale = null !== $row ? $row['value'] : 'fr';
|
||||
|
||||
$sql = 'UPDATE registry SET `value` = :value WHERE `key` = :key';
|
||||
$stmt = $app['phraseanet.appbox']->get_connection()->prepare($sql);
|
||||
$stmt->execute([':key' => 'GV_default_lng', ':value' => $this->extractLocale($locale)]);
|
||||
$stmt->closeCursor();
|
||||
}
|
||||
|
||||
private function updateUsers(\appbox $appbox)
|
||||
|
@@ -1905,7 +1905,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface
|
||||
FROM regroup g
|
||||
INNER JOIN (record r
|
||||
INNER JOIN collusr c
|
||||
ON site = :GV_site
|
||||
ON site = :site
|
||||
AND usr_id = :usr_id
|
||||
AND c.coll_id = r.coll_id
|
||||
AND ((status ^ mask_xor) & mask_and) = 0
|
||||
@@ -1915,7 +1915,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface
|
||||
ORDER BY g.ord ASC, dateadd ASC, record_id ASC';
|
||||
|
||||
$params = [
|
||||
':GV_site' => $this->app['conf']->get(['main', 'key']),
|
||||
':site' => $this->app['conf']->get(['main', 'key']),
|
||||
':usr_id' => $this->app['authentication']->getUser()->get_id(),
|
||||
':record_id' => $this->get_record_id(),
|
||||
];
|
||||
@@ -1956,7 +1956,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface
|
||||
FROM regroup g
|
||||
INNER JOIN (record r
|
||||
INNER JOIN collusr c
|
||||
ON site = :GV_site
|
||||
ON site = :site
|
||||
AND usr_id = :usr_id
|
||||
AND c.coll_id = r.coll_id
|
||||
AND ((status ^ mask_xor) & mask_and)=0
|
||||
@@ -1966,7 +1966,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface
|
||||
WHERE rid_child = :record_id';
|
||||
|
||||
$params = [
|
||||
':GV_site' => $this->app['conf']->get(['main', 'key'])
|
||||
':site' => $this->app['conf']->get(['main', 'key'])
|
||||
, ':usr_id' => $this->app['authentication']->getUser()->get_id()
|
||||
, ':record_id' => $this->get_record_id()
|
||||
];
|
||||
|
@@ -411,7 +411,7 @@ class record_preview extends record_adapter
|
||||
$report = $this->app['acl']->get($this->app['authentication']->getUser())->has_right_on_base(
|
||||
$this->get_base_id(), 'canreport');
|
||||
|
||||
if ( ! $report && ! $this->app['phraseanet.registry']->get('GV_google_api')) {
|
||||
if ( ! $report && ! $this->app['conf']->get(['registry', 'webservices', 'google-charts-enabled'])) {
|
||||
$this->view_popularity = false;
|
||||
|
||||
return $this->view_popularity;
|
||||
@@ -500,7 +500,7 @@ class record_preview extends record_adapter
|
||||
$report = $this->app['acl']->get($this->app['authentication']->getUser())->has_right_on_base(
|
||||
$this->get_base_id(), 'canreport');
|
||||
|
||||
if ( ! $report && ! $this->app['phraseanet.registry']->get('GV_google_api')) {
|
||||
if ( ! $report && ! $this->app['conf']->get(['registry', 'webservices', 'google-charts-enabled'])) {
|
||||
$this->refferer_popularity = false;
|
||||
|
||||
return $this->refferer_popularity;
|
||||
@@ -524,19 +524,19 @@ class record_preview extends record_adapter
|
||||
foreach ($rs as $row) {
|
||||
if ($row['referrer'] == 'NO REFERRER')
|
||||
$row['referrer'] = $this->app->trans('report::acces direct');
|
||||
if ($row['referrer'] == $this->app['phraseanet.registry']->get('GV_ServerName') . 'prod/')
|
||||
if ($row['referrer'] == $this->app['conf']->get('servername') . 'prod/')
|
||||
$row['referrer'] = $this->app->trans('admin::monitor: module production');
|
||||
if ($row['referrer'] == $this->app['phraseanet.registry']->get('GV_ServerName') . 'client/')
|
||||
if ($row['referrer'] == $this->app['conf']->get('servername') . 'client/')
|
||||
$row['referrer'] = $this->app->trans('admin::monitor: module client');
|
||||
if (strpos($row['referrer'], $this->app['phraseanet.registry']->get('GV_ServerName') . 'login/') !== false)
|
||||
if (strpos($row['referrer'], $this->app['conf']->get('servername') . 'login/') !== false)
|
||||
$row['referrer'] = $this->app->trans('report:: page d\'accueil');
|
||||
if (strpos($row['referrer'], 'http://apps.cooliris.com/') !== false)
|
||||
$row['referrer'] = $this->app->trans('report:: visualiseur cooliris');
|
||||
|
||||
if (strpos($row['referrer'], $this->app['phraseanet.registry']->get('GV_ServerName') . 'document/') !== false) {
|
||||
if (strpos($row['referrer'], $this->app['conf']->get('servername') . 'document/') !== false) {
|
||||
$row['referrer'] = $this->app->trans('report::acces direct');
|
||||
}
|
||||
if (strpos($row['referrer'], $this->app['phraseanet.registry']->get('GV_ServerName') . 'permalink/') !== false) {
|
||||
if (strpos($row['referrer'], $this->app['conf']->get('servername') . 'permalink/') !== false) {
|
||||
$row['referrer'] = $this->app->trans('report::acces direct');
|
||||
}
|
||||
if ( ! isset($referrers[$row['referrer']]))
|
||||
@@ -572,7 +572,7 @@ class record_preview extends record_adapter
|
||||
$report = $this->app['acl']->get($this->app['authentication']->getUser())->has_right_on_base($this->get_base_id(), 'canreport');
|
||||
|
||||
$ret = false;
|
||||
if ( ! $report && ! $this->app['phraseanet.registry']->get('GV_google_api')) {
|
||||
if ( ! $report && ! $this->app['conf']->get(['registry', 'webservices', 'google-charts-enabled'])) {
|
||||
$this->download_popularity = false;
|
||||
|
||||
return $this->download_popularity;
|
||||
|
@@ -1,220 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2013 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
use Alchemy\Phrasea\Application;
|
||||
use Alchemy\Phrasea\Cache\ArrayCache;
|
||||
|
||||
class registry implements registryInterface
|
||||
{
|
||||
/**
|
||||
*
|
||||
* @var \Alchemy\Phrasea\Cache\Cache
|
||||
*/
|
||||
protected $cache;
|
||||
|
||||
protected $app;
|
||||
|
||||
const TYPE_BOOLEAN = 'boolean';
|
||||
const TYPE_ENUM_MULTI = 'enum_multi';
|
||||
const TYPE_INTEGER = 'integer';
|
||||
const TYPE_ENUM = 'enum';
|
||||
const TYPE_STRING = 'string';
|
||||
const TYPE_TEXT = 'text';
|
||||
const TYPE_TIMEZONE = 'timezone';
|
||||
const TYPE_BINARY = 'binary';
|
||||
|
||||
/**
|
||||
*
|
||||
* @param Application $app
|
||||
* @return registry
|
||||
*/
|
||||
public function __construct(Application $app)
|
||||
{
|
||||
$this->app = $app;
|
||||
$this->cache = new ArrayCache();
|
||||
|
||||
if ($app['phraseanet.configuration-tester']->isInstalled()) {
|
||||
$this->cache->save('GV_ServerName', $app['conf']->get('servername'));
|
||||
$this->cache->save('GV_debug', $app['debug']);
|
||||
|
||||
if ($app['conf']->has(['main', 'key'])) {
|
||||
$this->cache->save('GV_sit', $app['conf']->get(['main', 'key']));
|
||||
}
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return registry
|
||||
*/
|
||||
protected function load()
|
||||
{
|
||||
if ($this->cache->fetch('registry_loaded') !== true) {
|
||||
$rs = [];
|
||||
$loaded = false;
|
||||
try {
|
||||
$conn = connection::getPDOConnection($this->app);
|
||||
$sql = 'SELECT `key`, `value`, `type` FROM registry';
|
||||
$stmt = $conn->prepare($sql);
|
||||
$stmt->execute();
|
||||
$rs = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
$stmt->closeCursor();
|
||||
$loaded = true;
|
||||
} catch (Exception $e) {
|
||||
|
||||
}
|
||||
foreach ($rs as $row) {
|
||||
if (in_array($row['key'], ['GV_ServerName', 'GV_sit', 'GV_debug'])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
switch ($row['type']) {
|
||||
case self::TYPE_BOOLEAN:
|
||||
$value = !!$row['value'];
|
||||
break;
|
||||
case self::TYPE_INTEGER:
|
||||
$value = (int) $row['value'];
|
||||
break;
|
||||
case self::TYPE_ENUM_MULTI:
|
||||
$value = unserialize($row['value']);
|
||||
break;
|
||||
case self::TYPE_BINARY:
|
||||
continue;
|
||||
break;
|
||||
case self::TYPE_STRING:
|
||||
case self::TYPE_ENUM:
|
||||
case self::TYPE_TIMEZONE:
|
||||
case self::TYPE_TEXT:
|
||||
default:
|
||||
$value = $row['value'];
|
||||
break;
|
||||
}
|
||||
|
||||
$this->cache->save($row['key'], $value);
|
||||
}
|
||||
if ($loaded === true)
|
||||
$this->cache->save('registry_loaded', true);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param string $key
|
||||
* @param mixed $defaultvalue
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function get($key, $defaultvalue = null)
|
||||
{
|
||||
if (!$this->cache->contains($key))
|
||||
$this->load();
|
||||
|
||||
if (!$this->cache->contains($key) && !is_null($defaultvalue)) {
|
||||
return $defaultvalue;
|
||||
}
|
||||
|
||||
return $this->cache->fetch($key);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param string $key
|
||||
* @param mixed $value
|
||||
* @param string $type
|
||||
*
|
||||
* @return registry
|
||||
*/
|
||||
public function set($key, $value, $type)
|
||||
{
|
||||
$this->load();
|
||||
|
||||
switch ($type) {
|
||||
case self::TYPE_ENUM_MULTI:
|
||||
$sql_value = serialize($value);
|
||||
$value = (array) $value;
|
||||
break;
|
||||
case self::TYPE_STRING;
|
||||
case self::TYPE_ENUM:
|
||||
case self::TYPE_TIMEZONE:
|
||||
case self::TYPE_TEXT:
|
||||
case self::TYPE_BINARY:
|
||||
default:
|
||||
$sql_value = (string) $value;
|
||||
$value = (string) $value;
|
||||
break;
|
||||
case self::TYPE_BOOLEAN:
|
||||
$sql_value = $value ? '1' : '0';
|
||||
$value = !!$value;
|
||||
break;
|
||||
case self::TYPE_INTEGER:
|
||||
$sql_value = (int) $value;
|
||||
$value = (int) $value;
|
||||
break;
|
||||
}
|
||||
|
||||
if ($type == self::TYPE_BINARY) {
|
||||
return $this;
|
||||
}
|
||||
|
||||
$conn = connection::getPDOConnection($this->app);
|
||||
|
||||
$sql = 'REPLACE INTO registry (`id`, `key`, `value`, `type`)
|
||||
VALUES (null, :key, :value, :type)';
|
||||
$stmt = $conn->prepare($sql);
|
||||
$stmt->execute([':key' => $key, ':value' => $sql_value, ':type' => $type]);
|
||||
$stmt->closeCursor();
|
||||
|
||||
$this->cache->save($key, $value);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setKey($value)
|
||||
{
|
||||
$this->cache->save('GV_sit', $value);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param string $key
|
||||
* @return mixed
|
||||
*/
|
||||
public function is_set($key)
|
||||
{
|
||||
$this->load();
|
||||
|
||||
return $this->cache->contains($key);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param string $key
|
||||
* @return registry
|
||||
*/
|
||||
public function un_set($key)
|
||||
{
|
||||
$this->load();
|
||||
$conn = connection::getPDOConnection($this->app);
|
||||
|
||||
$sql = 'DELETE FROM registry WHERE `key` = :key';
|
||||
$stmt = $conn->prepare($sql);
|
||||
$stmt->execute([':key' => $key]);
|
||||
$stmt->closeCursor();
|
||||
|
||||
$this->cache->delete($key);
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
@@ -1,22 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2013 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
interface registryInterface
|
||||
{
|
||||
|
||||
public function get($key, $defaultvalue = null);
|
||||
|
||||
public function set($key, $value, $type);
|
||||
|
||||
public function is_set($key);
|
||||
|
||||
public function un_set($key);
|
||||
}
|
@@ -220,7 +220,7 @@ class set_export extends set_abstract
|
||||
|
||||
$this->ftp_datas = [];
|
||||
|
||||
if ($this->app['phraseanet.registry']->get('GV_activeFTP') && ($hasadminright || $this->app['phraseanet.registry']->get('GV_ftp_for_user'))) {
|
||||
if ($this->app['conf']->get(['registry', 'ftp', 'ftp-enabled']) && ($hasadminright || $this->app['conf']->get(['registry', 'ftp', 'ftp-user-access']))) {
|
||||
$display_ftp = $display_download;
|
||||
$this->total_ftp = $this->total_download;
|
||||
|
||||
@@ -240,7 +240,7 @@ class set_export extends set_abstract
|
||||
)
|
||||
GROUP BY usr_id ";
|
||||
$params = [];
|
||||
} elseif ($this->app['phraseanet.registry']->get('GV_ftp_for_user')) {
|
||||
} elseif ($this->app['conf']->get(['registry', 'ftp', 'ftp-user-access'])) {
|
||||
$sql = "SELECT usr.usr_id,usr_login,usr.usr_mail, FtpCredential.*
|
||||
FROM (
|
||||
FtpCredential INNER JOIN usr ON (
|
||||
|
@@ -8,100 +8,11 @@
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
use Alchemy\Phrasea\Application;
|
||||
use Symfony\Component\Process\PhpExecutableFinder;
|
||||
use Symfony\Component\Process\ExecutableFinder;
|
||||
|
||||
class setup
|
||||
{
|
||||
public static function create_global_values(Application $app, $datas = [])
|
||||
{
|
||||
$GV = require(__DIR__ . "/../../lib/conf.d/_GV_template.inc");
|
||||
|
||||
$vars = [];
|
||||
$error = false;
|
||||
|
||||
foreach ($GV as $section) {
|
||||
foreach ($section['vars'] as $variable) {
|
||||
if (isset($datas[$variable['name']]) === false) {
|
||||
if (isset($variable['default'])) {
|
||||
if ($variable['type'] === 'boolean') {
|
||||
if ($variable['default'] === true)
|
||||
$datas[$variable['name']] = '1';
|
||||
else
|
||||
$datas[$variable['name']] = '0';
|
||||
} else {
|
||||
$datas[$variable['name']] = $variable['default'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$type = $variable['type'];
|
||||
switch ($variable['type']) {
|
||||
case \registry::TYPE_STRING:
|
||||
case \registry::TYPE_BINARY:
|
||||
case \registry::TYPE_TEXT:
|
||||
case \registry::TYPE_TIMEZONE:
|
||||
$datas[$variable['name']] = (string) trim($datas[$variable['name']]);
|
||||
break;
|
||||
case \registry::TYPE_ENUM:
|
||||
if (!isset($variable['available'])) {
|
||||
$variable['error'] = 'avalaibility';
|
||||
} elseif (!is_array($variable['available'])) {
|
||||
$variable['error'] = 'avalaibility';
|
||||
} elseif (!in_array($datas[$variable['name']], $variable['available'])) {
|
||||
$variable['error'] = 'avalaibility';
|
||||
}
|
||||
break;
|
||||
case \registry::TYPE_ENUM_MULTI:
|
||||
if (!isset($datas[$variable['name']]))
|
||||
$datas[$variable['name']] = null;
|
||||
$datas[$variable['name']] = ($datas[$variable['name']]);
|
||||
break;
|
||||
case \registry::TYPE_BOOLEAN:
|
||||
$datas[$variable['name']] = strtolower($datas[$variable['name']]) === 'true' ? '1' : '0';
|
||||
break;
|
||||
case \registry::TYPE_INTEGER:
|
||||
$datas[$variable['name']] = (int) trim($datas[$variable['name']]);
|
||||
break;
|
||||
default:
|
||||
$error = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if (isset($variable['required']) && $variable['required'] === true && trim($datas[$variable['name']]) === '')
|
||||
$variable['error'] = 'required';
|
||||
|
||||
if (isset($variable['end_slash'])) {
|
||||
if ($variable['end_slash'] === true) {
|
||||
$datas[$variable['name']] = trim($datas[$variable['name']]) !== '' ? p4string::addEndSlash($datas[$variable['name']]) : '';
|
||||
}
|
||||
if ($variable['end_slash'] === false) {
|
||||
$datas[$variable['name']] = trim($datas[$variable['name']]) !== '' ? p4string::delEndSlash($datas[$variable['name']]) : '';
|
||||
}
|
||||
}
|
||||
|
||||
if ($variable['type'] !== 'integer' && $variable['type'] !== 'boolean')
|
||||
$datas[$variable['name']] = $datas[$variable['name']];
|
||||
|
||||
$vars[$variable['name']] = ['value' => $datas[$variable['name']], 'type' => $type];
|
||||
}
|
||||
}
|
||||
|
||||
if ($error === false) {
|
||||
foreach ($vars as $key => $values) {
|
||||
if ($key == 'GV_sit' && null !== $app['phraseanet.registry']->get('GV_sit')) {
|
||||
continue;
|
||||
}
|
||||
$app['phraseanet.registry']->set($key, $values['value'], $values['type']);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static function discover_binaries()
|
||||
{
|
||||
$phpFinder = new PhpExecutableFinder();
|
||||
|
@@ -1,670 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Alchemy\Phrasea\Application;
|
||||
use Symfony\Component\Routing\Exception\RouteNotFoundException;
|
||||
|
||||
return call_user_func_array(function(Application $app) {
|
||||
|
||||
$avLanguages = $app['locales.available'];
|
||||
|
||||
$youtube_console_url = '<a href="https://code.google.com/apis/console/" target="_blank">https://code.google.com/apis/console/</a>';
|
||||
$dashboard_youtube = '<a href="https://code.google.com/apis/youtube/dashboard/" target="_blank">https://code.google.com/apis/youtube/dashboard/</a>';
|
||||
$create_api_flickr = '<a href="https://secure.flickr.com/services/apps/create/" target="_blank">https://secure.flickr.com/services/apps/create/</a>';
|
||||
$create_api_dailymotion = '<a href="http://www.dailymotion.com/profile/developer" target="_blank">http://www.dailymotion.com/profile/developer</a>';
|
||||
|
||||
try {
|
||||
$youtube_callback = $app->url('prod_bridge_callback', ['api_name' => 'youtube']);
|
||||
} catch (RouteNotFoundException $e) {
|
||||
$youtube_callback = null;
|
||||
}
|
||||
|
||||
try {
|
||||
$flickr_callback = $app->url('prod_bridge_callback', ['api_name' => 'flickr']);
|
||||
} catch (RouteNotFoundException $e) {
|
||||
$flickr_callback = null;
|
||||
}
|
||||
|
||||
try {
|
||||
$dailymotion_callback = $app->url('prod_bridge_callback', ['api_name' => 'dailymotion']);
|
||||
} catch (RouteNotFoundException $e) {
|
||||
$dailymotion_callback = null;
|
||||
}
|
||||
|
||||
$recaptchaDoc = '<a href="http://www.google.com/recaptcha">http://www.google.com/recaptcha</a>';
|
||||
$imagineDoc = '<a href="http://imagine.readthedocs.org/en/latest/usage/introduction.html">http://imagine.readthedocs.org/en/latest/usage/introduction.html</a>';
|
||||
|
||||
return [
|
||||
[
|
||||
'section' => $app->trans('HTTP Server'),
|
||||
'vars' => [
|
||||
[
|
||||
'type' => \registry::TYPE_ENUM,
|
||||
'name' => 'GV_default_lng',
|
||||
'comment' => $app->trans('Default language'),
|
||||
'default' => 'fr',
|
||||
'available' => $avLanguages,
|
||||
'required' => true
|
||||
],
|
||||
[
|
||||
'type' => \registry::TYPE_STRING,
|
||||
'name' => 'GV_STATIC_URL',
|
||||
'end_slash' => false,
|
||||
'comment' => $app->trans('Static URL'),
|
||||
'help' => $app->trans('optional'),
|
||||
'default' => '',
|
||||
]
|
||||
]
|
||||
], [
|
||||
'section' => $app->trans('Maintenance state'),
|
||||
'rolled' => true,
|
||||
'vars' => [
|
||||
[
|
||||
'type' => \registry::TYPE_TEXT,
|
||||
'name' => 'GV_message',
|
||||
'comment' => $app->trans('Maintenance message'),
|
||||
'default' => "May the force be with you"
|
||||
],
|
||||
[
|
||||
'type' => \registry::TYPE_BOOLEAN,
|
||||
'name' => 'GV_message_on',
|
||||
'comment' => $app->trans('Enable maintenance message broadcast'),
|
||||
'default' => false
|
||||
],
|
||||
[
|
||||
'type' => \registry::TYPE_BOOLEAN,
|
||||
'name' => 'GV_log_errors',
|
||||
'comment' => $app->trans('Log errors'),
|
||||
'default' => false
|
||||
]
|
||||
]
|
||||
], [
|
||||
'section' => $app->trans('Webservices connectivity'),
|
||||
'vars' => [
|
||||
[
|
||||
'type' => \registry::TYPE_BOOLEAN,
|
||||
'name' => 'GV_google_api',
|
||||
'comment' => $app->trans('Use Google API'),
|
||||
'default' => true,
|
||||
'required' => true
|
||||
],
|
||||
[
|
||||
'type' => \registry::TYPE_STRING,
|
||||
'name' => 'GV_i18n_service',
|
||||
'comment' => $app->trans('Geonames server address'),
|
||||
'default' => 'https://geonames.alchemyasp.com/',
|
||||
'end_slash' => true,
|
||||
'required' => true
|
||||
],
|
||||
[
|
||||
'type' => \registry::TYPE_BOOLEAN,
|
||||
'name' => 'GV_captchas',
|
||||
'comment' => $app->trans('Use recaptcha API'),
|
||||
'help' => $app->trans('See documentation at %website%', ['%website%' => $recaptchaDoc]),
|
||||
'default' => false,
|
||||
'required' => true
|
||||
],
|
||||
[
|
||||
'type' => \registry::TYPE_STRING,
|
||||
'name' => 'GV_captcha_public_key',
|
||||
'comment' => $app->trans('Recaptcha public key'),
|
||||
'default' => ''
|
||||
],
|
||||
[
|
||||
'type' => \registry::TYPE_STRING,
|
||||
'name' => 'GV_captcha_private_key',
|
||||
'comment' => $app->trans('Recaptcha private key'),
|
||||
'default' => ''
|
||||
]
|
||||
]
|
||||
], [
|
||||
'section' => $app->trans('Youtube connectivity'),
|
||||
'vars' => [
|
||||
[
|
||||
'type' => \registry::TYPE_BOOLEAN,
|
||||
'name' => 'GV_youtube_api',
|
||||
'comment' => $app->trans('Use youtube API'),
|
||||
'help' => $app->trans('Create API account at %website_url%, then use %callback_url% as callback URL value', ['%website_url%' => $youtube_console_url, '%callback_url%' => $youtube_callback]),
|
||||
'default' => false,
|
||||
'required' => true
|
||||
],
|
||||
[
|
||||
'type' => \registry::TYPE_STRING,
|
||||
'name' => 'GV_youtube_client_id',
|
||||
'comment' => $app->trans('Youtube public key'),
|
||||
'default' => ''
|
||||
],
|
||||
[
|
||||
'type' => \registry::TYPE_STRING,
|
||||
'name' => 'GV_youtube_client_secret',
|
||||
'comment' => $app->trans('Youtube secret key'),
|
||||
'default' => ''
|
||||
],
|
||||
[
|
||||
'type' => \registry::TYPE_STRING,
|
||||
'name' => 'GV_youtube_dev_key',
|
||||
'comment' => $app->trans('Youtube developer key'),
|
||||
'help' => $app->trans('See %url%', ['%url%' => $dashboard_youtube]),
|
||||
'default' => ''
|
||||
]
|
||||
]
|
||||
], [
|
||||
'section' => $app->trans('FlickR connectivity'),
|
||||
'vars' => [
|
||||
[
|
||||
'type' => \registry::TYPE_BOOLEAN,
|
||||
'name' => 'GV_flickr_api',
|
||||
'comment' => $app->trans('Use Flickr API'),
|
||||
'help' => $app->trans('Create API account at %website_url%, then use %callback_url% as callback URL value', ['%website_url%' => $create_api_flickr, '%callback_url%' => $flickr_callback]),
|
||||
'default' => false,
|
||||
'required' => true
|
||||
],
|
||||
[
|
||||
'type' => \registry::TYPE_STRING,
|
||||
'name' => 'GV_flickr_client_id',
|
||||
'comment' => $app->trans('Flickr public key'),
|
||||
'default' => ''
|
||||
],
|
||||
[
|
||||
'type' => \registry::TYPE_STRING,
|
||||
'name' => 'GV_flickr_client_secret',
|
||||
'comment' => $app->trans('Flickr secret key'),
|
||||
'default' => ''
|
||||
]
|
||||
]
|
||||
], [
|
||||
'section' => $app->trans('Dailymotion connectivity'),
|
||||
'vars' => [
|
||||
[
|
||||
'type' => \registry::TYPE_BOOLEAN,
|
||||
'name' => 'GV_dailymotion_api',
|
||||
'comment' => $app->trans('Use Dailymotion API'),
|
||||
'help' => $app->trans('Create API account at %website_url%, then use %callback_url% as callback URL value', ['%website_url%' => $create_api_dailymotion, '%callback_url%' => $dailymotion_callback]),
|
||||
'default' => false,
|
||||
'required' => true
|
||||
],
|
||||
[
|
||||
'type' => \registry::TYPE_STRING,
|
||||
'name' => 'GV_dailymotion_client_id',
|
||||
'comment' => $app->trans('Dailymotion public key'),
|
||||
'default' => ''
|
||||
],
|
||||
[
|
||||
'type' => \registry::TYPE_STRING,
|
||||
'name' => 'GV_dailymotion_client_secret',
|
||||
'comment' => $app->trans('Dailymotion secret key'),
|
||||
'default' => ''
|
||||
]
|
||||
]
|
||||
], [
|
||||
'section' => $app->trans('Phraseanet client API'),
|
||||
'vars' => [
|
||||
[
|
||||
'type' => \registry::TYPE_BOOLEAN,
|
||||
'name' => 'GV_client_navigator',
|
||||
'comment' => $app->trans('Authorize *Phraseanet Navigator*'),
|
||||
'help' => $app->trans('*Phraseanet Navigator* is a smartphone application that allow user to connect on this instance'),
|
||||
'default' => true,
|
||||
'required' => true
|
||||
],
|
||||
[
|
||||
'type' => \registry::TYPE_BOOLEAN,
|
||||
'name' => 'GV_client_officeplugin',
|
||||
'comment' => $app->trans('Authorize Microsoft Office Plugin to connect.'),
|
||||
'default' => true,
|
||||
'required' => true
|
||||
],
|
||||
]
|
||||
], [
|
||||
'section' => $app->trans('Documents storage'),
|
||||
'vars' => [
|
||||
[
|
||||
'type' => \registry::TYPE_STRING,
|
||||
'name' => 'GV_base_datapath_noweb',
|
||||
'end_slash' => true,
|
||||
'comment' => $app->trans('Default path for datas'),
|
||||
'default' => '',
|
||||
'required' => true
|
||||
]
|
||||
]
|
||||
], [
|
||||
'section' => $app->trans('Executables settings'),
|
||||
'vars' => [
|
||||
[
|
||||
'type' => \registry::TYPE_BOOLEAN,
|
||||
'name' => 'GV_h264_streaming',
|
||||
'comment' => $app->trans('Enable H264 stream mode'),
|
||||
'help' => $app->trans('Use with mod_token. Attention requires the apache modules and mod_h264_streaming mod_auth_token'),
|
||||
'default' => false
|
||||
],
|
||||
[
|
||||
'type' => \registry::TYPE_STRING,
|
||||
'name' => 'GV_mod_auth_token_directory',
|
||||
'end_slash' => true,
|
||||
'comment' => $app->trans('Auth_token mount point'),
|
||||
'default' => false
|
||||
],
|
||||
[
|
||||
'type' => \registry::TYPE_STRING,
|
||||
'name' => 'GV_mod_auth_token_directory_path',
|
||||
'end_slash' => false,
|
||||
'comment' => $app->trans('Auth_token directory path'),
|
||||
'default' => false
|
||||
],
|
||||
[
|
||||
'type' => \registry::TYPE_STRING,
|
||||
'name' => 'GV_mod_auth_token_passphrase',
|
||||
'comment' => $app->trans('Auth_token passphrase'),
|
||||
'help' => $app->trans('Defined in Apache configuration'),
|
||||
'default' => false
|
||||
],
|
||||
[
|
||||
'type' => \registry::TYPE_STRING,
|
||||
'name' => 'GV_PHP_INI',
|
||||
'comment' => $app->trans('php.ini path'),
|
||||
'help' => $app->trans('Empty if not used'),
|
||||
'default' => ''
|
||||
],
|
||||
[
|
||||
'type' => \registry::TYPE_ENUM,
|
||||
'name' => 'GV_imagine_driver',
|
||||
'default' => '',
|
||||
'comment' => $app->trans('Imagine driver'),
|
||||
'help' => $app->trans('See documentation at %website%', ['%website%' => $imagineDoc]),
|
||||
'available' => [
|
||||
'' => 'Auto',
|
||||
'gmagick' => 'GraphicsMagick',
|
||||
'imagick' => 'ImageMagick',
|
||||
'gd' => 'GD',
|
||||
]
|
||||
],
|
||||
[
|
||||
'type' => \registry::TYPE_INTEGER,
|
||||
'name' => 'GV_ffmpeg_threads',
|
||||
'comment' => $app->trans('Number of threads to use for FFMpeg'),
|
||||
'default' => 2
|
||||
],
|
||||
[
|
||||
'type' => \registry::TYPE_INTEGER,
|
||||
'name' => 'GV_pdfmaxpages',
|
||||
'comment' => $app->trans('Maximum number of pages to be extracted from PDF'),
|
||||
'default' => 5
|
||||
]
|
||||
]
|
||||
], [
|
||||
'section' => $app->trans('Main configuration'),
|
||||
'vars' => [
|
||||
[
|
||||
'type' => \registry::TYPE_STRING,
|
||||
'name' => 'GV_adminMail',
|
||||
'comment' => $app->trans('Admin email'),
|
||||
'default' => 'support@alchemy.fr'
|
||||
],
|
||||
[
|
||||
'type' => \registry::TYPE_BOOLEAN,
|
||||
'name' => 'GV_view_bas_and_coll',
|
||||
'comment' => $app->trans('Display the name of databases and collections'),
|
||||
'default' => true,
|
||||
'required' => true
|
||||
],
|
||||
[
|
||||
'type' => \registry::TYPE_BOOLEAN,
|
||||
'name' => 'GV_choose_export_title',
|
||||
'comment' => $app->trans('Choose the title of the document to export'),
|
||||
'default' => false,
|
||||
'required' => true
|
||||
],
|
||||
[
|
||||
'type' => \registry::TYPE_ENUM,
|
||||
'name' => 'GV_default_export_title',
|
||||
'comment' => $app->trans('Default export title'),
|
||||
'default' => 'title',
|
||||
'available' => [
|
||||
'title' => $app->trans('Document title'),
|
||||
'original' => $app->trans('Original name'),
|
||||
]
|
||||
],
|
||||
[
|
||||
'type' => \registry::TYPE_ENUM,
|
||||
'name' => 'GV_social_tools',
|
||||
'comment' => $app->trans('Enable this setting to share on Facebook and Twitter'),
|
||||
'available' => [
|
||||
'none' => $app->trans('Disabled'),
|
||||
'publishers' => $app->trans('Publishers'),
|
||||
'all' => $app->trans('Enabled'),
|
||||
],
|
||||
'default' => 'none',
|
||||
'required' => false
|
||||
]
|
||||
]
|
||||
], [
|
||||
'section' => $app->trans('Homepage'),
|
||||
'rolled' => true,
|
||||
'vars' => [
|
||||
[
|
||||
'type' => \registry::TYPE_ENUM,
|
||||
'name' => 'GV_home_publi',
|
||||
'comment' => $app->trans('Homepage slideshow'),
|
||||
'default' => 'COOLIRIS',
|
||||
'available' => [
|
||||
'DISPLAYx1' => $app->trans('Single image'),
|
||||
'SCROLL' => $app->trans('Slide show'),
|
||||
'COOLIRIS' => 'Cooliris',
|
||||
'CAROUSEL' => $app->trans('Carousel'),
|
||||
'GALLERIA' => $app->trans('Gallery')
|
||||
],
|
||||
'required' => true
|
||||
]
|
||||
]
|
||||
], [
|
||||
'section' => $app->trans('Search engine'),
|
||||
'rolled' => true,
|
||||
'vars' => [
|
||||
[
|
||||
'type' => \registry::TYPE_INTEGER,
|
||||
'name' => 'GV_min_letters_truncation',
|
||||
'comment' => $app->trans('Minimum number of letters before truncation'),
|
||||
'help' => $app->trans('Used in search engine'),
|
||||
'default' => 1
|
||||
],
|
||||
[
|
||||
'type' => \registry::TYPE_STRING,
|
||||
'name' => 'GV_defaultQuery',
|
||||
'comment' => $app->trans('Default query'),
|
||||
'default' => 'all'
|
||||
],
|
||||
[
|
||||
'type' => \registry::TYPE_ENUM,
|
||||
'name' => 'GV_defaultQuery_type',
|
||||
'comment' => $app->trans('Default searched type'),
|
||||
'help' => $app->trans('Used when opening the application'),
|
||||
'available' => [
|
||||
'0' => $app->trans('Documents'),
|
||||
'1' => $app->trans('Stories'),
|
||||
],
|
||||
'default' => '0'
|
||||
]
|
||||
]
|
||||
], [
|
||||
'section' => $app->trans('Report'),
|
||||
'rolled' => true,
|
||||
'vars' => [
|
||||
[
|
||||
'type' => \registry::TYPE_BOOLEAN,
|
||||
'name' => 'GV_anonymousReport',
|
||||
'comment' => $app->trans('Anonymous report'),
|
||||
'help' => $app->trans('Hide information about users'),
|
||||
'default' => false,
|
||||
'required' => true
|
||||
]
|
||||
]
|
||||
], [
|
||||
'section' => $app->trans('Additionnal modules'),
|
||||
'rolled' => true,
|
||||
'vars' => [
|
||||
[
|
||||
'type' => \registry::TYPE_BOOLEAN,
|
||||
'name' => 'GV_thesaurus',
|
||||
'comment' => $app->trans('Enable thesaurus'),
|
||||
'default' => true
|
||||
], [
|
||||
'type' => \registry::TYPE_BOOLEAN,
|
||||
'name' => 'GV_multiAndReport',
|
||||
'comment' => $app->trans('Enable multi-doc mode'),
|
||||
'default' => true
|
||||
], [
|
||||
'type' => \registry::TYPE_BOOLEAN,
|
||||
'name' => 'GV_seeOngChgDoc',
|
||||
'comment' => $app->trans('Enable HD substitution'),
|
||||
'default' => false
|
||||
], [
|
||||
'type' => \registry::TYPE_BOOLEAN,
|
||||
'name' => 'GV_seeNewThumb',
|
||||
'comment' => $app->trans('Enable thumbnail substitution'),
|
||||
'default' => false
|
||||
]
|
||||
]
|
||||
]
|
||||
, [
|
||||
'section' => $app->trans('Emails'),
|
||||
'vars' => [
|
||||
[
|
||||
'type' => \registry::TYPE_STRING,
|
||||
'name' => 'GV_defaulmailsenderaddr',
|
||||
'comment' => $app->trans('Default mail sender address'),
|
||||
'default' => 'phraseanet@example.com'
|
||||
],
|
||||
[
|
||||
'type' => \registry::TYPE_STRING,
|
||||
'name' => 'GV_email_prefix',
|
||||
'comment' => $app->trans('Prefix for notification emails'),
|
||||
'default' => ''
|
||||
],
|
||||
[
|
||||
'type' => \registry::TYPE_BOOLEAN,
|
||||
'name' => 'GV_smtp',
|
||||
'comment' => $app->trans('Use a SMTP server'),
|
||||
'default' => false
|
||||
],
|
||||
[
|
||||
'type' => \registry::TYPE_BOOLEAN,
|
||||
'name' => 'GV_smtp_auth',
|
||||
'comment' => $app->trans('Enable SMTP authentication'),
|
||||
'default' => false
|
||||
],
|
||||
[
|
||||
'type' => \registry::TYPE_STRING,
|
||||
'name' => 'GV_smtp_host',
|
||||
'comment' => $app->trans('SMTP host'),
|
||||
'default' => ''
|
||||
],
|
||||
[
|
||||
'type' => \registry::TYPE_STRING,
|
||||
'name' => 'GV_smtp_port',
|
||||
'comment' => $app->trans('SMTP port'),
|
||||
'default' => ''
|
||||
],
|
||||
[
|
||||
'type' => \registry::TYPE_ENUM,
|
||||
'name' => 'GV_smtp_secure',
|
||||
'comment' => $app->trans('SMTP encryption'),
|
||||
'default' => 'tls',
|
||||
'available' => [
|
||||
'none' => $app->trans('None'),
|
||||
'ssl' => 'SSL',
|
||||
'tls' => 'TLS'
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => \registry::TYPE_STRING,
|
||||
'name' => 'GV_smtp_user',
|
||||
'comment' => $app->trans('SMTP user'),
|
||||
'default' => ''
|
||||
],
|
||||
[
|
||||
'type' => \registry::TYPE_STRING,
|
||||
'name' => 'GV_smtp_password',
|
||||
'comment' => $app->trans('SMTP password'),
|
||||
'default' => ''
|
||||
]
|
||||
]
|
||||
], [
|
||||
'section' => $app->trans('FTP Export'),
|
||||
'vars' => [
|
||||
[
|
||||
'type' => \registry::TYPE_BOOLEAN,
|
||||
'name' => 'GV_activeFTP',
|
||||
'comment' => $app->trans('Enable FTP export'),
|
||||
'help' => $app->trans('Available in multi-export tab'),
|
||||
'default' => false
|
||||
],
|
||||
[
|
||||
'type' => \registry::TYPE_BOOLEAN,
|
||||
'name' => 'GV_ftp_for_user',
|
||||
'comment' => $app->trans('Enable FTP for users'),
|
||||
'help' => $app->trans('By default it is available for admins'),
|
||||
'default' => false
|
||||
]
|
||||
]
|
||||
], [
|
||||
'section' => $app->trans('Client'),
|
||||
'vars' => [
|
||||
[
|
||||
'type' => \registry::TYPE_INTEGER,
|
||||
'name' => 'GV_download_max',
|
||||
'comment' => $app->trans('Maximum megabytes allowed for download'),
|
||||
'help' => $app->trans('If request is bigger, then mail is still available'),
|
||||
'default' => 120
|
||||
],
|
||||
[
|
||||
'type' => \registry::TYPE_INTEGER,
|
||||
'name' => 'GV_ong_search',
|
||||
'comment' => $app->trans('Search tab position'),
|
||||
'default' => 1
|
||||
],
|
||||
[
|
||||
'type' => \registry::TYPE_INTEGER,
|
||||
'name' => 'GV_ong_advsearch',
|
||||
'comment' => $app->trans('Advanced search tab position'),
|
||||
'default' => 2
|
||||
],
|
||||
[
|
||||
'type' => \registry::TYPE_INTEGER,
|
||||
'name' => 'GV_ong_topics',
|
||||
'comment' => $app->trans('Topics tab position'),
|
||||
'default' => 0
|
||||
],
|
||||
[
|
||||
'type' => \registry::TYPE_INTEGER,
|
||||
'name' => 'GV_ong_actif',
|
||||
'comment' => $app->trans('Active tab position'),
|
||||
'default' => 1
|
||||
],
|
||||
[
|
||||
'type' => \registry::TYPE_ENUM,
|
||||
'name' => 'GV_client_render_topics',
|
||||
'comment' => $app->trans('Topics display mode'),
|
||||
'available' => [
|
||||
'tree' => $app->trans('Trees'),
|
||||
'popups' => $app->trans('Drop-down'),
|
||||
],
|
||||
'default' => 'tree'
|
||||
],
|
||||
[
|
||||
'type' => \registry::TYPE_BOOLEAN,
|
||||
'name' => 'GV_rollover_reg_preview',
|
||||
'comment' => $app->trans('Enable roll-over on stories'),
|
||||
'default' => true
|
||||
],
|
||||
[
|
||||
'type' => \registry::TYPE_BOOLEAN,
|
||||
'name' => 'GV_rollover_chu',
|
||||
'comment' => $app->trans('Enable roll-over on basket elements'),
|
||||
'default' => true
|
||||
],
|
||||
[
|
||||
'type' => \registry::TYPE_ENUM,
|
||||
'name' => 'GV_client_coll_ckbox',
|
||||
'comment' => $app->trans('Collections display mode'),
|
||||
'default' => 'checkbox',
|
||||
'available' => [
|
||||
'popup' => $app->trans('Drop-down'),
|
||||
'checkbox' => $app->trans('Check-box'),
|
||||
]
|
||||
],
|
||||
[
|
||||
'type' => \registry::TYPE_BOOLEAN,
|
||||
'name' => 'GV_viewSizeBaket',
|
||||
'comment' => $app->trans('Display the total size of the document basket'),
|
||||
'default' => true
|
||||
],
|
||||
[
|
||||
'type' => \registry::TYPE_BOOLEAN,
|
||||
'name' => 'GV_clientAutoShowProposals',
|
||||
'comment' => $app->trans('Display proposals tab'),
|
||||
'default' => true
|
||||
],
|
||||
[
|
||||
'type' => \registry::TYPE_BOOLEAN,
|
||||
'name' => 'GV_needAuth2DL',
|
||||
'comment' => $app->trans('Require authentication to download documents'),
|
||||
'help' => $app->trans('Used for guest account'),
|
||||
'default' => true
|
||||
],
|
||||
[
|
||||
'type' => 'boolean',
|
||||
'name' => 'GV_requireTOUValidationForExport',
|
||||
'comment' => $app->trans('Users must accept Terms of Use for each export'),
|
||||
'default' => false
|
||||
]
|
||||
]
|
||||
], [
|
||||
'section' => $app->trans('Registration'),
|
||||
'vars' => [
|
||||
[
|
||||
'type' => \registry::TYPE_BOOLEAN,
|
||||
'name' => 'GV_autoselectDB',
|
||||
'comment' => $app->trans('Auto select databases'),
|
||||
'help' => $app->trans('This option disables the selecting of the databases on which a user can register himself, and registration is made on all granted databases.'),
|
||||
'default' => true
|
||||
],
|
||||
[
|
||||
'type' => \registry::TYPE_BOOLEAN,
|
||||
'name' => 'GV_autoregister',
|
||||
'comment' => $app->trans('Enable auto registration'),
|
||||
'default' => false
|
||||
]
|
||||
]
|
||||
], [
|
||||
'section' => $app->trans('Push configuration'),
|
||||
'vars' => [
|
||||
[
|
||||
'type' => \registry::TYPE_INTEGER,
|
||||
'name' => 'GV_validation_reminder',
|
||||
'comment' => $app->trans('Number of days before the end of the validation to send a reminder email'),
|
||||
'default' => 2
|
||||
],
|
||||
[
|
||||
'type' => \registry::TYPE_INTEGER,
|
||||
'name' => 'GV_val_expiration',
|
||||
'comment' => $app->trans('Default validation links duration'),
|
||||
'help' => $app->trans('If set to 0, duration is permanent'),
|
||||
'default' => 10
|
||||
]
|
||||
]
|
||||
], [
|
||||
'section' => $app->trans('Robot indexing'),
|
||||
'vars' => [
|
||||
[
|
||||
'type' => \registry::TYPE_STRING,
|
||||
'name' => 'GV_homeTitle',
|
||||
'comment' => $app->trans('Application title'),
|
||||
'default' => 'Phraseanet'
|
||||
],
|
||||
[
|
||||
'type' => \registry::TYPE_STRING,
|
||||
'name' => 'GV_metaKeywords',
|
||||
'comment' => $app->trans('Keywords used for indexing purposes by search engines robots'),
|
||||
'default' => ''
|
||||
],
|
||||
[
|
||||
'type' => \registry::TYPE_TEXT,
|
||||
'name' => 'GV_metaDescription',
|
||||
'comment' => $app->trans('Application description'),
|
||||
'default' => ''
|
||||
],
|
||||
[
|
||||
'type' => \registry::TYPE_STRING,
|
||||
'name' => 'GV_googleAnalytics',
|
||||
'comment' => $app->trans('Google Analytics identifier'),
|
||||
'default' => ''
|
||||
],
|
||||
[
|
||||
'type' => \registry::TYPE_BOOLEAN,
|
||||
'name' => 'GV_allow_search_engine',
|
||||
'comment' => $app->trans('Allow the website to be indexed by search engines like Google'),
|
||||
'default' => true
|
||||
],
|
||||
]
|
||||
]
|
||||
];
|
||||
}, [$app]);
|
@@ -1,7 +1,9 @@
|
||||
servername: 'http://local.phrasea/'
|
||||
languages:
|
||||
available: []
|
||||
default: 'fr'
|
||||
main:
|
||||
servername: 'http://local.phrasea/'
|
||||
maintenance: false
|
||||
languages: []
|
||||
database:
|
||||
host: 'sql-host'
|
||||
port: 3306
|
||||
@@ -26,28 +28,51 @@ main:
|
||||
search-engine:
|
||||
type: Alchemy\Phrasea\SearchEngine\Phrasea\PhraseaEngine
|
||||
options: []
|
||||
binaries:
|
||||
ghostscript_binary: null
|
||||
php_binary: null
|
||||
swf_extract_binary: null
|
||||
pdf2swf_binary: null
|
||||
swf_render_binary: null
|
||||
unoconv_binary: null
|
||||
ffmpeg_binary: null
|
||||
ffprobe_binary: null
|
||||
mp4box_binary: null
|
||||
pdftotext_binary: null
|
||||
recess_binary: null
|
||||
phraseanet_indexer: null
|
||||
ffmpeg_timeout: 3600
|
||||
ffprobe_timeout: 60
|
||||
gs_timeout: 60
|
||||
mp4box_timeout: 60
|
||||
swftools_timeout: 60
|
||||
unoconv_timeout: 60
|
||||
task-manager:
|
||||
status: started
|
||||
listener:
|
||||
protocol: tcp
|
||||
host: 127.0.0.1
|
||||
port: 6700
|
||||
storage:
|
||||
subdefs:
|
||||
default-dir: null
|
||||
bridge:
|
||||
youtube:
|
||||
enabled: false
|
||||
client_id: null
|
||||
client_secret: null
|
||||
developer_key: null
|
||||
flickr:
|
||||
enabled: false
|
||||
client_id: null
|
||||
client_secret: null
|
||||
dailymotion:
|
||||
enabled: false
|
||||
client_id: null
|
||||
client_secret: null
|
||||
trusted-proxies: []
|
||||
debugger:
|
||||
allowed-ips: []
|
||||
binaries:
|
||||
ghostscript_binary: null
|
||||
php_binary: null
|
||||
swf_extract_binary: null
|
||||
pdf2swf_binary: null
|
||||
swf_render_binary: null
|
||||
unoconv_binary: null
|
||||
ffmpeg_binary: null
|
||||
ffprobe_binary: null
|
||||
mp4box_binary: null
|
||||
pdftotext_binary: null
|
||||
recess_binary: null
|
||||
phraseanet_indexer: null
|
||||
ffmpeg_timeout: 3600
|
||||
ffprobe_timeout: 60
|
||||
gs_timeout: 60
|
||||
mp4box_timeout: 60
|
||||
swftools_timeout: 60
|
||||
unoconv_timeout: 60
|
||||
border-manager:
|
||||
enabled: true
|
||||
checkers:
|
||||
@@ -134,10 +159,4 @@ xsendfile:
|
||||
enabled: false
|
||||
type: nginx
|
||||
mapping: []
|
||||
task-manager:
|
||||
status: started
|
||||
listener:
|
||||
protocol: tcp
|
||||
host: 127.0.0.1
|
||||
port: 6700
|
||||
plugins: []
|
||||
|
@@ -23,7 +23,7 @@
|
||||
<![endif]-->
|
||||
</head>
|
||||
|
||||
{% set home_title = app['phraseanet.registry'].get('GV_homeTitle') %}
|
||||
{% set home_title = app['conf'].get(['registry', 'general', 'title']) %}
|
||||
|
||||
<body>
|
||||
<div id="page" class="container">
|
||||
|
@@ -34,7 +34,7 @@
|
||||
<div id="main" class="row">
|
||||
|
||||
<div id="title-box" class="span6 offset3">
|
||||
<h1 id="namePhr">{{ app['phraseanet.registry'].get('GV_homeTitle') }}</h1>
|
||||
<h1 id="namePhr">{{ app['conf'].get(['registry', 'general', 'title']) }}</h1>
|
||||
</div>
|
||||
|
||||
{% if app['authentication'].getUser() is not none %}
|
||||
|
@@ -1,8 +1,8 @@
|
||||
{% if app['phraseanet.registry'].get('GV_googleAnalytics') != '' %}
|
||||
{% if app['conf'].get(['registry', 'general', 'analytics']) != '' %}
|
||||
<script type="text/javascript">
|
||||
|
||||
var _gaq = _gaq || [];
|
||||
_gaq.push(['_setAccount', '{{ app['phraseanet.registry'].get('GV_googleAnalytics') }}']);
|
||||
_gaq.push(['_setAccount', '{{ app['conf'].get(['registry', 'general', 'analytics']) }}']);
|
||||
_gaq.push(['_trackPageview']);
|
||||
|
||||
(function() {
|
||||
|
@@ -4,7 +4,7 @@
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="apple-mobile-web-app-capable" content="yes" />
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
|
||||
<title>{{ app['phraseanet.registry'].get('GV_homeTitle') }} - {{ module_name }} </title>
|
||||
<title>{{ app['conf'].get(['registry', 'general', 'title']) }} - {{ module_name }} </title>
|
||||
<link rel="stylesheet" href="{{ path('minifier', { 'f' : 'assets/jquery-mobile/jquery.mobile.css' }) }}" />
|
||||
<script src="{{ path('minifier', { 'f' : 'assets/jquery/jquery.js' }) }}"></script>
|
||||
<script src="{{ path('minifier', { 'f' : 'assets/jquery-mobile/jquery.mobile.js' }) }}"></script>
|
||||
|
@@ -18,7 +18,7 @@
|
||||
{% block menu %}
|
||||
<div id="main-bar" class="navbar">
|
||||
<div class="navbar-inner">
|
||||
<span class="brand">{{ app["phraseanet.registry"].get("GV_homeTitle") }}<span class="section-title"> {{ block("title") }}</span></span>
|
||||
<span class="brand">{{ app['conf'].get(['registry', 'general', 'title']) }}<span class="section-title"> {{ block("title") }}</span></span>
|
||||
<ul class="nav">
|
||||
<li {% if selected == "informations" %}class="active"{% endif %}><a href="{{ path("account") }}">{{ "Informations" | trans }}</a></li>
|
||||
<li {% if selected == "access" %}class="active"{% endif %}><a href="{{ path("account_access") }}">{{ "Acces" | trans }}</a></li>
|
||||
|
@@ -59,7 +59,7 @@
|
||||
{{ 'admin::base: nombre de mots indexes sur la base' | trans }}
|
||||
{{ databox.get_index_amount() }}
|
||||
</li>
|
||||
{% if app['phraseanet.registry'].get('GV_thesaurus') %}
|
||||
{% if app['conf'].get(['registry', 'modules', 'thesaurus']) %}
|
||||
<li>
|
||||
{{ 'admin::base: nombre de termes de Thesaurus indexes :' | trans }}
|
||||
{{ databox.get_thesaurus_hits() }}
|
||||
|
@@ -23,7 +23,7 @@
|
||||
var bodySize = {x:0,y:0};
|
||||
|
||||
var language = {
|
||||
serverName: '{{ app['phraseanet.registry'].get('GV_ServerName') | e('js') }}',
|
||||
serverName: '{{ app['conf'].get('servername') | e('js') }}',
|
||||
serverError: '{{ 'phraseanet::erreur: Une erreur est survenue, si ce probleme persiste, contactez le support technique' | trans | e('js') }}',
|
||||
serverTimeout: '{{ 'phraseanet::erreur: La connection au serveur Phraseanet semble etre indisponible' | trans | e('js') }}',
|
||||
serverDisconnected: '{{ 'phraseanet::erreur: Votre session est fermee, veuillez vous re-authentifier' | trans | e('js') }}',
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user