本文整理汇总了PHP中Director::protocol方法的典型用法代码示例。如果您正苦于以下问题:PHP Director::protocol方法的具体用法?PHP Director::protocol怎么用?PHP Director::protocol使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Director
的用法示例。
在下文中一共展示了Director::protocol方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getUrl
/**
* Returns Url to the photoset
* @return string|"" url of the photoset if userId is set
*/
public function getUrl()
{
if ($this->userId === null || !is_string($this->userId)) {
return "";
}
return sprintf('%swww.flickr.com/photos/%s/sets/%s', Director::protocol(), $this->userId, $this->data['id']);
}
示例2: MarketPlaceReviewForm
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;
}
示例3: FieldHolder
public function FieldHolder($attributes = array())
{
Requirements::css(THIRDPARTY_DIR . '/jquery-ui-themes/smoothness/jquery-ui.css');
Requirements::css("registration/css/affiliations.css");
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');
$js_scripts = array("themes/openstack/javascript/pure.min.js", "themes/openstack/javascript/jquery.serialize.js", "themes/openstack/javascript/jquery.cleanform.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", 'registration/javascript/affiliations.js');
foreach ($js_scripts as $js) {
Requirements::javascript($js);
}
$arrayData = new ArrayData(array('Title' => 'Edit Affiliation'));
$modal = $arrayData->renderWith('AffiliationModalForm');
$modal = trim(preg_replace('/\\s\\s+/', ' ', $modal));
$script = <<<JS
(function( \$ ){
\$(document).ready(function() {
\$('{$modal}').appendTo(\$('body'));
\$("#edit-affiliation-form").affiliations({
storage:'{$this->mode}'
});
});
}( jQuery ));
JS;
Requirements::customScript($script);
return parent::FieldHolder($attributes);
}
示例4: init
function init()
{
parent::init();
$this->securityToken = new SecurityToken();
Requirements::css('news/code/ui/frontend/css/news.css');
Requirements::css(Director::protocol() . '://maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css');
}
示例5: GerritStatisticsReport
public function GerritStatisticsReport()
{
Requirements::block(SAPPHIRE_DIR . "/javascript/jquery_improvements.js");
Requirements::block(FRAMEWORK_DIR . '/thirdparty/jquery/jquery.js');
Requirements::block(FRAMEWORK_DIR . '/thirdparty/jquery/jquery.min.js');
Requirements::block(THIRDPARTY_DIR . '/jquery-cookie/jquery.cookie.js');
if (Director::isLive()) {
Requirements::javascript('themes/openstack/javascript/jquery.min.js');
} else {
Requirements::javascript('themes/openstack/javascript/jquery.js');
}
Requirements::javascript('themes/openstack/javascript/jquery-migrate-1.2.1.min.js');
Requirements::javascript("themes/openstack/javascript/jquery.cookie.js");
Requirements::javascript("themes/openstack/javascript/bootstrap.min.js");
Requirements::css('themes/openstack/css/bootstrap.min.css');
Requirements::javascript(Director::protocol() . "maps.googleapis.com/maps/api/js?sensor=false");
Requirements::javascript("marketplace/code/ui/admin/js/utils.js");
Requirements::javascript("marketplace/code/ui/frontend/js/markerclusterer.js");
Requirements::javascript("marketplace/code/ui/frontend/js/oms.min.js");
Requirements::javascript("marketplace/code/ui/frontend/js/infobubble-compiled.js");
Requirements::javascript("marketplace/code/ui/frontend/js/google.maps.jquery.js");
Requirements::javascript('themes/openstack/javascript/Chart.js');
Requirements::javascript("gerrit_ingest/js/sangria.page.gerrit.statistics.report.js");
Requirements::css('gerrit_ingest/css/sangria.page.gerrit.statistics.report.css');
return $this->owner->getViewer('GerritStatisticsReport')->process($this->owner);
}
示例6: updateCMSFields
function updateCMSFields(FieldList $fields)
{
$subsites = Subsite::accessible_sites("CMS_ACCESS_CMSMain");
$subsitesMap = array();
if ($subsites && $subsites->Count()) {
$subsitesMap = $subsites->map('ID', 'Title');
unset($subsitesMap[$this->owner->SubsiteID]);
}
// Master page edit field (only allowed from default subsite to avoid inconsistent relationships)
$isDefaultSubsite = $this->owner->SubsiteID == 0 || $this->owner->Subsite()->DefaultSite;
if ($isDefaultSubsite && $subsitesMap) {
$fields->addFieldToTab('Root.Main', new DropdownField("CopyToSubsiteID", _t('SiteTreeSubsites.CopyToSubsite', "Copy page to subsite"), $subsitesMap, ''));
$fields->addFieldToTab('Root.Main', $copyAction = new InlineFormAction("copytosubsite", _t('SiteTreeSubsites.CopyAction', "Copy")));
$copyAction->includeDefaultJS(false);
}
// replace readonly link prefix
$subsite = $this->owner->Subsite();
$nested_urls_enabled = Config::inst()->get('SiteTree', 'nested_urls');
if ($subsite && $subsite->ID) {
$baseUrl = Director::protocol() . $subsite->domain() . '/';
$baseLink = Controller::join_links($baseUrl, $nested_urls_enabled && $this->owner->ParentID ? $this->owner->Parent()->RelativeLink(true) : null);
$urlsegment = $fields->dataFieldByName('URLSegment');
$urlsegment->setURLPrefix($baseLink);
}
}
示例7: init
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'));
}
示例8: init
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());
}
示例9: forceNonWWW
public static function forceNonWWW()
{
if (!Director::isDev() && !Director::isTest() && strpos($_SERVER['HTTP_HOST'], 'www') === 0) {
$destURL = str_replace(Director::protocol() . 'www.', Director::protocol(), Director::absoluteURL($_SERVER['REQUEST_URI']));
self::force_redirect($destURL);
}
}
示例10: init
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();
}
示例11: FieldHolder
public function FieldHolder()
{
Requirements::css(Director::protocol() . 'ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/themes/base/jquery-ui.css');
Requirements::css('eventresources/thirdparty/jquery-fullcalendar/fullcalendar.css');
Requirements::javascript('eventresources/thirdparty/jquery-fullcalendar/fullcalendar.min.js');
Requirements::javascript('eventresources/javascript/EventResourceCalendar.js');
return $this->createTag('div', array('id' => $this->id(), 'class' => 'event-resource-calendar ' . $this->extraClass(), 'href' => $this->Link('bookings')));
}
示例12: init
function init()
{
parent::init();
Requirements::css(Director::protocol() . "code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css");
Requirements::css('news/code/ui/frontend/css/news.admin.css');
Requirements::javascript(Director::protocol() . "code.jquery.com/ui/1.10.4/jquery-ui.min.js");
Requirements::javascript('news/code/ui/frontend/js/news.admin.js');
}
示例13: init
function init()
{
parent::init();
$this->securityToken = new SecurityToken();
Requirements::css('news/code/ui/frontend/css/news.css');
Requirements::css(Director::protocol() . '://maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css');
Requirements::javascript("themes/openstack/javascript/bootstrap-paginator.js");
Requirements::javascript("news/code/ui/frontend/js/news.archived.js");
}
示例14: onAfterInit
public function onAfterInit()
{
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::css(THIRDPARTY_DIR . '/jquery-ui-themes/smoothness/jquery-ui.css');
Requirements::javascript(THIRDPARTY_DIR . '/jquery-ui/jquery-ui.js');
Requirements::javascript("themes/openstack/javascript/jquery.validate.custom.methods.js");
Requirements::javascript('themes/openstack/javascript/sangria/sangria.page.export.data.js');
}
示例15: CanTrackEvents
public static function CanTrackEvents(Controller $controller)
{
$bIsContentController = is_a($controller, 'ContentController');
if ($bIsContentController && SiteConfig::current_site_config()->GoogleAnalyticsTrackingID) {
$strCurrentDomain = str_replace(Director::protocol(), '', Director::protocolAndHost());
$arrDomains = explode(',', SiteConfig::current_site_config()->GoogleAnalyticsTrackDomain);
return in_array($strCurrentDomain, $arrDomains);
}
}