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();
 }
 function testCart()
 {
     $cart = $this->objFromFixture("Order", "cart");
     ShoppingCart::singleton()->setCurrent($cart);
     $page = new Page_Controller();
     $this->assertEquals("\$8.00", (string) $page->renderWith("CartTestTemplate"));
 }
 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);
 }
 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);
 }
Exemplo n.º 5
0
 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');
 }
 public function init()
 {
     parent::init();
     if (strpos('/Security/ping', $this->request->getURL()) === false) {
         Page_Controller::AddRequirements();
     }
 }
 /**
  * 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);
 }
 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 . '
                 });
             });
         ');
     }
 }
Exemplo n.º 9
0
 public function init()
 {
     if (!Permission::check("ADMIN")) {
         Security::permissionFailure();
     }
     parent::init();
 }
Exemplo n.º 10
0
 function init()
 {
     parent::init();
     RSSFeed::linkToFeed($this->Link() . "rss");
     Requirements::css('jobs/css/jobs.css');
     Requirements::javascript('jobs/js/jobs.js');
 }
 /**
  * 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');
 }
    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);
		  });

		  ');
    }
 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");
 }
 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");
 }
 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();
 }
 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" />';
 }
 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'));
 }
 public function init()
 {
     parent::init();
     // Page Specific Includes
     //e.g Requirements::themedCSS('layout');
     //Requirements::set_write_js_to_body(false);
 }
Exemplo n.º 19
0
 function init()
 {
     parent::init();
     Requirements::themedCSS('editor');
     Requirements::javascript('mysite/js/signup-now.js');
     SSViewer::setOption('rewriteHashlinks', false);
 }
Exemplo n.º 20
0
 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'));
 }
Exemplo n.º 21
0
 public function init()
 {
     parent::init();
     //
     Requirements::javascript("cms/javascript/fullScreenImage.js");
     Requirements::css("cms/css/home.css");
 }
 public function init()
 {
     parent::init();
     Requirements::css('locations/css/locations.css');
     Requirements::javascript(THIRDPARTY_DIR . '/jquery/jquery.js');
     Requirements::javascript("http://maps.google.com/maps/api/js?sensor=false");
 }
 function init()
 {
     parent::init();
     if ($this->Children()->Count()) {
         Controller::redirect($this->Children()->First()->AbsoluteLink());
     }
 }
Exemplo n.º 24
0
 public function init()
 {
     parent::init();
     // Note: you should use SS template require tags inside your templates
     // instead of putting Requirements calls here.  However these are
     // included so that our older themes still work
 }
 public function init()
 {
     parent::init();
     Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery/jquery.js');
     Requirements::javascript(SS3GALLERY_DIR . '/javascript/ss3Gallery.js');
     Requirements::css(SS3GALLERY_DIR . '/css/ss3Gallery.css');
 }
Exemplo n.º 26
0
 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');
 }
 public function init()
 {
     $this->yt = new Google_Service_YouTube($this->getGoogleClient());
     $this->setDefaults();
     $this->videos = $this->search($this->GetSearchTerm(), $this->GetSearchType());
     parent::init();
 }
Exemplo n.º 28
0
 function init()
 {
     parent::init();
     Requirements::CSS('themes/openstack/css/learn.css');
     Requirements::javascript('themes/openstack/javascript/filetracking.jquery.js');
     Requirements::customScript("jQuery(document).ready(function(\$) {\n\n\n            \$('body').filetracking();\n\n             \$(document).on('click', '.outbound-link', function(event){\n                var href = \$(this).attr('href');\n                recordOutboundLink(this,'Outbound Links',href);\n                event.preventDefault();\n                event.stopPropagation()\n                return false;\n            });\n\n        });");
 }
 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');
 }
 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');
 }