本文整理汇总了PHP中SiteConfig::add_extension方法的典型用法代码示例。如果您正苦于以下问题:PHP SiteConfig::add_extension方法的具体用法?PHP SiteConfig::add_extension怎么用?PHP SiteConfig::add_extension使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SiteConfig
的用法示例。
在下文中一共展示了SiteConfig::add_extension方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: activate
public static function activate($code = null)
{
switch ($code) {
case null:
self::$google_analytics_code = null;
break;
case 'SiteConfig':
SiteConfig::add_extension('GoogleAnalyticsLiteConfig');
break;
default:
self::$google_analytics_code = $code;
}
Controller::add_extension('GoogleLiteLogger');
}
示例2: 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');
}
}
示例3: activate
/**
* Activate the GoogleLogger
*
* @param $code mixed:
* String the Google Analytics code to be used in the JS snippet or
* String 'SiteConfig' for using the SiteConfig to configure this value or
* Null if you hardcode the JS snippet into your template. The JS snippet will not be included through Requirements
*
**/
public static function activate($code = null)
{
switch ($code) {
case null:
self::$google_analytics_code = null;
break;
case 'SiteConfig':
SiteConfig::add_extension('GoogleConfig');
break;
default:
self::$google_analytics_code = $code;
}
Controller::add_extension('GoogleLogger');
if (substr(GoogleAnalyzer::get_sapphire_version(), 0, 3) == '2.3') {
Director::add_callback(array("GoogleLogger", "onAfterInit23"));
}
}
示例4: str_replace
<?php
// Define path constant
$path = str_replace('\\', '/', __DIR__);
$path_fragments = explode('/', $path);
$dir_name = $path_fragments[count($path_fragments) - 1];
define('ABC_SOCIAL_DIR', $dir_name);
// attach the social extensions to the config and page classes
SiteConfig::add_extension('SocialMediaConfig');
Page::add_extension('SocialMediaPageExtension');
// attach common behaviours to the social updates
FBUpdate::add_extension('SocialUpdatePageExtension');
Tweet::add_extension('SocialUpdatePageExtension');
InstagramUpdate::add_extension('SocialUpdatePageExtension');
// add the embed functionality
if (!Config::inst()->get('SocialGlobalConf', 'disable_wysiwyg_embed')) {
ShortcodeParser::get('default')->register('social_embed', array('SocialMediaPageExtension', 'SocialEmbedParser'));
HtmlEditorConfig::get('cms')->enablePlugins(array('social_embed' => '../../../' . ABC_SOCIAL_DIR . '/js/editor-plugin.js'));
HtmlEditorConfig::get('cms')->addButtonsToLine(2, 'social_embed');
}
// allow script tags
// maybe we could try using requirements and stripping the script tags
// HtmlEditorConfig::get('cms')
// ->setOption(
// 'extended_valid_elements',
// 'img[class|src|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name|usemap|data*],' .
// 'iframe[src|name|width|height|align|frameborder|marginwidth|marginheight|scrolling],' .
// 'object[width|height|data|type],' .
// 'param[name|value],' .
// 'map[class|name|id],' .
// 'area[shape|coords|href|target|alt],ol[class|start],' .
示例5:
<?php
SiteConfig::add_extension('GamesSiteConfig');
示例6: define
<?php
define('MOBILE_DIR', 'mobile');
SiteConfig::add_extension('MobileSiteConfigExtension');
ContentController::add_extension('MobileSiteControllerExtension');
Security::add_extension('MobileSiteControllerExtension');
SiteTree::add_extension('MobileSiteTreeExtension');
示例7: define
<?php
define("SOCIALLINKS_PATH", __DIR__);
SiteConfig::add_extension("SiteConfig_SocialLinks");
示例8:
<?php
// If subsites is installed
if (class_exists('Users_Account_Controller')) {
Users_Account_Controller::add_extension('OrdersUserAccountControllerExtension');
Member::add_extension('OrdersMemberExtension');
}
// If subsites is installed
if (class_exists('Subsite')) {
Order::add_extension('SubsitesOrdersExtension');
OrderAdmin::add_extension('SubsiteMenuExtension');
}
// If subsites is installed
if (class_exists('SiteConfig')) {
SiteConfig::add_extension('OrdersSiteConfigExtension');
}
示例9: getTempFolder
*
* CustomHtmlForms 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 CustomHtmlForms. If not, see <http://www.gnu.org/licenses/>.
*
* @package CustomHtmlForm
* @subpackage Config
* @ignore
*/
ContentController::add_extension('CustomHtmlFormPage_Controller');
Security::add_extension('CustomHtmlFormPage_Controller');
SiteConfig::add_extension('CustomHtmlFormConfiguration');
$cacheBaseDir = getTempFolder() . DIRECTORY_SEPARATOR . 'cache';
$cacheDir = $cacheBaseDir . DIRECTORY_SEPARATOR . 'CustomHtmlForm';
if (Director::isDev()) {
$cachelifetime = 1;
} else {
$cachelifetime = 86400;
}
if (!is_dir($cacheDir)) {
if (!is_dir($cacheBaseDir)) {
mkdir($cacheBaseDir);
}
mkdir($cacheDir);
}
if (class_exists('SilvercartCleanCacheTask')) {
SilvercartCleanCacheTask::register_cache_directory($cacheDir);
示例10: 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');
}
示例11:
<?php
SiteConfig::add_extension('SSTweaksSiteConfig');
SiteTree::add_extension('SSTweaksSiteTree');
Controller::add_extension('SSTweaksController');
示例12:
<?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');
示例13: define
<?php
// define this directory
define('DEVTOOLS_DIR', 'dev-tools');
// create definition of site name (based on SS_PRIMARY_DOMAIN)
$siteName = SS_PRIMARY_DOMAIN;
$siteName = str_replace('http://', '', $siteName);
$siteName = str_replace('https://', '', $siteName);
$siteName = str_replace('.', '_', $siteName);
define('SS_SITE_NAME', $siteName);
// detect if we're using the old domain and need to flag the issue
$fullDomain = (!empty($_SERVER['HTTPS']) ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'];
if ($fullDomain != SS_PRIMARY_DOMAIN && SS_ENVIRONMENT_TYPE == 'live') {
define('DEVTOOLS_ISOLDDOMAIN', true);
// if we're disabled, include our cms-disabling javascript
Requirements::customScript('var ss_primary_domain = "' . SS_PRIMARY_DOMAIN . '";');
LeftAndMain::require_javascript(DEVTOOLS_DIR . '/js/disable-cms.js');
} else {
define('DEVTOOLS_ISOLDDOMAIN', false);
}
// add functionality to SiteTree
ContentController::add_extension('DebugTools_ContentControllerExtension');
SiteConfig::add_extension('DebugTools_SiteConfigExtension');
Member::add_extension('DebugTools_MemberExtension');
// include css
LeftAndMain::require_css(DEVTOOLS_DIR . '/css/cms.css');
// specify editor css file (this needs to be pure CSS, not SCSS)
HtmlEditorConfig::get('cms')->setOption('content_css', '/site/cms/editor.css');
// enable our log jam logger
LogJam::EnableLog();
示例14:
<?php
// Extentions
SiteConfig::add_extension('Ext_Commerce_SiteConfig');
Image::add_extension('Ext_Commerce_Image');
Controller::add_extension('Ext_Commerce_Controller');
Group::add_extension('Ext_Commerce_Group');
Member::add_extension('Ext_Commerce_Member');
if (class_exists('Users_Account_Controller')) {
Users_Account_Controller::add_extension('Ext_Commerce_UsersController');
}
// If subsites is installed
if (class_exists('Subsite')) {
Product::add_extension('Ext_Subsites_CommerceObject');
ProductCategory::add_extension('Ext_Subsites_CommerceObject');
Order::add_extension('Ext_Subsites_CommerceObject');
CatalogueAdmin::add_extension('SubsiteMenuExtension');
LocaliseAdmin::add_extension('SubsiteMenuExtension');
OrderAdmin::add_extension('SubsiteMenuExtension');
}
LeftAndMain::add_extension('Ext_Commerce_LeftAndMain');
// Setup google sitemaps
if (class_exists("GoogleSitemap")) {
GoogleSitemap::register_dataobject('Product');
GoogleSitemap::register_dataobject('ProductCategory');
}
示例15:
<?php
SiteConfig::add_extension("ContactDetailsConfig");
Page::add_extension('ContactDetailsExtension');