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); }
/** * Shortcut for adding vendor styles to a page * @param string $app the appname * @param string|string[] $file the filename, * if an array is given it will add all styles */ function vendor_style($app, $file = null) { if (is_array($file)) { foreach ($file as $f) { OC_Util::addVendorStyle($app, $f); } } else { OC_Util::addVendorStyle($app, $file); } }
* 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'); }); $activityManager = \OC::$server->getActivityManager();
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; } }
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"); }
$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) { $l = \OC::$server->getL10N('settings', $lang);
public function testAddVendorStyle() { \OC_Util::addVendorStyle('core', 'myFancyCSSFile1'); \OC_Util::addVendorStyle('myApp', 'myFancyCSSFile2'); \OC_Util::addVendorStyle('core', 'myFancyCSSFile0', true); \OC_Util::addVendorStyle('core', 'myFancyCSSFile10', true); // add duplicate \OC_Util::addVendorStyle('core', 'myFancyCSSFile1'); $this->assertEquals([], \OC_Util::$scripts); $this->assertEquals(['core/vendor/myFancyCSSFile10', 'core/vendor/myFancyCSSFile0', 'core/vendor/myFancyCSSFile1', 'myApp/vendor/myFancyCSSFile2'], \OC_Util::$styles); }
* 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(); $wizTabs[] = array('tpl' => 'part.wizard-server', 'cap' => $l->t('Server')); $wizTabs[] = array('tpl' => 'part.wizard-userfilter', 'cap' => $l->t('User Filter'));