コード例 #1
0
ファイル: DNRoot.php プロジェクト: antons-/deploynaut
 /**
  * Include requirements that deploynaut needs, such as javascript.
  */
 public static function include_requirements()
 {
     // JS should always go to the bottom, otherwise there's the risk that Requirements
     // puts them halfway through the page to the nearest <script> tag. We don't want that.
     Requirements::set_force_js_to_bottom(true);
     Requirements::combine_files('deploynaut.js', array('deploynaut/javascript/jquery.js', 'deploynaut/javascript/bootstrap.js', 'deploynaut/javascript/q.js', 'deploynaut/javascript/deploynaut.js', 'deploynaut/javascript/react-with-addons.min.js', 'deploynaut/javascript/deploy.min.js', 'deploynaut/javascript/bootstrap.file-input.js', 'deploynaut/thirdparty/select2/dist/js/select2.min.js', 'deploynaut/javascript/material.js'));
 }
コード例 #2
0
 function init()
 {
     parent::init();
     Requirements::css(THIRDPARTY_DIR . '/jquery-ui-themes/smoothness/jquery-ui.css');
     Requirements::javascript(THIRDPARTY_DIR . '/jquery-ui/jquery-ui.js');
     Requirements::customScript("jQuery(document).ready(function(\$) {\n            \$('#consulting','.marketplace-nav').addClass('current');\n        });");
     Requirements::css("themes/openstack/css/chosen.css", "screen,projection");
     Requirements::javascript(Director::protocol() . "maps.googleapis.com/maps/api/js?sensor=false");
     Requirements::combine_files('marketplace_consultants_directory_page.js', array("marketplace/code/ui/frontend/js/markerclusterer.js", "marketplace/code/ui/frontend/js/oms.min.js", "marketplace/code/ui/frontend/js/infobubble-compiled.js", "marketplace/code/ui/frontend/js/google.maps.jquery.js", "themes/openstack/javascript/chosen.jquery.min.js", "marketplace/code/ui/frontend/js/consultants.directory.page.js"));
     Requirements::customScript($this->GATrackingCode());
     $this->consultant_repository = new SapphireConsultantRepository();
     $this->region_repository = new SapphireRegionRepository();
     $this->consultants_locations_query = new ConsultantsOfficesLocationsQueryHandler();
     $this->consultants_service_query = new ConsultantsServicesQueryHandler();
     $google_geo_coding_api_key = null;
     $google_geo_coding_client_id = null;
     $google_geo_coding_private_key = null;
     if (defined('GOOGLE_GEO_CODING_API_KEY')) {
         $google_geo_coding_api_key = GOOGLE_GEO_CODING_API_KEY;
     } else {
         if (defined('GOOGLE_GEO_CODING_CLIENT_ID') && defined('GOOGLE_GEO_CODING_PRIVATE_KEY')) {
             $google_geo_coding_client_id = GOOGLE_GEO_CODING_CLIENT_ID;
             $google_geo_coding_private_key = GOOGLE_GEO_CODING_PRIVATE_KEY;
         }
     }
     $this->manager = new ConsultantManager($this->consultant_repository, new SapphireMarketPlaceVideoTypeRepository(), new SapphireMarketPlaceTypeRepository(), new SapphireOpenStackApiVersionRepository(), new SapphireOpenStackComponentRepository(), new SapphireOpenStackReleaseRepository(), new SapphireRegionRepository(), new SapphireSupportChannelTypeRepository(), new SapphireSpokenLanguageRepository(), new SapphireConfigurationManagementTypeRepository(), new SapphireConsultantServiceOfferedTypeRepository(), new ConsultantAddPolicy($this->consultant_repository, new SapphireMarketPlaceTypeRepository()), new CompanyServiceCanAddResourcePolicy(), new CompanyServiceCanAddVideoPolicy(), new ConsultantFactory(), new MarketplaceFactory(), new ValidatorFactory(), new OpenStackApiFactory(), new GoogleGeoCodingService(new SapphireGeoCodingQueryRepository(), new UtilFactory(), SapphireTransactionManager::getInstance(), $google_geo_coding_api_key, $google_geo_coding_client_id, $google_geo_coding_private_key), null, new SessionCacheService(), SapphireTransactionManager::getInstance());
 }
コード例 #3
0
 public function init()
 {
     // set reading lang
     if (SiteTree::has_extension('Translatable') && !$this->getRequest()->isAjax()) {
         Translatable::choose_site_locale(array_keys(Translatable::get_existing_content_languages('SiteTree')));
     }
     parent::init();
     Versioned::reading_stage("Stage");
     Requirements::css(CMS_DIR . '/css/screen.css');
     Requirements::customCSS($this->generatePageIconsCss());
     Requirements::combine_files('cmsmain.js', array_merge(array(CMS_DIR . '/javascript/CMSMain.js', CMS_DIR . '/javascript/CMSMain.EditForm.js', CMS_DIR . '/javascript/CMSMain.AddForm.js', CMS_DIR . '/javascript/CMSPageHistoryController.js', CMS_DIR . '/javascript/CMSMain.Tree.js', CMS_DIR . '/javascript/SilverStripeNavigator.js', CMS_DIR . '/javascript/SiteTreeURLSegmentField.js'), Requirements::add_i18n_javascript(CMS_DIR . '/javascript/lang', true, true)));
     CMSBatchActionHandler::register('publish', 'CMSBatchAction_Publish');
     CMSBatchActionHandler::register('unpublish', 'CMSBatchAction_Unpublish');
     // Check legacy actions
     $legacy = $this->config()->enabled_legacy_actions;
     // Delete from live is unnecessary since we have unpublish which does the same thing
     if (in_array('CMSBatchAction_DeleteFromLive', $legacy)) {
         Deprecation::notice('4.0', 'Delete From Live is deprecated. Use Un-publish instead');
         CMSBatchActionHandler::register('deletefromlive', 'CMSBatchAction_DeleteFromLive');
     }
     // Delete action
     if (in_array('CMSBatchAction_Delete', $legacy)) {
         Deprecation::notice('4.0', 'Delete from Stage is deprecated. Use Archive instead.');
         CMSBatchActionHandler::register('delete', 'CMSBatchAction_Delete');
     } else {
         CMSBatchActionHandler::register('archive', 'CMSBatchAction_Archive');
         CMSBatchActionHandler::register('restore', 'CMSBatchAction_Restore');
     }
 }
コード例 #4
0
ファイル: SwaggerPage.php プロジェクト: govtnz/swagger-ui
 public function init()
 {
     parent::init();
     // --------------------------------------------------------------------
     // CSS
     // --------------------------------------------------------------------
     Requirements::css('vendor/govtnz/swagger-ui/dist/css/reset.css', 'print,screen');
     Requirements::css('vendor/govtnz/swagger-ui/dist/css/typography.css', 'print,screen');
     Requirements::css('vendor/govtnz/swagger-ui/dist/css/print.css', 'print');
     Requirements::css('vendor/govtnz/swagger-ui/dist/css/screen.css', 'screen');
     $print = array('vendor/govtnz/swagger-ui/dist/css/reset.css', 'vendor/govtnz/swagger-ui/dist/css/typography.css', 'vendor/govtnz/swagger-ui/dist/css/print.css');
     Requirements::combine_files('swagger-print.css', $print, 'print');
     $screen = array('vendor/govtnz/swagger-ui/dist/css/reset.css', 'vendor/govtnz/swagger-ui/dist/css/typography.css', 'vendor/govtnz/swagger-ui/dist/css/screen.css');
     Requirements::combine_files('swagger-screen.css', $screen, 'screen');
     // --------------------------------------------------------------------
     // Javascript
     // --------------------------------------------------------------------
     parent::init();
     Requirements::javascript('vendor/govtnz/swagger-ui/dist/lib/jquery.slideto.min.js');
     Requirements::javascript('vendor/govtnz/swagger-ui/dist/lib/jquery.wiggle.min.js');
     Requirements::javascript('vendor/govtnz/swagger-ui/dist/lib/jquery.ba-bbq.min.js');
     Requirements::javascript('vendor/govtnz/swagger-ui/dist/lib/handlebars-2.0.0.js');
     Requirements::javascript('vendor/govtnz/swagger-ui/dist/lib/underscore-min.js');
     Requirements::javascript('vendor/govtnz/swagger-ui/dist/lib/backbone-min.js');
     Requirements::javascript('vendor/govtnz/swagger-ui/dist/swagger-ui.js');
     Requirements::javascript('vendor/govtnz/swagger-ui/dist/lib/highlight.7.3.pack.js');
     Requirements::javascript('vendor/govtnz/swagger-ui/dist/lib/marked.js');
     Requirements::javascript('vendor/govtnz/swagger-ui/dist/lib/swagger-oauth.js');
     Requirements::javascript('vendor/govtnz/swagger-ui/resources/javascript/api-swagger.js');
     Requirements::combine_files('swagger.js', array('vendor/govtnz/swagger-ui/dist/lib/jquery.slideto.min.js', 'vendor/govtnz/swagger-ui/dist/lib/jquery.wiggle.min.js', 'vendor/govtnz/swagger-ui/dist/lib/jquery.ba-bbq.min.js', 'vendor/govtnz/swagger-ui/dist/lib/handlebars-2.0.0.js', 'vendor/govtnz/swagger-ui/dist/lib/underscore-min.js', 'vendor/govtnz/swagger-ui/dist/lib/backbone-min.js', 'vendor/govtnz/swagger-ui/dist/swagger-ui.js', 'vendor/govtnz/swagger-ui/dist/lib/highlight.7.3.pack.js', 'vendor/govtnz/swagger-ui/dist/lib/marked.js', 'vendor/govtnz/swagger-ui/dist/lib/swagger-oauth.js', 'vendor/govtnz/swagger-ui/resources/javascript/api-swagger.js'));
 }
コード例 #5
0
    /**
     * Init
     * 	Include the javascript we will need
     *
     * @return void
     * @author Andrew Lowther <*****@*****.**>
     **/
    public function init()
    {
        parent::init();
        // Get the config variables we'll need
        $config = Config::inst()->get('MediaManager', 'Cloudinary');
        // Inject them into the global scope
        Requirements::customScript(<<<JS
\t\t\t;(function (window, undefined) {
\t\t\t\twindow.mediamanager = window.mediamanager || {};
\t\t\t\twindow.mediamanager.cloudinary = {
\t\t\t\t\tcloud_name: "{$config['cloud_name']}",
\t\t\t\t\tapi_key: "{$config['api_key']}"
\t\t\t\t}
\t\t\t}/)(window);
JS
);
        // Get the base javascript path
        $BaseJsPath = MEDIAMANAGER_CORE_PATH . '/javascript';
        // Combine the cloudinary files into one super file
        Requirements::combine_files('cloudinary.js', array("{$BaseJsPath}/cloudinary/js/load-image.min.js", "{$BaseJsPath}/cloudinary/js/canvas-to-blob.min.js", "{$BaseJsPath}/cloudinary/js/jquery.fileupload.js", "{$BaseJsPath}/cloudinary/js/jquery.ui.widget.js", "{$BaseJsPath}/cloudinary/js/jquery.fileupload-process.js", "{$BaseJsPath}/cloudinary/js/jquery.fileupload-image.js", "{$BaseJsPath}/cloudinary/js/jquery.fileupload-validate.js", "{$BaseJsPath}/cloudinary/js/jquery.cloudinary.js"));
        // Same again for our files
        Requirements::combine_files('mediamanager.js', array("{$BaseJsPath}/mediamanager/mediamanager.core.js"));
        // Set the cloudinary config
        \Cloudinary::config($config);
    }
コード例 #6
0
ファイル: Page.php プロジェクト: digi-brains/Silver-Stream
    public function init()
    {
        parent::init();
        // Concatenate CSS
        Requirements::combine_files('style.css', array('mysite/css/layout.css', 'mysite/css/userstyles.css'));
        // Concatenate JavaScript
        Requirements::combine_files('scripts.js', array('mysite/javascript/lib/top-nav.js', 'mysite/javascript/vanilla.js'));
        // Google Analytics
        $config = SiteConfig::current_site_config();
        $google = $config->GACode;
        $gaJS = <<<JS
            (function(i, s, o, g, r, a, m) {
                i['GoogleAnalyticsObject'] = r;
                i[r] = i[r] || function() {
                    (i[r].q = i[r].q || []).push(arguments)
                }, i[r].l = 1 * new Date();
                a = s.createElement(o), m = s.getElementsByTagName(o)[0];
                a.async = 1;
                a.src = g;
                m.parentNode.insertBefore(a, m)
            })(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');
            ga('create', '{$google}', 'auto');
            ga('send', 'pageview');
JS;
        Requirements::customScript($gaJS);
    }
コード例 #7
0
 public function init()
 {
     parent::init();
     Requirements::combine_files('app.css', array('app/css/normalize.css', 'app/css/app.css'));
     Requirements::javascript('framework/thirdparty/jquery/jquery.js');
     Requirements::javascript('app/js/app.js');
 }
 /**
  * Requiring the combined js/css files- can be separate library files
  * @param array $libArr
  */
 private static function process_combined($libArr, $type)
 {
     //Debug::dump($libArr);
     $theme = self::$theme;
     //Defining library files
     foreach ($libArr as $lib => $arr) {
         $files = array();
         foreach ($arr as $str) {
             $files[] = self::replace_vars($str);
         }
         foreach ($files as $f) {
             if ($type == 'javascript') {
                 Requirements::javascript($f);
             } elseif ($type == 'css') {
                 Requirements::css($f);
             }
         }
         if ($type == 'javascript') {
             $libName = "{$theme}/{$lib}.js";
         } elseif ($type == 'css') {
             $libName = "{$theme}/{$lib}.css";
         }
         Requirements::combine_files($libName, $files);
     }
 }
コード例 #9
0
 function init()
 {
     parent::init();
     $google_geo_coding_api_key = null;
     $google_geo_coding_client_id = null;
     $google_geo_coding_private_key = null;
     if (defined('GOOGLE_GEO_CODING_API_KEY')) {
         $google_geo_coding_api_key = GOOGLE_GEO_CODING_API_KEY;
     } else {
         if (defined('GOOGLE_GEO_CODING_CLIENT_ID') && defined('GOOGLE_GEO_CODING_PRIVATE_KEY')) {
             $google_geo_coding_client_id = GOOGLE_GEO_CODING_CLIENT_ID;
             $google_geo_coding_private_key = GOOGLE_GEO_CODING_PRIVATE_KEY;
         }
     }
     //managers
     $this->factory = new EventRegistrationRequestFactory();
     $this->event_registration_request_manager = new EventRegistrationRequestManager(new SapphireEventRegistrationRequestRepository(), new SapphireEventRepository(), $this->factory, new GoogleGeoCodingService(new SapphireGeoCodingQueryRepository(), new UtilFactory(), SapphireTransactionManager::getInstance(), $google_geo_coding_api_key, $google_geo_coding_client_id, $google_geo_coding_private_key), new SapphireEventPublishingService(), new EventValidatorFactory(), SapphireTransactionManager::getInstance());
     //js files
     Requirements::css("themes/openstack/css/chosen.css", "screen,projection");
     Requirements::css(THIRDPARTY_DIR . '/jquery-ui-themes/smoothness/jquery-ui.css');
     Requirements::javascript(THIRDPARTY_DIR . '/jquery-ui/jquery-ui.js');
     Requirements::javascript(Director::protocol() . "ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/jquery.validate.min.js");
     Requirements::javascript(Director::protocol() . "ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/additional-methods.min.js");
     Requirements::combine_files('event_registration_request_page.js', array("themes/openstack/javascript/chosen.jquery.min.js", "themes/openstack/javascript/jquery.ui.datepicker.validation.package-1.0.1/jquery.ui.datepicker.validation.js", "themes/openstack/javascript/jquery.validate.custom.methods.js", 'events/js/event.registration.request.page.js'));
 }
コード例 #10
0
ファイル: CMSMain.php プロジェクト: redema/silverstripe-cms
	public function init() {
		// set reading lang
		if(Object::has_extension('SiteTree', 'Translatable') && !$this->request->isAjax()) {
			Translatable::choose_site_locale(array_keys(Translatable::get_existing_content_languages('SiteTree')));
		}
		
		parent::init();
		
		Requirements::css(CMS_DIR . '/css/screen.css');
		
		Requirements::combine_files(
			'cmsmain.js',
			array_merge(
				array(
					CMS_DIR . '/javascript/CMSMain.js',
					CMS_DIR . '/javascript/CMSMain.EditForm.js',
					CMS_DIR . '/javascript/CMSMain.AddForm.js',
					CMS_DIR . '/javascript/CMSPageHistoryController.js',
					CMS_DIR . '/javascript/CMSMain.Tree.js',
					CMS_DIR . '/javascript/SilverStripeNavigator.js'
				),
				Requirements::add_i18n_javascript(CMS_DIR . '/javascript/lang', true, true)
			)
		);

		CMSBatchActionHandler::register('publish', 'CMSBatchAction_Publish');
		CMSBatchActionHandler::register('unpublish', 'CMSBatchAction_Unpublish');
		CMSBatchActionHandler::register('delete', 'CMSBatchAction_Delete');
		CMSBatchActionHandler::register('deletefromlive', 'CMSBatchAction_DeleteFromLive');
	}
コード例 #11
0
 public function MarketPlaceReviewForm()
 {
     Requirements::javascript(Director::protocol() . "ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/jquery.validate.min.js");
     Requirements::javascript(Director::protocol() . "ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/additional-methods.min.js");
     Requirements::combine_files('marketplace_review_form.js', array("themes/openstack/javascript/jquery.validate.custom.methods.js", "marketplace/code/ui/frontend/js/star-rating.min.js", "marketplace/code/ui/frontend/js/marketplace.review.js"));
     $css_files = array("marketplace/code/ui/frontend/css/star-rating.min.css", "marketplace/code/ui/frontend/css/marketplace-review.css");
     foreach ($css_files as $css_file) {
         Requirements::css($css_file);
     }
     $form = new MarketPlaceReviewForm($this, 'MarketPlaceReviewForm');
     $data = Session::get("FormInfo.Form_MarketPlaceReviewForm.data");
     $review = $this->review_repository->getReview($this->company_service_ID, Member::CurrentUserID());
     if (is_array($data)) {
         //get data from cache
         $form->loadDataFrom($data);
     } elseif ($review) {
         // get submitted review
         $form->loadDataFrom($review);
     }
     // Optional spam protection
     if (class_exists('SpamProtectorManager')) {
         SpamProtectorManager::update_form($form);
     }
     return $form;
 }
 /**
  * 
  * @param FieldList $fields
  * @return void
  */
 public function updateCMSFields(FieldList $fields)
 {
     $controller = Controller::curr();
     if ($controller instanceof SecuredAssetAdmin || $controller instanceof CMSSecuredFileAddController) {
         Requirements::combine_files('securedassetsadmincmsfields.js', array(SECURED_FILES_MODULE_DIR . '/thirdparty/javascript/jquery-ui/timepicker/jquery-ui-sliderAccess.js', SECURED_FILES_MODULE_DIR . '/thirdparty/javascript/jquery-ui/timepicker/jquery-ui-timepicker-addon.min.js', SECURED_FILES_MODULE_DIR . "/javascript/SecuredFilesLeftAndMain.js"));
         Requirements::css(SECURED_FILES_MODULE_DIR . '/thirdparty/javascript/jquery-ui/timepicker/jquery-ui-timepicker-addon.min.css');
         Requirements::css(SECURED_FILES_MODULE_DIR . "/css/SecuredFilesLeftAndMain.css");
         Requirements::javascript(SECURED_FILES_MODULE_DIR . "/javascript/SecuredFilesLeftAndMain.js");
         if ($this->isFile()) {
             $buttonsSecurity = $this->showButtonsSecurity();
             $buttonsEmbargoExpiry = $this->showButtonsEmbargoExpiry();
             // Embargo field
             $embargoTypeField = new OptionSetField("EmbargoType", "", array("None" => _t('AdvancedSecuredFiles.NONENICE', "None"), "Indefinitely" => _t('AdvancedSecuredFiles.INDEFINITELYNICE', "Hide document indefinitely"), "UntilAFixedDate" => _t('AdvancedSecuredFiles.UNTILAFIXEDDATENICE', 'Hide until set date')));
             $embargoUntilDateField = DatetimeField::create('EmbargoedUntilDate', '');
             $embargoUntilDateField->getDateField()->setConfig('showcalendar', true)->setConfig('dateformat', 'dd-MM-yyyy')->setConfig('datavalueformat', 'dd-MM-yyyy')->setAttribute('readonly', true);
             $embargoUntilDateField->getTimeField()->setAttribute('readonly', true);
             // Expiry field
             $expireTypeField = new OptionSetField("ExpiryType", "", array("None" => _t('AdvancedSecuredFiles.NONENICE', "None"), "AtAFixedDate" => _t('AdvancedSecuredFiles.ATAFIXEDDATENICE', 'Set file to expire on')));
             $expiryDatetime = DatetimeField::create('ExpireAtDate', '');
             $expiryDatetime->getDateField()->setConfig('showcalendar', true)->setConfig('dateformat', 'dd-MM-yyyy')->setConfig('datavalueformat', 'dd-MM-yyyy')->setAttribute('readonly', true);
             $expiryDatetime->getTimeField()->setAttribute('readonly', true);
             $securitySettingsGroup = FieldGroup::create(FieldGroup::create($embargoTypeField, $embargoUntilDateField)->addExtraClass('embargo option-change-datetime')->setName("EmbargoGroupField"), FieldGroup::create($expireTypeField, $expiryDatetime)->addExtraClass('expiry option-change-datetime')->setName("ExpiryGroupField"));
         } else {
             $buttonsSecurity = $this->showButtonsSecurity();
             $buttonsEmbargoExpiry = '';
             $securitySettingsGroup = FieldGroup::create();
         }
         $canViewTypeField = new OptionSetField("CanViewType", "", array("Inherit" => _t('AdvancedSecuredFiles.INHERIT', "Inherit from parent folder"), "Anyone" => _t('SiteTree.ACCESSANYONE', 'Anyone'), "LoggedInUsers" => _t('SiteTree.ACCESSLOGGEDIN', 'Logged-in users'), "OnlyTheseUsers" => _t('SiteTree.ACCESSONLYTHESE', 'Only these people (choose from list)')));
         $canEditTypeField = new OptionSetField("CanEditType", "", array("Inherit" => _t('AdvancedSecuredFiles.INHERIT', "Inherit from parent folder"), "LoggedInUsers" => _t('SiteTree.ACCESSLOGGEDIN', 'Logged-in users'), "OnlyTheseUsers" => _t('SiteTree.ACCESSONLYTHESE', 'Only these people (choose from list)')));
         $groupsMap = array();
         foreach (Group::get() as $group) {
             // Listboxfield values are escaped, use ASCII char instead of &raquo;
             $groupsMap[$group->ID] = $group->getBreadcrumbs(' > ');
         }
         asort($groupsMap);
         $viewerGroupsField = ListboxField::create("ViewerGroups", _t('AdvancedSecuredFiles.VIEWERGROUPS', "Viewer Groups"))->setMultiple(true)->setSource($groupsMap)->setAttribute('data-placeholder', _t('AdvancedSecuredFiles.GroupPlaceholder', 'Click to select group'));
         $editorGroupsField = ListBoxField::create("EditorGroups", _t('AdvancedSecuredFiles.EDITORGROUPS', "Editor Groups"))->setMultiple(true)->setSource($groupsMap)->setAttribute('data-placeholder', _t('AdvancedSecuredFiles.GroupPlaceholder', 'Click to select group'));
         $securitySettingsGroup->push(FieldGroup::create($canViewTypeField, $viewerGroupsField)->addExtraClass('whocanview option-change-listbox')->setName("CanViewGroupField"));
         $securitySettingsGroup->push(FieldGroup::create($canEditTypeField, $editorGroupsField)->addExtraClass('whocanedit option-change-listbox')->setName("CanEditGroupField"));
         $securitySettingsGroup->setName("SecuritySettingsGroupField")->addExtraClass('security-settings');
         $showAdvanced = AdvancedAssetsFilesSiteConfig::is_security_enabled() || $this->isFile() && AdvancedAssetsFilesSiteConfig::is_embargoexpiry_enabled();
         if ($showAdvanced) {
             $fields->insertAfter(LiteralField::create('BottomTaskSelection', $this->owner->renderWith('componentField', ArrayData::create(array('ComponentSecurity' => AdvancedAssetsFilesSiteConfig::component_cms_icon('security'), 'ComponentEmbargoExpiry' => AdvancedAssetsFilesSiteConfig::component_cms_icon('embargoexpiry'), 'ButtonsSecurity' => $buttonsSecurity, 'ButtonsEmbargoExpiry' => $buttonsEmbargoExpiry)))), "ParentID");
             $fields->insertAfter($securitySettingsGroup, "BottomTaskSelection");
         }
     }
     if (!is_a($this->owner, "Folder") && is_a($this->owner, "File")) {
         $parentIDField = $fields->dataFieldByName("ParentID");
         if ($controller instanceof SecuredAssetAdmin) {
             $securedRoot = FileSecured::getSecuredRoot();
             $parentIDField->setTreeBaseID($securedRoot->ID);
             $parentIDField->setFilterFunction(create_function('$node', "return \$node->Secured == 1;"));
         } else {
             $parentIDField->setFilterFunction(create_function('$node', "return \$node->Secured == 0;"));
         }
         // SilverStripe core has a bug for search function now, so disable it for now.
         $parentIDField->setShowSearch(false);
     }
 }
コード例 #13
0
 function init()
 {
     parent::init();
     Requirements::css("marketplace/code/ui/frontend/css/marketplace.landing.css");
     Requirements::javascript(Director::protocol() . "maps.googleapis.com/maps/api/js?sensor=false");
     Requirements::combine_files('marketplace_landing.js', array("marketplace/code/ui/frontend/js/markerclusterer.js", "marketplace/code/ui/frontend/js/oms.min.js", "marketplace/code/ui/frontend/js/infobubble-compiled.js", "marketplace/code/ui/frontend/js/google.maps.jquery.js", "marketplace/code/ui/frontend/js/landing.page.js"));
     $this->public_cloud_repository = new SapphirePublicCloudRepository();
 }
コード例 #14
0
 function init()
 {
     parent::init();
     Requirements::css("marketplace/code/ui/frontend/css/marketplace.landing.css");
     $this->InitGoogleMapLibs();
     Requirements::combine_files('marketplace_landing.js', array("marketplace/code/ui/frontend/js/landing.page.js"));
     $this->public_cloud_repository = new SapphirePublicCloudRepository();
 }
コード例 #15
0
ファイル: CMSSecurity.php プロジェクト: aaronleslie/aaronunix
 public function init()
 {
     parent::init();
     // Include CMS styles and js
     Requirements::css(THIRDPARTY_DIR . '/jquery-ui-themes/smoothness/jquery-ui.css');
     Requirements::css(FRAMEWORK_ADMIN_DIR . '/css/screen.css');
     Requirements::combine_files('cmssecurity.js', array(THIRDPARTY_DIR . '/jquery/jquery.js', THIRDPARTY_DIR . '/jquery-ui/jquery-ui.js', THIRDPARTY_DIR . '/jquery-entwine/dist/jquery.entwine-dist.js', FRAMEWORK_ADMIN_DIR . '/javascript/lib.js', FRAMEWORK_ADMIN_DIR . '/javascript/CMSSecurity.js'));
 }
 public function init()
 {
     parent::init();
     // CSS requirements
     Requirements::combine_files('style.css', array(MODULE_BASE . '/vendor/bootstrap/dist/css/bootstrap.css', MODULE_BASE . '/css/animations.css', MODULE_BASE . '/javascript/modules/product/product.css'));
     // Vendor JavaScript
     Requirements::combine_files('vendor.js', array(MODULE_BASE . '/vendor/jquery/jquery.min.js', MODULE_BASE . '/vendor/bootstrap/dist/js/bootstrap.min.js', MODULE_BASE . '/vendor/angular/angular.min.js', MODULE_BASE . '/vendor/angular-route/angular-route.min.js', MODULE_BASE . '/vendor/angular-animate/angular-animate.min.js'));
     // AngularJS application
     Requirements::combine_files('application.js', array(MODULE_BASE . '/javascript/app.js', MODULE_BASE . '/javascript/modules/navigation/navigation.js', MODULE_BASE . '/javascript/modules/catalog/catalog.js', MODULE_BASE . '/javascript/modules/product/product.js'));
 }
コード例 #17
0
 /**
  * Blocks default silverstripe jquery, and loads all required JS and CSS.
  *
  * Note: moment.min.js breaks javascript minimisation so is excluded from the
  * combine_files call.
  */
 public function init()
 {
     parent::init();
     Requirements::block(THIRDPARTY_DIR . '/jquery/jquery.js');
     Requirements::block(THIRDPARTY_DIR . '/jquery-ui/jquery-ui.js');
     Requirements::combine_files('full-calendar.css', array('full-calendar/css/lib/font-awesome.css', 'full-calendar/css/lib/fullcalendar.css', 'full-calendar/css/lib/jquery.fancybox.css', 'full-calendar/css/style.css'));
     Requirements::javascript('full-calendar/javascript/lib/moment.min.js');
     Requirements::combine_files('full-calendar.js', array('full-calendar/javascript/lib/jquery.min.js', 'full-calendar/javascript/lib/fullcalendar.min.js', 'full-calendar/javascript/lib/jquery.fancybox.js', 'full-calendar/javascript/functions.js'));
     Requirements::set_combined_files_folder(ASSETS_DIR . '/_combinedfiles/full-calendar');
 }
コード例 #18
0
ファイル: DNRoot.php プロジェクト: adrexia/deploynaut
 /**
  *
  */
 public function init()
 {
     parent::init();
     if (!Permission::check('DEPLOYNAUT_ACCESS')) {
         return Security::permissionFailure();
     }
     parent::init();
     Requirements::combine_files('deploynaut.js', array(THIRDPARTY_DIR . '/jquery/jquery.js', 'deploynaut/javascript/bootstrap.js', 'deploynaut/javascript/deploynaut.js', 'deploynaut/javascript/bootstrap.file-input.js'));
     Requirements::css(FRAMEWORK_ADMIN_DIR . '/thirdparty/chosen/chosen/chosen.css');
 }
 public function loadStyles()
 {
     $config = Config::inst();
     $_path = 'themes/' . $config->get("SSViewer", 'theme') . '/';
     $_isCustomCSSSpecified = count($this->_css);
     $_isCustomJSSpecified = count($this->_js);
     Requirements::clear();
     $jsItems = array(THIRDPARTY_DIR . '/jquery/jquery.js', THIRDPARTY_DIR . '/jquery-ui/jquery-ui.js', $_path . 'javascript/jquery.pubsub.js', $_path . 'javascript/getParameterByName.js', $_path . 'javascript/URLEncode.js', $_path . 'javascript/forCrappyBrowsers.js', $_path . 'javascript/ga.js', $_path . 'javascript/SocialScripts.js');
     $jsItemsCustom = array();
     if ($_isCustomJSSpecified) {
         foreach ($this->_js as $jsFileName) {
             array_push($jsItemsCustom, $_path . 'javascript/' . $jsFileName . '.js');
         }
     }
     $cssItems = array($_path . 'css/layout.css');
     $cssItemsCustom = array();
     if ($_isCustomCSSSpecified) {
         foreach ($this->_css as $cssFileName) {
             array_push($cssItemsCustom, $_path . 'css/' . $cssFileName . '.css');
         }
     }
     foreach ($jsItems as $item) {
         Requirements::javascript($item);
     }
     foreach ($cssItems as $item) {
         Requirements::css($item);
     }
     foreach ($jsItemsCustom as $item) {
         Requirements::javascript($item);
     }
     foreach ($cssItemsCustom as $item) {
         Requirements::css($item);
     }
     /*
     Combine the files, append the custom file name if specified to avoid conflict
     */
     Requirements::combine_files('assets/cache/css/cssmin.css', $cssItems);
     if ($_isCustomCSSSpecified) {
         Requirements::combine_files('assets/cache/css/cssmin_' . str_replace('/', '_', $this->Link()) . '.css', $cssItemsCustom);
     }
     Requirements::combine_files('assets/cache/javascript/jsmin.js', $jsItems);
     if ($_isCustomJSSpecified) {
         Requirements::combine_files('assets/cache/javascript/jsmin_' . str_replace('/', '_', $this->Link()) . '.js', $jsItemsCustom);
     }
     // Now do the combine
     Requirements::process_combined_files();
     if ($pos = strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE')) {
         $version = substr($_SERVER['HTTP_USER_AGENT'], $pos + 5, 3);
         if ($version <= 7) {
             Requirements::css($_path . 'css/iesucks.css');
         }
         Requirements::javascript($_path . 'javascript/ie-placeholder.js');
     }
 }
コード例 #20
0
ファイル: Page.php プロジェクト: robert-h-curry/huttclub
 public function init()
 {
     parent::init();
     Requirements::clear();
     $themeDir = SSViewer::get_theme_folder();
     Requirements::css("{$themeDir}/css/dp_calendar.css");
     Requirements::combine_files('combined.css', array("{$themeDir}/css/reset.css", "{$themeDir}/css/layout.css", "{$themeDir}/css/typography.css", "{$themeDir}/css/form.css", "{$themeDir}/css/flexslider.css"));
     Requirements::javascript('http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js');
     Requirements::combine_files('combined.js', array("{$themeDir}/javascript/lib/jquery.ui.core.js", "{$themeDir}/javascript/lib/jquery.ui.position.js", "{$themeDir}/javascript/lib/jquery.ui.datepicker.js", "{$themeDir}/javascript/lib/jquery.flexslider.js", "{$themeDir}/javascript/lib/date.js", "{$themeDir}/javascript/lib/jquery.dp_calendar.js", "{$themeDir}/javascript/script.js"));
     Requirements::set_combined_files_folder("{$themeDir}/_combined");
 }
コード例 #21
0
ファイル: ShopAdmin.php プロジェクト: vinstah/body
 public function init()
 {
     // set reading lang
     // if(Object::has_extension('SiteTree', 'Translatable') && !$this->request->isAjax()) {
     // 	Translatable::choose_site_locale(array_keys(Translatable::get_existing_content_languages('SiteTree')));
     // }
     parent::init();
     Requirements::css(CMS_DIR . '/css/screen.css');
     Requirements::css('swipestripe/css/ShopAdmin.css');
     Requirements::combine_files('cmsmain.js', array_merge(array(CMS_DIR . '/javascript/CMSMain.js', CMS_DIR . '/javascript/CMSMain.EditForm.js', CMS_DIR . '/javascript/CMSMain.AddForm.js', CMS_DIR . '/javascript/CMSPageHistoryController.js', CMS_DIR . '/javascript/CMSMain.Tree.js', CMS_DIR . '/javascript/SilverStripeNavigator.js', CMS_DIR . '/javascript/SiteTreeURLSegmentField.js'), Requirements::add_i18n_javascript(CMS_DIR . '/javascript/lang', true, true)));
 }
 function onAfterInit()
 {
     $themeDir = SSViewer::get_theme_folder();
     $scripts = array();
     $styles = array();
     $printStyles = array();
     // Add the combined scripts.
     if (method_exists($this->owner, 'getScriptOverrides')) {
         Deprecation::notice('0.1.3', $this->owner->ClassName . '->getScriptOverrides() is deprecated. Use Requirements::javascript("file") instead');
         $scripts = $this->owner->getScriptOverrides();
     } else {
         if (method_exists($this->owner, 'getScriptIncludes')) {
             Deprecation::notice('0.1.3', $this->owner->ClassName . '->getScriptOverrides() is deprecated. Use Requirements::javascript("file") instead');
             $scripts = array_unique(array_merge($scripts, $this->owner->getScriptIncludes()));
         }
     }
     // Add the combined styles.
     if (method_exists($this->owner, 'getStyleOverrides')) {
         Deprecation::notice('0.1.3', $this->owner->ClassName . '->getStyleOverrides() is deprecated. Use Requirements::css("file") instead');
         $styles = $this->owner->getStyleOverrides();
     } else {
         if (method_exists($this->owner, 'getStyleIncludes')) {
             Deprecation::notice('0.1.3', $this->owner->ClassName . '->getStyleIncludes() is deprecated. Use Requirements::css("file") instead');
             $styles = array_unique(array_merge($styles, $this->owner->getStyleIncludes()));
         }
     }
     // Print styles
     if (method_exists($this->owner, 'getPrintStyleOverrides')) {
         Deprecation::notice('0.1.3', $this->owner->ClassName . '->getPrintStyleOverrides() is deprecated. Use Requirements::css("file","print") instead');
         $printStyles = $this->owner->getPrintStyleOverrides();
     } else {
         if (method_exists($this->owner, 'getPrintStyleIncludes')) {
             Deprecation::notice('0.1.3', $this->owner->ClassName . '->getPrintStyleIncludes() is deprecated. Use Requirements::css("file","print") instead');
             $printStyles = array_unique(array_merge($printStyles, $this->owner->getPrintStyleIncludes()));
         }
     }
     if (Director::isDev()) {
         foreach ($scripts as $script) {
             Requirements::javascript($script);
         }
         foreach ($styles as $style) {
             Requirements::css($style);
         }
         foreach ($styles as $printStyle) {
             Requirements::css($printStyle, 'print');
         }
     } else {
         Requirements::combine_files('scripts.js', $scripts);
         Requirements::combine_files('styles.css', $styles);
         Requirements::combine_files('print.css', $printStyles, 'print');
     }
     // Extra folder to keep the relative paths consistent when combining.
     Requirements::set_combined_files_folder($themeDir . '/combinedfiles');
 }
 public function FieldHolder($properties = array())
 {
     // load requirements
     Requirements::css('international-phone-number-field/lib/intl-tel-input/build/css/intlTelInput.css');
     Requirements::javascript(THIRDPARTY_DIR . '/jquery/jquery.min.js');
     Requirements::javascript(THIRDPARTY_DIR . '/jquery-validate/jquery.validate.min.js');
     Requirements::combine_files('InternationalPhoneNumberField.js', array('international-phone-number-field/lib/intl-tel-input/build/js/intlTelInput.min.js', 'international-phone-number-field/javascript/init.js'));
     // call parent
     $html = parent::FieldHolder();
     return $html;
 }
コード例 #24
0
 public function onAfterInit()
 {
     if ($this->owner->CarouselsRecursive()) {
         Requirements::themedCSS("carousel.styles", "maxcarousel");
         $JS = self::$carouselRequiredJSFiles;
         foreach ($JS as $js) {
             Requirements::javascript($js);
         }
         Requirements::combine_files("combined.carousel.js", $JS);
         Requirements::customScript(self::$carouselInitJS);
     }
 }
コード例 #25
0
 function init()
 {
     parent::init();
     // require custom CSS
     Requirements::css("themes/openstack/css/chosen.css");
     Requirements::css("themes/openstack/css/jquery.autocomplete.css");
     Requirements::css(THIRDPARTY_DIR . '/jquery-ui-themes/smoothness/jquery-ui.css');
     Requirements::javascript(THIRDPARTY_DIR . '/jquery-ui/jquery-ui.js');
     Requirements::javascript(Director::protocol() . "ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/jquery.validate.min.js");
     Requirements::javascript(Director::protocol() . "ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/additional-methods.min.js");
     Requirements::combine_files('company_list.js', array("themes/openstack/javascript/chosen.jquery.min.js", "themes/openstack/javascript/jquery.autocomplete.min.js"));
 }
コード例 #26
0
 public function onAfterInit()
 {
     if ($this->owner->SkitterSlidesRecursive()) {
         Requirements::themedCSS("skitter.styles", "maxskitter");
         Requirements::themedCSS("skitter.custom", "maxskitter");
         $JS = array("maxskitter/javascript/jquery-1.6.3.min.js", "maxskitter/javascript/jquery.skitter.min.js", "maxskitter/javascript/jquery.easing.1.3.js", "maxskitter/javascript/jquery.animate-colors-min.js");
         foreach ($JS as $js) {
             Requirements::javascript($js);
         }
         Requirements::combine_files("combined.skitter.js", $JS);
         Requirements::customScript("\n\t\t\t\tjQuery(document).ready(function() {\n\t\t\t\tjQuery('#skitter').skitter({\n\t\t\t\t\t" . $this->owner->get_skitter_config_for_js() . "\n\t\t\t\t});\n\t\t\t});\n\t\t");
     }
 }
コード例 #27
0
 /**
  *
  */
 public function init()
 {
     parent::init();
     if (!$this->canView()) {
         return Security::permissionFailure($this);
     }
     Requirements::javascript('//use.typekit.net/emt4dhq.js');
     Requirements::customScript('try{Typekit.load();}catch(e){}');
     Requirements::javascript(THIRDPARTY_DIR . '/jquery/jquery.js');
     Requirements::javascript('https://google-code-prettify.googlecode.com/svn/loader/run_prettify.js');
     Requirements::javascript(DOCSVIEWER_DIR . '/javascript/DocumentationViewer.js');
     Requirements::combine_files('docs.css', array(DOCSVIEWER_DIR . '/css/normalize.css', DOCSVIEWER_DIR . '/css/utilities.css', DOCSVIEWER_DIR . '/css/typography.css', DOCSVIEWER_DIR . '/css/forms.css', DOCSVIEWER_DIR . '/css/layout.css', DOCSVIEWER_DIR . '/css/small.css'));
 }
コード例 #28
0
 function init()
 {
     parent::init();
     Requirements::css(THIRDPARTY_DIR . '/jquery-ui-themes/smoothness/jquery-ui.css');
     $css_files = array("themes/openstack/css/chosen.css", "registration/css/affiliations.css", 'registration/css/registration.page.css');
     foreach ($css_files as $css_file) {
         Requirements::css($css_file);
     }
     Requirements::javascript(Director::protocol() . "ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/jquery.validate.min.js");
     Requirements::javascript(Director::protocol() . "ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/additional-methods.min.js");
     Requirements::javascript(THIRDPARTY_DIR . '/jquery-ui/jquery-ui.js');
     Requirements::combine_files('registration.js', array("themes/openstack/javascript/jquery.ui.datepicker.validation.package-1.0.1/jquery.ui.datepicker.validation.js", "themes/openstack/javascript/jquery.validate.custom.methods.js", "themes/openstack/javascript/chosen.jquery.min.js", "themes/openstack/javascript/pure.min.js", "themes/openstack/javascript/jquery.serialize.js", "themes/openstack/javascript/jquery.cleanform.js", "registration/javascript/affiliations.js", "registration/javascript/registration.page.js", "themes/openstack/javascript/tag-it.js"));
 }
コード例 #29
0
 function init()
 {
     parent::init();
     Requirements::css("themes/openstack/css/chosen.css", "screen,projection");
     Requirements::css(THIRDPARTY_DIR . '/jquery-ui-themes/smoothness/jquery-ui.css');
     Requirements::javascript(THIRDPARTY_DIR . '/jquery-ui/jquery-ui.js');
     Requirements::combine_files('marketplace_training_landing.js', array("themes/openstack/javascript/chosen.jquery.min.js", "marketplace/code/ui/frontend/js/training.directory.page.js"));
     Requirements::customScript("jQuery(document).ready(function(\$) {\n            \$('#training','.marketplace-nav').addClass('current');\n        });");
     $this->training_facade = new TrainingFacade($this, new TrainingManager(new SapphireTrainingServiceRepository(), new SapphireMarketPlaceTypeRepository(), new TrainingAddPolicy(), new TrainingShowPolicy(), new SessionCacheService(), new MarketplaceFactory(), SapphireTransactionManager::getInstance()), new SapphireCourseRepository(new MarketplaceFactory()));
     $this->course_location_query = new TrainingCoursesLocationQueryHandler();
     $this->course_level_query = new TrainingCoursesLevelQueryHandler();
     Requirements::customScript($this->GATrackingCode());
 }
 /**
  * Adds Javascript and CSS module to Requirements
  * Calls getModuleJavascriptFiles and getModuleCSSFiles
  *
  * @see getModuleJavascriptFiles
  * @see getModuleCSSFiles
  */
 public function addModuleRequirements()
 {
     if (Director::isDev()) {
         foreach ($this->getModuleJavascriptFiles() as $script) {
             Requirements::javascript($script);
         }
         foreach ($this->getModuleCSSFiles() as $cssFile) {
             Requirements::css($cssFile);
         }
     } else {
         Requirements::combine_files(__CLASS__ . '.js', $this->getModuleJavascriptFiles());
         Requirements::combine_files(__CLASS__ . '.css', $this->getModuleCSSFiles());
     }
 }