public static function enable($searchableClasses = array('SiteTree'))
 {
     // Chris Bolt, removed file
     // Chris Bolt add site tree extension
     SiteTree::add_extension('BoltSearchIndexedSiteTree');
     $defaultColumns = array('SiteTree' => '"Title","MenuTitle","Content","MetaDescription","SearchIndex"');
     if (!is_array($searchableClasses)) {
         $searchableClasses = array($searchableClasses);
     }
     foreach ($searchableClasses as $class) {
         if (!class_exists($class)) {
             continue;
         }
         if (isset($defaultColumns[$class])) {
             Config::inst()->update($class, 'create_table_options', array(MySQLSchemaManager::ID => 'ENGINE=MyISAM'));
             $class::add_extension("FulltextSearchable('{$defaultColumns[$class]}')");
         } else {
             throw new Exception("FulltextSearchable::enable() I don't know the default search columns for class '{$class}'");
         }
     }
     self::$searchable_classes = $searchableClasses;
     if (class_exists("ContentController")) {
         ContentController::add_extension("ContentControllerSearchExtension");
     }
 }
 public function setUp()
 {
     parent::setUp();
     SiteTree::add_extension("FilesystemPublisher('assets/FilesystemPublisherTest-static-folder/')");
     Config::inst()->nest();
     Config::inst()->update('StaticPagesQueue', 'realtime', true);
     Config::inst()->update('FilesystemPublisher', 'domain_based_caching', false);
     Config::inst()->update('FilesystemPublisher', 'static_base_url', 'http://foo');
     Config::inst()->update('Director', 'alternate_base_url', 'http://foo/');
 }
 /**
  *	Activate the GoogleAnalyzer
  *
  *	@param $profile String:
  *		the Google Analytics profile ID or
  *		'SiteConfig' for using the SiteConfig to configure this value
  *	@param $email String email address of the account to use (can be left blank if configured with SiteConfig)
  *	@param $password String password for the above account (can be left blank if configured with SiteConfig)
  **/
 public static function activate($profile = 'SiteConfig', $email = null, $password = null)
 {
     switch ($profile) {
         case 'SiteConfig':
             SiteConfig::add_extension('GoogleConfig');
             break;
         default:
             self::$profile_id = $profile;
             self::$email = $email;
             self::$password = $password;
     }
     if (class_exists('SiteTree')) {
         SiteTree::add_extension('GoogleAnalyzer');
     }
 }
<?php

SiteTree::add_extension('Accessible');
 /**
  * Enables the multilingual feature
  *
  * @deprecated 2.4 Use SiteTree::add_extension('Translatable')
  */
 public static function enable()
 {
     if (class_exists('SiteTree')) {
         SiteTree::add_extension('Translatable');
     }
 }
<?php

Member::add_extension('FrameworkTestRole');
Member::add_extension('FileUploadRole');
SiteTree::add_extension('FrameworkTestSiteTreeExtension');
File::add_extension('FrameworkTestFileExtension');
if (class_exists('SiteTreeCMSWorkflow')) {
    SiteConfig::add_extension('CMSWorkflowSiteConfigDecorator');
    CMSWorkflowSiteConfigDecorator::apply_active_config();
}
Director::addRules(100, array('dev/regress/$Action/$ID' => 'FrameworktestRegressSessionAdmin'));
if (@$_GET['db']) {
    $enabletranslatable = @$_GET['enabletranslatable'];
} elseif (@$_SESSION['db']) {
    $enabletranslatable = @$_SESSION['enabletranslatable'];
} else {
    $enabletranslatable = null;
}
if ($enabletranslatable) {
    SiteTree::add_extension('Translatable');
    SiteConfig::add_extension('Translatable');
}
Exemplo n.º 7
0
<?php

SiteTree::add_extension('CarouselPage');
// Disable hash re-writing
SSViewer::setOption('rewriteHashlinks', false);
Exemplo n.º 8
0
<?php

/**
 * Copyright 2013 pixeltricks GmbH
 *
 * This file is part of the Widgetsets module.
 *
 * Widgetsets module is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * It is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this package. If not, see <http://www.gnu.org/licenses/>.
 *
 * @package Widgetsets
 * @subpackage Config
 */
SiteTree::add_extension('WidgetSetPageExtension');
ContentController::add_extension('WidgetSetPageExtension_Controller');
Widget::add_extension('WidgetSetWidgetExtension');
WidgetSetWidgetExtension::preventWidgetCreationByClass('WidgetSetWidget');
 public function testURLSegmentPrioritizesExtensionVotes()
 {
     $sitetree = new SiteTree();
     $sitetree->URLSegment = 'unique-segment';
     $this->assertTrue($sitetree->validURLSegment());
     SiteTree::add_extension('SiteTreeTest_Extension');
     $sitetree = new SiteTree();
     $sitetree->URLSegment = 'unique-segment';
     $this->assertFalse($sitetree->validURLSegment());
     SiteTree::remove_extension('SiteTreeTest_Extension');
 }
Exemplo n.º 10
0
<?php

SiteTree::add_extension('TimelinePage');
Exemplo n.º 11
0
<?php

/**
 * The subsites module modifies the behaviour of the CMS - in the SiteTree and Group databases - to store information
 * about a number of sub-sites, rather than a single site.
 */
SiteTree::add_extension('SiteTreeSubsites');
ContentController::add_extension('ControllerSubsites');
CMSPageAddController::add_extension('CMSPageAddControllerExtension');
LeftAndMain::add_extension('LeftAndMainSubsites');
LeftAndMain::add_extension('ControllerSubsites');
Group::add_extension('GroupSubsites');
ErrorPage::add_extension('ErrorPageSubsite');
SiteConfig::add_extension('SiteConfigSubsites');
SS_Report::add_excluded_reports('SubsiteReportWrapper');
//Display in cms menu
SecurityAdmin::add_extension('SubsiteMenuExtension');
CMSMain::add_extension('SubsiteMenuExtension');
CMSPagesController::add_extension('SubsiteMenuExtension');
SubsiteAdmin::add_extension('SubsiteMenuExtension');
CMSSettingsController::add_extension('SubsiteMenuExtension');
CMSMenu::remove_menu_item('SubsiteXHRController');
<?php

// add the extension to pages
if (class_exists('SiteTree')) {
    SiteTree::add_extension('GoogleSitemapSiteTreeExtension');
}
// if you need to add this to DataObjects include the following in
// your own _config:
// GoogleSiteMap::register_dataobject('MyDataObject');
<?php

// add the extension to pages
if (class_exists('SiteTree')) {
    SiteTree::add_extension('SitemapSiteTreeExtension');
}
Exemplo n.º 14
0
<?php

/**
 * Extension that adds translations vertically (eg. adds more fields to a DB table instead of
 * creating new tables).
 *
 * Well suited to add translations to DataObjects.
 *
 * This is meant as an *addition* to the SilverStripe translatable module. Hence, the
 * translatable module is a requirement: https://github.com/silverstripe/silverstripe-translatable
 */
if (!defined('TRANSLATABLE_COLUMN_SEPARATOR')) {
    define('TRANSLATABLE_COLUMN_SEPARATOR', '__');
}
SiteTree::add_extension('TranslatableUtility');
Exemplo n.º 15
0
<?php

SiteTree::add_extension("LocaleDomainSiteTreeExtension");
if (class_exists("GoogleSitemapController")) {
    GoogleSitemapController::add_extension("LocaleDomainsGoogleSitemapControllerExtension");
}
Exemplo n.º 16
0
<?php

define('MOBILE_DIR', 'mobile');
SiteConfig::add_extension('MobileSiteConfigExtension');
ContentController::add_extension('MobileSiteControllerExtension');
Security::add_extension('MobileSiteControllerExtension');
SiteTree::add_extension('MobileSiteTreeExtension');
<?php

SiteConfig::add_extension('SSTweaksSiteConfig');
SiteTree::add_extension('SSTweaksSiteTree');
Controller::add_extension('SSTweaksController');
 public function testContentTypeJSON()
 {
     SiteTree::remove_extension('FilesystemPublisher');
     SiteTree::add_extension("FilesystemPublisher('assets/FilesystemPublisherTest-static-folder/', 'php')");
     $l1 = new StaticPublisherTestPage();
     $l1->URLSegment = 'mimetype';
     $l1->write();
     $l1->doPublish();
     $response = Director::test('mimetype/json');
     $this->assertEquals($response->getHeader('Content-Type'), 'application/json', 'Content-Type should be application/json');
 }
<?php

define('SITE_TREE_ICON', basename(dirname(__FILE__)));
Config::inst()->update('LeftAndMain', 'extra_requirements_css', array(SITE_TREE_ICON . "/css/style.css" => array('media' => null)));
Config::inst()->update('LeftAndMain', 'extra_requirements_javascript', array(SITE_TREE_ICON . "/javascript/chicon.js" => array()));
SiteTree::add_extension('SiteTreeIconExtension');
<?php

SiteTree::add_extension('OrbitPage');
// Disable hash re-writing
SSViewer::setOption('rewriteHashlinks', false);
Exemplo n.º 21
0
<?php

// Define path constant
$path = str_replace('\\', '/', __DIR__);
$path_fragments = explode('/', $path);
$dir_name = $path_fragments[count($path_fragments) - 1];
define('ABC_VENDOR_PATH', $dir_name . '/thirdparty');
define('ABC_PATH', $dir_name . '/src/abc');
// Configure Image Extension
AbcImageExtension::$fallback_image = ABC_PATH . '/images/no-image.jpg';
// attach Extensions
Image::add_extension('AbcImageExtension');
File::add_extension('AbcFileExtension');
LeftAndMain::add_extension('AbcLeftAndMainExtension');
SiteTree::add_extension('AbcSiteTreeExtension');
Security::add_extension('AbcSecurityExtension');
Controller::add_extension('AbcControllerExtension');
// DatePicker config
Object::useCustomClass('DateField_View_JQuery', 'jQueryUIDateField_View');