public function onBeforeInit()
    {
        $canEdit        = FrontendEditing::ShowAdmin();
        $editingEnabled = FrontendEditing::editingEnabled();
        $minExt         = (Director::isDev()) ? "" : ".min";

        if ($canEdit) {
            // Enable front-end fly-out menu
            // 
            //Flexslider imports easing, which breaks?
            Requirements::block('flexslider/javascript/jquery.easing.1.3.js');

            Requirements::javascript(FRAMEWORK_DIR.'/thirdparty/jquery/jquery.js');
            Requirements::javascript(FRAMEWORK_DIR.'/thirdparty/jquery-ui/jquery-ui.js');
            Requirements::javascript(FRAMEWORK_ADMIN_DIR.'/javascript/ssui.core.js');
            Requirements::javascript(THIRDPARTY_DIR.'/jquery-entwine/dist/jquery.entwine-dist.js');
            Requirements::javascriptTemplate(FRONTEND_ADMIN_DIR.'/javascript/dist/FrontEndAdminTemplate'.$minExt.'.js', $this->getConfig($this->owner->data()));
            Requirements::css(FRAMEWORK_DIR.'/thirdparty/jquery-ui-themes/smoothness/jquery-ui.css');
            Requirements::javascript(FRONTEND_ADMIN_DIR.'/javascript/dist/FrontEndAdmin'.$minExt.'.js');
            Requirements::css(FRONTEND_ADMIN_DIR.'/css/frontend-admin'.$minExt.'.css');

            $this->owner->getResponse()->addHeader("X-DynamicCache-OptOut", true);
        }
        if ($canEdit && $editingEnabled) {
            // Disable mode pagespeed while editing
            $this->owner->getResponse()->addHeader("PageSpeed", "off");
            // Disable HTTP cache while editing
            HTTP::set_cache_age(0);
            // Enable TinyMCE when editing has been enabled
            Requirements::javascript(FRONTEND_ADMIN_DIR.'/bower_components/tinymce/jquery.tinymce.min.js');
            Requirements::javascript(FRONTEND_ADMIN_DIR.'/javascript/dist/FrontEndEditor'.$minExt.'.js');
            Requirements::css(FRONTEND_ADMIN_DIR.'/css/frontend-editor'.$minExt.'.css');
        }
    }