本文整理匯總了PHP中Page_Controller::init方法的典型用法代碼示例。如果您正苦於以下問題:PHP Page_Controller::init方法的具體用法?PHP Page_Controller::init怎麽用?PHP Page_Controller::init使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Page_Controller
的用法示例。
在下文中一共展示了Page_Controller::init方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: init
function init()
{
parent::init();
$this->myEventName = isset($_GET['name']) ? $_GET['name'] : '';
//register
$this->inRegistration = isset($_GET['registration']) && $_GET['registration'] == 1 ? $_GET['registration'] : '';
//waiting list
if (isset($_GET['registration']) && $_GET['registration'] == 2) {
$this->waitingList = true;
}
$this->inPayment = isset($_GET['payment']) ? $_GET['payment'] : '';
$obj = MagnetismConnect::magnetism_connect_singleton();
$this->myEvent = $obj->getEventByName($this->myEventName);
$this->success = isset($_GET['success']) ? 'Yes' : '';
$this->accepted = isset($_GET['accepted']) ? 'Yes' : '';
// if($this->inPayment){
// $this->RegisterForEvent();
// }
if ($this->inPayment == "creditcard") {
$this->PayByCreditCard();
}
if ($this->inPayment == "invoice") {
$this->RequestInvoice();
}
if ($this->accepted == 'Yes') {
$this->RegisterForEvent();
}
if ($this->myEvent['Price'] == 0) {
$this->isFree = true;
if ($this->inRegistration) {
return $this->RegisterForEvent();
}
}
$this->isRegistered();
}
示例2: init
/**
* Allow this controller to be viewed when the site is in draft mode.
*/
function init()
{
$draftsecurity = Session::get('unsecuredDraftSite');
Session::set("unsecuredDraftSite", true);
parent::init();
Session::set("unsecuredDraftSite", $draftsecurity);
}
示例3: init
function init()
{
parent::init();
Requirements::css('newsletter/css/SubscriptionPage.css');
Requirements::javascript(THIRDPARTY_DIR . '/jquery/jquery.js');
Requirements::javascript(THIRDPARTY_DIR . '/jquery-validate/jquery.validate.min.js');
}
示例4: init
public function init()
{
if (!Permission::check("ADMIN")) {
Security::permissionFailure();
}
parent::init();
}
示例5: init
public function init()
{
parent::init();
$themeDir = SSViewer::get_theme_folder();
Requirements::javascript('framework/thirdparty/jquery/jquery.js');
if (Locator::getLocations()) {
Requirements::javascript('http://maps.google.com/maps/api/js?sensor=false');
Requirements::javascript('locator/thirdparty/handlebars/handlebars-v1.3.0.js');
Requirements::javascript('locator/thirdparty/jquery-store-locator/js/jquery.storelocator.js');
}
Requirements::css('locator/css/map.css');
$featured = Locator::getLocations(array('Featured' => 1))->count() > 0 ? 'featuredLocations: true' : 'featuredLocations: false';
// map config based on user input in Settings tab
// AutoGeocode or Full Map
$load = $this->data()->AutoGeocode ? 'autoGeocode: true, fullMapStart: false,' : 'autoGeocode: false, fullMapStart: true, storeLimit: 1000, maxDistance: true,';
$base = Director::baseFolder();
$themePath = $base . '/' . $themeDir;
$listTemplatePath = file_exists($themePath . '/templates/location-list-description.html') ? $themeDir . '/templates/location-list-description.html' : 'locator/templates/location-list-description.html';
$infowindowTemplatePath = file_exists($themePath . '/templates/infowindow-description.html') ? $themeDir . '/templates/infowindow-description.html' : 'locator/templates/infowindow-description.html';
// in page or modal
$modal = $this->data()->ModalWindow ? 'modalWindow: true' : 'modalWindow: false';
$kilometer = $this->data()->Unit == 'km' ? 'lengthUnit: "km"' : 'lengthUnit: "m"';
$link = $this->Link() . 'xml.xml';
// init map
if (Locator::getLocations()) {
Requirements::customScript("\n \$(function(\$) {\n \$('#map-container').storeLocator({\n " . $load . "\n dataLocation: '" . $link . "',\n listTemplatePath: '" . $listTemplatePath . "',\n infowindowTemplatePath: '" . $infowindowTemplatePath . "',\n originMarker: true,\n " . $modal . ',
' . $featured . ",\n slideMap: false,\n zoomLevel: 0,\n distanceAlert: 120,\n formID: 'Form_LocationSearch',\n inputID: 'Form_LocationSearch_address',\n categoryID: 'Form_LocationSearch_category',\n distanceAlert: -1,\n " . $kilometer . '
});
});
');
}
}
示例6: 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'));
}
示例7: init
function init()
{
parent::init();
Requirements::themedCSS('editor');
Requirements::javascript('mysite/js/signup-now.js');
SSViewer::setOption('rewriteHashlinks', false);
}
示例8: init
function init()
{
parent::init();
Requirements::themedCSS('ElectricVehicleCalculator', 'electric-vehicle-calculator');
Requirements::javascript("framework/thirdparty/jquery/jquery.js");
Requirements::javascript("electric-vehicle-calculator/thirdparty/chartjs/Chart.min.js");
}
示例9: init
public function init()
{
/* Inherit initialisation from parent SiteTree */
parent::init();
//Include the CSS in the users selected theme to ensure the calendar styles correctly
Requirements::css("torindul-silverstripe-calendar/css/calendar.css");
}
示例10: init
public function init()
{
$ageMonth = Cookie::get('bmonth');
$ageDay = Cookie::get('bday');
$ageYear = Cookie::get('byear');
$age = Cookie::get('age');
$allowed_urls = array('/age-gate/');
if ($age == NULL) {
if (!$this->isSearchEngine()) {
if (!in_array($_SERVER['REQUEST_URI'], $allowed_urls)) {
Session::set('AgeGateBackURL', urlencode($_SERVER['REQUEST_URI']));
$this->redirect(Director::absoluteBaseURL() . "age-gate/");
}
}
} else {
if (!in_array($_SERVER['REQUEST_URI'], $allowed_urls)) {
if ($ageMonth == NULL || $ageDay == NULL || $ageYear == NULL) {
if (!in_array($_SERVER['REQUEST_URI'], $allowed_urls)) {
Session::set('AgeGateBackURL', urlencode($_SERVER['REQUEST_URI']));
}
$this->redirect(Director::absoluteBaseURL() . "age-gate/");
}
}
}
parent::init();
}
示例11: init
/**
*
*/
public function init()
{
parent::init();
if (!$this->WebpackDevServer()) {
Requirements::css('summit-video-app/production/css/main.css');
}
}
示例12: init
public function init()
{
parent::init();
Requirements::javascript(basename(dirname(dirname(__FILE__))) . '/javascript/typo.js');
$this->Title = 'Typography test page';
$this->ExtraMeta .= '<meta name="robots" content="noindex, nofollow" />';
}
示例13: init
public function init()
{
//Pull in parent properties for controller e.g css & js assets
parent::init();
Requirements::css($this->ThemeDir() . '/css/module-page.css');
Requirements::css($this->ThemeDir() . '/css/tron-devices.min.css');
}
示例14: init
public function init()
{
parent::init();
Requirements::javascript(THIRDPARTY_DIR . '/jquery-form/jquery.form.js');
Requirements::javascript('microblog/javascript/timeline.js');
Requirements::css('microblog/css/timeline.css');
}
示例15: init
function init()
{
parent::init();
Requirements::CSS('themes/openstack/css/enterprise.css');
Requirements::CSS('themes/openstack/css/science.css');
Requirements::javascript('themes/openstack/javascript/enterprise.js');
}