本文整理匯總了PHP中OC_Util::addVendorScript方法的典型用法代碼示例。如果您正苦於以下問題:PHP OC_Util::addVendorScript方法的具體用法?PHP OC_Util::addVendorScript怎麽用?PHP OC_Util::addVendorScript使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類OC_Util
的用法示例。
在下文中一共展示了OC_Util::addVendorScript方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: display
public function display($post)
{
$defaults = array('adminlogin' => '', 'adminpass' => '', 'dbuser' => '', 'dbpass' => '', 'dbname' => '', 'dbtablespace' => '', 'dbhost' => 'localhost', 'dbtype' => '');
$parameters = array_merge($defaults, $post);
\OC_Util::addVendorScript('strengthify/jquery.strengthify');
\OC_Util::addVendorStyle('strengthify/strengthify');
\OC_Util::addScript('setup');
\OC_Template::printGuestPage('', 'installation', $parameters);
}
示例2: vendor_script
/**
* Shortcut for adding vendor scripts to a page
* @param string $app the appname
* @param string|string[] $file the filename,
* if an array is given it will add all scripts
*/
function vendor_script($app, $file = null)
{
if (is_array($file)) {
foreach ($file as $f) {
OC_Util::addVendorScript($app, $f);
}
} else {
OC_Util::addVendorScript($app, $file);
}
}
示例3: function
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License, version 3,
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
use OCA\SystemTags\Activity\Extension;
use OCA\SystemTags\Activity\Listener;
use OCP\SystemTag\ManagerEvent;
use OCP\SystemTag\MapperEvent;
$eventDispatcher = \OC::$server->getEventDispatcher();
$eventDispatcher->addListener('OCA\\Files::loadAdditionalScripts', function () {
// FIXME: no public API for these ?
\OC_Util::addVendorScript('select2/select2');
\OC_Util::addVendorStyle('select2/select2');
\OCP\Util::addScript('select2-toggleselect');
\OCP\Util::addScript('oc-backbone-webdav');
\OCP\Util::addScript('systemtags/systemtags');
\OCP\Util::addScript('systemtags/systemtagmodel');
\OCP\Util::addScript('systemtags/systemtagsmappingcollection');
\OCP\Util::addScript('systemtags/systemtagscollection');
\OCP\Util::addScript('systemtags/systemtagsinputfield');
\OCP\Util::addScript('systemtags', 'app');
\OCP\Util::addScript('systemtags', 'systemtagsfilelist');
\OCP\Util::addScript('systemtags', 'filesplugin');
\OCP\Util::addScript('systemtags', 'systemtagsinfoview');
\OCP\Util::addStyle('systemtags');
\OCP\Util::addStyle('systemtags', 'systemtagsfilelist');
});
示例4: initTemplateEngine
public static function initTemplateEngine($renderAs)
{
if (self::$initTemplateEngineFirstRun) {
//apps that started before the template initialization can load their own scripts/styles
//so to make sure this scripts/styles here are loaded first we use OC_Util::addScript() with $prepend=true
//meaning the last script/style in this list will be loaded first
if (\OC::$server->getSystemConfig()->getValue('installed', false) && $renderAs !== 'error' && !\OCP\Util::needUpgrade()) {
if (\OC::$server->getConfig()->getAppValue('core', 'backgroundjobs_mode', 'ajax') == 'ajax') {
OC_Util::addScript('backgroundjobs', null, true);
}
}
OC_Util::addStyle("tooltip", null, true);
OC_Util::addStyle('jquery-ui-fixes', null, true);
OC_Util::addVendorStyle('jquery-ui/themes/base/jquery-ui', null, true);
OC_Util::addStyle("multiselect", null, true);
OC_Util::addStyle("fixes", null, true);
OC_Util::addStyle("global", null, true);
OC_Util::addStyle("apps", null, true);
OC_Util::addStyle("fonts", null, true);
OC_Util::addStyle("icons", null, true);
OC_Util::addStyle("mobile", null, true);
OC_Util::addStyle("header", null, true);
OC_Util::addStyle("inputs", null, true);
OC_Util::addStyle("styles", null, true);
// avatars
if (\OC::$server->getSystemConfig()->getValue('enable_avatars', true) === true) {
\OC_Util::addScript('avatar', null, true);
\OC_Util::addScript('jquery.avatar', null, true);
\OC_Util::addScript('placeholder', null, true);
}
OC_Util::addScript('oc-backbone', null, true);
OC_Util::addVendorScript('core', 'backbone/backbone', true);
OC_Util::addVendorScript('snapjs/dist/latest/snap', null, true);
OC_Util::addScript('mimetypelist', null, true);
OC_Util::addScript('mimetype', null, true);
OC_Util::addScript("apps", null, true);
OC_Util::addScript("oc-requesttoken", null, true);
OC_Util::addScript('search', 'search', true);
OC_Util::addScript("config", null, true);
OC_Util::addScript("eventsource", null, true);
OC_Util::addScript("octemplate", null, true);
OC_Util::addTranslations("core", null, true);
OC_Util::addScript("l10n", null, true);
OC_Util::addScript("js", null, true);
OC_Util::addScript("oc-dialogs", null, true);
OC_Util::addScript("jquery.ocdialog", null, true);
OC_Util::addStyle("jquery.ocdialog");
OC_Util::addScript("compatibility", null, true);
OC_Util::addScript("placeholders", null, true);
OC_Util::addScript('files/fileinfo');
OC_Util::addScript('files/client');
// Add the stuff we need always
// following logic will import all vendor libraries that are
// specified in core/js/core.json
$fileContent = file_get_contents(OC::$SERVERROOT . '/core/js/core.json');
if ($fileContent !== false) {
$coreDependencies = json_decode($fileContent, true);
foreach (array_reverse($coreDependencies['vendor']) as $vendorLibrary) {
// remove trailing ".js" as addVendorScript will append it
OC_Util::addVendorScript(substr($vendorLibrary, 0, strlen($vendorLibrary) - 3), null, true);
}
} else {
throw new \Exception('Cannot read core/js/core.json');
}
if (\OC::$server->getRequest()->isUserAgent([\OC\AppFramework\Http\Request::USER_AGENT_IE])) {
// shim for the davclient.js library
\OCP\Util::addScript('files/iedavclient');
}
self::$initTemplateEngineFirstRun = false;
}
}
示例5: initTemplateEngine
public static function initTemplateEngine()
{
// Add the stuff we need always
// following logic will import all vendor libraries that are
// specified in core/js/core.json
$fileContent = file_get_contents(OC::$SERVERROOT . '/core/js/core.json');
if ($fileContent !== false) {
$coreDependencies = json_decode($fileContent, true);
foreach ($coreDependencies['vendor'] as $vendorLibrary) {
// remove trailing ".js" as addVendorScript will append it
OC_Util::addVendorScript(substr($vendorLibrary, 0, strlen($vendorLibrary) - 3));
}
} else {
throw new \Exception('Cannot read core/js/core.json');
}
OC_Util::addScript("placeholders");
OC_Util::addScript("compatibility");
OC_Util::addScript("jquery.ocdialog");
OC_Util::addScript("oc-dialogs");
OC_Util::addScript("js");
OC_Util::addScript("l10n");
OC_Util::addTranslations("core");
OC_Util::addScript("octemplate");
OC_Util::addScript("eventsource");
OC_Util::addScript("config");
OC_Util::addScript('search', 'search');
OC_Util::addScript("oc-requesttoken");
OC_Util::addScript("apps");
OC_Util::addScript('mimetype');
OC_Util::addScript('mimetypelist');
OC_Util::addVendorScript('snapjs/dist/latest/snap');
OC_Util::addVendorScript('core', 'backbone/backbone');
OC_Util::addScript('oc-backbone');
// avatars
if (\OC::$server->getSystemConfig()->getValue('enable_avatars', true) === true) {
\OC_Util::addScript('placeholder');
\OC_Util::addVendorScript('blueimp-md5/js/md5');
\OC_Util::addScript('jquery.avatar');
\OC_Util::addScript('avatar');
}
OC_Util::addStyle("styles");
OC_Util::addStyle("header");
OC_Util::addStyle("mobile");
OC_Util::addStyle("icons");
OC_Util::addStyle("fonts");
OC_Util::addStyle("apps");
OC_Util::addStyle("fixes");
OC_Util::addStyle("multiselect");
OC_Util::addVendorStyle('jquery-ui/themes/base/jquery-ui');
OC_Util::addStyle('jquery-ui-fixes');
OC_Util::addStyle("tooltip");
OC_Util::addStyle("jquery.ocdialog");
}
示例6: isset
OCP\Util::addscript('files', 'jquery.fileupload');
OCP\Util::addscript('files', 'jquery-visibility');
OCP\Util::addscript('files', 'fileinfomodel');
OCP\Util::addscript('files', 'filesummary');
OCP\Util::addscript('files', 'breadcrumb');
OCP\Util::addscript('files', 'filelist');
OCP\Util::addscript('files', 'search');
\OCP\Util::addScript('files', 'favoritesfilelist');
\OCP\Util::addScript('files', 'tagsplugin');
\OCP\Util::addScript('files', 'favoritesplugin');
\OCP\Util::addScript('files', 'detailfileinfoview');
\OCP\Util::addScript('files', 'detailtabview');
\OCP\Util::addScript('files', 'mainfileinfodetailview');
\OCP\Util::addScript('files', 'detailsview');
\OCP\Util::addStyle('files', 'detailsView');
\OC_Util::addVendorScript('core', 'handlebars/handlebars');
OCP\App::setActiveNavigationEntry('files_index');
$l = \OC::$server->getL10N('files');
$isIE8 = false;
preg_match('/MSIE (.*?);/', $_SERVER['HTTP_USER_AGENT'], $matches);
if (count($matches) > 0 && $matches[1] <= 9) {
$isIE8 = true;
}
// if IE8 and "?dir=path&view=someview" was specified, reformat the URL to use a hash like "#?dir=path&view=someview"
if ($isIE8 && (isset($_GET['dir']) || isset($_GET['view']))) {
$hash = '#?';
$dir = isset($_GET['dir']) ? $_GET['dir'] : '/';
$view = isset($_GET['view']) ? $_GET['view'] : 'files';
$hash = '#?dir=' . \OCP\Util::encodePath($dir);
if ($view !== 'files') {
$hash .= '&view=' . urlencode($view);
示例7: OC_Defaults
OC_Util::checkLoggedIn();
$defaults = new OC_Defaults();
// initialize themable default strings and urls
$certificateManager = \OC::$server->getCertificateManager();
$config = \OC::$server->getConfig();
$urlGenerator = \OC::$server->getURLGenerator();
// Highlight navigation entry
OC_Util::addScript('settings', 'personal');
OC_Util::addScript('settings', 'certificates');
OC_Util::addStyle('settings', 'settings');
\OC_Util::addVendorScript('strengthify/jquery.strengthify');
\OC_Util::addVendorStyle('strengthify/strengthify');
\OC_Util::addScript('files', 'jquery.iframe-transport');
\OC_Util::addScript('files', 'jquery.fileupload');
if ($config->getSystemValue('enable_avatars', true) === true) {
\OC_Util::addVendorScript('jcrop/js/jquery.Jcrop');
\OC_Util::addVendorStyle('jcrop/css/jquery.Jcrop');
}
// Highlight navigation entry
OC::$server->getNavigationManager()->setActiveEntry('personal');
$storageInfo = OC_Helper::getStorageInfo('/');
$user = OC::$server->getUserManager()->get(OC_User::getUser());
$email = $user->getEMailAddress();
$userLang = $config->getUserValue(OC_User::getUser(), 'core', 'lang', OC_L10N::findLanguage());
$languageCodes = OC_L10N::findAvailableLanguages();
// array of common languages
$commonLangCodes = array('en', 'es', 'fr', 'de', 'de_DE', 'ja', 'ar', 'ru', 'nl', 'it', 'pt_BR', 'pt_PT', 'da', 'fi_FI', 'nb_NO', 'sv', 'tr', 'zh_CN', 'ko');
$languageNames = (include 'languageCodes.php');
$languages = array();
$commonLanguages = array();
foreach ($languageCodes as $lang) {
示例8: index
/**
* @NoCSRFRequired
* @NoAdminRequired
*
* @param string $dir
* @param string $view
* @return TemplateResponse
* @throws \OCP\Files\NotFoundException
*/
public function index($dir = '', $view = '')
{
$nav = new \OCP\Template('files', 'appnavigation', '');
// Load the files we need
\OCP\Util::addStyle('files', 'files');
\OCP\Util::addStyle('files', 'upload');
\OCP\Util::addStyle('files', 'mobile');
\OCP\Util::addscript('files', 'app');
\OCP\Util::addscript('files', 'file-upload');
\OCP\Util::addscript('files', 'newfilemenu');
\OCP\Util::addscript('files', 'jquery.iframe-transport');
\OCP\Util::addscript('files', 'jquery.fileupload');
\OCP\Util::addscript('files', 'jquery-visibility');
\OCP\Util::addscript('files', 'fileinfomodel');
\OCP\Util::addscript('files', 'filesummary');
\OCP\Util::addscript('files', 'breadcrumb');
\OCP\Util::addscript('files', 'filelist');
\OCP\Util::addscript('files', 'search');
\OCP\Util::addScript('files', 'favoritesfilelist');
\OCP\Util::addScript('files', 'tagsplugin');
\OCP\Util::addScript('files', 'favoritesplugin');
\OCP\Util::addScript('files', 'detailfileinfoview');
\OCP\Util::addScript('files', 'detailtabview');
\OCP\Util::addScript('files', 'mainfileinfodetailview');
\OCP\Util::addScript('files', 'detailsview');
\OCP\Util::addStyle('files', 'detailsView');
\OC_Util::addVendorScript('core', 'handlebars/handlebars');
\OCP\Util::addscript('files', 'fileactions');
\OCP\Util::addscript('files', 'fileactionsmenu');
\OCP\Util::addscript('files', 'files');
\OCP\Util::addscript('files', 'keyboardshortcuts');
\OCP\Util::addscript('files', 'navigation');
// if IE8 and "?dir=path&view=someview" was specified, reformat the URL to use a hash like "#?dir=path&view=someview"
$isIE8 = $this->request->isUserAgent([Request::USER_AGENT_IE_8]);
if ($isIE8 && ($dir !== '' || $view !== '')) {
$dir = !empty($dir) ? $dir : '/';
$view = !empty($view) ? $view : 'files';
$hash = '#?dir=' . \OCP\Util::encodePath($dir);
if ($view !== 'files') {
$hash .= '&view=' . urlencode($view);
}
return new RedirectResponse($this->urlGenerator->linkToRoute('files.view.index') . $hash);
}
// mostly for the home storage's free space
// FIXME: Make non static
$storageInfo = $this->getStorageInfo();
\OCA\Files\App::getNavigationManager()->add(['id' => 'favorites', 'appname' => 'files', 'script' => 'simplelist.php', 'order' => 5, 'name' => $this->l10n->t('Favorites')]);
$navItems = \OCA\Files\App::getNavigationManager()->getAll();
usort($navItems, function ($item1, $item2) {
return $item1['order'] - $item2['order'];
});
$nav->assign('navigationItems', $navItems);
$contentItems = [];
// render the container content for every navigation item
foreach ($navItems as $item) {
$content = '';
if (isset($item['script'])) {
$content = $this->renderScript($item['appname'], $item['script']);
}
$contentItem = [];
$contentItem['id'] = $item['id'];
$contentItem['content'] = $content;
$contentItems[] = $contentItem;
}
$this->eventDispatcher->dispatch('OCA\\Files::loadAdditionalScripts');
$params = [];
$params['usedSpacePercent'] = (int) $storageInfo['relative'];
$params['owner'] = $storageInfo['owner'];
$params['ownerDisplayName'] = $storageInfo['ownerDisplayName'];
$params['isPublic'] = false;
$params['mailNotificationEnabled'] = $this->config->getAppValue('core', 'shareapi_allow_mail_notification', 'no');
$params['mailPublicNotificationEnabled'] = $this->config->getAppValue('core', 'shareapi_allow_public_notification', 'no');
$params['allowShareWithLink'] = $this->config->getAppValue('core', 'shareapi_allow_links', 'yes');
$params['appNavigation'] = $nav;
$params['appContents'] = $contentItems;
$this->navigationManager->setActiveEntry('files_index');
$response = new TemplateResponse($this->appName, 'index', $params);
$policy = new ContentSecurityPolicy();
$policy->addAllowedFrameDomain('\'self\'');
$response->setContentSecurityPolicy($policy);
return $response;
}
示例9: testAddVendorScript
public function testAddVendorScript()
{
\OC_Util::addVendorScript('core', 'myFancyJSFile1');
\OC_Util::addVendorScript('myApp', 'myFancyJSFile2');
\OC_Util::addVendorScript('core', 'myFancyJSFile0', true);
\OC_Util::addVendorScript('core', 'myFancyJSFile10', true);
// add duplicate
\OC_Util::addVendorScript('core', 'myFancyJSFile1');
$this->assertEquals(['core/vendor/myFancyJSFile10', 'core/vendor/myFancyJSFile0', 'core/vendor/myFancyJSFile1', 'myApp/vendor/myFancyJSFile2'], \OC_Util::$scripts);
$this->assertEquals([], \OC_Util::$styles);
}
示例10: initTemplateEngine
public static function initTemplateEngine()
{
// Add the stuff we need always
// TODO: read from core/js/core.json
OC_Util::addVendorScript('jquery/jquery.min');
OC_Util::addVendorScript('jquery/jquery-migrate.min');
OC_Util::addScript("jquery-ui-1.10.0.custom");
OC_Util::addScript("jquery-showpassword");
OC_Util::addScript("placeholders");
OC_Util::addScript("jquery-tipsy");
OC_Util::addScript("compatibility");
OC_Util::addVendorScript("underscore/underscore");
OC_Util::addScript("jquery.ocdialog");
OC_Util::addScript("oc-dialogs");
OC_Util::addScript("js");
OC_Util::addScript("l10n");
OC_Util::addTranslations("core");
OC_Util::addScript("octemplate");
OC_Util::addScript("eventsource");
OC_Util::addScript("config");
//OC_Util::addScript( "multiselect" );
OC_Util::addScript('search', 'result');
OC_Util::addScript("oc-requesttoken");
OC_Util::addScript("apps");
OC_Util::addScript("snap");
OC_Util::addVendorScript('moment/min/moment-with-locales');
// avatars
if (\OC_Config::getValue('enable_avatars', true) === true) {
\OC_Util::addScript('placeholder');
\OC_Util::addScript('3rdparty', 'md5/md5.min');
\OC_Util::addScript('jquery.avatar');
\OC_Util::addScript('avatar');
}
OC_Util::addStyle("styles");
OC_Util::addStyle("header");
OC_Util::addStyle("mobile");
OC_Util::addStyle("icons");
OC_Util::addStyle("fonts");
OC_Util::addStyle("apps");
OC_Util::addStyle("fixes");
OC_Util::addStyle("multiselect");
OC_Util::addStyle("jquery-ui-1.10.0.custom");
OC_Util::addStyle("jquery-tipsy");
OC_Util::addStyle("jquery.ocdialog");
}
示例11: array
* version 3 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
*/
OC_Util::checkAdminUser();
OCP\Util::addScript('user_ldap', 'ldapFilter');
OCP\Util::addScript('user_ldap', 'experiencedAdmin');
OCP\Util::addScript('user_ldap', 'settings');
\OC_Util::addVendorScript('user_ldap', 'ui-multiselect/src/jquery.multiselect');
OCP\Util::addStyle('user_ldap', 'settings');
\OC_Util::addVendorStyle('user_ldap', 'ui-multiselect/jquery.multiselect');
// fill template
$tmpl = new OCP\Template('user_ldap', 'settings');
$helper = new \OCA\user_ldap\lib\Helper();
$prefixes = $helper->getServerConfigurationPrefixes();
$hosts = $helper->getServerConfigurationHosts();
$wizardHtml = '';
$toc = array();
$wControls = new OCP\Template('user_ldap', 'part.wizardcontrols');
$wControls = $wControls->fetchPage();
$sControls = new OCP\Template('user_ldap', 'part.settingcontrols');
$sControls = $sControls->fetchPage();
$l = \OC::$server->getL10N('user_ldap');
$wizTabs = array();