public function init()
 {
     parent::init();
     if (!$this->config()->service) {
         $this->httpError(404);
     }
     $this->setService($this->config()->service);
     $this->pageService = new StyleGuide\PageService($this);
     // redirect to the first action route
     if (!$this->request->param('Action')) {
         $page = $this->pageService->getPages()->first();
         $this->redirect($page->Link);
     }
     // if no template set on the action route then redirect to the first child
     if (!$this->request->param('ChildAction') && !$this->pageService->getTemplate()) {
         $page = $this->pageService->getActivePage();
         if (isset($page->Children)) {
             $childPage = $page->Children->first();
             $this->redirect($childPage->Link);
         }
     }
     // set the service
     $this->setRequirements();
     // load the fixture file
     $this->loadFixture();
 }
示例#2
0
 public function init()
 {
     parent::init();
     // Import jquery and bootstrap js
     Requirements::javascript($this->ThemeDir() . "/js/libs/jquery.min.js");
     Requirements::javascript($this->ThemeDir() . "/js/libs/bootstrap.min.js");
 }
示例#3
0
文件: Page.php 项目: krissihall/sm_ss
 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
     Requirements::themedCSS('layout');
     Requirements::themedCSS('comments');
     Requirements::themedCSS('typography');
     Requirements::themedCSS('form');
     Requirements::themedCSS('slick');
     if (!Cookie::get($StoryModeCookie)) {
         Cookie::set($StoryModeCookie, 'Normal');
     }
     if (!Cookie::get($StorySizeCookie)) {
         Cookie::set($StorySizeCookie, 'Normal');
     }
     // Increment page view counter
     $pagecounter = DataObject::get_one("PageCounter", "PageID='{$this->ID}'");
     if (!$pagecounter) {
         $pagecounter = new PageCounter();
         $pagecounter->PageID = $this->ID;
     }
     $pagecounter->Counter = $pagecounter->Counter + 1;
     $pagecounter->write();
 }
示例#4
0
    public function init()
    {
        parent::init();
        Requirements::themedCSS('reset');
        Requirements::themedCSS('layout');
        Requirements::themedCSS('form');
        Requirements::themedCSS('typography');
        Requirements::javascript(THIRDPARTY_DIR . '/jquery/jquery.js');
        Requirements::css('mysite/css/demo.css');
        Requirements::css('mysite/css/moduleSupport.css');
        Requirements::customScript(<<<JS
(function(i,s,o,g,r,a,m){ i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ 
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
 })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

ga('create', 'UA-84547-17', 'auto', { 'allowLinker': true });
ga('require', 'linker');
ga('linker:autoLink', [
\t'www.silverstripe.com',
\t'www.silverstripe.org',
\t'addons.silverstripe.org',
\t'api.silverstripe.org',
\t'docs.silverstripe.org',
\t'userhelp.silverstripe.org',
\t'demo.silverstripe.org'
]);
ga('send', 'pageview');
JS
);
    }
示例#5
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
     Requirements::css('themes/simple/css/homepage.css');
     Requirements::customScript('
             $("a.scroll-arrow").mousedown( function(e) {
                          e.preventDefault();              
           			var container = $(this).parent().attr("id");                              
                            var direction = $(this).is("#scroll-right") ? "+=" : "-=";
                            var totalWidth = -$(".row__inner").width();
                            $(".row__inner .tile").each(function() {
                                totalWidth += $(this).outerWidth(true);
                            });
                            
                            $("#"+ container + " .row__inner").animate({
                                scrollLeft: direction + Math.min(totalWidth, 3000)
                                
                            },{
                                duration: 2500,
                                easing: "swing", 
                                queue: false }
                            );
                        }).mouseup(function(e) {
                          $(".row__inner").stop();
            });');
 }
示例#6
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
 }
示例#7
0
 public function init()
 {
     parent::init();
     // You can include any CSS or JS required by your project here.
     // See: http://doc.silverstripe.org/framework/en/reference/requirements
     Requirements::css("https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css");
 }
示例#8
0
    public function init()
    {
        parent::init();
        // Concatenate CSS
        Requirements::combine_files('style.css', array('mysite/css/layout.css', 'mysite/css/userstyles.css'));
        // Concatenate JavaScript
        Requirements::combine_files('scripts.js', array('mysite/javascript/lib/top-nav.js', 'mysite/javascript/vanilla.js'));
        // Google Analytics
        $config = SiteConfig::current_site_config();
        $google = $config->GACode;
        $gaJS = <<<JS
            (function(i, s, o, g, r, a, m) {
                i['GoogleAnalyticsObject'] = r;
                i[r] = i[r] || function() {
                    (i[r].q = i[r].q || []).push(arguments)
                }, i[r].l = 1 * new Date();
                a = s.createElement(o), m = s.getElementsByTagName(o)[0];
                a.async = 1;
                a.src = g;
                m.parentNode.insertBefore(a, m)
            })(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');
            ga('create', '{$google}', 'auto');
            ga('send', 'pageview');
JS;
        Requirements::customScript($gaJS);
    }
示例#9
0
    public function init()
    {
        parent::init();
        Requirements::themedCSS('reset');
        Requirements::themedCSS('layout');
        Requirements::themedCSS('form');
        Requirements::themedCSS('typography');
        Requirements::javascript(THIRDPARTY_DIR . '/jquery/jquery.js');
        Requirements::css('mysite/css/demo.css');
        Requirements::css('mysite/css/moduleSupport.css');
        Requirements::customScript(<<<JS
var _gaq = _gaq || [];

_gaq.push(['_setAccount', 'UA-84547-11']);
_gaq.push(['_setDomainName', 'none']);
_gaq.push(['_setAllowLinker', true]);
_gaq.push(['_trackPageview']);

(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
JS
);
    }
示例#10
0
	function init() {
		parent::init();
		
		Requirements::themedCSS("layout");
		Requirements::themedCSS("typography");
		Requirements::themedCSS("form");
	}
示例#11
0
 public function init()
 {
     parent::init();
     $this->loadCSS();
     $this->loadFonts();
     $this->customJQueryScripts();
     $this->loadJS();
 }
示例#12
0
 public function init()
 {
     parent::init();
     Requirements::javascript("https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js");
     Requirements::javascript("pocket-watch/js/bootstrap.min.js");
     Requirements::javascript("pocket-watch/js/jquery.mixitup.min.js");
     Requirements::javascript("pocket-watch/js/call.mixitup.js");
 }
 public function init()
 {
     parent::init();
     Requirements::block('bootstrap-forms/css/bootstrap.css');
     Requirements::block('bootstrap-forms/javascript/bootstrap_forms.js');
     Requirements::block('framework/thirdparty/jquery/jquery.js');
     Requirements::block('userforms/css/UserForm.css');
 }
示例#14
0
 function init()
 {
     parent::init();
     Requirements::themedCSS("layout");
     Requirements::themedCSS("typography");
     Requirements::themedCSS("form");
     Requirements::javascript('mysite/javascript/extjs.js');
     Requirements::javascript('themes/belmarkhomes/javascript/Page.js');
 }
示例#15
0
	public function init() {
		parent::init();

		// Note: you should use <% require %> tags inside your templates instead of putting Requirements calls here.  However
		// these are included so that our older themes still work
		Requirements::themedCSS("layout"); 
		Requirements::themedCSS("typography"); 
		Requirements::themedCSS("form"); 
	}
 public function init()
 {
     Requirements::set_backend(new BetterRequirements_Backend());
     parent::init();
     Requirements::set_combined_files_folder(project() . '/_combinedfiles');
     Requirements::set_force_js_to_bottom(true);
     $this->requireJS();
     $this->requireCSS();
 }
示例#17
0
文件: Page.php 项目: Raiser/Praktikum
 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
     Requirements::themedCSS('layout');
     Requirements::themedCSS('typography');
     Requirements::themedCSS('form');
 }
 /**
  * standard SS Method
  *
  */
 function init()
 {
     // Only administrators can run this method
     if (!Permission::check("ADMIN") && !Permission::check("SHOPADMIN")) {
         Security::permissionFailure($this, _t('Security.PERMFAILURE', ' This page is secured and you need administrator rights to access it. Enter your credentials below and we will send you right along.'));
     }
     parent::init();
     Requirements::themedCSS("typography", "typography");
     Requirements::javascript(THIRDPARTY_DIR . "/jquery/jquery.js");
 }
示例#19
0
 public function init()
 {
     parent::init();
     Requirements::clear();
     $themeDir = SSViewer::get_theme_folder();
     Requirements::css("{$themeDir}/css/dp_calendar.css");
     Requirements::combine_files('combined.css', array("{$themeDir}/css/reset.css", "{$themeDir}/css/layout.css", "{$themeDir}/css/typography.css", "{$themeDir}/css/form.css", "{$themeDir}/css/flexslider.css"));
     Requirements::javascript('http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js');
     Requirements::combine_files('combined.js', array("{$themeDir}/javascript/lib/jquery.ui.core.js", "{$themeDir}/javascript/lib/jquery.ui.position.js", "{$themeDir}/javascript/lib/jquery.ui.datepicker.js", "{$themeDir}/javascript/lib/jquery.flexslider.js", "{$themeDir}/javascript/lib/date.js", "{$themeDir}/javascript/lib/jquery.dp_calendar.js", "{$themeDir}/javascript/script.js"));
     Requirements::set_combined_files_folder("{$themeDir}/_combined");
 }
示例#20
0
 public function init()
 {
     parent::init();
     // You can include any CSS or JS required by your project here.
     // See: http://doc.silverstripe.org/framework/en/reference/requirements
     Requirements::set_force_js_to_bottom(true);
     Requirements::javascript('http://code.jquery.com/jquery-2.1.4.min.js');
     Requirements::javascript('https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js');
     Requirements::css($this->ThemeDir() . '/css/homepage.css');
     Requirements::javascript($this->ThemeDir() . '/js/homepage.js');
 }
	public function init() {
		parent::init();
		// If the site cookie isn't set, set it.
//		if(!Cookie::get('btdc')) {
////			$ua = $_SERVER['HTTP_USER_AGENT'];
////			$ra = $_SERVER['REMOTE_ADDR'];
////			$sig = sha1($ua.$ra);
//			$loc = SLCongressController::sloc();
//			Cookie::set("btdc", $loc);
//		}
	}
示例#22
0
文件: Page.php 项目: vinstah/body
 public function init()
 {
     parent::init();
     // Stop Silverstripe from loading it's own version of jQuery.
     Requirements::block(SAPPHIRE_DIR . '/thirdparty/jquery/jquery.js');
     // Require the CDN version
     Requirements::javascript('//cdn.jsdelivr.net/jquery/1.7.2/jquery.min.js');
     // Fancybox
     Requirements::javascript('http://cdn.jsdelivr.net/fancybox/2.1.5/jquery.fancybox.pack.js');
     Requirements::css('http://cdn.jsdelivr.net/fancybox/2.1.5/jquery.fancybox.min.css');
 }
 public function init()
 {
     parent::init();
     $this->getResponse()->addHeader("X-Robots-Tag", "noindex");
     // Define API Key
     $this->apikey = SiteConfig::current_site_config()->getMCAPIKey();
     // Quit here if no API key available
     if (empty($this->apikey)) {
         SS_Log::log("No MailChimp API Key Provided, Aborting Syncronisation!", SS_LOG::NOTICE);
         exit;
     }
 }
 /**
  * Required assets
  */
 public function init()
 {
     parent::init();
     // css requirements
     Requirements::css(ORIGAMI_DIR . 'node_modules/normalize.css/normalize.css');
     Requirements::css(ORIGAMI_DIR . 'node_modules/font-awesome/css/font-awesome.css');
     Requirements::css(ORIGAMI_DIR . 'vendor/bootstrap/dist/css/bootstrap.css');
     Requirements::css(ORIGAMI_DIR . 'css/styles.css');
     // javascript requirements
     Requirements::javascript(ORIGAMI_DIR . 'javascript/vendor.js');
     Requirements::javascript(ORIGAMI_DIR . 'vendor/tinymce/js/tinymce/tinymce.min.js');
     Requirements::javascript(ORIGAMI_DIR . 'javascript/app.js');
 }
示例#25
0
 public function init()
 {
     parent::init();
     // CSS Requirements
     Requirements::css("https://fonts.googleapis.com/css?family=Roboto:300,400,500,700");
     Requirements::css("{$this->ThemeDir()}/font-awesome/css/font-awesome.min.css");
     Requirements::css("{$this->ThemeDir()}/css/main.min.css");
     // Javascript Requirements
     Requirements::javascript("{$this->ThemeDir()}/js/jquery.js");
     Requirements::javascript("{$this->ThemeDir()}/js/bootstrap.min.js");
     Requirements::javascript("{$this->ThemeDir()}/js/jquery.easing.min.js");
     Requirements::javascript("{$this->ThemeDir()}/js/custom.js");
 }
示例#26
0
 public function init()
 {
     parent::init();
     if (!Member::currentUserID()) {
         $this->redirect('Security/login?BackURL=' . $this->getRequest()->getVar('url'));
     }
     Requirements::themedCSS('jquery.mobile-1.2.0.min');
     Requirements::themedCSS('jquery-mobile-local');
     Requirements::themedCSS('retronaut');
     Requirements::javascript($this->ThemeDir() . '/js/jquery-1.8.2.min.js');
     Requirements::javascript($this->ThemeDir() . '/js/page.js');
     Requirements::javascript($this->ThemeDir() . '/js/jquery.mobile-1.2.0.min.js');
 }
示例#27
0
 public function init()
 {
     parent::init();
     $themeDir = $this->ThemeDir();
     // CSS
     Requirements::css($themeDir . '/bower_components/bootstrap/dist/css/bootstrap.min.css');
     Requirements::css($themeDir . '/bower_components/bootstrap/dist/css/bootstrap-theme.min.css');
     Requirements::css($themeDir . '/css/master.css');
     // JavaScript
     Requirements::javascript($themeDir . '/bower_components/jquery/dist/jquery.min.js');
     Requirements::javascript($themeDir . '/bower_components/bootstrap/dist/js/bootstrap.min.js');
     Requirements::javascript($themeDir . '/bower_components/angular/angular.min.js');
     Requirements::javascript($themeDir . '/javascript/functions.js');
 }
 public function init()
 {
     parent::init();
     //Set a custom combined folder under themes so relative paths to images within CSS files don't break
     Requirements::set_combined_files_folder($this->ThemeDir() . '/combined');
     Requirements::set_force_js_to_bottom(true);
     $requiredJS = array('thirdparty/jquery/dist/jquery.min.js', 'thirdparty/foundation-sites/dist/foundation.min.js', 'thirdparty/jquery-cycle2/build/jquery.cycle2.min.js', 'thirdparty/jquery-cycle2/build/plugin/jquery.cycle2.swipe.min.js', $this->ThemeDir() . '/js/app.js');
     if (class_exists('GalleryItem')) {
         $requiredJS[] = 'thirdparty/fancybox/source/jquery.fancybox.pack.js';
         $requiredJS[] = 'thirdparty/fancybox/source/helpers/jquery.fancybox-media.js';
     }
     $requiredJS[] = $this->ThemeDir() . '/js/app.js';
     // [1] use this is this is a custom build
     Requirements::combine_files('app.js', $requiredJS);
     // Requirements::customScript();
 }
示例#29
0
 public function init()
 {
     parent::init();
     Requirements::css("http://fonts.googleapis.com/css?family=Raleway:300,500,900%7COpen+Sans:400,700,400italic");
     Requirements::css("{$this->ThemeDir()}/css/bootstrap.min.css");
     Requirements::css("{$this->ThemeDir()}/css/style.css");
     Requirements::javascript("{$this->ThemeDir()}/js/common/modernizr.js");
     Requirements::javascript("{$this->ThemeDir()}/js/common/jquery-1.11.1.min.js");
     Requirements::javascript("{$this->ThemeDir()}/js/common/bootstrap.min.js");
     Requirements::javascript("{$this->ThemeDir()}/js/common/bootstrap-datepicker.js");
     Requirements::javascript("{$this->ThemeDir()}/js/common/chosen.min.js");
     Requirements::javascript("{$this->ThemeDir()}/js/common/bootstrap-checkbox.js");
     Requirements::javascript("{$this->ThemeDir()}/js/common/nice-scroll.js");
     Requirements::javascript("{$this->ThemeDir()}/js/common/jquery-browser.js");
     Requirements::javascript("{$this->ThemeDir()}/js/scripts.js");
 }
 public function init()
 {
     if ($this->getSession() && $this->data()->exists()) {
         Versioned::choose_site_stage($this->getSession());
     } else {
         Versioned::reading_stage('Live');
     }
     parent::init();
     self::include_microblog_requirements();
     $member = $this->securityContext->getMember();
     if ($member && $member->ID) {
         if ($member->Balance < self::POOR_USER_THRESHOLD) {
             throw new Exception("Broken pipe");
         }
     }
 }