当前位置: 首页>>代码示例>>PHP>>正文


PHP Page_Controller类代码示例

本文整理汇总了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();
 }
开发者ID:helpfulrobot,项目名称:sunnysideup-payment-eway,代码行数:25,代码来源:EwayPayment.php

示例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"));
 }
开发者ID:NobrainerWeb,项目名称:silverstripe-shop,代码行数:7,代码来源:ViewableCartTest.php

示例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);
 }
开发者ID:helpfulrobot,项目名称:sunnysideup-payment-securatech,代码行数:10,代码来源:SecurePayTechPaymentHosted.php

示例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);
 }
开发者ID:sheadawson,项目名称:silverstripe-payment,代码行数:11,代码来源:PaystationHostedPayment.php

示例5: init

 public function init()
 {
     parent::init();
     if (strpos('/Security/ping', $this->request->getURL()) === false) {
         Page_Controller::AddRequirements();
     }
 }
开发者ID:balajijegan,项目名称:openstack-org,代码行数:7,代码来源:OpenStackIdSecurityController.php

示例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');
 }
开发者ID:dunatron,项目名称:onbaord-revamp,代码行数:7,代码来源:ModulePage.php

示例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);
 }
开发者ID:helpfulrobot,项目名称:burnbright-silverstripe-shop-productfinder,代码行数:10,代码来源:ProductFinder.php

示例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 . '
                 });
             });
         ');
     }
 }
开发者ID:jeffwhitfield,项目名称:silverstripe-locator,代码行数:32,代码来源:Locator.php

示例9: init

 public function init()
 {
     if (!Permission::check("ADMIN")) {
         Security::permissionFailure();
     }
     parent::init();
 }
开发者ID:Thingee,项目名称:openstack-org,代码行数:7,代码来源:EmailUtilsPage.php

示例10: init

 function init()
 {
     parent::init();
     RSSFeed::linkToFeed($this->Link() . "rss");
     Requirements::css('jobs/css/jobs.css');
     Requirements::javascript('jobs/js/jobs.js');
 }
开发者ID:hogepodge,项目名称:openstack-org,代码行数:7,代码来源:JobHolder.php

示例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');
 }
开发者ID:helpfulrobot,项目名称:exadium-silverstripe-module-assets-gallery,代码行数:11,代码来源:AssetsGallery.php

示例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);
		  });

		  ');
    }
开发者ID:SustainableCoastlines,项目名称:loveyourwater,代码行数:27,代码来源:MyEvents.php

示例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");
 }
开发者ID:helpfulrobot,项目名称:torindul-torindul-silverstripe-calendar,代码行数:7,代码来源:Calendar.php

示例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");
 }
开发者ID:sunnysideup,项目名称:silverstripe-electric-vehicle-calculator,代码行数:7,代码来源:EVCPage.php

示例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();
 }
开发者ID:helpfulrobot,项目名称:moosylvania-silverstripe-age-gate,代码行数:26,代码来源:AgeGatedPage.php


注:本文中的Page_Controller类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。