当前位置: 首页>>代码示例>>PHP>>正文


PHP SiteTree::add_extension方法代码示例

本文整理汇总了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");
     }
 }
开发者ID:christopherbolt,项目名称:silverstripe-bolttools,代码行数:25,代码来源:BoltFulltextSearchable.php

示例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/');
 }
开发者ID:spark-green,项目名称:silverstripe-staticpublishqueue,代码行数:10,代码来源:FilesystemPublisherTest.php

示例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');
     }
 }
开发者ID:helpfulrobot,项目名称:jelicanin-silverstripe-googleanalytics,代码行数:24,代码来源:GoogleAnalyzer.php

示例4:

<?php

SiteTree::add_extension('Accessible');
开发者ID:helpfulrobot,项目名称:silverstripe-accessibility,代码行数:3,代码来源:_config.php

示例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');
     }
 }
开发者ID:camfindlay,项目名称:silverstripe-translatable,代码行数:11,代码来源:Translatable.php

示例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');
}
开发者ID:helpfulrobot,项目名称:silverstripe-frameworktest,代码行数:22,代码来源:_config.php

示例7:

<?php

SiteTree::add_extension('CarouselPage');
// Disable hash re-writing
SSViewer::setOption('rewriteHashlinks', false);
开发者ID:i-lateral,项目名称:silverstripe-carousel,代码行数:5,代码来源:_config.php

示例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');
开发者ID:silvercart,项目名称:widgetsets,代码行数:27,代码来源:_config.php

示例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');
 }
开发者ID:fanggu,项目名称:loveyourwater_ss_v3.1.6,代码行数:11,代码来源:SiteTreeTest.php

示例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');
开发者ID:mikenz,项目名称:silverstripe-simplesubsites,代码行数:22,代码来源:_config.php

示例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');
开发者ID:helpfulrobot,项目名称:silverstripe-googlesitemaps,代码行数:9,代码来源:_config.php

示例12:

<?php

// add the extension to pages
if (class_exists('SiteTree')) {
    SiteTree::add_extension('SitemapSiteTreeExtension');
}
开发者ID:helpfulrobot,项目名称:silverstripe-australia-sitemap,代码行数:6,代码来源:_config.php

示例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');
开发者ID:bummzack,项目名称:translatable-dataobject,代码行数:15,代码来源:_config.php

示例14:

<?php

SiteTree::add_extension("LocaleDomainSiteTreeExtension");
if (class_exists("GoogleSitemapController")) {
    GoogleSitemapController::add_extension("LocaleDomainsGoogleSitemapControllerExtension");
}
开发者ID:xini,项目名称:silverstripe-localedomains,代码行数:6,代码来源:_config.php

示例15: define

<?php

define('MOBILE_DIR', 'mobile');
SiteConfig::add_extension('MobileSiteConfigExtension');
ContentController::add_extension('MobileSiteControllerExtension');
Security::add_extension('MobileSiteControllerExtension');
SiteTree::add_extension('MobileSiteTreeExtension');
开发者ID:helpfulrobot,项目名称:silverstripe-mobile,代码行数:7,代码来源:_config.php


注:本文中的SiteTree::add_extension方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。