本文整理汇总了PHP中OCP\Util::addTranslations方法的典型用法代码示例。如果您正苦于以下问题:PHP Util::addTranslations方法的具体用法?PHP Util::addTranslations怎么用?PHP Util::addTranslations使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OCP\Util
的用法示例。
在下文中一共展示了Util::addTranslations方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: use
$c = $app->getContainer();
$appName = $c->query('AppName');
/**
* Menu entry in ownCloud
*/
$c->query('OCP\\INavigationManager')->add(function () use($c, $appName) {
$urlGenerator = $c->query('OCP\\IURLGenerator');
$l10n = $c->query('OCP\\IL10N');
return ['id' => $appName, 'order' => 3, 'href' => $urlGenerator->linkToRoute($appName . '.page.index'), 'icon' => $urlGenerator->imagePath($appName, 'app.svg'), 'name' => $l10n->t('Gallery')];
});
/**
* Loading translations
*
* The string has to match the app's folder name
*/
Util::addTranslations('gallery');
// Hack which only loads the scripts in the Files app
$request = $c->query('Request');
if (isset($request->server['REQUEST_URI'])) {
$url = $request->server['REQUEST_URI'];
if (preg_match('%index\\.php/apps/files(/.*)?%', $url) || preg_match('%index\\.php/s/\\b(.*)\\b(?<!/authenticate)$%', $url)) {
// @codeCoverageIgnoreStart
/**
* Scripts for the Files app
*/
Util::addScript($appName, 'vendor/bigshot/bigshot-compressed');
Util::addScript($appName, 'vendor/image-scale/image-scale.min');
Util::addScript($appName, 'vendor/dompurify/src/purify');
Util::addScript($appName, 'galleryfileaction');
Util::addScript($appName, 'slideshow');
Util::addScript($appName, 'slideshowcontrols');
示例2:
<?php
OC::$CLASSPATH['OCA\\Encryption\\Crypt'] = 'files_encryption/lib/crypt.php';
OC::$CLASSPATH['OCA\\Encryption\\Hooks'] = 'files_encryption/hooks/hooks.php';
OC::$CLASSPATH['OCA\\Encryption\\Util'] = 'files_encryption/lib/util.php';
OC::$CLASSPATH['OCA\\Encryption\\Keymanager'] = 'files_encryption/lib/keymanager.php';
OC::$CLASSPATH['OCA\\Encryption\\Stream'] = 'files_encryption/lib/stream.php';
OC::$CLASSPATH['OCA\\Encryption\\Proxy'] = 'files_encryption/lib/proxy.php';
OC::$CLASSPATH['OCA\\Encryption\\Session'] = 'files_encryption/lib/session.php';
OC::$CLASSPATH['OCA\\Encryption\\Capabilities'] = 'files_encryption/lib/capabilities.php';
OC::$CLASSPATH['OCA\\Encryption\\Helper'] = 'files_encryption/lib/helper.php';
// Exceptions
OC::$CLASSPATH['OCA\\Encryption\\Exceptions\\MultiKeyEncryptException'] = 'files_encryption/lib/exceptions.php';
OC::$CLASSPATH['OCA\\Encryption\\Exceptions\\MultiKeyDecryptException'] = 'files_encryption/lib/exceptions.php';
\OCP\Util::addTranslations('files_encryption');
\OCP\Util::addscript('files_encryption', 'encryption');
\OCP\Util::addscript('files_encryption', 'detect-migration');
if (!OC_Config::getValue('maintenance', false)) {
OC_FileProxy::register(new OCA\Encryption\Proxy());
// User related hooks
OCA\Encryption\Helper::registerUserHooks();
// Sharing related hooks
OCA\Encryption\Helper::registerShareHooks();
// Filesystem related hooks
OCA\Encryption\Helper::registerFilesystemHooks();
// App manager related hooks
OCA\Encryption\Helper::registerAppHooks();
if (!in_array('crypt', stream_get_wrappers())) {
stream_wrapper_register('crypt', 'OCA\\Encryption\\Stream');
}
} else {
示例3: varchar
<?php
/*
19.02.2014 Patrick Hoffmann
This app is free to use and can be fully or in parts distributed.
If you have questions or suggestions please
feel free to contact me. patrick@gen7.de
Great thanks to Vincent Petry <pvince81@owncloud.com> for
supporting me the whole development progress.
*/
namespace OCA\files_w2g;
\OCP\Util::addTranslations('files_w2g');
//Init translations
$l = \OCP\Util::getL10N('files_w2g');
//Requirements check
\OCP\JSON::checkLoggedIn();
\OCP\JSON::checkAppEnabled('files_w2g');
//Init Database table
$exist = \OCP\DB::prepare("SHOW TABLES LIKE '*PREFIX*" . app::table . "'")->execute()->fetchAll();
if ($exist == null) {
@($query = \OCP\DB::prepare("CREATE table *PREFIX*" . app::table . "(name varchar(255) PRIMARY KEY,created TIMESTAMP DEFAULT CURRENT_TIMESTAMP,locked_by varchar(255)) " . app::charset));
@$query->execute()->fetchAll();
}
$naming = "rule_username";
$naming_q = \OCP\DB::prepare("SELECT * FROM *PREFIX*appconfig where configkey='suffix' and appid='files_w2g' LIMIT 1")->execute()->fetchAll();
if (count($naming_q) >= 1) {
$naming = $naming_q[0]['configvalue'];
}
//<-End Init Database table
//Vars
示例4: use
*/
$container->query('OCP\\INavigationManager')->add(function () use($container, $appName) {
$urlGenerator = $container->query('OCP\\IURLGenerator');
/**@type \OCP\IL10N $l10n */
$l10n = \OC::$server->getL10NFactory()->get('owncollab_chart');
//$l10n = $container->query('OCP\IL10N'); $l = \OC::$server->getL10N('owncollab_chart');
return ['id' => $appName, 'order' => 10, 'href' => $urlGenerator->linkToRoute($appName . '.main.index'), 'icon' => $urlGenerator->imagePath($appName, 'gantt.svg'), 'name' => $l10n->t('Gantt')];
});
// Create public accept, only redirecting
$shred = new Sharedchart();
$shred->match();
/**
* Loading translations
* The string has to match the app's folder name
*/
Util::addTranslations($appName);
/**
* Application styles and scripts
*/
if (Helper::isApp($appName)) {
Util::addStyle($appName, 'jquery.custom-scrollbar');
Util::addStyle($appName, 'jquery-ui-timepicker');
Util::addStyle($appName, 'main');
Util::addScript($appName, 'libs/jquery.custom-scrollbar');
Util::addScript($appName, 'libs/ns.application');
Util::addScript($appName, 'init');
// dhtmlxGantt v.4.0.0 Standard
Util::addStyle($appName, 'dhtmlxgantt');
Helper::provider('config', ['domain' => '']);
}
/**
示例5: use
$c = $app->getContainer();
$appName = $c->query('AppName');
/**
* Menu entry in ownCloud
*/
$c->query('OCP\\INavigationManager')->add(function () use($c, $appName) {
$urlGenerator = $c->query('OCP\\IURLGenerator');
$l10n = $c->query('OCP\\IL10N');
return ['id' => $appName, 'order' => 3, 'href' => $urlGenerator->linkToRoute($appName . '.page.index'), 'icon' => $urlGenerator->imagePath($appName, 'app.svg'), 'name' => $l10n->t('Gallery+')];
});
/**
* Loading translations
*
* The string has to match the app's folder name
*/
Util::addTranslations('galleryplus');
// Hack which only loads the scripts in the Files app, if the official Gallery is disabled
$request = $c->query('Request');
if (isset($request->server['REQUEST_URI']) && !\OCP\App::isEnabled('gallery')) {
$url = $request->server['REQUEST_URI'];
if (preg_match('%index\\.php/apps/files(/.*)?%', $url) || preg_match('%index\\.php/s/\\b(.*)\\b(?<!/authenticate)$%', $url)) {
// @codeCoverageIgnoreStart
/**
* Scripts for the Files app
*/
Util::addScript($appName, 'vendor/bigshot/bigshot-compressed');
Util::addScript($appName, 'vendor/image-scale/image-scale.min');
Util::addScript($appName, 'galleryfileaction');
Util::addScript($appName, 'slideshow');
Util::addScript($appName, 'slideshowcontrols');
Util::addScript($appName, 'slideshowzoomablepreview');