本文整理汇总了PHP中Page_Controller类的典型用法代码示例。如果您正苦于以下问题:PHP Page_Controller类的具体用法?PHP Page_Controller怎么用?PHP Page_Controller使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Page_Controller类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: processPayment
function processPayment($data, $form)
{
// 1) Get secured Eway url
$url = $this->EwayURL();
$response = file_get_contents($url);
if ($response) {
$response = Convert::xml2array($response);
if (isset($response['Result']) && $response['Result'] == 'True' && isset($response['URI']) && $response['URI']) {
// 2) Redirect to the secured Eway url
$page = new Page();
$page->Title = 'Redirection to eWAY...';
$page->Logo = '<img src="' . $this->config()->get('logo') . '" alt="Payments powered by eWAY"/>';
$page->Form = $this->EwayForm($response['URI']);
$controller = new Page_Controller($page);
$form = $controller->renderWith('PaymentProcessingPage');
return new Payment_Processing($form);
}
}
$this->Status = 'Failure';
if ($response && isset($response['Error'])) {
$this->Message = $response['Error'];
}
$this->write();
return $this->redirectToOrder();
}
示例2: testCart
function testCart()
{
$cart = $this->objFromFixture("Order", "cart");
ShoppingCart::singleton()->setCurrent($cart);
$page = new Page_Controller();
$this->assertEquals("\$8.00", (string) $page->renderWith("CartTestTemplate"));
}
示例3: processPayment
function processPayment($data, $form)
{
$page = new Page();
$page->Title = "Make payment";
$page->Form = $this->processPaymentForm($data);
$page->Logo = '<img src="payment_securatech/images/paymark_small.png" "payment gateway powered by Securatech" />';
$controller = new Page_Controller($page);
$form = $controller->renderWith("PaymentProcessingPage");
return new Payment_Processing($form);
}
示例4: processPayment
public function processPayment($data, $form)
{
$page = new Page();
$page->Title = 'Redirection to Paystation...';
$page->Logo = '<img src="' . self::$logo . '" alt="Payments powered by Paystation"/>';
$page->Form = $this->PaystationForm();
$controller = new Page_Controller($page);
Requirements::javascript(THIRDPARTY_DIR . '/jquery/jquery.js');
$form = $controller->renderWith('PaymentProcessingPage');
return new Payment_Processing($form);
}
示例5: init
public function init()
{
parent::init();
if (strpos('/Security/ping', $this->request->getURL()) === false) {
Page_Controller::AddRequirements();
}
}
示例6: 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');
}
示例7: 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);
}
示例8: 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 . '
});
});
');
}
}
示例9: init
public function init()
{
if (!Permission::check("ADMIN")) {
Security::permissionFailure();
}
parent::init();
}
示例10: init
function init()
{
parent::init();
RSSFeed::linkToFeed($this->Link() . "rss");
Requirements::css('jobs/css/jobs.css');
Requirements::javascript('jobs/js/jobs.js');
}
示例11: init
/**
* Load all the custom jquery needed to run the custom
* validation
*/
public function init()
{
parent::init();
$ui = new Colorbox();
$ui->initialize();
Requirements::css(ASSETS_GALLERY_BASE . '/css/AssetsGallery.css');
}
示例12: init
public function init()
{
parent::init();
// Page Specific Includes
Requirements::customScript('
//VITALSCRIPT!!!
jQuery("a.sendmessage").bind("click", function(){
var myval = $(this).attr("id");
jQuery("#SendForm_SendForm_CleanupID").attr("value", myval);
});
jQuery(".invite").fancybox({
"titleShow" : "false",
"transitionIn" : "elastic",
"transitionOut" : "elastic"
});
//VITALSCRIPT!!!
jQuery("a.invite").bind("click", function(){
var myval = $(this).attr("id");
jQuery("#InviteForm_InviteForm_CleanupID").attr("value", myval);
});
');
}
示例13: 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");
}
示例14: 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");
}
示例15: 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();
}