public function FieldHolder($attributes = array())
 {
     //$tags_json = json_encode($this->Category->AllowedTags()->column('Tag'));
     $tag_array = array();
     foreach ($this->Category->AllowedTags() as $tag) {
         if (!isset($tag_array[$tag->Group])) {
             $tag_array[$tag->Group] = array();
         }
         $tag_array[$tag->Group][] = $tag->Tag;
     }
     $tags_json = json_encode($tag_array);
     Requirements::customScript("var category_tags = {$tags_json};");
     Requirements::javascript('themes/openstack/bower_assets/jquery-validate/dist/jquery.validate.min.js');
     Requirements::set_write_js_to_body(false);
     return parent::FieldHolder($attributes);
 }
 public function fifth()
 {
     $this->Title = 'The OpenStack Fifth Anniversary';
     $this->FBImage = 'http://www.openstack.org/themes/openstack/images/anniversary/5/img/bot-facebook.jpg';
     $this->FBImageW = '200';
     $this->FBImageH = '284';
     $this->FBDesc = 'Happy 5th OpenStack! Come celebrate at one of 40 global events.';
     $this->FBUrl = Director::protocolAndHost() . $this->Link('fifth');
     $this->CurrentDomain = Director::protocolAndHost();
     Requirements::set_write_js_to_body(false);
     Requirements::combine_files('5.css', array());
     Requirements::css($this->ThemeDir() . '/images/anniversary/5/css/bootstrap.css');
     Requirements::css($this->ThemeDir() . '/images/anniversary/5/css/styles.css');
     Requirements::combine_files('5.js', array($this->ThemeDir() . '/images/anniversary/5/js/jquery.js', $this->ThemeDir() . '/images/anniversary/5/js/scripts.js', $this->ThemeDir() . '/images/anniversary/5/js/jquery.easing.min.js'));
     return $this->getViewer('fifth')->process($this, array('ImgPath' => '/themes/openstack/images/anniversary/5/img', 'BadgeImgUrl' => 'http://841038e5aa7ad2e38487-650bfe6158d7143a3437ef4c83572bc4.r48.cf1.rackcdn.com/5/openstack-5th-anniversary.png', 'SlideDeckUrl' => '//www.dropbox.com/s/8bvbo2dzp9jd61o/OpenStack%205th%20Birthday%20slide%20deck.pptx?dl=0', 'LocalEventUrl' => '//www.openstack.org/blog/2015/06/openstack-turns-5-its-time-to-celebrate-the-community/', 'SummitUrl' => '//www.openstack.org/summit/tokyo-2015/', 'FBSharerUrl' => 'http://www.openstack.org/birthday/fifth', 'FBSharerImg' => 'http://www.openstack.org/themes/openstack/images/anniversary/5/img/bot-facebook.jpg'));
 }
 public function init()
 {
     parent::init();
     i18n::set_locale('de_DE');
     setlocale(LC_ALL, 'de_DE@euro', 'de_DE.UTF-8', 'de_DE', 'de', 'ge');
     i18n::set_date_format('dd.MM.YYYY');
     i18n::set_time_format('HH:mm');
     Requirements::set_write_js_to_body(false);
     Requirements::javascript("framework/thirdparty/jquery/jquery.js");
     Requirements::javascript("calendar/3rdparty/jquery-ui-1.9.2.custom.js");
     Requirements::javascript("calendar/3rdparty/fullcalendar/fullcalendar.js");
     Requirements::javascript("calendar/3rdparty/jQuery-Loading/toggleLoading.jquery.js");
     Requirements::javascript("calendar/javascript/widget.js");
     Requirements::css("framework/thirdparty/jquery-ui-themes/smoothness/jquery-ui.css");
     Requirements::css("calendar/3rdparty/fullcalendar/fullcalendar.css");
     Requirements::css("calendar/css/calendar.css");
 }
 /**
  * Inlcudes the CSS and Javascript files required by the cwsoft-foldergallery module
  *
  * @return void
  */
 function init()
 {
     parent::init();
     // include i18n Javascript library and lang files
     // it doesn't work without the meta-tag (see http://open.silverstripe.org/ticket/7949)
     Requirements::insertHeadTags('<meta http-equiv="Content-language" content="' . i18n::get_locale() . '" />');
     Requirements::javascript(FRAMEWORK_DIR . "/javascript/i18n.js");
     Requirements::add_i18n_javascript('cwsoft-foldergallery/javascript/lang');
     // load cwsoft-foldergallery Javascript files into head
     Requirements::set_write_js_to_body(false);
     // include required cwsoft-foldergallery CSS and Javascript files
     Requirements::css('cwsoft-foldergallery/thirdparty/colorbox/colorbox.css');
     Requirements::css('cwsoft-foldergallery/css/cwsoft-foldergallery.css');
     Requirements::javascript('cwsoft-foldergallery/thirdparty/jquery/jquery.min.js');
     Requirements::javascript('cwsoft-foldergallery/thirdparty/colorbox/jquery.colorbox-min.js');
     Requirements::javascript('cwsoft-foldergallery/javascript/cwsoft-foldergallery.js');
 }
 * 
 * @platform    CMS SilverStripe 3
 * @package     cwsoft-shortcode
 * @version     2.2.4
 * @author      cwsoft (http://cwsoft.de)
 * @copyright   cwsoft
 * @license     http://www.gnu.org/licenses/gpl-3.0.html
*/
// ensure module is stored in folder "cwsoft-shortcode"
$moduleName = 'cwsoft-shortcode';
$folderName = basename(dirname(__FILE__));
if ($folderName != $moduleName) {
    user_error(_t('_config.WRONG_MODULE_FOLDER', 'Please rename the folder "{folderName}" into "{moduleName}" to get the {moduleName} module working properly.', array('moduleName' => $moduleName, 'folderName' => $folderName)), E_USER_ERROR);
}
// include external files into head section
Requirements::set_write_js_to_body(false);
// register short code tags accessible from pages of type cwsCodePage
ShortcodeParser::get()->register('cwsHideMailto', array('cwsShortCodeHideMailto', 'cwsShortCodeHideMailtoHandler'));
ShortcodeParser::get()->register('cwsRandomImage', array('cwsShortCodeRandomImage', 'cwsShortCodeRandomImageHandler'));
ShortcodeParser::get()->register('cwsRandomQuote', array('cwsShortCodeRandomQuote', 'cwsShortCodeRandomQuoteHandler'));
// increase quality of created thumbnails
if (class_exists('GDBackend')) {
    // SilverStripe >= 3.1.0
    GDBackend::set_default_quality(95);
} else {
    // SilverStripe 3.0.x
    GD::set_default_quality(95);
}
// Note: If you see unparsed placeholders like "{#shortcode.dlg_description}" when using the TinyMCE cwsoft-shortcode plugin,
// you need to add a plugin language file for your locale to the folder "./plugins/shortcode/langs". Supported locales: EN, DE.
HtmlEditorConfig::get('cms')->enablePlugins(array('shortcode' => '../../../cwsoft-shortcode/plugins/shortcode/editor_plugin_src.js'));
Пример #6
0
}
if (!defined('DOCUMENT_ROOT_PATH')) {
    define('DOCUMENT_ROOT_PATH', $_SERVER['DOCUMENT_ROOT']);
}
if (!defined('SS_SITE_DATABASE_NAME')) {
    define('SS_SITE_DATABASE_NAME', $databaseConfig['database']);
}
//jpeg quality
Config::inst()->update('GDBackend', 'default_quality', 80);
// block the default page build
SiteTree::set_create_default_pages(false);
Config::inst()->update('SiteTree', 'create_default_pages', false);
// --------------------------------- //
// Assets
// --------------------------------- //
Requirements::set_write_js_to_body(true);
Requirements::set_combined_files_enabled(true);
// HTML5 Shims
// -----------
$shimRequirements = array('thirdparty/selectivizr/index.js', 'thirdparty/respond/dest/respond.min.js', 'thirdparty/modernizr/modernizr.js');
Requirements::combine_files('lte-ie8-shims.js', $shimRequirements);
Requirements::process_combined_files();
// forces ss to generate the file regardless of blocking
// CSS
// ---
$cssRequirements = array('themes/project/css/main.css', 'themes/project/css/typography.css');
Requirements::combine_files('application.css', $cssRequirements);
// Primary JS
// ----------
$jsRequirements = array('thirdparty/jquery/dist/jquery.min.js', 'project/javascript/main.js', 'project/javascript/forms.js');
Requirements::combine_files('application.js', $jsRequirements);
Пример #7
0
 /**
  * On before init.
  * 
  * @return void
  *
  * @author Sebastian Diel <*****@*****.**>
  * @since 22.10.2014
  */
 public function loadJSRequirements()
 {
     if (SilvercartTools::isIsolatedEnvironment()) {
         return;
     }
     Requirements::set_write_js_to_body(true);
     Requirements::javascript('https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js');
     Requirements::javascript('https://ajax.googleapis.com/ajax/libs/jqueryui/1.10.1/jquery-ui.min.js');
     $jsFiles = array('customhtmlform/script/jquery.pixeltricks.forms.checkFormData.js', 'customhtmlform/script/jquery.pixeltricks.forms.events.js', 'customhtmlform/script/jquery.pixeltricks.forms.validator.js', 'silvercart/javascript/jquery.pixeltricks.tools.js', 'silvercart/javascript/jquery.cookie.js', 'silvercart/javascript/bootstrap.min.js', 'silvercart/javascript/jquery.flexslider-min.js', 'silvercart/javascript/jquery.cycle2.min.js', 'silvercart/javascript/jquery.cycle2.carousel.min.js', 'silvercart/javascript/jquery.cycle2.swipe.min.js', 'silvercart/javascript/jquery.tweet.js', 'silvercart/javascript/fancybox/jquery.fancybox.js', 'silvercart/javascript/custom.js', 'silvercart/javascript/silvercart.js');
     if (SilvercartWidget::$use_anything_slider) {
         $jsFiles = array_merge($jsFiles, array('silvercart/javascript/anythingslider/js/jquery.anythingslider.min.js', 'silvercart/javascript/anythingslider/js/jquery.anythingslider.fx.min.js', 'silvercart/javascript/anythingslider/js/jquery.easing.1.2.js'));
     }
     $this->extend('updatedJSRequirements', $jsFiles);
     Requirements::combine_files('m.js.js', $jsFiles);
 }