本文整理汇总了PHP中SiteTree::add_extension方法的典型用法代码示例。如果您正苦于以下问题:PHP SiteTree::add_extension方法的具体用法?PHP SiteTree::add_extension怎么用?PHP SiteTree::add_extension使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SiteTree
的用法示例。
在下文中一共展示了SiteTree::add_extension方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: enable
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");
}
}
示例2: setUp
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/');
}
示例3: activate
/**
* 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');
}
}
示例4:
<?php
SiteTree::add_extension('Accessible');
示例5: enable
/**
* Enables the multilingual feature
*
* @deprecated 2.4 Use SiteTree::add_extension('Translatable')
*/
public static function enable()
{
if (class_exists('SiteTree')) {
SiteTree::add_extension('Translatable');
}
}
示例6: array
<?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');
}
示例7:
<?php
SiteTree::add_extension('CarouselPage');
// Disable hash re-writing
SSViewer::setOption('rewriteHashlinks', false);
示例8:
<?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');
示例9: testURLSegmentPrioritizesExtensionVotes
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');
}
示例10:
<?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');
示例11:
<?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');
示例12:
<?php
// add the extension to pages
if (class_exists('SiteTree')) {
SiteTree::add_extension('SitemapSiteTreeExtension');
}
示例13: define
<?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');
示例14:
<?php
SiteTree::add_extension("LocaleDomainSiteTreeExtension");
if (class_exists("GoogleSitemapController")) {
GoogleSitemapController::add_extension("LocaleDomainsGoogleSitemapControllerExtension");
}
示例15: define
<?php
define('MOBILE_DIR', 'mobile');
SiteConfig::add_extension('MobileSiteConfigExtension');
ContentController::add_extension('MobileSiteControllerExtension');
Security::add_extension('MobileSiteControllerExtension');
SiteTree::add_extension('MobileSiteTreeExtension');