public function testEnableWithCustomClasses() { FulltextSearchable::enable(array('File')); $this->assertTrue(File::has_extension('FulltextSearchable')); File::remove_extension('FulltextSearchable'); $this->assertFalse(File::has_extension('FulltextSearchable')); }
public function testEnableWithCustomClasses() { FulltextSearchable::enable(array('File')); $this->assertTrue(Object::has_extension('File', 'FulltextSearchable')); // TODO This shouldn't need all arguments included Object::remove_extension('File', 'FulltextSearchable(\'"Filename","Title","Content"\')'); $this->assertFalse(Object::has_extension('File', 'FulltextSearchable')); }
function testCustomSearchFormClassesToTest() { FulltextSearchable::enable('File'); $page = new Page(); $controller = new ContentController($page); $form = $controller->SearchForm(); $this->assertEquals(array('File'), $form->getClassesToSearch()); }
function setUpOnce() { // HACK Postgres doesn't refresh TSearch indexes when the schema changes after CREATE TABLE // MySQL will need a different table type self::kill_temp_db(); FulltextSearchable::enable(); self::create_temp_db(); $this->resetDBSchema(true); parent::setUpOnce(); }
function testCustomSearchFormClassesToTest() { FulltextSearchable::enable('File'); $page = new Page(); $page->URLSegment = 'whatever'; $page->Content = 'oh really?'; $page->write(); $page->publish('Stage', 'Live'); $controller = new ContentController($page); $form = $controller->SearchForm(); if (get_class($form) == 'SearchForm') $this->assertEquals(array('File'), $form->getClassesToSearch()); }
<?php global $project; $project = 'mysite'; global $databaseConfig; $databaseConfig = array("type" => 'MySQLDatabase', "server" => 'localhost', "username" => 'root', "password" => 'omega', "database" => 'vp', "path" => ''); MySQLDatabase::set_connection_charset('utf8'); // Set the current theme. More themes can be downloaded from // http://www.silverstripe.org/themes/ SSViewer::set_theme('simple'); // Set the site locale i18n::set_locale('en_US'); FulltextSearchable::enable(); // Enable nested URLs for this site (e.g. page/sub-page/) if (class_exists('SiteTree')) { SiteTree::enable_nested_urls(); } Director::set_environment_type("dev"); // add a button to remove formatting HtmlEditorConfig::get('cms')->insertButtonsBefore('styleselect', 'removeformat'); // tell the button which tags it may remove HtmlEditorConfig::get('cms')->setOption('removeformat_selector', 'b,strong,em,i,span,ins'); //remove font->span conversion HtmlEditorConfig::get('cms')->setOption('convert_fonts_to_spans', 'false,'); HtmlEditorConfig::get('cms')->setOptions(array('valid_elements' => "@[id|class|style|title],#a[id|rel|rev|dir|tabindex|accesskey|type|name|href|target|title|class],-strong/-b[class],-em/-i[class],-strike[class],-u[class],#p[id|dir|class|align|style],-ol[class],-ul[class],-li[class],br,img[id|dir|longdesc|usemap|class|src|border|alt=|title|width|height|align],-sub[class],-sup[class],-blockquote[dir|class],-table[border=0|cellspacing|cellpadding|width|height|class|align|summary|dir|id|style],-tr[id|dir|class|rowspan|width|height|align|valign|bgcolor|background|bordercolor|style],tbody[id|class|style],thead[id|class|style],tfoot[id|class|style],#td[id|dir|class|colspan|rowspan|width|height|align|valign|scope|style],-th[id|dir|class|colspan|rowspan|width|height|align|valign|scope|style],caption[id|dir|class],-h1[id|dir|class|align|style],-h2[id|dir|class|align|style],-h3[id|dir|class|align|style],-h4[id|dir|class|align|style],-h5[id|dir|class|align|style],-h6[id|dir|class|align|style],hr[class],dd[id|class|title|dir],dl[id|class|title|dir],dt[id|class|title|dir],@[id,style,class],small", 'extended_valid_elements' => "img[class|src|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name|usemap],#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]")); // TinyMCE cleanup on paste HtmlEditorConfig::get('cms')->setOption('paste_auto_cleanup_on_paste', 'true'); HtmlEditorConfig::get('cms')->setOption('paste_remove_styles', 'true'); HtmlEditorConfig::get('cms')->setOption('paste_remove_styles_if_webkit', 'true'); HtmlEditorConfig::get('cms')->setOption('paste_strip_class_attributes', 'true'); GD::set_default_quality(80);
<?php global $project; $project = 'mysite'; /** Use the _ss_environment.php file for configuration */ require_once 'conf/ConfigureFromEnv.php'; /** Set default language */ i18n::set_locale('en_US'); /** Uncomment to control SSL and www */ if (!Director::is_cli() && Director::isLive()) { // Director::forceWWW(); // Director::forceSSL(); } define('PROJECT_THIRDPARTY_DIR', project() . '/thirdparty'); define('PROJECT_THIRDPARTY_PATH', project() . '/' . PROJECT_THIRDPARTY_DIR); FulltextSearchable::enable(array('SiteTree')); /** * it is suggested to set SS_ERROR_LOG in _ss_environment.php to enable logging, * alternatively you can use the line below for your custom logging settings * SS_Log::add_writer(new SS_LogFileWriter('../silverstripe-errors.log'), SS_Log::ERR); */ if (!Director::isLive()) { /** * set settings that should only be in dev and test */ } else { /** * we are in live mode, send errors per email */ SS_Log::add_writer(new SS_LogEmailWriter('*****@*****.**'), SS_Log::ERR); }
public function setUpOnce() { parent::setUpOnce(); FulltextSearchable::enable('File'); }
<?php global $project; $project = 'mysite'; global $database; $database = 'silverstripe_webdevelopment_com'; require_once "conf/ConfigureFromEnv.php"; //===================---------------- START php MODULE ----------------=================== date_default_timezone_set('Pacific/Auckland'); //===================---------------- END php MODULE ----------------=================== //===================---------------- START sapphire MODULE ----------------=================== FulltextSearchable::enable(array("SiteTree")); if (Director::isLive()) { Director::forceWWW(); SS_Log::add_writer(new SS_LogEmailWriter('*****@*****.**'), SS_Log::ERR); } else { //BasicAuth::protect_entire_site(); see config.yml } //===================---------------- END sapphire MODULE ----------------===================