API-CHANGE sapphire folder can now be renamed.

This commit is contained in:
Simon Welsh 2012-03-24 16:38:57 +13:00 committed by Sean Harvey
parent f8082e4814
commit 3a6341a251
174 changed files with 618 additions and 585 deletions

View File

@ -5,13 +5,13 @@ Requires a [`silverstripe-installer`](http://github.com/silverstripe/silverstrip
## Installation ##
See [installation on different platforms](http://doc.silverstripe.org/sapphire/en/installation/),
and [installation from source](http://doc.silverstripe.org/sapphire/en/installation/from-source).
See [installation on different platforms](http://doc.silverstripe.org/framework/en/installation/),
and [installation from source](http://doc.silverstripe.org/framework/en/installation/from-source).
## Links ##
* [Requirements](http://doc.silverstripe.org/sapphire/en/installation/server-requirements)
* [Changelogs](http://doc.silverstripe.org/sapphire/en/changelogs/)
* [Requirements](http://doc.silverstripe.org/framework/en/installation/server-requirements)
* [Changelogs](http://doc.silverstripe.org/framework/en/changelogs/)
* [Bugtracker](http://open.silverstripe.org)
* [Forums](http://silverstripe.org/forums)
* [Developer Mailinglist](https://groups.google.com/forum/#!forum/silverstripe-dev)

View File

@ -1,9 +1,9 @@
<?php
/**
* Sapphire configuration file
* Framework configuration file
*
* Here you can make different settings for the Sapphire module (the core
* Here you can make different settings for the Framework module (the core
* module).
*
* For example you can register the authentication methods you wish to use
@ -45,7 +45,7 @@ Object::useCustomClass('Datetime', 'SS_Datetime', true);
/**
* The root directory of TinyMCE
*/
define('MCE_ROOT', 'sapphire/thirdparty/tinymce/');
define('MCE_ROOT', FRAMEWORK_DIR . '/thirdparty/tinymce/');
ShortcodeParser::get('default')->register('file_link', array('File', 'link_shortcode_handler'));

View File

@ -5,7 +5,7 @@ DatabaseAdapterRegistry::register(
array(
'class' => 'MySQLDatabase',
'title' => 'MySQL 5.0+',
'helperPath' => 'sapphire/dev/install/MySQLDatabaseConfigurationHelper.php',
'helperPath' => FRAMEWORK_PATH . '/dev/install/MySQLDatabaseConfigurationHelper.php',
'supported' => function_exists('mysql_connect'),
)
);

View File

@ -22,7 +22,8 @@ HtmlEditorConfig::get('cms')->setOptions(array(
'use_native_selects' => true, // fancy selects are bug as of SS 2.3.0
'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],-div[id|dir|class|align|style],-span[class|align|style],-pre[class|align],address[class|align],-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]",
'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]"
'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]",
'spellchecker_rpc_url' => THIRDPARTY_DIR . '/tinymce-spellchecker/rpc.php'
));
HtmlEditorConfig::get('cms')->enablePlugins('media', 'fullscreen');

View File

@ -209,7 +209,7 @@ class LeftAndMain extends Controller implements PermissionProvider {
$htmlEditorConfig->setOption('language', i18n::get_tinymce_lang());
if(!$htmlEditorConfig->getOption('content_css')) {
$cssFiles = array();
$cssFiles[] = 'sapphire/admin/css/editor.css';
$cssFiles[] = FRAMEWORK_ADMIN_DIR . '/css/editor.css';
// Use theme from the site config
if(class_exists('SiteConfig') && ($config = SiteConfig::current_site_config()) && $config->Theme) {
@ -241,32 +241,32 @@ class LeftAndMain extends Controller implements PermissionProvider {
array(
THIRDPARTY_DIR . '/jquery/jquery.js',
THIRDPARTY_DIR . '/jquery-livequery/jquery.livequery.js',
SAPPHIRE_DIR . '/javascript/jquery-ondemand/jquery.ondemand.js',
SAPPHIRE_DIR . '/admin/javascript/lib.js',
FRAMEWORK_DIR . '/javascript/jquery-ondemand/jquery.ondemand.js',
FRAMEWORK_ADMIN_DIR . '/javascript/lib.js',
THIRDPARTY_DIR . '/jquery-ui/jquery-ui.js',
THIRDPARTY_DIR . '/json-js/json2.js',
THIRDPARTY_DIR . '/jquery-entwine/dist/jquery.entwine-dist.js',
THIRDPARTY_DIR . '/jquery-cookie/jquery.cookie.js',
THIRDPARTY_DIR . '/jquery-query/jquery.query.js',
THIRDPARTY_DIR . '/jquery-form/jquery.form.js',
SAPPHIRE_ADMIN_DIR . '/thirdparty/jquery-notice/jquery.notice.js',
SAPPHIRE_ADMIN_DIR . '/thirdparty/jsizes/lib/jquery.sizes.js',
SAPPHIRE_ADMIN_DIR . '/thirdparty/jlayout/lib/jlayout.border.js',
SAPPHIRE_ADMIN_DIR . '/thirdparty/jlayout/lib/jquery.jlayout.js',
SAPPHIRE_ADMIN_DIR . '/thirdparty/history-js/scripts/uncompressed/history.js',
SAPPHIRE_ADMIN_DIR . '/thirdparty/history-js/scripts/uncompressed/history.adapter.jquery.js',
SAPPHIRE_ADMIN_DIR . '/thirdparty/history-js/scripts/uncompressed/history.html4.js',
FRAMEWORK_ADMIN_DIR . '/thirdparty/jquery-notice/jquery.notice.js',
FRAMEWORK_ADMIN_DIR . '/thirdparty/jsizes/lib/jquery.sizes.js',
FRAMEWORK_ADMIN_DIR . '/thirdparty/jlayout/lib/jlayout.border.js',
FRAMEWORK_ADMIN_DIR . '/thirdparty/jlayout/lib/jquery.jlayout.js',
FRAMEWORK_ADMIN_DIR . '/thirdparty/history-js/scripts/uncompressed/history.js',
FRAMEWORK_ADMIN_DIR . '/thirdparty/history-js/scripts/uncompressed/history.adapter.jquery.js',
FRAMEWORK_ADMIN_DIR . '/thirdparty/history-js/scripts/uncompressed/history.html4.js',
THIRDPARTY_DIR . '/jstree/jquery.jstree.js',
SAPPHIRE_ADMIN_DIR . '/thirdparty/chosen/chosen/chosen.jquery.js',
SAPPHIRE_ADMIN_DIR . '/thirdparty/jquery-hoverIntent/jquery.hoverIntent.js',
SAPPHIRE_ADMIN_DIR . '/javascript/jquery-changetracker/lib/jquery.changetracker.js',
SAPPHIRE_DIR . '/javascript/TreeDropdownField.js',
SAPPHIRE_DIR . '/javascript/DateField.js',
SAPPHIRE_DIR . '/javascript/HtmlEditorField.js',
SAPPHIRE_DIR . '/javascript/TabSet.js',
SAPPHIRE_DIR . '/javascript/i18n.js',
SAPPHIRE_ADMIN_DIR . '/javascript/ssui.core.js',
SAPPHIRE_DIR . '/javascript/GridField.js',
FRAMEWORK_ADMIN_DIR . '/thirdparty/chosen/chosen/chosen.jquery.js',
FRAMEWORK_ADMIN_DIR . '/thirdparty/jquery-hoverIntent/jquery.hoverIntent.js',
FRAMEWORK_ADMIN_DIR . '/javascript/jquery-changetracker/lib/jquery.changetracker.js',
FRAMEWORK_DIR . '/javascript/TreeDropdownField.js',
FRAMEWORK_DIR . '/javascript/DateField.js',
FRAMEWORK_DIR . '/javascript/HtmlEditorField.js',
FRAMEWORK_DIR . '/javascript/TabSet.js',
FRAMEWORK_DIR . '/javascript/i18n.js',
FRAMEWORK_ADMIN_DIR . '/javascript/ssui.core.js',
FRAMEWORK_DIR . '/javascript/GridField.js',
)
);
@ -276,36 +276,36 @@ class LeftAndMain extends Controller implements PermissionProvider {
'leftandmain.js',
array_unique(array_merge(
array(
SAPPHIRE_ADMIN_DIR . '/javascript/LeftAndMain.js',
SAPPHIRE_ADMIN_DIR . '/javascript/LeftAndMain.Panel.js',
SAPPHIRE_ADMIN_DIR . '/javascript/LeftAndMain.Tree.js',
SAPPHIRE_ADMIN_DIR . '/javascript/LeftAndMain.Ping.js',
SAPPHIRE_ADMIN_DIR . '/javascript/LeftAndMain.Content.js',
SAPPHIRE_ADMIN_DIR . '/javascript/LeftAndMain.EditForm.js',
SAPPHIRE_ADMIN_DIR . '/javascript/LeftAndMain.Menu.js',
SAPPHIRE_ADMIN_DIR . '/javascript/LeftAndMain.AddForm.js',
SAPPHIRE_ADMIN_DIR . '/javascript/LeftAndMain.Preview.js',
SAPPHIRE_ADMIN_DIR . '/javascript/LeftAndMain.BatchActions.js',
FRAMEWORK_ADMIN_DIR . '/javascript/LeftAndMain.js',
FRAMEWORK_ADMIN_DIR . '/javascript/LeftAndMain.Panel.js',
FRAMEWORK_ADMIN_DIR . '/javascript/LeftAndMain.Tree.js',
FRAMEWORK_ADMIN_DIR . '/javascript/LeftAndMain.Ping.js',
FRAMEWORK_ADMIN_DIR . '/javascript/LeftAndMain.Content.js',
FRAMEWORK_ADMIN_DIR . '/javascript/LeftAndMain.EditForm.js',
FRAMEWORK_ADMIN_DIR . '/javascript/LeftAndMain.Menu.js',
FRAMEWORK_ADMIN_DIR . '/javascript/LeftAndMain.AddForm.js',
FRAMEWORK_ADMIN_DIR . '/javascript/LeftAndMain.Preview.js',
FRAMEWORK_ADMIN_DIR . '/javascript/LeftAndMain.BatchActions.js',
),
Requirements::add_i18n_javascript(SAPPHIRE_DIR . '/javascript/lang', true, true),
Requirements::add_i18n_javascript(SAPPHIRE_ADMIN_DIR . '/javascript/lang', true, true)
Requirements::add_i18n_javascript(FRAMEWORK_DIR . '/javascript/lang', true, true),
Requirements::add_i18n_javascript(FRAMEWORK_ADMIN_DIR . '/javascript/lang', true, true)
))
);
Requirements::css(SAPPHIRE_ADMIN_DIR . '/thirdparty/jquery-notice/jquery.notice.css');
Requirements::css(FRAMEWORK_ADMIN_DIR . '/thirdparty/jquery-notice/jquery.notice.css');
Requirements::css(THIRDPARTY_DIR . '/jquery-ui-themes/smoothness/jquery-ui.css');
Requirements::css(SAPPHIRE_ADMIN_DIR .'/thirdparty/chosen/chosen/chosen.css');
Requirements::css(FRAMEWORK_ADMIN_DIR .'/thirdparty/chosen/chosen/chosen.css');
Requirements::css(THIRDPARTY_DIR . '/jstree/themes/apple/style.css');
Requirements::css(SAPPHIRE_DIR . '/css/TreeDropdownField.css');
Requirements::css(SAPPHIRE_ADMIN_DIR . '/css/screen.css');
Requirements::css(SAPPHIRE_DIR . '/css/GridField.css');
Requirements::css(FRAMEWORK_DIR . '/css/TreeDropdownField.css');
Requirements::css(FRAMEWORK_ADMIN_DIR . '/css/screen.css');
Requirements::css(FRAMEWORK_DIR . '/css/GridField.css');
// Browser-specific requirements
$ie = isset($_SERVER['HTTP_USER_AGENT']) ? strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') : false;
if($ie) {
$version = substr($_SERVER['HTTP_USER_AGENT'], $ie + 5, 3);
if($version == 7) Requirements::css('sapphire/admin/css/ie7.css');
else if($version == 8) Requirements::css('sapphire/admin/css/ie8.css');
if($version == 7) Requirements::css(FRAMEWORK_ADMIN_DIR . '/css/ie7.css');
else if($version == 8) Requirements::css(FRAMEWORK_ADMIN_DIR . '/css/ie8.css');
}
// Custom requirements
@ -1078,7 +1078,7 @@ class LeftAndMain extends Controller implements PermissionProvider {
$form->setActions(null);
Requirements::clear();
Requirements::css(SAPPHIRE_ADMIN_DIR . '/css/LeftAndMain_printable.css');
Requirements::css(FRAMEWORK_ADMIN_DIR . '/css/LeftAndMain_printable.css');
return array(
"PrintForm" => $form
);
@ -1175,11 +1175,11 @@ class LeftAndMain extends Controller implements PermissionProvider {
if(defined('CMS_PATH') && file_exists(CMS_PATH . '/silverstripe_version')) {
$sapphireVersion = file_get_contents(CMS_PATH . '/silverstripe_version');
} else {
$sapphireVersion = file_get_contents(SAPPHIRE_PATH . '/silverstripe_version');
$sapphireVersion = file_get_contents(FRAMEWORK_PATH . '/silverstripe_version');
}
if(!$sapphireVersion) $sapphireVersion = _t('LeftAndMain.VersionUnknown', 'unknown');
return sprintf(
"sapphire: %s",
"SilverStripe: %s",
$sapphireVersion
);
}
@ -1313,7 +1313,7 @@ class LeftAndMain extends Controller implements PermissionProvider {
/**
* Register the given javascript file as required in the CMS.
* Filenames should be relative to the base, eg, SAPPHIRE_DIR . '/javascript/loader.js'
* Filenames should be relative to the base, eg, FRAMEWORK_DIR . '/javascript/loader.js'
*/
public static function require_javascript($file) {
self::$extra_requirements['javascript'][] = array($file);

View File

@ -57,8 +57,8 @@ class MemberImportForm extends Form {
parent::__construct($controller, $name, $fields, $actions, $validator);
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery-entwine/dist/jquery.entwine-dist.js');
Requirements::javascript(SAPPHIRE_ADMIN_DIR . '/javascript/MemberImportForm.js');
Requirements::javascript(FRAMEWORK_DIR . '/thirdparty/jquery-entwine/dist/jquery.entwine-dist.js');
Requirements::javascript(FRAMEWORK_ADMIN_DIR . '/javascript/MemberImportForm.js');
$this->addExtraClass('cms');
$this->addExtraClass('import-form');

View File

@ -110,7 +110,7 @@ abstract class ModelAdmin extends LeftAndMain {
user_error('ModelAdmin::init(): Invalid Model class', E_USER_ERROR);
}
Requirements::javascript(SAPPHIRE_ADMIN_DIR . '/javascript/ModelAdmin.js');
Requirements::javascript(FRAMEWORK_ADMIN_DIR . '/javascript/ModelAdmin.js');
}
function getEditForm($id = null, $fields = null) {

View File

@ -31,7 +31,7 @@ class SecurityAdmin extends LeftAndMain implements PermissionProvider {
public function init() {
parent::init();
Requirements::javascript(SAPPHIRE_ADMIN_DIR . '/javascript/SecurityAdmin.js');
Requirements::javascript(FRAMEWORK_ADMIN_DIR . '/javascript/SecurityAdmin.js');
}
public function getEditForm($id = null, $fields = null) {
@ -133,12 +133,12 @@ class SecurityAdmin extends LeftAndMain implements PermissionProvider {
public function memberimport() {
Requirements::clear();
Requirements::css(SAPPHIRE_ADMIN_DIR . '/css/screen.css');
Requirements::css(FRAMEWORK_ADMIN_DIR . '/css/screen.css');
Requirements::javascript(THIRDPARTY_DIR . '/jquery/jquery.js');
Requirements::javascript(THIRDPARTY_DIR . '/jquery-livequery/jquery.livequery.js');
Requirements::css(SAPPHIRE_ADMIN_DIR . '/css/MemberImportForm.css');
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery-entwine/dist/jquery.entwine-dist.js');
Requirements::javascript(SAPPHIRE_ADMIN_DIR . '/javascript/MemberImportForm.js');
Requirements::css(FRAMEWORK_ADMIN_DIR . '/css/MemberImportForm.css');
Requirements::javascript(FRAMEWORK_DIR . '/thirdparty/jquery-entwine/dist/jquery.entwine-dist.js');
Requirements::javascript(FRAMEWORK_ADMIN_DIR . '/javascript/MemberImportForm.js');
return $this->renderWith('BlankPage', array(
'Form' => $this->MemberImportForm()->forTemplate(),
@ -164,12 +164,12 @@ class SecurityAdmin extends LeftAndMain implements PermissionProvider {
public function groupimport() {
Requirements::clear();
Requirements::css(SAPPHIRE_ADMIN_DIR . '/css/screen.css');
Requirements::css(FRAMEWORK_ADMIN_DIR . '/css/screen.css');
Requirements::javascript(THIRDPARTY_DIR . '/jquery/jquery.js');
Requirements::javascript(THIRDPARTY_DIR . '/jquery-livequery/jquery.livequery.js');
Requirements::css(SAPPHIRE_ADMIN_DIR . '/css/MemberImportForm.css');
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery-entwine/dist/jquery.entwine-dist.js');
Requirements::javascript(SAPPHIRE_ADMIN_DIR . '/javascript/MemberImportForm.js');
Requirements::css(FRAMEWORK_ADMIN_DIR . '/css/MemberImportForm.css');
Requirements::javascript(FRAMEWORK_DIR . '/thirdparty/jquery-entwine/dist/jquery.entwine-dist.js');
Requirements::javascript(FRAMEWORK_ADMIN_DIR . '/javascript/MemberImportForm.js');
return $this->renderWith('BlankPage', array(
'Content' => ' ',

View File

@ -159,10 +159,10 @@
},
'themes': {
'theme': 'apple',
'url': 'sapphire/thirdparty/jstree/themes/apple/style.css'
'url': $('body').data('frameworkpath') + '/thirdparty/jstree/themes/apple/style.css'
},
// Caution: SilverStripe has disabled $.vakata.css.add_sheet() for performance reasons,
// which means you need to add any CSS manually to sapphire/admin/scss/_tree.css
// which means you need to add any CSS manually to framework/admin/scss/_tree.css
'plugins': [
'html_data', 'ui', 'dnd', 'crrm', 'themes',
'checkbox' // checkboxes are hidden unless .multiple is set

View File

@ -1,6 +1,6 @@
/**
* This file defines common styles for form elements used throughout the CMS interface.
* It is an addition to the base styles defined in sapphire/css/Form.css.
* It is an addition to the base styles defined in framework/css/Form.css.
*
* @package sapphire
* @subpackage admin

View File

@ -1,6 +1,6 @@
<div class="ss-loading-screen">
<div class="loading-logo">
<img class="loading-animation" src="sapphire/admin/images/spinner.gif" alt="<% _t('LOADING','Loading...',PR_HIGH) %>" />
<img class="loading-animation" src="$FrameworkAdminDir/images/spinner.gif" alt="<% _t('LOADING','Loading...',PR_HIGH) %>" />
<noscript><p class="nojs-warning"><span class="message notice"><% _t('REQUIREJS','The CMS requires that you have JavaScript enabled.',PR_HIGH) %></span></p></noscript>
</div>
</div>

View File

@ -7,7 +7,7 @@
<title>$Title</title>
</head>
<body class="loading cms" lang="$Locale.RFC1766">
<body class="loading cms" lang="$Locale.RFC1766" data-frameworkpath="$FrameworkDir">
<% include CMSLoadingScreen %>

View File

@ -5,7 +5,7 @@
*/
class LeftAndMainTest extends FunctionalTest {
static $fixture_file = 'sapphire/admin/tests/LeftAndMainTest.yml';
static $fixture_file = 'LeftAndMainTest.yml';
protected $extraDataObjects = array('LeftAndMainTest_Object');

View File

@ -1,7 +1,7 @@
<?php
class ModelAdminTest extends FunctionalTest {
static $fixture_file = 'sapphire/admin/tests/ModelAdminTest.yml';
static $fixture_file = 'ModelAdminTest.yml';
protected $extraDataObjects = array(
'ModelAdminTest_Admin',

View File

@ -5,7 +5,7 @@
*/
class SecurityAdminTest extends FunctionalTest {
static $fixture_file = 'sapphire/admin/tests/LeftAndMainTest.yml';
static $fixture_file = 'LeftAndMainTest.yml';
protected $extraDataObjects = array('LeftAndMainTest_Object');

View File

@ -1,6 +1,6 @@
<?php
/**
* A DataFormatter object handles transformation of data from Sapphire model objects to a particular output format, and vice versa.
* A DataFormatter object handles transformation of data from SilverStripe model objects to a particular output format, and vice versa.
* This is most commonly used in developing RESTful APIs.
*
* @package sapphire

View File

@ -1,10 +1,10 @@
<?php
/**
* Sapphire's generic RESTful server.
* SilverStripe's generic RESTful server.
*
* This class gives your application a RESTful API for free. All you have to do is define static $api_access = true on
* the appropriate DataObjects. You will need to ensure that all of your data manipulation and security is defined in
* your model layer (ie, the DataObject classes) and not in your Controllers. This is the recommended design for Sapphire
* your model layer (ie, the DataObject classes) and not in your Controllers. This is the recommended design for SilverStripe
* applications.
*
* Enabling restful access on a model will also enable a SOAP API, see {@link SOAPModelAccess}.

View File

@ -3,7 +3,7 @@
/**
* File similar to main.php designed for command-line scripts
*
* This file lets you execute Sapphire requests from the command-line. The URL is passed as the first argument to the scripts.
* This file lets you execute SilverStripe requests from the command-line. The URL is passed as the first argument to the scripts.
*
* @package sapphire
* @subpackage core
@ -57,7 +57,7 @@ if(isset($_SERVER['argv'][1])) {
}
/**
* Include Sapphire's core code
* Include SilverStripe's core code
*/
require_once("core/Core.php");

View File

@ -1,8 +1,8 @@
<?php
/**
* Configure Sapphire from the _ss_environment.php file.
* Usage: Put "require_once('../sapphire/conf/ConfigureFromEnv.php');" into your _config.php file.
* Configure SilverStripe from the _ss_environment.php file.
* Usage: Put "require_once('conf/ConfigureFromEnv.php');" into your _config.php file.
*
* If you include this file, you will be able to use the following defines in _ss_environment.php to control
* your site.

View File

@ -1,7 +1,7 @@
<?php
/**
* Base controller class.
* Controllers are the cornerstone of all site functionality in Sapphire. The {@link Director}
* Controllers are the cornerstone of all site functionality in SilverStripe. The {@link Director}
* selects a controller to pass control to, and then calls {@link run()}. This method will execute
* the appropriate action - either by calling the action method, or displaying the action's template.
*

View File

@ -715,7 +715,7 @@ class Director implements TemplateGlobalProvider {
* The behaviour of these environments often varies slightly. For example, development sites may have errors dumped to the screen,
* and order confirmation emails might be sent to the developer instead of the client.
*
* To help with this, Sapphire support the notion of an environment type. The environment type can be dev, test, or live.
* To help with this, SilverStripe supports the notion of an environment type. The environment type can be dev, test, or live.
*
* You can set it explicitly with Director::set_environment_tpye(). Or you can use {@link Director::set_dev_servers()} and {@link Director::set_test_servers()}
* to set it implicitly, based on the value of $_SERVER['HTTP_HOST']. If the HTTP_HOST value is one of the servers listed, then

View File

@ -4,7 +4,7 @@
* Set on controllers on construction time, typically overwritten
* by {@link Controller->handleRequest()} and {@link Controller->handleAction()} later on.
*
* @param sapphire
* @package sapphire
* @subpackage control
*/
class NullHTTPRequest extends SS_HTTPRequest {

View File

@ -1,7 +1,7 @@
<?php
/**
* This class is the base class of any Sapphire object that can be used to handle HTTP requests.
* This class is the base class of any SilverStripe object that can be used to handle HTTP requests.
*
* Any RequestHandler object can be made responsible for handling its own segment of the URL namespace.
* The {@link Director} begins the URL parsing process; it will parse the beginning of the URL to identify which
@ -10,7 +10,7 @@
*
* You can use ?debug_request=1 to view information about the different components and rule matches for a specific URL.
*
* In Sapphire, URL parsing is distributed throughout the object graph. For example, suppose that we have a search form
* In SilverStripe, URL parsing is distributed throughout the object graph. For example, suppose that we have a search form
* that contains a {@link TreeMultiSelectField} named "Groups". We want to use ajax to load segments of this tree as they are needed
* rather than downloading the tree right at the beginning. We could use this URL to get the tree segment that appears underneath
* Group #36: "admin/crm/SearchForm/field/Groups/treesegment/36"

View File

@ -1,7 +1,7 @@
<?php
/**
* Provides introspection information about the class tree.
* It's a cached wrapper around the built-in class functions. Sapphire uses class introspection heavily
* It's a cached wrapper around the built-in class functions. SilverStripe uses class introspection heavily
* and without the caching it creates an unfortunate performance hit.
*
* @package sapphire

View File

@ -1,6 +1,6 @@
<?php
/**
* This file is the Sapphire bootstrap. It will get your environment ready to call Director::direct().
* This file is the Framework bootstrap. It will get your environment ready to call Director::direct().
*
* It takes care of:
* - Including _ss_environment.php
@ -20,12 +20,12 @@
* - MODULES_PATH: Not used at the moment
* - THEMES_DIR: Path relative to webroot, e.g. "themes"
* - THEMES_PATH: Absolute filepath, e.g. "/var/www/my-webroot/themes"
* - SAPPHIRE_DIR: Path relative to webroot, e.g. "sapphire"
* - SAPPHIRE_PATH:Absolute filepath, e.g. "/var/www/my-webroot/sapphire"
* - SAPPHIRE_ADMIN_DIR:
* - SAPPHIRE_ADMIN_PATH:
* - THIRDPARTY_DIR: Path relative to webroot, e.g. "sapphire/thirdparty"
* - THIRDPARTY_PATH: Absolute filepath, e.g. "/var/www/my-webroot/sapphire/thirdparty"
* - FRAMEWORK_DIR: Path relative to webroot, e.g. "framework"
* - FRAMEWORK_PATH:Absolute filepath, e.g. "/var/www/my-webroot/framework"
* - FRAMEWORK_ADMIN_DIR: Path relative to webroot, e.g. "framework/admin"
* - FRAMEWORK_ADMIN_PATH: Absolute filepath, e.g. "/var/www/my-webroot/framework/admin"
* - THIRDPARTY_DIR: Path relative to webroot, e.g. "framework/thirdparty"
* - THIRDPARTY_PATH: Absolute filepath, e.g. "/var/www/my-webroot/framework/thirdparty"
*
* @todo This file currently contains a lot of bits and pieces, and its various responsibilities should probably be
* moved into different subsystems.
@ -124,7 +124,7 @@ if(!isset($_SERVER['HTTP_HOST'])) {
* Define system paths
*/
if(!defined('BASE_PATH')) {
// Assuming that this file is sapphire/core/Core.php we can then determine the base path
// Assuming that this file is framework/core/Core.php we can then determine the base path
$candidateBasePath = rtrim(dirname(dirname(dirname(__FILE__))), DIRECTORY_SEPARATOR);
// We can't have an empty BASE_PATH. Making it / means that double-slashes occur in places but that's benign.
// This likely only happens on chrooted environemnts
@ -155,11 +155,22 @@ define('MODULES_DIR', 'modules');
define('MODULES_PATH', BASE_PATH . '/' . MODULES_DIR);
define('THEMES_DIR', 'themes');
define('THEMES_PATH', BASE_PATH . '/' . THEMES_DIR);
define('SAPPHIRE_DIR', 'sapphire');
define('SAPPHIRE_PATH', BASE_PATH . '/' . SAPPHIRE_DIR);
define('SAPPHIRE_ADMIN_DIR', 'sapphire/admin');
define('SAPPHIRE_ADMIN_PATH', BASE_PATH . '/' . SAPPHIRE_ADMIN_DIR);
define('THIRDPARTY_DIR', SAPPHIRE_DIR . '/thirdparty');
// Relies on this being in a subdir of the framework.
// If it isn't, or is symlinked to a folder with a different name, you must define FRAMEWORK_DIR
if(!defined('FRAMEWORK_DIR')) {
define('FRAMEWORK_DIR', basename(dirname(dirname(__FILE__))));
}
define('FRAMEWORK_PATH', BASE_PATH . '/' . FRAMEWORK_DIR);
define('FRAMEWORK_ADMIN_DIR', FRAMEWORK_DIR . '/admin');
define('FRAMEWORK_ADMIN_PATH', BASE_PATH . '/' . FRAMEWORK_ADMIN_DIR);
// These are all deprecated. Use the FRAMEWORK_ versions instead.
define('SAPPHIRE_DIR', FRAMEWORK_DIR);
define('SAPPHIRE_PATH', FRAMEWORK_PATH);
define('SAPPHIRE_ADMIN_DIR', FRAMEWORK_ADMIN_DIR);
define('SAPPHIRE_ADMIN_PATH', FRAMEWORK_ADMIN_PATH);
define('THIRDPARTY_DIR', FRAMEWORK_DIR . '/thirdparty');
define('THIRDPARTY_PATH', BASE_PATH . '/' . THIRDPARTY_DIR);
define('ASSETS_DIR', 'assets');
define('ASSETS_PATH', BASE_PATH . '/' . ASSETS_DIR);
@ -202,14 +213,14 @@ if(function_exists('mb_http_output')) {
if(defined('CUSTOM_INCLUDE_PATH')) {
$includePath = CUSTOM_INCLUDE_PATH . PATH_SEPARATOR
. BASE_PATH . '/sapphire' . PATH_SEPARATOR
. BASE_PATH . '/sapphire/parsers' . PATH_SEPARATOR
. BASE_PATH . '/sapphire/thirdparty' . PATH_SEPARATOR
. FRAMEWORK_PATH . PATH_SEPARATOR
. FRAMEWORK_PATH . '/parsers' . PATH_SEPARATOR
. THIRDPARTY_PATH . PATH_SEPARATOR
. get_include_path();
} else {
$includePath = BASE_PATH . '/sapphire' . PATH_SEPARATOR
. BASE_PATH . '/sapphire/parsers' . PATH_SEPARATOR
. BASE_PATH . '/sapphire/thirdparty' . PATH_SEPARATOR
$includePath = FRAMEWORK_PATH . PATH_SEPARATOR
. FRAMEWORK_PATH . '/parsers' . PATH_SEPARATOR
. THIRDPARTY_PATH . PATH_SEPARATOR
. get_include_path();
}
@ -288,7 +299,7 @@ function getSysTempDir() {
}
/**
* Returns the temporary folder that sapphire/silverstripe should use for its cache files
* Returns the temporary folder that silverstripe should use for its cache files
* This is loaded into the TEMP_FOLDER define on start up
*
* @param $base The base path to use as the basis for the temp folder name. Defaults to BASE_PATH,

View File

@ -1,6 +1,6 @@
<?php
/**
* A base class for all sapphire objects to inherit from.
* A base class for all SilverStripe objects to inherit from.
*
* This class provides a number of pattern implementations, as well as methods and fixes to add extra psuedo-static
* and method functionality to PHP.

View File

@ -246,7 +246,7 @@ class SS_ClassManifest {
/**
* Returns an array of module names mapped to their paths.
* "Modules" in sapphire are simply directories with a _config.php file.
* "Modules" in SilverStripe are simply directories with a _config.php file.
*
* @return array
*/

View File

@ -1,5 +1,5 @@
/*
typography.css has been removed from sapphire, why shall we still has this? a dynamic typographp.css should be used by
typography.css has been removed from framework, why shall we still has this? a dynamic typographp.css should be used by
server side call, like Requirements::css();
@import url("typography.css");
*/
@ -40,7 +40,7 @@ html > body div.TreeDropdownField div.tree_holder { top: 20px; left: 0px; z-inde
/** HACK IE6, see http://www.hedgerwow.com/360/bugs/css-select-free.html */
.SelectionGroup div.TreeDropdownField div.tree_holder iframe { display: none; /* IE5*/ display/**/: block; /* IE5*/ position: absolute; top: 0; left: 0; z-index: -1; filter: mask(); width: 180px; /*must have for any big value*/ height: 200px; border: 0; }
div.TreeDropdownField a.editLink { border-width: 1px 1px 1px 0; background: url(../../sapphire/images/TreeDropdownField_button.gif) left top no-repeat; width: 19px; height: 21px; margin: 0; padding: 0; float: left; clear: right; z-index: 0; overflow: hidden; }
div.TreeDropdownField a.editLink { border-width: 1px 1px 1px 0; background: url(../images/TreeDropdownField_button.gif) left top no-repeat; width: 19px; height: 21px; margin: 0; padding: 0; float: left; clear: right; z-index: 0; overflow: hidden; }
/* added block/width so tree values don't disappear in ie7 */
.SelectionGroup div.TreeDropdownField ul.tree li { display: block; width: 100%; }

View File

@ -17,14 +17,14 @@
#right form .hasmanyfile .clear { clear: both; }
/* ICONS */
#right form .hasmanyfile .currentFiles a[href$=".pdf"], #right form .hasmanyfile .currentFiles a[href$=".PDF"], #right form .hasmanyfile .currentFiles a.pdf { padding: 2px; padding-left: 20px; background: url(../../sapphire/images/icons/page_white_acrobat.png) no-repeat left center; }
#right form .hasmanyfile .currentFiles a[href$=".pdf"], #right form .hasmanyfile .currentFiles a[href$=".PDF"], #right form .hasmanyfile .currentFiles a.pdf { padding: 2px; padding-left: 20px; background: url(../images/icons/page_white_acrobat.png) no-repeat left center; }
#right form .hasmanyfile .currentFiles a[href$=".doc"], #right form .hasmanyfile .currentFiles a[href$=".DOC"], #right form .hasmanyfile .currentFiles a.doc { padding: 2px; padding-left: 20px; background: url(../../sapphire/images/icons/page_word.png) no-repeat left center; }
#right form .hasmanyfile .currentFiles a[href$=".doc"], #right form .hasmanyfile .currentFiles a[href$=".DOC"], #right form .hasmanyfile .currentFiles a.doc { padding: 2px; padding-left: 20px; background: url(../images/icons/page_word.png) no-repeat left center; }
#right form .hasmanyfile .currentFiles a[href$=".xls"], #right form .hasmanyfile .currentFiles a[href$=".XLS"], #right form .hasmanyfile .currentFiles a.xls { padding: 2px; padding-left: 20px; background: url(../../sapphire/images/icons/page_excel.png) no-repeat left center; }
#right form .hasmanyfile .currentFiles a[href$=".xls"], #right form .hasmanyfile .currentFiles a[href$=".XLS"], #right form .hasmanyfile .currentFiles a.xls { padding: 2px; padding-left: 20px; background: url(../images/icons/page_excel.png) no-repeat left center; }
#right form .hasmanyfile .currentFiles a[href$=".gz"], #right form .hasmanyfile .currentFiles a[href$=".GZ"], #right form .hasmanyfile .currentFiles a[href$=".gzip"], #right form .hasmanyfile .currentFiles a[href$=".GZIP"], #right form .hasmanyfile .currentFiles a[href$=".zip"], #right form .hasmanyfile .currentFiles a[href$=".ZIP"], #right form .hasmanyfile .currentFiles a.archive { padding: 2px; padding-left: 20px; background: url(../../sapphire/images/icons/page_white_zip.png) no-repeat left center; }
#right form .hasmanyfile .currentFiles a[href$=".gz"], #right form .hasmanyfile .currentFiles a[href$=".GZ"], #right form .hasmanyfile .currentFiles a[href$=".gzip"], #right form .hasmanyfile .currentFiles a[href$=".GZIP"], #right form .hasmanyfile .currentFiles a[href$=".zip"], #right form .hasmanyfile .currentFiles a[href$=".ZIP"], #right form .hasmanyfile .currentFiles a.archive { padding: 2px; padding-left: 20px; background: url(../images/icons/page_white_zip.png) no-repeat left center; }
#right form .hasmanyfile .currentFiles a[href$=".jpg"], #right form .hasmanyfile .currentFiles a[href$=".JPG"], #right form .hasmanyfile .currentFiles a[href$=".gif"], #right form .hasmanyfile .currentFiles a[href$=".GIF"], #right form .hasmanyfile .currentFiles a[href$=".png"], #right form .hasmanyfile .currentFiles a[href$=".PNG"], #right form .hasmanyfile .currentFiles a.image { padding: 2px; padding-left: 20px; background: url(../../sapphire/images/icons/icon-jpg.gif) no-repeat left center; }
#right form .hasmanyfile .currentFiles a[href$=".jpg"], #right form .hasmanyfile .currentFiles a[href$=".JPG"], #right form .hasmanyfile .currentFiles a[href$=".gif"], #right form .hasmanyfile .currentFiles a[href$=".GIF"], #right form .hasmanyfile .currentFiles a[href$=".png"], #right form .hasmanyfile .currentFiles a[href$=".PNG"], #right form .hasmanyfile .currentFiles a.image { padding: 2px; padding-left: 20px; background: url(../images/icons/icon-jpg.gif) no-repeat left center; }
#right form .hasmanyfile .currentFiles a[href$=".exe"], #right form .hasmanyfile .currentFiles a[href$=".EXE"], #right form .hasmanyfile .currentFiles a.application { padding: 2px; padding-left: 20px; background: url(../../sapphire/images/icons/application.png) no-repeat left center; }
#right form .hasmanyfile .currentFiles a[href$=".exe"], #right form .hasmanyfile .currentFiles a[href$=".EXE"], #right form .hasmanyfile .currentFiles a.application { padding: 2px; padding-left: 20px; background: url(../images/icons/application.png) no-repeat left center; }

View File

@ -7,7 +7,6 @@
* To disable the task (in the case of potentially destructive updates or deletes), declare
* the $Disabled property on the subclass.
*
* @todo move from sapphire/testing to sapphire/dev or sapphire/development?
* @package sapphire
* @subpackage dev
*/

View File

@ -1,7 +1,7 @@
<?php
/**
* A base for bulk loaders of content into the SilverStripe database.
* Bulk loaders give SilverStripe authors the ability to do large-scale uploads into their Sapphire databases.
* Bulk loaders give SilverStripe authors the ability to do large-scale uploads into their SilverStripe databases.
*
* You can configure column-handling,
*

View File

@ -94,7 +94,7 @@ class DevelopmentAdmin extends Controller {
$renderer = DebugView::create();
$renderer->writeHeader();
$renderer->writeInfo("Sapphire Development Tools", Director::absoluteBaseURL());
$renderer->writeInfo("SilverStripe Development Tools", Director::absoluteBaseURL());
$base = Director::baseURL();
echo '<div class="options"><ul>';
@ -106,7 +106,7 @@ class DevelopmentAdmin extends Controller {
// CLI mode
} else {
echo "SAPPHIRE DEVELOPMENT TOOLS\n--------------------------\n\n";
echo "SILVERSTRIPE DEVELOPMENT TOOLS\n--------------------------\n\n";
echo "You can execute any of the following commands:\n\n";
foreach($actions as $action => $description) {
echo " sake dev/$action: $description\n";

View File

@ -1,7 +1,7 @@
<?php
/**
* Sapphire-specific testing object designed to support functional testing of your web app. It simulates get/post
* SilverStripe-specific testing object designed to support functional testing of your web app. It simulates get/post
* requests, form submission, and can validate resulting HTML, looking up content by CSS selector.
*
* The example below shows how it works.

View File

@ -121,7 +121,7 @@ class JSTestRunner extends Controller {
function runTests($tests) {
$this->setUp();
self::$default_reporter->writeHeader("Sapphire JavaScript Test Runner");
self::$default_reporter->writeHeader("SilverStripe JavaScript Test Runner");
self::$default_reporter->writeInfo("All Tests", "Running test cases: " . implode(", ", $tests));
foreach($tests as $test) {

View File

@ -17,18 +17,8 @@ class SapphireInfo extends Controller {
}
function Version() {
$sapphireVersionFile = file_get_contents(BASE_PATH . '/sapphire/silverstripe_version');
if(strstr($sapphireVersionFile, "/sapphire/trunk")) {
$sapphireVersion = "trunk";
} else {
if(preg_match("/sapphire\/(?:(?:branches)|(?:tags))(?:\/rc)?\/([A-Za-z0-9._-]+)\/silverstripe_version/", $sapphireVersionFile, $matches)) {
$sapphireVersion = $matches[1];
} else {
$sapphireVersion = "unknown";
}
}
$sapphireVersion = file_get_contents(FRAMEWORK_PATH . '/silverstripe_version');
if(!$sapphireVersion) $sapphireVersion = _t('LeftAndMain.VersionUnknown', 'unknown');
return $sapphireVersion;
}

View File

@ -36,7 +36,7 @@ class SapphireREPL extends Controller {
}
function index() {
if(!Director::is_cli()) return "The Sapphire Interactive Command-line doesn't work in a web browser. Use 'sake interactive' from the command-line to run.";
if(!Director::is_cli()) return "The SilverStripe Interactive Command-line doesn't work in a web browser. Use 'sake interactive' from the command-line to run.";
/* Try using PHP_Shell if it exists */
@ -46,7 +46,7 @@ class SapphireREPL extends Controller {
if( empty( $__shell ) ) {
set_error_handler(array($this, 'error_handler'));
echo "Sapphire Interactive Command-line (REPL interface). Type help for hints.\n\n";
echo "SilverStripe Interactive Command-line (REPL interface). Type help for hints.\n\n";
while(true) {
echo SS_Cli::text("?> ", "cyan");
echo SS_Cli::start_colour("yellow");

View File

@ -36,7 +36,7 @@ class TaskRunner extends Controller {
if(!Director::is_cli()) {
$renderer = new DebugView();
$renderer->writeHeader();
$renderer->writeInfo("Sapphire Development Tools: Tasks", Director::absoluteBaseURL());
$renderer->writeInfo("SilverStripe Development Tools: Tasks", Director::absoluteBaseURL());
$base = Director::absoluteBaseURL();
echo "<ul>";
@ -51,7 +51,7 @@ class TaskRunner extends Controller {
$renderer->writeFooter();
// CLI mode
} else {
echo "SAPPHIRE DEVELOPMENT TOOLS: Tasks\n--------------------------\n\n";
echo "SILVERSTRIPE DEVELOPMENT TOOLS: Tasks\n--------------------------\n\n";
foreach($tasks as $task) {
echo " * $task: sake dev/tasks/" . $task['class'] . "\n";
}

View File

@ -63,12 +63,9 @@ class TestRunner extends Controller {
* @see http://www.phpunit.de/manual/current/en/appendixes.configuration.html#appendixes.configuration.blacklist-whitelist
*/
static $coverage_filter_dirs = array(
'cms/thirdparty',
'cms/tests',
'cms/lang',
'sapphire/thirdparty',
'sapphire/tests',
'sapphire/lang',
'*/thirdparty',
'*/tests',
'*/lang',
);
/**
@ -198,7 +195,7 @@ class TestRunner extends Controller {
/**
* Run coverage tests for one or more "modules".
* A module is generally a toplevel folder, e.g. "mysite" or "sapphire".
* A module is generally a toplevel folder, e.g. "mysite" or "framework".
*/
function coverageModule($request) {
$this->module($request, true);
@ -229,7 +226,7 @@ class TestRunner extends Controller {
/**
* Run tests for one or more "modules".
* A module is generally a toplevel folder, e.g. "mysite" or "sapphire".
* A module is generally a toplevel folder, e.g. "mysite" or "framework".
*/
function module($request, $coverage = false) {
self::use_test_manifest();
@ -285,7 +282,7 @@ class TestRunner extends Controller {
restore_error_handler();
self::$default_reporter->writeHeader("Sapphire Test Runner");
self::$default_reporter->writeHeader("SilverStripe Test Runner");
if (count($classList) > 1) {
self::$default_reporter->writeInfo("All Tests", "Running test cases: ",implode(", ", $classList));
} else

View File

@ -6,9 +6,9 @@
<head>
<title>SilverStripe CMS / Framework Installation</title>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<script type="text/javascript" src="sapphire/thirdparty/jquery/jquery.js"></script>
<script type="text/javascript" src="sapphire/dev/install/install.js"></script>
<link rel="stylesheet" type="text/css" href="sapphire/dev/install/css/install.css">
<script type="text/javascript" src="<?php echo FRAMEWORK_NAME; ?>/thirdparty/jquery/jquery.js"></script>
<script type="text/javascript" src="<?php echo FRAMEWORK_NAME; ?>/dev/install/install.js"></script>
<link rel="stylesheet" type="text/css" href="<?php echo FRAMEWORK_NAME; ?>/dev/install/css/install.css">
<link rel="shortcut icon" href="favicon.ico">
</head>
<body>
@ -276,7 +276,7 @@
<span id="saving_top" style="display: none">
&nbsp;
<img src="sapphire/images/network-save.gif">
<img src="<?php echo FRAMEWORK_NAME; ?>/images/network-save.gif">
(this will take a minute or so)
</span>
</p>

View File

@ -12,11 +12,12 @@
/**
* PHP version check. Make sure we've got at least PHP 5.3.2 in the most friendly way possible
*/
define('FRAMEWORK_NAME', 'framework');
if (version_compare(phpversion(), '5.3.2', '<')) {
header("HTTP/1.1 500 Server Error");
echo str_replace('$PHPVersion', phpversion(), file_get_contents("sapphire/dev/install/php5-required.html"));
echo str_replace(array('$PHPVersion', 'sapphire'), array(phpversion(), FRAMEWORK_NAME), file_get_contents(FRAMEWORK_NAME . "/dev/install/php5-required.html"));
die();
}
include('sapphire/dev/install/install.php5');
include(FRAMEWORK_NAME . '/dev/install/install.php5');

View File

@ -11,7 +11,7 @@
/**
* SilverStripe CMS Installer
* This installer doesn't use any of the fancy Sapphire stuff in case it's unsupported.
* This installer doesn't use any of the fancy SilverStripe stuff in case it's unsupported.
*/
// speed up mysql_connect timeout if the server can't be found
@ -41,11 +41,11 @@ if($envFileExists) {
}
}
include_once('sapphire/core/Object.php');
include_once('sapphire/view/TemplateGlobalProvider.php');
include_once('sapphire/i18n/i18n.php');
include_once('sapphire/dev/install/DatabaseConfigurationHelper.php');
include_once('sapphire/dev/install/DatabaseAdapterRegistry.php');
include_once(FRAMEWORK_NAME . '/core/Object.php');
include_once(FRAMEWORK_NAME . '/view/TemplateGlobalProvider.php');
include_once(FRAMEWORK_NAME . '/i18n/i18n.php');
include_once(FRAMEWORK_NAME . '/dev/install/DatabaseConfigurationHelper.php');
include_once(FRAMEWORK_NAME . '/dev/install/DatabaseAdapterRegistry.php');
// Set default locale, but try and sniff from the user agent
$locales = i18n::$common_locales;
@ -135,14 +135,8 @@ if(file_exists('mysite/_config.php')) {
}
}
if(file_exists('sapphire/silverstripe_version')) {
$sapphireVersionFile = file_get_contents('sapphire/silverstripe_version');
if(strstr($sapphireVersionFile, "/sapphire/trunk")) {
$silverstripe_version = "trunk";
} else {
preg_match("/sapphire\/(?:(?:branches)|(?:tags))(?:\/rc)?\/([A-Za-z0-9._-]+)\/silverstripe_version/", $sapphireVersionFile, $matches);
$silverstripe_version = $matches[1];
}
if(file_exists(FRAMEWORK_NAME . '/silverstripe_version')) {
$silverstripe_version = file_get_contents(FRAMEWORK_NAME . '/silverstripe_version');
} else {
$silverstripe_version = "unknown";
}
@ -192,7 +186,7 @@ if($installFromCli && ($req->hasErrors() || $dbReq->hasErrors())) {
if((isset($_REQUEST['go']) || $installFromCli) && !$req->hasErrors() && !$dbReq->hasErrors() && $adminConfig['username'] && $adminConfig['password']) {
// Confirm before reinstalling
if(!$installFromCli && $alreadyInstalled) {
include('sapphire/dev/install/config-form.html');
include(FRAMEWORK_NAME . '/dev/install/config-form.html');
} else {
$inst = new Installer();
@ -205,7 +199,7 @@ if((isset($_REQUEST['go']) || $installFromCli) && !$req->hasErrors() && !$dbReq-
// Show the config form
} else {
include('sapphire/dev/install/config-form.html');
include(FRAMEWORK_NAME . '/dev/install/config-form.html');
}
/**
@ -328,14 +322,14 @@ class InstallRequirements {
$this->requirePHPVersion('5.3.10', '5.3.2', array("PHP Configuration", "PHP5 installed", null, "PHP version " . phpversion()));
// Check that we can identify the root folder successfully
$this->requireFile('sapphire/dev/install/config-form.html', array("File permissions",
$this->requireFile(FRAMEWORK_NAME . '/dev/install/config-form.html', array("File permissions",
"Does the webserver know where files are stored?",
"The webserver isn't letting me identify where files are stored.",
$this->getBaseDir()
));
$this->requireModule('mysite', array("File permissions", "mysite/ directory exists?"));
$this->requireModule('sapphire', array("File permissions", "sapphire/ directory exists?"));
$this->requireModule(FRAMEWORK_NAME, array("File permissions", FRAMEWORK_NAME . "/ directory exists?"));
if($isApache) {
$this->requireWriteable('.htaccess', array("File permissions", "Is the .htaccess file writeable?", null));
@ -944,8 +938,8 @@ class Installer extends InstallRequirements {
<html>
<head>
<title>Installing SilverStripe...</title>
<link rel="stylesheet" type="text/css" href="sapphire/dev/install/css/install.css" />
<script src="sapphire/thirdparty/jquery/jquery.js"></script>
<link rel="stylesheet" type="text/css" href="<?php echo FRAMEWORK_NAME; ?>/dev/install/css/install.css" />
<script src="<?php echo FRAMEWORK_NAME; ?>/thirdparty/jquery/jquery.js"></script>
</head>
<body>
<div class="install-header">
@ -978,14 +972,8 @@ class Installer extends InstallRequirements {
flush();
if(isset($config['stats'])) {
if(file_exists('sapphire/silverstripe_version')) {
$sapphireVersionFile = file_get_contents('sapphire/silverstripe_version');
if(strstr($sapphireVersionFile, "/sapphire/trunk")) {
$silverstripe_version = "trunk";
} else {
preg_match("/sapphire\/(?:(?:branches)|(?:tags))(?:\/rc)?\/([A-Za-z0-9._-]+)\/silverstripe_version/", $sapphireVersionFile, $matches);
$silverstripe_version = $matches[1];
}
if(file_exists(FRAMEWORK_NAME . '/silverstripe_version')) {
$silverstripe_version = file_get_contents(FRAMEWORK_NAME . '/silverstripe_version');
} else {
$silverstripe_version = "unknown";
}
@ -1117,9 +1105,9 @@ PHP
}
}
// Load the sapphire runtime
$_SERVER['SCRIPT_FILENAME'] = dirname(realpath($_SERVER['SCRIPT_FILENAME'])) . '/sapphire/main.php';
chdir('sapphire');
// Load the SilverStripe runtime
$_SERVER['SCRIPT_FILENAME'] = dirname(realpath($_SERVER['SCRIPT_FILENAME'])) . '/' . FRAMEWORK_NAME . '/main.php';
chdir(FRAMEWORK_NAME);
// Rebuild the manifest
$_GET['flush'] = true;
@ -1207,7 +1195,7 @@ HTML;
if($base != '.') $baseClause = "RewriteBase '$base'\n";
else $baseClause = "";
$modulePath = FRAMEWORK_NAME;
$rewrite = <<<TEXT
<Files *.ss>
Order deny,allow
@ -1233,7 +1221,7 @@ ErrorDocument 500 /assets/error-500.html
$baseClause
RewriteCond %{REQUEST_URI} ^(.*)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .* sapphire/main.php?url=%1&%{QUERY_STRING} [L]
RewriteRule .* $modulePath/main.php?url=%1&%{QUERY_STRING} [L]
</IfModule>
TEXT;
@ -1258,6 +1246,7 @@ TEXT;
* so that rewriting capability can be use.
*/
function createWebConfig() {
$modulePath = FRAMEWORK_NAME;
$content = <<<TEXT
<?xml version="1.0" encoding="utf-8"?>
<configuration>
@ -1276,7 +1265,7 @@ TEXT;
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
</conditions>
<action type="Rewrite" url="sapphire/main.php?url={R:1}" appendQueryString="true" />
<action type="Rewrite" url="$modulePath/main.php?url={R:1}" appendQueryString="true" />
</rule>
</rules>
</rewrite>

View File

@ -189,7 +189,7 @@ class PhpUnitWrapper implements IPhpUnitWrapper {
}
/**
* Perform all tests, added to the suite and initialises Sapphire to collect
* Perform all tests, added to the suite and initialises SilverStripe to collect
* the results of the unit tests.
*
* This method calls @see beforeRunTests and @see afterRunTests.
@ -211,6 +211,22 @@ class PhpUnitWrapper implements IPhpUnitWrapper {
$this->getSuite()->run($this->getFrameworkTestResults());
$this->aferRunTests();
}
/**
* Returns an array containing all the module folders in the base dir.
*
* @return array
*/
protected function moduleDirectories() {
$files = scandir(BASE_PATH);
$modules = array();
foreach($files as $file) {
if(is_dir(BASE_PATH . "/$file") && file_exists(BASE_PATH . "/$file/_config.php")) {
$modules[] = $file;
}
}
return $modules;
}
}
/**
@ -237,7 +253,7 @@ class PhpUnitWrapper_Exception extends Exception {}
if(!PhpUnitWrapper::has_php_unit()) {
/**
* PHPUnit is a testing framework that can be installed using PEAR.
* It's not bundled with Sapphire, you will need to install it yourself.
* It's not bundled with SilverStripe, you will need to install it yourself.
*
* @package sapphire
* @subpackage testing

View File

@ -29,9 +29,18 @@ class PhpUnitWrapper_3_4 extends PhpUnitWrapper {
if($this->getCoverageStatus()) {
// blacklist selected folders from coverage report
$modules = $this->moduleDirectories();
foreach(TestRunner::$coverage_filter_dirs as $dir) {
if($dir[0] == '*') {
$dir = substr($dir, 1);
foreach ($modules as $module) {
PHPUnit_Util_Filter::addDirectoryToFilter(BASE_PATH . '/' . $dir);
}
} else {
PHPUnit_Util_Filter::addDirectoryToFilter(BASE_PATH . '/' . $dir);
}
}
$this->getFrameworkTestResults()->collectCodeCoverageInformation(true);
}
}

View File

@ -39,10 +39,18 @@ class PhpUnitWrapper_3_5 extends PhpUnitWrapper {
$coverage = $this->coverage;
$filter = $coverage->filter();
$modules = $this->moduleDirectories();
foreach(TestRunner::$coverage_filter_dirs as $dir) {
if($dir[0] == '*') {
$dir = substr($dir, 1);
foreach ($modules as $module) {
$filter->addDirectoryToBlacklist(BASE_PATH . "/$module/$dir");
}
} else {
$filter->addDirectoryToBlacklist(BASE_PATH . '/' . $dir);
}
}
$filter->addFileToBlacklist(__FILE__, 'PHPUNIT');

View File

@ -647,7 +647,7 @@ class Email_BounceHandler extends Controller {
return;
}
// Check against access key defined in sapphire/_config.php
// Check against access key defined in framework/_config.php
if( $_REQUEST['Key'] != EMAIL_BOUNCEHANDLER_KEY) {
echo 'Error: Access validation failed. Invalid "Key" specified.';
return;

View File

@ -447,7 +447,7 @@ function getMimeType($filename) {
*/
function loadMimeTypes() {
$mimetypePathCustom = '/etc/mime.types';
$mimetypePathGeneric = Director::baseFolder() . '/sapphire/email/mime.types';
$mimetypePathGeneric = FRAMEWORK_PATH . '/email/mime.types';
$mimeTypes = file_exists($mimetypePathGeneric) ? file($mimetypePathGeneric) : file($mimetypePathCustom);
foreach($mimeTypes as $typeSpec) {
if(($typeSpec = trim($typeSpec)) && substr($typeSpec,0,1) != "#") {

View File

@ -3,7 +3,7 @@
* This class handles the representation of a file on the filesystem within the framework.
* Most of the methods also handle the {@link Folder} subclass.
*
* Note: The files are stored in the assets/ directory, but sapphire
* Note: The files are stored in the assets/ directory, but SilverStripe
* looks at the db object to gather information about a file such as URL
* It then uses this for all processing functions (like image manipulation).
*
@ -55,7 +55,7 @@
*
* Typically both files and folders should be created first on the filesystem,
* and then reflected in as database records. Folders can be created recursively
* from sapphire both in the database and filesystem through {@link Folder::findOrMake()}.
* from SilverStripe both in the database and filesystem through {@link Folder::findOrMake()}.
* Ensure that you always set a "Filename" property when writing to the database,
* leaving it out can lead to unexpected results.
*
@ -415,21 +415,21 @@ class File extends DataObject {
/**
* Return the relative URL of an icon for the file type,
* based on the {@link appCategory()} value.
* Images are searched for in "sapphire/images/app_icons/".
* Images are searched for in "framework/images/app_icons/".
*
* @return String
*/
function Icon() {
$ext = $this->Extension;
if(!Director::fileExists(SAPPHIRE_DIR . "/images/app_icons/{$ext}_32.gif")) {
if(!Director::fileExists(FRAMEWORK_DIR . "/images/app_icons/{$ext}_32.gif")) {
$ext = $this->appCategory();
}
if(!Director::fileExists(SAPPHIRE_DIR . "/images/app_icons/{$ext}_32.gif")) {
if(!Director::fileExists(FRAMEWORK_DIR . "/images/app_icons/{$ext}_32.gif")) {
$ext = "generic";
}
return SAPPHIRE_DIR . "/images/app_icons/{$ext}_32.gif";
return FRAMEWORK_DIR . "/images/app_icons/{$ext}_32.gif";
}
/**

View File

@ -12,7 +12,7 @@
* to avoid touching the filesystem.
*
* See {@link File} documentation for more details about the
* relationship between the database and filesystem in the sapphire file APIs.
* relationship between the database and filesystem in the SilverStripe file APIs.
*
* @package sapphire
* @subpackage filesystem

View File

@ -31,8 +31,8 @@ class AjaxUniqueTextField extends TextField {
function Field($properties = array()) {
Requirements::javascript(THIRDPARTY_DIR . "/prototype/prototype.js");
Requirements::javascript(THIRDPARTY_DIR . "/behaviour/behaviour.js");
Requirements::add_i18n_javascript(SAPPHIRE_DIR . '/javascript/lang');
Requirements::javascript(SAPPHIRE_DIR . "/javascript/UniqueFields.js");
Requirements::add_i18n_javascript(FRAMEWORK_DIR . '/javascript/lang');
Requirements::javascript(FRAMEWORK_DIR . "/javascript/UniqueFields.js");
$url = Convert::raw2att( $this->validateURL );

View File

@ -44,7 +44,7 @@ class CheckboxSetField extends OptionsetField {
* e.g. SQLMap, ArrayList or an array.
*/
function Field($properties = array()) {
Requirements::css(SAPPHIRE_DIR . '/css/CheckboxSetField.css');
Requirements::css(FRAMEWORK_DIR . '/css/CheckboxSetField.css');
$source = $this->source;
$values = $this->value;
@ -286,4 +286,5 @@ class CheckboxSetField extends OptionsetField {
function ExtraOptions() {
return FormField::ExtraOptions();
}
}

View File

@ -211,12 +211,12 @@ class ComplexTableField extends TableListField {
Requirements::javascript(THIRDPARTY_DIR . "/behaviour/behaviour.js");
Requirements::javascript(THIRDPARTY_DIR . "/greybox/AmiJS.js");
Requirements::javascript(THIRDPARTY_DIR . "/greybox/greybox.js");
Requirements::add_i18n_javascript(SAPPHIRE_DIR . '/javascript/lang');
Requirements::javascript(SAPPHIRE_DIR . '/javascript/TableListField.js');
Requirements::javascript(SAPPHIRE_DIR . "/javascript/ComplexTableField.js");
Requirements::add_i18n_javascript(FRAMEWORK_DIR . '/javascript/lang');
Requirements::javascript(FRAMEWORK_DIR . '/javascript/TableListField.js');
Requirements::javascript(FRAMEWORK_DIR . "/javascript/ComplexTableField.js");
Requirements::css(THIRDPARTY_DIR . "/greybox/greybox.css");
Requirements::css(SAPPHIRE_DIR . "/css/TableListField.css");
Requirements::css(SAPPHIRE_DIR . "/css/ComplexTableField.css");
Requirements::css(FRAMEWORK_DIR . "/css/TableListField.css");
Requirements::css(FRAMEWORK_DIR . "/css/ComplexTableField.css");
// set caption if required
if($this->popupCaption) {
@ -834,13 +834,13 @@ class ComplexTableField_Popup extends Form {
function forTemplate() {
$ret = parent::forTemplate();
Requirements::css(SAPPHIRE_DIR . '/css/ComplexTableField_popup.css');
Requirements::javascript(SAPPHIRE_DIR . "/thirdparty/prototype/prototype.js");
Requirements::javascript(SAPPHIRE_DIR . "/thirdparty/behaviour/behaviour.js");
Requirements::javascript(SAPPHIRE_DIR . "/thirdparty/scriptaculous/scriptaculous.js");
Requirements::javascript(SAPPHIRE_DIR . "/thirdparty/scriptaculous/scriptaculous/controls.js");
Requirements::add_i18n_javascript(SAPPHIRE_DIR . '/javascript/lang');
Requirements::javascript(SAPPHIRE_DIR . "/javascript/ComplexTableField_popup.js");
Requirements::css(FRAMEWORK_DIR . '/css/ComplexTableField_popup.css');
Requirements::javascript(FRAMEWORK_DIR . "/thirdparty/prototype/prototype.js");
Requirements::javascript(FRAMEWORK_DIR . "/thirdparty/behaviour/behaviour.js");
Requirements::javascript(FRAMEWORK_DIR . "/thirdparty/scriptaculous/scriptaculous.js");
Requirements::javascript(FRAMEWORK_DIR . "/thirdparty/scriptaculous/scriptaculous/controls.js");
Requirements::add_i18n_javascript(FRAMEWORK_DIR . '/javascript/lang');
Requirements::javascript(FRAMEWORK_DIR . "/javascript/ComplexTableField_popup.js");
// Append requirements from instance callbacks
$parent = $this->getParentController();

View File

@ -94,9 +94,9 @@ class ConfirmedPasswordField extends FormField {
}
function Field($properties = array()) {
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery/jquery.js');
Requirements::javascript(SAPPHIRE_DIR . '/javascript/ConfirmedPasswordField.js');
Requirements::css(SAPPHIRE_DIR . '/css/ConfirmedPasswordField.css');
Requirements::javascript(FRAMEWORK_DIR . '/thirdparty/jquery/jquery.js');
Requirements::javascript(FRAMEWORK_DIR . '/javascript/ConfirmedPasswordField.js');
Requirements::css(FRAMEWORK_DIR . '/css/ConfirmedPasswordField.css');
$content = '';

View File

@ -504,7 +504,7 @@ class DateField_View_JQuery extends Object {
if($this->getField()->getConfig('showcalendar')) {
Requirements::javascript(THIRDPARTY_DIR . '/jquery/jquery.js');
Requirements::css(THIRDPARTY_DIR . '/jquery-ui-themes/smoothness/jquery-ui.css');
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery-ui/jquery-ui.js');
Requirements::javascript(FRAMEWORK_DIR . '/thirdparty/jquery-ui/jquery-ui.js');
// Include language files (if required)
$lang = $this->getLang();
@ -518,7 +518,7 @@ class DateField_View_JQuery extends Object {
));
}
Requirements::javascript(SAPPHIRE_DIR . "/javascript/DateField.js");
Requirements::javascript(FRAMEWORK_DIR . "/javascript/DateField.js");
}
return $html;

View File

@ -85,7 +85,7 @@ class DatetimeField extends FormField {
}
function Field($properties = array()) {
Requirements::css(SAPPHIRE_DIR . '/css/DatetimeField.css');
Requirements::css(FRAMEWORK_DIR . '/css/DatetimeField.css');
$tzField = ($this->getConfig('usertimezone')) ? $this->timezoneField->FieldHolder() : '';
return $this->dateField->FieldHolder() .

View File

@ -61,10 +61,10 @@ class FileIFrameField extends FileField {
public function Field($properties = array()) {
Deprecation::notice('3.0', 'Use UploadField');
Requirements::css(SAPPHIRE_DIR . '/thirdparty/jquery-ui-themes/smoothness/jquery-ui.css');
Requirements::add_i18n_javascript(SAPPHIRE_DIR . '/javascript/lang');
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery/jquery.js');
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery-ui/jquery-ui.js');
Requirements::css(FRAMEWORK_DIR . '/thirdparty/jquery-ui-themes/smoothness/jquery-ui.css');
Requirements::add_i18n_javascript(FRAMEWORK_DIR . '/javascript/lang');
Requirements::javascript(FRAMEWORK_DIR . '/thirdparty/jquery/jquery.js');
Requirements::javascript(FRAMEWORK_DIR . '/thirdparty/jquery-ui/jquery-ui.js');
if($this->form->getRecord() && $this->form->getRecord()->exists()) {
@ -113,11 +113,11 @@ class FileIFrameField extends FileField {
public function iframe() {
// clear the requirements added by any parent controllers
Requirements::clear();
Requirements::add_i18n_javascript('sapphire/javascript/lang');
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery/jquery.js');
Requirements::javascript('sapphire/javascript/FileIFrameField.js');
Requirements::add_i18n_javascript(FRAMEWORK_DIR . '/javascript/lang');
Requirements::javascript(THIRDPARTY_DIR . '/jquery/jquery.js');
Requirements::javascript(FRAMEWORK_DIR . '/javascript/FileIFrameField.js');
Requirements::css('sapphire/css/FileIFrameField.css');
Requirements::css(FRAMEWORK_DIR . '/css/FileIFrameField.css');
return $this->renderWith('FileIframeField_iframe');
}

View File

@ -1,7 +1,7 @@
<?php
/**
* Base class for all forms.
* The form class is an extensible base for all forms on a sapphire application. It can be used
* The form class is an extensible base for all forms on a SilverStripe application. It can be used
* either by extending it, and creating processor methods on the subclass, or by creating instances
* of form whose actions are handled by the parent controller.
*

View File

@ -67,10 +67,10 @@ class HasManyComplexTableField extends ComplexTableField {
function FieldHolder($properties = array()) {
$ret = parent::FieldHolder($properties);
Requirements::add_i18n_javascript(SAPPHIRE_DIR . '/javascript/lang');
Requirements::javascript(SAPPHIRE_DIR . "/javascript/HasManyFileField.js");
Requirements::javascript(SAPPHIRE_DIR . '/javascript/RelationComplexTableField.js');
Requirements::css(SAPPHIRE_DIR . '/css/HasManyFileField.css');
Requirements::add_i18n_javascript(FRAMEWORK_DIR . '/javascript/lang');
Requirements::javascript(FRAMEWORK_DIR . "/javascript/HasManyFileField.js");
Requirements::javascript(FRAMEWORK_DIR . '/javascript/RelationComplexTableField.js');
Requirements::css(FRAMEWORK_DIR . '/css/HasManyFileField.css');
return $ret;
}

View File

@ -81,8 +81,6 @@ class HtmlEditorConfig {
'safari_warning' => false,
'relative_urls' => true,
'verify_html' => true,
'spellchecker_rpc_url' => 'sapphire/thirdparty/tinymce-spellchecker/rpc.php'
);
/**

View File

@ -255,11 +255,11 @@ class HtmlEditorField_Toolbar extends RequestHandler {
function __construct($controller, $name) {
parent::__construct();
Requirements::javascript(SAPPHIRE_DIR . "/thirdparty/jquery/jquery.js");
Requirements::javascript(FRAMEWORK_DIR . "/thirdparty/jquery/jquery.js");
Requirements::javascript(THIRDPARTY_DIR . '/jquery-ui/jquery-ui.js');
Requirements::javascript(THIRDPARTY_DIR . '/jquery-entwine/dist/jquery.entwine-dist.js');
Requirements::javascript(SAPPHIRE_ADMIN_DIR . '/javascript/ssui.core.js');
Requirements::javascript(SAPPHIRE_DIR ."/javascript/HtmlEditorField.js");
Requirements::javascript(FRAMEWORK_ADMIN_DIR . '/javascript/ssui.core.js');
Requirements::javascript(FRAMEWORK_DIR ."/javascript/HtmlEditorField.js");
Requirements::css(THIRDPARTY_DIR . '/jquery-ui-themes/smoothness/jquery-ui.css');
@ -389,7 +389,7 @@ class HtmlEditorField_Toolbar extends RequestHandler {
$fromCMS->addExtraClass('content');
$selectComposite->addExtraClass('content-select');
Requirements::css(SAPPHIRE_DIR . '/css/AssetUploadField.css');
Requirements::css(FRAMEWORK_DIR . '/css/AssetUploadField.css');
$computerUploadField = Object::create('UploadField', 'AssetUploadField', '');
$computerUploadField->setConfig('previewMaxWidth', 40);
$computerUploadField->setConfig('previewMaxHeight', 30);

View File

@ -28,7 +28,7 @@ class ImageFormAction extends FormAction {
function Field($properties = array()) {
Requirements::javascript(THIRDPARTY_DIR . '/jquery/jquery.js');
Requirements::javascript(SAPPHIRE_DIR . '/javascript/ImageFormAction.js');
Requirements::javascript(FRAMEWORK_DIR . '/javascript/ImageFormAction.js');
$classClause = '';
if($this->className) $classClause = $this->className . ' ';

View File

@ -3,7 +3,7 @@
* Render a button that will submit the form its contained in through ajax.
* If you want to add custom behaviour, please set {@link inlcudeDefaultJS()} to FALSE and work with behaviour.js.
*
* @see sapphire/javascript/InlineFormAction.js
* @see framework/javascript/InlineFormAction.js
*
* @package forms
* @subpackage actions
@ -29,7 +29,7 @@ class InlineFormAction extends FormField {
function Field($properties = array()) {
if($this->includeDefaultJS) {
Requirements::javascriptTemplate(SAPPHIRE_DIR . '/javascript/InlineFormAction.js',array('ID'=>$this->id()));
Requirements::javascriptTemplate(FRAMEWORK_DIR . '/javascript/InlineFormAction.js',array('ID'=>$this->id()));
}
return "<input type=\"submit\" name=\"action_{$this->name}\" value=\"{$this->title}\" id=\"{$this->id()}\" class=\"action{$this->extraClass}\" />";
@ -40,7 +40,7 @@ class InlineFormAction extends FormField {
}
/**
* Optionally disable the default javascript include (sapphire/javascript/InlineFormAction.js),
* Optionally disable the default javascript include (framework/javascript/InlineFormAction.js),
* which routes to an "admin-custom"-URL.
*
* @param $bool boolean

View File

@ -74,7 +74,7 @@ class NullableField extends FormField {
/**
* (non-PHPdoc)
* @see sapphire/forms/FormField#Field()
* @see framework/forms/FormField#Field()
*/
function Field($properties = array()) {
if ( $this->isReadonly()) {
@ -114,7 +114,7 @@ class NullableField extends FormField {
/**
* (non-PHPdoc)
* @see sapphire/forms/FormField#debug()
* @see framework/forms/FormField#debug()
*/
function debug() {
$result = "$this->class ($this->name: $this->title : <font style='color:red;'>$this->message</font>) = ";

View File

@ -25,7 +25,7 @@ class SelectionGroup extends CompositeField {
parent::__construct($items);
Requirements::css(SAPPHIRE_DIR . '/css/SelectionGroup.css');
Requirements::css(FRAMEWORK_DIR . '/css/SelectionGroup.css');
}
function FieldSet() {
@ -69,8 +69,8 @@ class SelectionGroup extends CompositeField {
function FieldHolder($properties = array()) {
Requirements::javascript(THIRDPARTY_DIR .'/jquery/jquery.js');
Requirements::javascript(SAPPHIRE_DIR . '/javascript/SelectionGroup.js');
Requirements::css(SAPPHIRE_DIR . '/css/SelectionGroup.css');
Requirements::javascript(FRAMEWORK_DIR . '/javascript/SelectionGroup.js');
Requirements::css(FRAMEWORK_DIR . '/css/SelectionGroup.css');
$obj = $properties ? $this->customise($properties) : $this;

View File

@ -68,15 +68,15 @@ class TabSet extends CompositeField {
* The HTML is a standardised format, containing a &lt;ul;
*/
public function FieldHolder($properties = array()) {
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery/jquery.js');
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery-ui/jquery-ui.js');
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery-cookie/jquery.cookie.js');
Requirements::javascript(FRAMEWORK_DIR . '/thirdparty/jquery/jquery.js');
Requirements::javascript(FRAMEWORK_DIR . '/thirdparty/jquery-ui/jquery-ui.js');
Requirements::javascript(FRAMEWORK_DIR . '/thirdparty/jquery-cookie/jquery.cookie.js');
Requirements::css(SAPPHIRE_DIR . '/thirdparty/jquery-ui-themes/smoothness/jquery.ui.css');
Requirements::css(FRAMEWORK_DIR . '/thirdparty/jquery-ui-themes/smoothness/jquery.ui.css');
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery-entwine/dist/jquery.entwine-dist.js');
Requirements::javascript(FRAMEWORK_DIR . '/thirdparty/jquery-entwine/dist/jquery.entwine-dist.js');
Requirements::javascript(SAPPHIRE_DIR . '/javascript/TabSet.js');
Requirements::javascript(FRAMEWORK_DIR . '/javascript/TabSet.js');
$obj = $properties ? $this->customise($properties) : $this;

View File

@ -464,13 +464,13 @@ class TableField extends TableListField {
* Sets the template to be rendered with
*/
function FieldHolder($properties = array()) {
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery/jquery.js');
Requirements::javascript(FRAMEWORK_DIR . '/thirdparty/jquery/jquery.js');
Requirements::javascript(THIRDPARTY_DIR . "/prototype/prototype.js");
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/behaviour/behaviour.js');
Requirements::add_i18n_javascript(SAPPHIRE_DIR . '/javascript/lang');
Requirements::javascript(SAPPHIRE_DIR . '/javascript/TableListField.js');
Requirements::javascript(SAPPHIRE_DIR . '/javascript/TableField.js');
Requirements::css(SAPPHIRE_DIR . '/css/TableListField.css');
Requirements::javascript(FRAMEWORK_DIR . '/thirdparty/behaviour/behaviour.js');
Requirements::add_i18n_javascript(FRAMEWORK_DIR . '/javascript/lang');
Requirements::javascript(FRAMEWORK_DIR . '/javascript/TableListField.js');
Requirements::javascript(FRAMEWORK_DIR . '/javascript/TableField.js');
Requirements::css(FRAMEWORK_DIR . '/css/TableListField.css');
$obj = $properties ? $this->customise($properties) : $this;
return $obj->renderWith($this->template);

View File

@ -237,6 +237,9 @@ class TableListField extends FormField {
*/
function __construct($name, $sourceClass = null, $fieldList = null, $sourceFilter = null,
$sourceSort = null, $sourceJoin = null) {
if(FRAMEWORK_DIR != 'sapphire') {
user_error('TableListField requires FRAMEWORK_DIR to be sapphire.', E_USER_WARNING);
}
if($sourceClass) {
// You can optionally pass a list
@ -279,12 +282,12 @@ class TableListField extends FormField {
}
function FieldHolder($properties = array()) {
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery/jquery.js');
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/prototype/prototype.js');
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/behaviour/behaviour.js');
Requirements::add_i18n_javascript(SAPPHIRE_DIR . '/javascript/lang');
Requirements::javascript(SAPPHIRE_DIR . '/javascript/TableListField.js');
Requirements::css(SAPPHIRE_DIR . '/css/TableListField.css');
Requirements::javascript(FRAMEWORK_DIR . '/thirdparty/jquery/jquery.js');
Requirements::javascript(FRAMEWORK_DIR . '/thirdparty/prototype/prototype.js');
Requirements::javascript(FRAMEWORK_DIR . '/thirdparty/behaviour/behaviour.js');
Requirements::add_i18n_javascript(FRAMEWORK_DIR . '/javascript/lang');
Requirements::javascript(FRAMEWORK_DIR . '/javascript/TableListField.js');
Requirements::css(FRAMEWORK_DIR . '/css/TableListField.css');
if($this->clickAction) {
$id = $this->id();
@ -1055,7 +1058,7 @@ JS
Requirements::css(CMS_DIR . '/css/typography.css');
Requirements::css(CMS_DIR . '/css/cms_right.css');
}
Requirements::css(SAPPHIRE_DIR . '/css/TableListField_print.css');
Requirements::css('sapphire/css/TableListField_print.css');
$this->cachedSourceItems = null;
$oldShowPagination = $this->showPagination;

View File

@ -22,9 +22,9 @@ class ToggleCompositeField extends CompositeField {
}
public function FieldHolder($properties = array()) {
Requirements::javascript(SAPPHIRE_DIR . "/thirdparty/prototype/prototype.js");
Requirements::javascript(SAPPHIRE_DIR . "/thirdparty/behaviour/behaviour.js");
Requirements::javascript(SAPPHIRE_DIR . "/javascript/ToggleCompositeField.js");
Requirements::javascript(FRAMEWORK_DIR . "/thirdparty/prototype/prototype.js");
Requirements::javascript(FRAMEWORK_DIR . "/thirdparty/behaviour/behaviour.js");
Requirements::javascript(FRAMEWORK_DIR . "/javascript/ToggleCompositeField.js");
$obj = $properties ? $this->customise($properties) : $this;

View File

@ -49,9 +49,9 @@ class ToggleField extends ReadonlyField {
function Field($properties = array()) {
$content = '';
Requirements::javascript(SAPPHIRE_DIR . "/thirdparty/prototype/prototype.js");
Requirements::javascript(SAPPHIRE_DIR . "/thirdparty/behaviour/behaviour.js");
Requirements::javascript(SAPPHIRE_DIR . "/javascript/ToggleField.js");
Requirements::javascript(FRAMEWORK_DIR . "/thirdparty/prototype/prototype.js");
Requirements::javascript(FRAMEWORK_DIR . "/thirdparty/behaviour/behaviour.js");
Requirements::javascript(FRAMEWORK_DIR . "/javascript/ToggleField.js");
if($this->startClosed) $this->addExtraClass('startClosed');

View File

@ -161,15 +161,15 @@ class TreeDropdownField extends FormField {
* @return string
*/
public function Field($properties = array()) {
Requirements::add_i18n_javascript(SAPPHIRE_DIR . '/javascript/lang');
Requirements::add_i18n_javascript(FRAMEWORK_DIR . '/javascript/lang');
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery/jquery.js');
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery-entwine/dist/jquery.entwine-dist.js');
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jstree/jquery.jstree.js');
Requirements::javascript(SAPPHIRE_DIR . '/javascript/TreeDropdownField.js');
Requirements::javascript(FRAMEWORK_DIR . '/thirdparty/jquery/jquery.js');
Requirements::javascript(FRAMEWORK_DIR . '/thirdparty/jquery-entwine/dist/jquery.entwine-dist.js');
Requirements::javascript(FRAMEWORK_DIR . '/thirdparty/jstree/jquery.jstree.js');
Requirements::javascript(FRAMEWORK_DIR . '/javascript/TreeDropdownField.js');
Requirements::css(SAPPHIRE_DIR . '/thirdparty/jquery-ui-themes/smoothness/jquery-ui.css');
Requirements::css(SAPPHIRE_DIR . '/css/TreeDropdownField.css');
Requirements::css(FRAMEWORK_DIR . '/thirdparty/jquery-ui-themes/smoothness/jquery-ui.css');
Requirements::css(FRAMEWORK_DIR . '/css/TreeDropdownField.css');
$record = $this->Value() ? $this->objectForKey($this->Value()) : null;
if($record) {

View File

@ -79,15 +79,15 @@ class TreeMultiselectField extends TreeDropdownField {
* formfield can contain multiple values.
*/
function Field($properties = array()) {
Requirements::add_i18n_javascript(SAPPHIRE_DIR . '/javascript/lang');
Requirements::add_i18n_javascript(FRAMEWORK_DIR . '/javascript/lang');
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery/jquery.js');
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery-entwine/dist/jquery.entwine-dist.js');
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jstree/jquery.jstree.js');
Requirements::javascript(SAPPHIRE_DIR . '/javascript/TreeDropdownField.js');
Requirements::javascript(FRAMEWORK_DIR . '/thirdparty/jquery/jquery.js');
Requirements::javascript(FRAMEWORK_DIR . '/thirdparty/jquery-entwine/dist/jquery.entwine-dist.js');
Requirements::javascript(FRAMEWORK_DIR . '/thirdparty/jstree/jquery.jstree.js');
Requirements::javascript(FRAMEWORK_DIR . '/javascript/TreeDropdownField.js');
Requirements::css(SAPPHIRE_DIR . '/thirdparty/jquery-ui-themes/smoothness/jquery-ui.css');
Requirements::css(SAPPHIRE_DIR . '/css/TreeDropdownField.css');
Requirements::css(FRAMEWORK_DIR . '/thirdparty/jquery-ui-themes/smoothness/jquery-ui.css');
Requirements::css(FRAMEWORK_DIR . '/css/TreeDropdownField.css');
$value = '';
$itemList = '';

View File

@ -321,8 +321,8 @@ class UploadField extends FileField {
Requirements::javascript(THIRDPARTY_DIR . '/jquery/jquery.js');
Requirements::javascript(THIRDPARTY_DIR . '/jquery-ui/jquery-ui.js');
Requirements::javascript(THIRDPARTY_DIR . '/jquery-entwine/dist/jquery.entwine-dist.js');
Requirements::javascript(SAPPHIRE_DIR . '/javascript/i18n.js');
Requirements::javascript(SAPPHIRE_ADMIN_DIR . '/javascript/ssui.core.js');
Requirements::javascript(FRAMEWORK_DIR . '/javascript/i18n.js');
Requirements::javascript(FRAMEWORK_ADMIN_DIR . '/javascript/ssui.core.js');
Requirements::combine_files('uploadfield.js', array(
THIRDPARTY_DIR . '/javascript-templates/tmpl.js',
@ -331,12 +331,12 @@ class UploadField extends FileField {
THIRDPARTY_DIR . '/jquery-fileupload/cors/jquery.xdr-transport.js',
THIRDPARTY_DIR . '/jquery-fileupload/jquery.fileupload.js',
THIRDPARTY_DIR . '/jquery-fileupload/jquery.fileupload-ui.js',
SAPPHIRE_DIR . '/javascript/UploadField_uploadtemplate.js',
SAPPHIRE_DIR . '/javascript/UploadField_downloadtemplate.js',
SAPPHIRE_DIR . '/javascript/UploadField.js',
FRAMEWORK_DIR . '/javascript/UploadField_uploadtemplate.js',
FRAMEWORK_DIR . '/javascript/UploadField_downloadtemplate.js',
FRAMEWORK_DIR . '/javascript/UploadField.js',
));
Requirements::css(THIRDPARTY_DIR . '/jquery-ui-themes/smoothness/jquery-ui.css'); // TODO hmmm, remove it?
Requirements::css(SAPPHIRE_DIR . '/css/UploadField.css');
Requirements::css(FRAMEWORK_DIR . '/css/UploadField.css');
$config = array(
'url' => $this->Link('upload'),
@ -715,7 +715,7 @@ class UploadField_ItemHandler extends RequestHandler {
$items = $this->parent->getItems();
if($this->parent->managesRelation() && !$items->byID($item->ID)) return $this->httpError(403);
Requirements::css(SAPPHIRE_DIR . '/css/UploadField.css');
Requirements::css(FRAMEWORK_DIR . '/css/UploadField.css');
return $this->customise(array(
'Form' => $this->EditForm()

View File

@ -92,7 +92,7 @@ abstract class Validator extends Object {
* - 'message': Validation message (optionally localized)
* - 'messageType': Arbitrary type of the message which is rendered as a CSS class in the FormField template,
* e.g. <span class="message (type)">. Usually "bad|message|validation|required", which renders differently
* if sapphire/css/Form.css is included.
* if framework/css/Form.css is included.
*
* @return array
*/

View File

@ -291,15 +291,15 @@ class GridField extends FormField {
*/
public function FieldHolder($properties = array()) {
Requirements::css(THIRDPARTY_DIR . '/jquery-ui-themes/smoothness/jquery-ui.css');
Requirements::css(SAPPHIRE_DIR . '/css/GridField.css');
Requirements::css(FRAMEWORK_DIR . '/css/GridField.css');
Requirements::javascript(THIRDPARTY_DIR . '/jquery/jquery.js');
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery-ui/jquery-ui.js');
Requirements::javascript(FRAMEWORK_DIR . '/thirdparty/jquery-ui/jquery-ui.js');
Requirements::javascript(THIRDPARTY_DIR . '/json-js/json2.js');
Requirements::javascript(SAPPHIRE_DIR . '/javascript/i18n.js');
Requirements::add_i18n_javascript(SAPPHIRE_DIR . '/javascript/lang');
Requirements::javascript(FRAMEWORK_DIR . '/javascript/i18n.js');
Requirements::add_i18n_javascript(FRAMEWORK_DIR . '/javascript/lang');
Requirements::javascript(THIRDPARTY_DIR . '/jquery-entwine/dist/jquery.entwine-dist.js');
Requirements::javascript(SAPPHIRE_DIR . '/javascript/GridField.js');
Requirements::javascript(FRAMEWORK_DIR . '/javascript/GridField.js');
// Get columns
$columns = $this->getColumns();

View File

@ -84,7 +84,7 @@ class GridFieldPrintButton implements GridField_HTMLProvider, GridField_ActionPr
public function handlePrint($gridField, $request = null) {
set_time_limit(60);
Requirements::clear();
Requirements::css(SAPPHIRE_DIR . '/css/GridField_print.css');
Requirements::css(FRAMEWORK_DIR . '/css/GridField_print.css');
if($data = $this->generatePrintData($gridField)){
return $data->renderWith("GridField_print");
}

View File

@ -19,7 +19,7 @@
* <% sprintf(_t('MyNamespace.MYENTITY','Counting %s things'),$ThingsCount) %>
* </code>
*
* Javascript (see sapphire/javascript/i18n.js):
* Javascript (see framework/javascript/i18n.js):
* <code>
* ss.i18n._t('MyEntity.MyNamespace','My default natural language value');
* </code>
@ -87,8 +87,8 @@ class i18n extends Object implements TemplateGlobalProvider {
/**
* Use javascript i18n through the ss.i18n class (enabled by default).
* If set to TRUE, includes javascript requirements for the base library
* (sapphire/javascript/i18n.js) and all necessary lang files (e.g. sapphire/lang/de_DE.js)
* plus fallbacks to the default locale (e.g. sapphire/lang/en_US.js).
* (framework/javascript/i18n.js) and all necessary lang files (e.g. framework/lang/de_DE.js)
* plus fallbacks to the default locale (e.g. framework/lang/en_US.js).
* If set to FALSE, only includes a stub implementation
* which is necessary. Mainly disabled to save bandwidth
* in a frontend context when website is in single language.

View File

@ -8,7 +8,7 @@
*
* Collects all found entities (and their natural language text for the default locale)
* into language-files for each module in an array notation. Creates or overwrites these files,
* e.g. sapphire/lang/en_US.php.
* e.g. framework/lang/en_US.php.
*
* The collector needs to be run whenever you make new translatable
* entities available. Please don't alter the arrays in language tables manually.
@ -158,8 +158,8 @@ class i18nTextCollector extends Object {
// Search for calls in code files if these exists
if(is_dir("$this->basePath/$module/code")) {
$fileList = $this->getFilesRecursive("$this->basePath/$module/code");
} else if($module == 'sapphire' || substr($module, 0, 7) == 'themes/') {
// sapphire doesn't have the usual module structure, so we'll scan all subfolders
} else if($module == FRAMEWORK_DIR || substr($module, 0, 7) == 'themes/') {
// framework doesn't have the usual module structure, so we'll scan all subfolders
$fileList = $this->getFilesRecursive("$this->basePath/$module");
}
foreach($fileList as $filePath) {

View File

@ -6,7 +6,7 @@
* @subpackage i18n
*/
i18n::include_locale_file('sapphire', 'en_US');
i18n::include_locale_file(FRAMEWORK_DIR, 'en_US');
global $lang;

View File

@ -6,7 +6,7 @@
* @subpackage i18n
*/
i18n::include_locale_file('sapphire', 'en_US');
i18n::include_locale_file(FRAMEWORK_DIR, 'en_US');
global $lang;

View File

@ -6,7 +6,7 @@
* @subpackage i18n
*/
i18n::include_locale_file('sapphire', 'en_US');
i18n::include_locale_file(FRAMEWORK_DIR, 'en_US');
global $lang;

View File

@ -6,7 +6,7 @@
* @subpackage i18n
*/
i18n::include_locale_file('sapphire', 'en_US');
i18n::include_locale_file(FRAMEWORK_DIR, 'en_US');
global $lang;

View File

@ -6,7 +6,7 @@
* @subpackage i18n
*/
i18n::include_locale_file('sapphire', 'en_US');
i18n::include_locale_file(FRAMEWORK_DIR, 'en_US');
global $lang;

View File

@ -6,7 +6,7 @@
* @subpackage i18n
*/
i18n::include_locale_file('sapphire', 'en_US');
i18n::include_locale_file(FRAMEWORK_DIR, 'en_US');
global $lang;

View File

@ -6,7 +6,7 @@
* @subpackage i18n
*/
i18n::include_locale_file('sapphire', 'en_US');
i18n::include_locale_file(FRAMEWORK_DIR, 'en_US');
global $lang;

View File

@ -6,7 +6,7 @@
* @subpackage i18n
*/
i18n::include_locale_file('sapphire', 'en_US');
i18n::include_locale_file(FRAMEWORK_DIR, 'en_US');
global $lang;

View File

@ -6,7 +6,7 @@
* @subpackage i18n
*/
i18n::include_locale_file('sapphire', 'en_US');
i18n::include_locale_file(FRAMEWORK_DIR, 'en_US');
global $lang;

View File

@ -6,7 +6,7 @@
* @subpackage i18n
*/
i18n::include_locale_file('sapphire', 'en_US');
i18n::include_locale_file(FRAMEWORK_DIR, 'en_US');
global $lang;

View File

@ -6,7 +6,7 @@
* @subpackage i18n
*/
i18n::include_locale_file('sapphire', 'en_US');
i18n::include_locale_file(FRAMEWORK_DIR, 'en_US');
global $lang;

View File

@ -6,7 +6,7 @@
* @subpackage i18n
*/
i18n::include_locale_file('sapphire', 'en_US');
i18n::include_locale_file(FRAMEWORK_DIR, 'en_US');
global $lang;

View File

@ -6,7 +6,7 @@
* @subpackage i18n
*/
i18n::include_locale_file('sapphire', 'en_US');
i18n::include_locale_file(FRAMEWORK_DIR, 'en_US');
global $lang;

View File

@ -6,7 +6,7 @@
* @subpackage i18n
*/
i18n::include_locale_file('sapphire', 'en_US');
i18n::include_locale_file(FRAMEWORK_DIR, 'en_US');
global $lang;

View File

@ -6,7 +6,7 @@
* @subpackage i18n
*/
i18n::include_locale_file('sapphire', 'en_US');
i18n::include_locale_file(FRAMEWORK_DIR, 'en_US');
global $lang;

View File

@ -6,7 +6,7 @@
* @subpackage i18n
*/
i18n::include_locale_file('sapphire', 'en_US');
i18n::include_locale_file(FRAMEWORK_DIR, 'en_US');
global $lang;

View File

@ -6,7 +6,7 @@
* @subpackage i18n
*/
i18n::include_locale_file('sapphire', 'en_US');
i18n::include_locale_file(FRAMEWORK_DIR, 'en_US');
global $lang;

View File

@ -6,7 +6,7 @@
* @subpackage i18n
*/
i18n::include_locale_file('sapphire', 'en_US');
i18n::include_locale_file(FRAMEWORK_DIR, 'en_US');
global $lang;

View File

@ -6,7 +6,7 @@
* @subpackage i18n
*/
i18n::include_locale_file('sapphire', 'en_US');
i18n::include_locale_file(FRAMEWORK_DIR, 'en_US');
global $lang;

View File

@ -6,7 +6,7 @@
* @subpackage i18n
*/
i18n::include_locale_file('sapphire', 'en_US');
i18n::include_locale_file(FRAMEWORK_DIR, 'en_US');
global $lang;

View File

@ -6,7 +6,7 @@
* @subpackage i18n
*/
i18n::include_locale_file('sapphire', 'en_US');
i18n::include_locale_file(FRAMEWORK_DIR, 'en_US');
global $lang;

View File

@ -6,7 +6,7 @@
* @subpackage i18n
*/
i18n::include_locale_file('sapphire', 'en_US');
i18n::include_locale_file(FRAMEWORK_DIR, 'en_US');
global $lang;

View File

@ -6,7 +6,7 @@
* @subpackage i18n
*/
i18n::include_locale_file('sapphire', 'en_US');
i18n::include_locale_file(FRAMEWORK_DIR, 'en_US');
global $lang;

View File

@ -6,7 +6,7 @@
* @subpackage i18n
*/
i18n::include_locale_file('sapphire', 'en_US');
i18n::include_locale_file(FRAMEWORK_DIR, 'en_US');
global $lang;

View File

@ -6,7 +6,7 @@
* @subpackage i18n
*/
i18n::include_locale_file('sapphire', 'en_US');
i18n::include_locale_file(FRAMEWORK_DIR, 'en_US');
global $lang;

View File

@ -6,7 +6,7 @@
* @subpackage i18n
*/
i18n::include_locale_file('sapphire', 'en_US');
i18n::include_locale_file(FRAMEWORK_DIR, 'en_US');
global $lang;

View File

@ -6,7 +6,7 @@
* @subpackage i18n
*/
i18n::include_locale_file('sapphire', 'en_US');
i18n::include_locale_file(FRAMEWORK_DIR, 'en_US');
global $lang;

View File

@ -6,7 +6,7 @@
* @subpackage i18n
*/
i18n::include_locale_file('sapphire', 'en_US');
i18n::include_locale_file(FRAMEWORK_DIR, 'en_US');
global $lang;

View File

@ -6,7 +6,7 @@
* @subpackage i18n
*/
i18n::include_locale_file('sapphire', 'en_US');
i18n::include_locale_file(FRAMEWORK_DIR, 'en_US');
global $lang;

View File

@ -6,7 +6,7 @@
* @subpackage i18n
*/
i18n::include_locale_file('sapphire', 'en_US');
i18n::include_locale_file(FRAMEWORK_DIR, 'en_US');
global $lang;

View File

@ -6,7 +6,7 @@
* @subpackage i18n
*/
i18n::include_locale_file('sapphire', 'en_US');
i18n::include_locale_file(FRAMEWORK_DIR, 'en_US');
global $lang;

View File

@ -6,7 +6,7 @@
* @subpackage i18n
*/
i18n::include_locale_file('sapphire', 'en_US');
i18n::include_locale_file(FRAMEWORK_DIR, 'en_US');
global $lang;

View File

@ -6,7 +6,7 @@
* @subpackage i18n
*/
i18n::include_locale_file('sapphire', 'en_US');
i18n::include_locale_file(FRAMEWORK_DIR, 'en_US');
global $lang;

View File

@ -6,7 +6,7 @@
* @subpackage i18n
*/
i18n::include_locale_file('sapphire', 'en_US');
i18n::include_locale_file(FRAMEWORK_DIR, 'en_US');
global $lang;

View File

@ -6,7 +6,7 @@
* @subpackage i18n
*/
i18n::include_locale_file('sapphire', 'en_US');
i18n::include_locale_file(FRAMEWORK_DIR, 'en_US');
global $lang;

View File

@ -6,7 +6,7 @@
* @subpackage i18n
*/
i18n::include_locale_file('sapphire', 'en_US');
i18n::include_locale_file(FRAMEWORK_DIR, 'en_US');
global $lang;

View File

@ -6,7 +6,7 @@
* @subpackage i18n
*/
i18n::include_locale_file('sapphire', 'en_US');
i18n::include_locale_file(FRAMEWORK_DIR, 'en_US');
global $lang;

View File

@ -6,7 +6,7 @@
* @subpackage i18n
*/
i18n::include_locale_file('sapphire', 'en_US');
i18n::include_locale_file(FRAMEWORK_DIR, 'en_US');
global $lang;

View File

@ -41,9 +41,9 @@ if (version_compare(phpversion(), '5.3.2', '<')) {
*
* CONFIGURING THE WEBSERVER
*
* To use Sapphire, every request that doesn't point directly to a file should be rewritten to
* sapphire/main.php?url=(url). For example, http://www.example.com/about-us/rss would be rewritten
* to http://www.example.com/sapphire/main.php?url=about-us/rss
* To use SilverStripe, every request that doesn't point directly to a file should be rewritten to
* framework/main.php?url=(url). For example, http://www.example.com/about-us/rss would be rewritten
* to http://www.example.com/framework/main.php?url=about-us/rss
*
* It's important that requests that point directly to a file aren't rewritten; otherwise, visitors
* won't be able to download any CSS, JS, image files, or other downloads.
@ -57,7 +57,7 @@ if (version_compare(phpversion(), '5.3.2', '<')) {
/**
* Include Sapphire's core code
* Include SilverStripe's core code
*/
require_once("core/Core.php");

View File

@ -1138,7 +1138,7 @@ class MySQLQuery extends SS_Query {
private $handle;
/**
* Hook the result-set given into a Query class, suitable for use by sapphire.
* Hook the result-set given into a Query class, suitable for use by SilverStripe.
* @param database The database object that created this query.
* @param handle the internal mysql handle that is points to the resultset.
*/

View File

@ -44,7 +44,7 @@ class HTMLText extends Text {
* @param string $add What to add to the end of the summary if we cut at a less-than-ideal cut point
* @return string A nice(ish) summary with no html tags (but possibly still some html entities)
*
* @see sapphire/core/model/fieldtypes/Text#Summary($maxWords)
* @see framework/core/model/fieldtypes/Text#Summary($maxWords)
*/
public function Summary($maxWords = 50, $flex = 15, $add = '...') {
$str = false;
@ -106,7 +106,7 @@ class HTMLText extends Text {
*
* This is the HTML aware equivilent to Text#FirstSentence
*
* @see sapphire/core/model/fieldtypes/Text#FirstSentence()
* @see framework/core/model/fieldtypes/Text#FirstSentence()
*/
function FirstSentence() {
/* Use summary's html processing logic to get the first paragraph */

View File

@ -29,13 +29,16 @@ class BBCodeParser extends TextParser {
protected static $allowSimilies = false;
/**
* Set the location of the smiles folder. By default use the ones in sapphire
* Set the location of the smiles folder. By default use the ones in framework
* but this can be overridden by setting BBCodeParser::set_icon_folder('themes/yourtheme/images/');
* @var string
*/
protected static $smilies_location = 'sapphire/images/smilies';
protected static $smilies_location = null;
static function smilies_location() {
if(!BBCodeParser::$smilies_location) {
return FRAMEWORK_DIR . '/images/smilies';
}
return BBCodeParser::$smilies_location;
}
static function set_icon_folder($path) {

19
sake
View File

@ -2,26 +2,29 @@
# Check for an argument
if [ ${1:-""} = "" ]; then
echo "Sapphire Sake
echo "SilverStripe Sake
Usage: $0 (command-url) (params)
Executes a Sapphire command"
Executes a SilverStripe command"
exit 1
fi
# Set $sapphire and $base
# Set $framework and $base
sakedir=`dirname $0`
if [ -f $sakedir/cli-script.php ]; then
sapphire=$sakedir
framework=$sakedir
base=`dirname $sakedir`
elif [ -d ./framework ]; then
framework=./framework
base=.
elif [ -d ./sapphire ]; then
sapphire=./sapphire
framework=./sapphire
base=.
elif [ -f ./cli-script.php ]; then
sapphire=.
framework=.
base=..
else
echo "Can't find ./sapphire/cli-script.php or ./cli-script.php"
echo "Can't find ./framework/cli-script.php or ./cli-script.php"
exit 1
fi
@ -102,4 +105,4 @@ fi
################################################################################################
## Basic execution
$php $sapphire/cli-script.php ${*}
$php $framework/cli-script.php ${*}

View File

@ -1,5 +1,5 @@
/*
typography.css has been removed from sapphire, why shall we still has this? a dynamic typographp.css should be used by
typography.css has been removed from framework, why shall we still has this? a dynamic typographp.css should be used by
server side call, like Requirements::css();
@import url("typography.css");
*/
@ -124,7 +124,7 @@ html>body div.TreeDropdownField div.tree_holder {
div.TreeDropdownField a.editLink {
border-width: 1px 1px 1px 0;
background: url(../../sapphire/images/TreeDropdownField_button.gif) left top no-repeat;
background: url(../images/TreeDropdownField_button.gif) left top no-repeat;
width: 19px;
height: 21px;
margin: 0;

View File

@ -77,21 +77,21 @@
#right form .hasmanyfile .currentFiles a.pdf {
padding: 2px;
padding-left: 20px;
background: url(../../sapphire/images/icons/page_white_acrobat.png) no-repeat left center;
background: url(../images/icons/page_white_acrobat.png) no-repeat left center;
}
#right form .hasmanyfile .currentFiles a[href$=".doc"],
#right form .hasmanyfile .currentFiles a[href$=".DOC"],
#right form .hasmanyfile .currentFiles a.doc {
padding: 2px;
padding-left: 20px;
background: url(../../sapphire/images/icons/page_word.png) no-repeat left center;
background: url(../images/icons/page_word.png) no-repeat left center;
}
#right form .hasmanyfile .currentFiles a[href$=".xls"],
#right form .hasmanyfile .currentFiles a[href$=".XLS"],
#right form .hasmanyfile .currentFiles a.xls {
padding: 2px;
padding-left: 20px;
background: url(../../sapphire/images/icons/page_excel.png) no-repeat left center;
background: url(../images/icons/page_excel.png) no-repeat left center;
}
#right form .hasmanyfile .currentFiles a[href$=".gz"],
#right form .hasmanyfile .currentFiles a[href$=".GZ"],
@ -102,7 +102,7 @@
#right form .hasmanyfile .currentFiles a.archive {
padding: 2px;
padding-left: 20px;
background: url(../../sapphire/images/icons/page_white_zip.png) no-repeat left center;
background: url(../images/icons/page_white_zip.png) no-repeat left center;
}
#right form .hasmanyfile .currentFiles a[href$=".jpg"],
#right form .hasmanyfile .currentFiles a[href$=".JPG"],
@ -113,12 +113,12 @@
#right form .hasmanyfile .currentFiles a.image {
padding: 2px;
padding-left: 20px;
background: url(../../sapphire/images/icons/icon-jpg.gif) no-repeat left center;
background: url(../images/icons/icon-jpg.gif) no-repeat left center;
}
#right form .hasmanyfile .currentFiles a[href$=".exe"],
#right form .hasmanyfile .currentFiles a[href$=".EXE"],
#right form .hasmanyfile .currentFiles a.application {
padding: 2px;
padding-left: 20px;
background: url(../../sapphire/images/icons/application.png) no-repeat left center;
background: url(../images/icons/application.png) no-repeat left center;
}

View File

@ -60,7 +60,7 @@ class Group extends DataObject {
* @return FieldList
*/
public function getCMSFields() {
Requirements::javascript(SAPPHIRE_DIR . '/javascript/PermissionCheckboxSetField.js');
Requirements::javascript(FRAMEWORK_DIR . '/javascript/PermissionCheckboxSetField.js');
$fields = new FieldList(
new TabSet("Root",

View File

@ -1433,7 +1433,7 @@ class Member_GroupSet extends ManyManyList {
class Member_ProfileForm extends Form {
function __construct($controller, $name, $member) {
Requirements::block(SAPPHIRE_DIR . '/admin/css/layout.css');
Requirements::block(FRAMEWORK_DIR . '/admin/css/layout.css');
$fields = $member->getCMSFields();
$fields->push(new HiddenField('ID','ID',$member->ID));

View File

@ -71,8 +71,8 @@ class PermissionCheckboxSetField extends FormField {
}
function Field($properties = array()) {
Requirements::css(SAPPHIRE_DIR . '/css/CheckboxSetField.css');
Requirements::javascript(SAPPHIRE_DIR . '/javascript/PermissionCheckboxSetField.js');
Requirements::css(FRAMEWORK_DIR . '/css/CheckboxSetField.css');
Requirements::javascript(FRAMEWORK_DIR . '/javascript/PermissionCheckboxSetField.js');
$uninheritedCodes = array();
$inheritedCodes = array();

View File

@ -362,16 +362,16 @@ class Security extends Controller {
// with the tabstrip library otherwise
$link_base = Director::absoluteURL($this->Link("login"));
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery/jquery.js');
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery-ui/jquery-ui.js');
Requirements::javascript(FRAMEWORK_DIR . '/thirdparty/jquery/jquery.js');
Requirements::javascript(FRAMEWORK_DIR . '/thirdparty/jquery-ui/jquery-ui.js');
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery-entwine/dist/jquery.entwine-dist.js');
Requirements::javascript(FRAMEWORK_DIR . '/thirdparty/jquery-entwine/dist/jquery.entwine-dist.js');
Requirements::css(THIRDPARTY_DIR . '/jquery-ui-themes/smoothness/jquery-ui.css');
Requirements::css(SAPPHIRE_DIR . '/css/Security_login.css');
Requirements::css(FRAMEWORK_DIR . '/css/Security_login.css');
Requirements::javascript(SAPPHIRE_DIR . '/javascript/TabSet.js');
Requirements::javascript(FRAMEWORK_DIR . '/javascript/TabSet.js');
$content = '<div id="Form_EditForm">';
$content .= '<div class="ss-tabset">';

View File

@ -35,7 +35,7 @@ if (
) {
// Define system paths (copied from Core.php)
if(!defined('BASE_PATH')) {
// Assuming that this file is sapphire/static-main.php we can then determine the base path
// Assuming that this file is framework/static-main.php we can then determine the base path
define('BASE_PATH', rtrim(dirname(dirname(__FILE__))), DIRECTORY_SEPARATOR);
}
if(!defined('BASE_URL')) {

View File

@ -29,7 +29,7 @@
* You can test your task from the command line by running the following command
* (replace <MyTask> is the classname of your task):
*
* <code>sapphire/cli-script.php /<MyTask></code>
* <code>framework/cli-script.php /<MyTask></code>
*
* To perform all Daily tasks, run from the command line:
*
@ -39,16 +39,16 @@
*
* <code>
* # Quarter-hourly task (every hour at 25 minutes past) (remove space between first * and /15)
* * /15 * * * * www-data /my/webroot/sapphire/cli-script.php /QuarterlyHourlyTask > /var/log/silverstripe_quarterhourlytask.log
* * /15 * * * * www-data /my/webroot/framework/cli-script.php /QuarterlyHourlyTask > /var/log/silverstripe_quarterhourlytask.log
*
* # HourlyTask (every hour at 25 minutes past)
* 25 * * * * www-data /my/webroot/sapphire/cli-script.php /HourlyTask > /var/log/silverstripe_hourlytask.log
* 25 * * * * www-data /my/webroot/framework/cli-script.php /HourlyTask > /var/log/silverstripe_hourlytask.log
*
* # DailyTask (every day at 6:25am)
* 25 6 * * * www-data /my/webroot/sapphire/cli-script.php /DailyTask > /var/log/silverstripe_dailytask.log
* 25 6 * * * www-data /my/webroot/framework/cli-script.php /DailyTask > /var/log/silverstripe_dailytask.log
*
* # WeelkyTask (every Monday at 6:25am)
* 25 6 1 * * www-data /my/webroot/sapphire/cli-script.php /WeeklyTask > /var/log/silverstripe_weeklytask.log
* 25 6 1 * * www-data /my/webroot/framework/cli-script.php /WeeklyTask > /var/log/silverstripe_weeklytask.log
* </code>
*
* @todo Improve documentation

View File

@ -1,7 +1,7 @@
<html>
<head>
<% base_tag %>
<link rel="stylesheet" href="sapphire/css/CodeViewer.css" />
<link rel="stylesheet" href="$FrameworkDir/css/CodeViewer.css" />
</head>
<body>
$Content

View File

@ -17,9 +17,9 @@
<span class="sortLink <% if SortBy %><% else %>sortLinkHidden<% end_if %>">
<a href="$SortLink">
<% if SortDirection = desc %>
<img src="sapphire/images/bullet_arrow_up.png" alt="<% _t('SORTASC', 'Sort ascending') %>" />
<img src="$FrameworkDir/images/bullet_arrow_up.png" alt="<% _t('SORTASC', 'Sort ascending') %>" />
<% else %>
<img src="sapphire/images/bullet_arrow_down.png" alt="<% _t('SORTDESC', 'Sort descending') %>" />
<img src="$FrameworkDir/images/bullet_arrow_down.png" alt="<% _t('SORTDESC', 'Sort descending') %>" />
<% end_if %>
</a>
&nbsp;
@ -49,7 +49,7 @@
<td colspan="$ItemCount">
<input type="hidden" id="{$id}_PopupHeight" value="$PopupHeight" disabled="disabled">
<input type="hidden" id="{$id}_PopupWidth" value="$PopupWidth" disabled="disabled">
<a class="popuplink addlink" href="$AddLink" alt="add"><img src="sapphire/images/add.gif" alt="<% _t('ADDITEM', 'add') %>" />
<a class="popuplink addlink" href="$AddLink" alt="add"><img src="$FrameworkDir/images/add.gif" alt="<% _t('ADDITEM', 'add') %>" />
<% sprintf(_t('ADDITEM', 'Add %s', PR_MEDIUM, 'Add [name]'),$Title) %>
</a>
</td>

View File

@ -15,7 +15,7 @@
<tr>
<% if Paginator.PrevLink %>
<td id="ComplexTableField_Pagination_Previous">
<a href="$Paginator.PrevLink"><img src="sapphire/images/pagination/record-prev.png" /><% _t('PREVIOUS', 'Previous') %></a>
<a href="$Paginator.PrevLink"><img src="$FrameworkDir/images/pagination/record-prev.png" /><% _t('PREVIOUS', 'Previous') %></a>
</td>
<% end_if %>
<% if xdsfdsf %>
@ -32,7 +32,7 @@
<% end_if %>
<% if Paginator.NextLink %>
<td id="ComplexTableField_Pagination_Next">
<a href="$Paginator.NextLink"><% _t('NEXT', 'Next') %><img src="sapphire/images/pagination/record-next.png" /></a>
<a href="$Paginator.NextLink"><% _t('NEXT', 'Next') %><img src="$FrameworkDir/images/pagination/record-next.png" /></a>
</td>
<% end_if %>
</tr>

View File

@ -1,17 +1,17 @@
<% if ShowPagination %>
<% if TotalCount %>
<div class="PageControls">
<% if FirstLink %><a class="First" href="$FirstLink" title="<% _t('VIEWFIRST', 'View first') %> $PageSize"><img src="sapphire/images/pagination/record-first.png" alt="<% _t('VIEWFIRST', 'View first') %> $PageSize" /></a>
<% else %><span class="First"><img src="sapphire/images/pagination/record-first-g.png" alt="<% _t('VIEWFIRST', 'View first') %> $PageSize" /></span><% end_if %>
<% if PrevLink %><a class="Prev" href="$PrevLink" title="<% _t('VIEWPREVIOUS', 'View previous') %> $PageSize"><img src="sapphire/images/pagination/record-prev.png" alt="<% _t('VIEWPREVIOUS', 'View previous') %> $PageSize" /></a>
<% else %><img class="Prev" src="sapphire/images/pagination/record-prev-g.png" alt="<% _t('VIEWPREVIOUS', 'View previous') %> $PageSize" /><% end_if %>
<% if FirstLink %><a class="First" href="$FirstLink" title="<% _t('VIEWFIRST', 'View first') %> $PageSize"><img src="$FrameworkDir/images/pagination/record-first.png" alt="<% _t('VIEWFIRST', 'View first') %> $PageSize" /></a>
<% else %><span class="First"><img src="$FrameworkDir/images/pagination/record-first-g.png" alt="<% _t('VIEWFIRST', 'View first') %> $PageSize" /></span><% end_if %>
<% if PrevLink %><a class="Prev" href="$PrevLink" title="<% _t('VIEWPREVIOUS', 'View previous') %> $PageSize"><img src="$FrameworkDir/images/pagination/record-prev.png" alt="<% _t('VIEWPREVIOUS', 'View previous') %> $PageSize" /></a>
<% else %><img class="Prev" src="$FrameworkDir/images/pagination/record-prev-g.png" alt="<% _t('VIEWPREVIOUS', 'View previous') %> $PageSize" /><% end_if %>
<span class="Count">
<% _t('DISPLAYING', 'Displaying') %> $FirstItem <% _t('TO', 'to') %> $LastItem <% _t('OF', 'of') %> $TotalCount
</span>
<% if NextLink %><a class="Next" href="$NextLink" title="<% _t('VIEWNEXT', 'View next') %> $PageSize"><img src="sapphire/images/pagination/record-next.png" alt="<% _t('VIEWNEXT', 'View next') %> $PageSize" /></a>
<% else %><img class="Next" src="sapphire/images/pagination/record-next-g.png" alt="<% _t('VIEWNEXT', 'View next') %> $PageSize" /><% end_if %>
<% if LastLink %><a class="Last" href="$LastLink" title="<% _t('VIEWLAST', 'View last') %> $PageSize"><img src="sapphire/images/pagination/record-last.png" alt="<% _t('VIEWLAST', 'View last') %> $PageSize" /></a>
<% else %><span class="Last"><img src="sapphire/images/pagination/record-last-g.png" alt="<% _t('VIEWLAST', 'View last') %> $PageSize" /></span><% end_if %>
<% if NextLink %><a class="Next" href="$NextLink" title="<% _t('VIEWNEXT', 'View next') %> $PageSize"><img src="$FrameworkDir/images/pagination/record-next.png" alt="<% _t('VIEWNEXT', 'View next') %> $PageSize" /></a>
<% else %><img class="Next" src="$FrameworkDir/images/pagination/record-next-g.png" alt="<% _t('VIEWNEXT', 'View next') %> $PageSize" /><% end_if %>
<% if LastLink %><a class="Last" href="$LastLink" title="<% _t('VIEWLAST', 'View last') %> $PageSize"><img src="$FrameworkDir/images/pagination/record-last.png" alt="<% _t('VIEWLAST', 'View last') %> $PageSize" /></a>
<% else %><span class="Last"><img src="$FrameworkDir/images/pagination/record-last-g.png" alt="<% _t('VIEWLAST', 'View last') %> $PageSize" /></span><% end_if %>
</div>
<% end_if %>

View File

@ -34,7 +34,7 @@
<td colspan="$ItemCount">
<input type="hidden" id="{$id}_PopupHeight" value="$PopupHeight" disabled="disabled">
<input type="hidden" id="{$id}_PopupWidth" value="$PopupWidth" disabled="disabled">
<a class="popuplink addlink" href="$AddLink" alt="<% _t('ADD', 'Add') %>"><img src="sapphire/images/add.gif" alt="<% _t('ADD', 'Add') %>" /><% _t('ADD', 'Add') %> $Title</a>
<a class="popuplink addlink" href="$AddLink" alt="<% _t('ADD', 'Add') %>"><img src="$FrameworkDir/images/add.gif" alt="<% _t('ADD', 'Add') %>" /><% _t('ADD', 'Add') %> $Title</a>
</td>
<% if Can(show) %><td width="18">&nbsp;</td><% end_if %>
<% if Can(edit) %><td width="18">&nbsp;</td><% end_if %>

View File

@ -1,13 +1,13 @@
<html>
<head>
<title>Sapphire Application Information</title>
<title>SilverStripe Application Information</title>
</head>
<body>
<h1>Sapphire Application Information</h1>
<h1>SilverStripe Application Information</h1>
<dl>
<dt>Sapphire version:</dt> <dd>$Version</dd>
<dt>SilverStripe version:</dt> <dd>$Version</dd>
<dt>Environment type:</dt> <dd>$EnvironmentType</dd>
<dt>Site URL:</dt> <dd>$BaseURL</dd>
</dl>

View File

@ -30,7 +30,7 @@
<% if Can(add) %>
<tr>
<td colspan="$ItemCount">
<a href="#" class="addrow" title="<% _t('ADD', 'Add a new row') %>"><img src="sapphire/images/add.gif" alt="<% _t('ADD','Add a new row') %>" />
<a href="#" class="addrow" title="<% _t('ADD', 'Add a new row') %>"><img src="$FrameworkDir/images/add.gif" alt="<% _t('ADD','Add a new row') %>" />
<% sprintf(_t('ADDITEM','Add %s'),$Title) %>
</a>
</td>
@ -47,7 +47,7 @@
<td class="$FieldClass $extraClass $ClassName $Title tablecolumn">$Field</td>
<% end_control %>
<td style="display: none">$ExtraData</td>
<% if Can(delete) %><td width="18"><a class="deletelink" href="$DeleteLink" title="<% _t('DELETEROW') %>"><img src="sapphire/images/delete.gif" alt="<% _t('DELETE') %>" /></a></td><% end_if %>
<% if Can(delete) %><td width="18"><a class="deletelink" href="$DeleteLink" title="<% _t('DELETEROW') %>"><img src="$FrameworkDir/images/delete.gif" alt="<% _t('DELETE') %>" /></a></td><% end_if %>
</tr>
<% end_control %>
<% else %>

View File

@ -24,9 +24,9 @@
</span>
<span class="sortLink <% if SortBy %><% else %>sortLinkHidden<% end_if %>">
<% if SortDirection = desc %>
<a href="$SortLink"><img src="sapphire/images/bullet_arrow_up.png" alt="<% _t('SORTDESC', 'Sort in descending order') %>" /></a>
<a href="$SortLink"><img src="$FrameworkDir/images/bullet_arrow_up.png" alt="<% _t('SORTDESC', 'Sort in descending order') %>" /></a>
<% else %>
<a href="$SortLink"><img src="sapphire/images/bullet_arrow_down.png" alt="<% _t('SORTASC', 'Sort in ascending order') %>" /></a>
<a href="$SortLink"><img src="$FrameworkDir/images/bullet_arrow_down.png" alt="<% _t('SORTASC', 'Sort in ascending order') %>" /></a>
<% end_if %>
</a>
&nbsp;

View File

@ -1,7 +1,7 @@
<html>
<head>
<% base_tag %>
<link rel="stylesheet" href="sapphire/css/TestViewer.css" />
<link rel="stylesheet" href="$FrameworkDir/css/TestViewer.css" />
</head>
<body>
$Content

View File

@ -1,7 +1,7 @@
<div id="$Name" class="$Type $extraClass">
<h$HeadingLevel style="cursor: pointer;" class="trigger$ClosedClass">
<img class="triggerClosed" src="sapphire/images/toggle-closed.gif" alt="+" style="display:none;" title="<% _t('SHOW', 'Show') %>" />
<img class="triggerOpened" src="sapphire/images/toggle-open.gif" alt="-" style="display:none;" title="<% _t('HIDE', 'Hide') %>" />
<img class="triggerClosed" src="$FrameworkDir/images/toggle-closed.gif" alt="+" style="display:none;" title="<% _t('SHOW', 'Show') %>" />
<img class="triggerOpened" src="$FrameworkDir/images/toggle-open.gif" alt="-" style="display:none;" title="<% _t('HIDE', 'Hide') %>" />
$Title
</h$HeadingLevel>
<div class="contentMore">

View File

@ -6,9 +6,9 @@
* to group or testsuite definitions in a custom phpunit.xml file.
*
* Usage:
* - "phpunit sapphire/tests/FullTestSuite.php"
* - "phpunit framework/tests/FullTestSuite.php"
* (all tests)
* - "phpunit sapphire/tests/FullTestSuite.php '' module=sapphire,cms"
* - "phpunit framework/tests/FullTestSuite.php '' module=framework,cms"
* (comma-separated modules. empty quotes are necessary to avoid PHPUnit argument confusion)
*
* See http://www.phpunit.de/manual/current/en/organizing-tests.html#organizing-tests.testsuite
@ -27,7 +27,7 @@ class FullTestSuite {
* @return PHPUnit_Framework_TestSuite
*/
public static function suite() {
require_once('sapphire/tests/bootstrap.php');
require_once(dirname(__FILE__) . '/bootstrap.php');
$suite = new PHPUnit_Framework_TestSuite();
if(isset($_GET['module'])) {
@ -47,7 +47,7 @@ class FullTestSuite {
* @return Array
*/
public static function get_all_tests() {
require_once('sapphire/tests/bootstrap.php');
require_once(dirname(__FILE__) . '/bootstrap.php');
TestRunner::use_test_manifest();
$tests = ClassInfo::subclassesFor('SapphireTest');
@ -58,13 +58,13 @@ class FullTestSuite {
/**
* Run tests for one or more "modules".
* A module is generally a toplevel folder, e.g. "mysite" or "sapphire".
* A module is generally a toplevel folder, e.g. "mysite" or "framework".
*
* @param String $nameStr
* @return Array
*/
protected static function get_module_tests($namesStr) {
require_once('sapphire/tests/bootstrap.php');
require_once(dirname(__FILE__) . '/bootstrap.php');
$tests = array();
$names = explode(',', $namesStr);

View File

@ -24,7 +24,7 @@ class PhpSyntaxTest extends SapphireTest {
$settingTests = array('short_open_tag=Off','short_open_tag=On -d asp_tags=On');
$files = $this->getAllFiles('php');
$files[] = BASE_PATH.'/sapphire/dev/install/config-form.html';
$files[] = FRAMEWORK_PATH.'/dev/install/config-form.html';
foreach($files as $i => $file) {
$CLI_file = escapeshellarg($file);

View File

@ -1,5 +1,5 @@
<?php
// Simulate an execution from sapphire/cli-script.php, Core.php has too many
// Simulate an execution from framework/cli-script.php, Core.php has too many
// hardcoded assumptions about folder depth of the executing script.
// Make sure display_errors is on
@ -9,10 +9,13 @@ ini_set('display_errors', 1);
global $_SERVER;
if (!$_SERVER) $_SERVER = array();
$_SERVER['SCRIPT_FILENAME'] = getcwd() . DIRECTORY_SEPARATOR . 'sapphire' . DIRECTORY_SEPARATOR . 'cli-script.php';
$_SERVER['SCRIPT_NAME'] = '.' . DIRECTORY_SEPARATOR . 'sapphire' . DIRECTORY_SEPARATOR . 'cli-script.php';
$frameworkPath = dirname(dirname(__FILE__));
$frameworkDir = basename($frameworkPath);
define('BASE_PATH', getcwd());
$_SERVER['SCRIPT_FILENAME'] = $frameworkPath . DIRECTORY_SEPARATOR . 'cli-script.php';
$_SERVER['SCRIPT_NAME'] = '.' . DIRECTORY_SEPARATOR . $frameworkDir . DIRECTORY_SEPARATOR . 'cli-script.php';
define('BASE_PATH', dirname($frameworkPath));
// Copied from cli-script.php, to enable same behaviour through phpunit runner.
if(isset($_SERVER['argv'][2])) {
@ -34,7 +37,7 @@ if(isset($_SERVER['argv'][2])) {
$_GET['flush'] = 1;
// Connect to database
require_once(getcwd()."/sapphire/core/Core.php");
require_once($frameworkPath . "/core/Core.php");
global $databaseConfig;
DB::connect($databaseConfig);

View File

@ -251,7 +251,7 @@ class DirectorTest extends SapphireTest {
'SERVER_PROTOCOL' => 'HTTP/1.1',
'REQUEST_METHOD' => 'GET',
'REQUEST_URI' => '/',
'SCRIPT_NAME' => '/sapphire/main.php',
'SCRIPT_NAME' => FRAMEWORK_DIR . '/main.php',
'CONTENT_TYPE' => 'text/xml',
'CONTENT_LENGTH' => 10
);

View File

@ -24,10 +24,10 @@ class ClassInfoTest extends SapphireTest {
}
function testClassesForFolder() {
//$baseFolder = Director::baseFolder() . '/' . SAPPHIRE_DIR . '/tests/_ClassInfoTest';
//$baseFolder = Director::baseFolder() . '/' . FRAMEWORK_DIR . '/tests/_ClassInfoTest';
//$manifestInfo = ManifestBuilder::get_manifest_info($baseFolder);
$classes = ClassInfo::classes_for_folder('sapphire/tests');
$classes = ClassInfo::classes_for_folder(FRAMEWORK_DIR . '/tests');
$this->assertContains(
'classinfotest',
$classes,

View File

@ -1,6 +1,6 @@
<?php
/**
* Tests for the core of sapphire, such as how the temporary
* Tests for the core of SilverStripe, such as how the temporary
* directory is determined throughout the framework.
*
* @package sapphire

View File

@ -23,12 +23,12 @@ class NamespacedClassManifestTest extends SapphireTest {
public function testGetItemPath() {
$expect = array(
'SAPPHIRE\TEST\CLASSA' => 'module/classes/ClassA.php',
'Sapphire\Test\ClassA' => 'module/classes/ClassA.php',
'sapphire\test\classa' => 'module/classes/ClassA.php',
'SAPPHIRE\TEST\INTERFACEA' => 'module/interfaces/InterfaceA.php',
'Sapphire\Test\InterfaceA' => 'module/interfaces/InterfaceA.php',
'sapphire\test\interfacea' => 'module/interfaces/InterfaceA.php'
'SILVERSTRIPE\TEST\CLASSA' => 'module/classes/ClassA.php',
'Silverstripe\Test\ClassA' => 'module/classes/ClassA.php',
'silverstripe\test\classa' => 'module/classes/ClassA.php',
'SILVERSTRIPE\TEST\INTERFACEA' => 'module/interfaces/InterfaceA.php',
'Silverstripe\Test\InterfaceA' => 'module/interfaces/InterfaceA.php',
'silverstripe\test\interfacea' => 'module/interfaces/InterfaceA.php'
);
foreach ($expect as $name => $path) {
@ -38,14 +38,14 @@ class NamespacedClassManifestTest extends SapphireTest {
public function testGetClasses() {
$expect = array(
'sapphire\test\classa' => "{$this->base}/module/classes/ClassA.php",
'sapphire\test\classb' => "{$this->base}/module/classes/ClassB.php",
'sapphire\test\classc' => "{$this->base}/module/classes/ClassC.php",
'sapphire\test\classd' => "{$this->base}/module/classes/ClassD.php",
'sapphire\test\classe' => "{$this->base}/module/classes/ClassE.php",
'sapphire\test\classf' => "{$this->base}/module/classes/ClassF.php",
'sapphire\test\classg' => "{$this->base}/module/classes/ClassG.php",
'sapphire\test\classh' => "{$this->base}/module/classes/ClassH.php"
'silverstripe\test\classa' => "{$this->base}/module/classes/ClassA.php",
'silverstripe\test\classb' => "{$this->base}/module/classes/ClassB.php",
'silverstripe\test\classc' => "{$this->base}/module/classes/ClassC.php",
'silverstripe\test\classd' => "{$this->base}/module/classes/ClassD.php",
'silverstripe\test\classe' => "{$this->base}/module/classes/ClassE.php",
'silverstripe\test\classf' => "{$this->base}/module/classes/ClassF.php",
'silverstripe\test\classg' => "{$this->base}/module/classes/ClassG.php",
'silverstripe\test\classh' => "{$this->base}/module/classes/ClassH.php"
);
$this->assertEquals($expect, $this->manifest->getClasses());
@ -53,13 +53,13 @@ class NamespacedClassManifestTest extends SapphireTest {
public function testGetClassNames() {
$this->assertEquals(
array('sapphire\test\classa', 'sapphire\test\classb', 'sapphire\test\classc', 'sapphire\test\classd', 'sapphire\test\classe', 'sapphire\test\classf', 'sapphire\test\classg', 'sapphire\test\classh'),
array('silverstripe\test\classa', 'silverstripe\test\classb', 'silverstripe\test\classc', 'silverstripe\test\classd', 'silverstripe\test\classe', 'silverstripe\test\classf', 'silverstripe\test\classg', 'silverstripe\test\classh'),
$this->manifest->getClassNames());
}
public function testGetDescendants() {
$expect = array(
'sapphire\test\classa' => array('sapphire\test\ClassB', 'sapphire\test\ClassH'),
'silverstripe\test\classa' => array('silverstripe\test\ClassB', 'silverstripe\test\ClassH'),
);
$this->assertEquals($expect, $this->manifest->getDescendants());
@ -67,8 +67,8 @@ class NamespacedClassManifestTest extends SapphireTest {
public function testGetDescendantsOf() {
$expect = array(
'SAPPHIRE\TEST\CLASSA' => array('sapphire\test\ClassB', 'sapphire\test\ClassH'),
'sapphire\test\classa' => array('sapphire\test\ClassB', 'sapphire\test\ClassH'),
'SILVERSTRIPE\TEST\CLASSA' => array('silverstripe\test\ClassB', 'silverstripe\test\ClassH'),
'silverstripe\test\classa' => array('silverstripe\test\ClassB', 'silverstripe\test\ClassH'),
);
foreach ($expect as $class => $desc) {
@ -78,28 +78,28 @@ class NamespacedClassManifestTest extends SapphireTest {
public function testGetInterfaces() {
$expect = array(
'sapphire\test\interfacea' => "{$this->base}/module/interfaces/InterfaceA.php",
'silverstripe\test\interfacea' => "{$this->base}/module/interfaces/InterfaceA.php",
);
$this->assertEquals($expect, $this->manifest->getInterfaces());
}
public function testGetImplementors() {
$expect = array(
'sapphire\test\interfacea' => array('sapphire\test\ClassE'),
'interfacea' => array('sapphire\test\ClassF'),
'sapphire\test\subtest\interfacea' => array('sapphire\test\ClassG')
'silverstripe\test\interfacea' => array('silverstripe\test\ClassE'),
'interfacea' => array('silverstripe\test\ClassF'),
'silverstripe\test\subtest\interfacea' => array('silverstripe\test\ClassG')
);
$this->assertEquals($expect, $this->manifest->getImplementors());
}
public function testGetImplementorsOf() {
$expect = array(
'SAPPHIRE\TEST\INTERFACEA' => array('sapphire\test\ClassE'),
'sapphire\test\interfacea' => array('sapphire\test\ClassE'),
'INTERFACEA' => array('sapphire\test\ClassF'),
'interfacea' => array('sapphire\test\ClassF'),
'SAPPHIRE\TEST\SUBTEST\INTERFACEA' => array('sapphire\test\ClassG'),
'sapphire\test\subtest\interfacea' => array('sapphire\test\ClassG'),
'SILVERSTRIPE\TEST\INTERFACEA' => array('silverstripe\test\ClassE'),
'silverstripe\test\interfacea' => array('silverstripe\test\ClassE'),
'INTERFACEA' => array('silverstripe\test\ClassF'),
'interfacea' => array('silverstripe\test\ClassF'),
'SILVERSTRIPE\TEST\SUBTEST\INTERFACEA' => array('silverstripe\test\ClassG'),
'silverstripe\test\subtest\interfacea' => array('silverstripe\test\ClassG'),
);
foreach ($expect as $interface => $impl) {

View File

@ -56,7 +56,7 @@ PHP
return token_get_all(<<<PHP
<?php
namespace sapphire\\test;
namespace silverstripe\\test;
class ClassA {
@ -179,6 +179,6 @@ PHP
$matches = $parser->findAll($tokens);
$this->assertEquals(array(), $matches);
$this->assertEquals(array('sapphire', '\\', 'test'), $namespacedMatches[0]['namespaceName']);
$this->assertEquals(array('silverstripe', '\\', 'test'), $namespacedMatches[0]['namespaceName']);
}
}

View File

@ -3,6 +3,6 @@
* @ignore
*/
namespace sapphire\test;
namespace silverstripe\test;
class ClassA { }

View File

@ -3,6 +3,6 @@
* @ignore
*/
namespace sapphire\test;
namespace silverstripe\test;
class ClassB extends ClassA { }

View File

@ -3,6 +3,6 @@
* @ignore
*/
namespace sapphire\test;
namespace silverstripe\test;
class ClassC extends \ClassA { }

View File

@ -3,6 +3,6 @@
* @ignore
*/
namespace sapphire\test;
namespace silverstripe\test;
class ClassD extends subtest\ClassC { }

View File

@ -3,6 +3,6 @@
* @ignore
*/
namespace sapphire\test;
namespace silverstripe\test;
class ClassE implements InterfaceA { }

View File

@ -3,6 +3,6 @@
* @ignore
*/
namespace sapphire\test;
namespace silverstripe\test;
class ClassF implements \InterfaceA { }

View File

@ -3,6 +3,6 @@
* @ignore
*/
namespace sapphire\test;
namespace silverstripe\test;
class ClassG implements subtest\InterfaceA { }

View File

@ -3,6 +3,6 @@
* @ignore
*/
namespace sapphire\test;
namespace silverstripe\test;
class ClassH extends \sapphire\test\ClassA { }
class ClassH extends \silverstripe\test\ClassA { }

View File

@ -3,6 +3,6 @@
* @ignore
*/
namespace sapphire\test;
namespace silverstripe\test;
interface InterfaceA { }

View File

@ -157,7 +157,7 @@ class CsvBulkLoaderTest extends SapphireTest {
$this->assertEquals($player->Biography, 'He\'s a good guy', 'test updating of duplicate imports within the same import works');
// load with updated data
$filepath = Director::baseFolder() . '/sapphire/tests/dev/CsvBulkLoaderTest_PlayersWithIdUpdated.csv';
$filepath = FRAMEWORK_PATH . '/tests/dev/CsvBulkLoaderTest_PlayersWithIdUpdated.csv';
$results = $loader->load($filepath);
// HACK need to update the loaded record from the database

View File

@ -53,7 +53,7 @@ class DeprecationTest extends SapphireTest {
function testNonMatchingModuleNotifcationVersionDoesntAffectNotice() {
Deprecation::notification_version('1.0.0');
Deprecation::notification_version('3.0.0', 'mysite');
$this->callThatOriginatesFromSapphire();
$this->callThatOriginatesFromFramework();
}
/**
@ -61,12 +61,12 @@ class DeprecationTest extends SapphireTest {
*/
function testMatchingModuleNotifcationVersionAffectsNotice() {
Deprecation::notification_version('1.0.0');
Deprecation::notification_version('3.0.0', 'sapphire');
$this->callThatOriginatesFromSapphire();
Deprecation::notification_version('3.0.0', 'framework');
$this->callThatOriginatesFromFramework();
}
protected function callThatOriginatesFromSapphire() {
$this->assertEquals(DeprecationTest_Deprecation::get_module(), 'sapphire');
protected function callThatOriginatesFromFramework() {
$this->assertEquals(DeprecationTest_Deprecation::get_module(), 'framework');
Deprecation::notice('2.0', 'Deprecation test passed');
}

View File

@ -6,7 +6,7 @@
class LookupFieldTest extends SapphireTest {
static $fixture_file = 'sapphire/tests/forms/LookupFieldTest.yml';
static $fixture_file = 'LookupFieldTest.yml';
function testNullValueWithNumericArraySource() {
$source = array(1 => 'one', 2 => 'two', 3 => 'three');

View File

@ -1,7 +1,7 @@
<?php
class GridFieldAddExistingAutocompleterTest extends FunctionalTest {
static $fixture_file = 'sapphire/tests/forms/gridfield/GridFieldTest.yml';
static $fixture_file = 'GridFieldTest.yml';
protected $extraDataObjects = array('GridFieldTest_Team', 'GridFieldTest_Player');

View File

@ -12,7 +12,7 @@ class GridFieldDeleteActionTest extends SapphireTest {
protected $form;
/** @var string */
public static $fixture_file = 'sapphire/tests/forms/gridfield/GridFieldActionTest.yml';
public static $fixture_file = 'GridFieldActionTest.yml';
/** @var array */
protected $extraDataObjects = array('GridFieldAction_Delete_Team', 'GridFieldAction_Edit_Team');

View File

@ -12,7 +12,7 @@ class GridFieldEditButtonTest extends SapphireTest {
protected $form;
/** @var string */
public static $fixture_file = 'sapphire/tests/forms/gridfield/GridFieldActionTest.yml';
public static $fixture_file = 'GridFieldActionTest.yml';
/** @var array */
protected $extraDataObjects = array('GridFieldAction_Delete_Team', 'GridFieldAction_Edit_Team');

View File

@ -7,7 +7,7 @@ class i18nTest extends SapphireTest {
/**
* @var string $tmpBasePath Used to write language files.
* We don't want to store them inside sapphire (or in any web-accessible place)
* We don't want to store them inside framework (or in any web-accessible place)
* in case something goes wrong with the file parsing.
*/
protected $alternateBaseSavePath;

View File

@ -7,7 +7,7 @@ class i18nTextCollectorTest extends SapphireTest {
/**
* @var string $tmpBasePath Used to write language files.
* We don't want to store them inside sapphire (or in any web-accessible place)
* We don't want to store them inside framework (or in any web-accessible place)
* in case something goes wrong with the file parsing.
*/
protected $alternateBaseSavePath;

View File

@ -6,7 +6,7 @@
class DataDifferencerTest extends SapphireTest {
static $fixture_file = 'sapphire/tests/model/DataDifferencerTest.yml';
static $fixture_file = 'DataDifferencerTest.yml';
protected $extraDataObjects = array(
'DataDifferencerTest_Object',

View File

@ -1,8 +1,8 @@
DataDifferencerTest_MockImage:
image1:
Filename: sapphire/tests/model/testimages/test_image.png
Filename: framework/tests/model/testimages/test_image.png
image2:
Filename: sapphire/tests/model/testimages/test.image.with.dots.png
Filename: framework/tests/model/testimages/test.image.with.dots.png
DataDifferencerTest_HasOneRelationObject:
relobj1:
Title: obj1

View File

@ -1,32 +0,0 @@
def loadFixture(fileName)
if $baseURL and $browser then
$browser.goto $baseURL + "dev/tests/sessionloadyml?fixture=" + fileName + "&flush=1"
else
fail("No \$baseUrl or \$browser found")
end
end
def startSession
# Reset database
if $baseURL and $browser then
$browser.goto $baseURL + 'dev/tests/endsession'
else
fail("No \$baseUrl or \$browser found")
end
fileName = 'sapphire/tests/Bare.yml'
if $baseURL and $browser then
$browser.goto $baseURL + "dev/tests/startsession?fixture=" + fileName + "&flush=1"
else
fail("No \$baseUrl or \$browser found")
end
end
Given /load the fixture file "([^"]+)"/ do |fileName|
loadFixture(fileName)
end
startSession()
Before do
Given "I visit /dev/tests/emptydb?fixture=sapphire/tests/Bare.yml"
end

View File

@ -1,9 +1,9 @@
<% if FailTest %>
<% require css(sapphire/tests/forms/RequirementsTest_a.css) %>
<% require javascript(sapphire/tests/forms/RequirementsTest_b.js) %>
<% require javascript(sapphire/tests/forms/RequirementsTest_c.js) %>
<% if $FailTest %>
<% require css(framework/tests/forms/RequirementsTest_a.css) %>
<% require javascript(framework/tests/forms/RequirementsTest_b.js) %>
<% require javascript(framework/tests/forms/RequirementsTest_c.js) %>
<% else %>
<% require javascript(sapphire/tests/forms/RequirementsTest_a.js) %>
<% require css(sapphire/tests/forms/RequirementsTest_b.css) %>
<% require css(sapphire/tests/forms/RequirementsTest_c.css) %>
<% require javascript(framework/tests/forms/RequirementsTest_a.js) %>
<% require css(framework/tests/forms/RequirementsTest_b.css) %>
<% require css(framework/tests/forms/RequirementsTest_c.css) %>
<% end_if %>

View File

@ -10,13 +10,13 @@ class YamlFixtureTest extends SapphireTest {
);
function testAbsoluteFixturePath() {
$absPath = Director::baseFolder() . '/sapphire/tests/testing/YamlFixtureTest.yml';
$absPath = FRAMEWORK_PATH . '/tests/testing/YamlFixtureTest.yml';
$obj = new YamlFixture($absPath);
$this->assertEquals($absPath, $obj->getFixtureFile());
}
function testRelativeFixturePath() {
$relPath = 'sapphire/tests/testing/YamlFixtureTest.yml';
$relPath = FRAMEWORK_DIR . '/tests/testing/YamlFixtureTest.yml';
$obj = new YamlFixture($relPath);
$this->assertEquals(Director::baseFolder() . '/' . $relPath, $obj->getFixtureFile());
}
@ -25,7 +25,7 @@ class YamlFixtureTest extends SapphireTest {
* @expectedException InvalidArgumentException
*/
function testFailsWithInvalidFixturePath() {
$invalidPath = 'sapphire/tests/testing/invalid.yml';
$invalidPath = FRAMEWORK_DIR . '/tests/testing/invalid.yml';
$obj = new YamlFixture($invalidPath);
}

View File

@ -41,8 +41,8 @@ class SSViewerTest extends SapphireTest {
function testRequirements() {
$requirements = $this->getMock("Requirements_Backend", array("javascript", "css"));
$jsFile = 'sapphire/tests/forms/a.js';
$cssFile = 'sapphire/tests/forms/a.js';
$jsFile = FRAMEWORK_DIR . '/tests/forms/a.js';
$cssFile = FRAMEWORK_DIR . '/tests/forms/a.js';
$requirements->expects($this->once())->method('javascript')->with($jsFile);
$requirements->expects($this->once())->method('css')->with($cssFile);
@ -943,10 +943,10 @@ after')
$result = $view->process($data);
$expected = '<!doctype html>
<html><!-- template ' . BASE_PATH . '/sapphire/tests/templates/SSViewerTestCommentsFullSource.ss -->
<html><!-- template ' . FRAMEWORK_PATH . '/tests/templates/SSViewerTestCommentsFullSource.ss -->
<head></head>
<body></body>
<!-- end template ' . BASE_PATH . '/sapphire/tests/templates/SSViewerTestCommentsFullSource.ss --></html>
<!-- end template ' . FRAMEWORK_PATH . '/tests/templates/SSViewerTestCommentsFullSource.ss --></html>
';
$this->assertEquals($result, $expected);
@ -954,14 +954,14 @@ after')
$data = new ArrayData(array());
$result = $view->process($data);
$expected = '<!-- template ' . BASE_PATH . '/sapphire/tests/templates/SSViewerTestCommentsPartialSource.ss --><div class=\'typography\'></div><!-- end template ' . BASE_PATH . '/sapphire/tests/templates/SSViewerTestCommentsPartialSource.ss -->';
$expected = '<!-- template ' . FRAMEWORK_PATH . '/tests/templates/SSViewerTestCommentsPartialSource.ss --><div class=\'typography\'></div><!-- end template ' . FRAMEWORK_PATH . '/tests/templates/SSViewerTestCommentsPartialSource.ss -->';
$this->assertEquals($result, $expected);
$view = new SSViewer(array('SSViewerTestCommentsWithInclude'));
$data = new ArrayData(array());
$result = $view->process($data);
$expected = '<!-- template ' . BASE_PATH . '/sapphire/tests/templates/SSViewerTestCommentsWithInclude.ss --><div class=\'typography\'><!-- include \'SSViewerTestCommentsInclude\' --><!-- template ' . BASE_PATH . '/sapphire/tests/templates/SSViewerTestCommentsInclude.ss -->Included<!-- end template ' . BASE_PATH . '/sapphire/tests/templates/SSViewerTestCommentsInclude.ss --><!-- end include \'SSViewerTestCommentsInclude\' --></div><!-- end template ' . BASE_PATH . '/sapphire/tests/templates/SSViewerTestCommentsWithInclude.ss -->';
$expected = '<!-- template ' . FRAMEWORK_PATH . '/tests/templates/SSViewerTestCommentsWithInclude.ss --><div class=\'typography\'><!-- include \'SSViewerTestCommentsInclude\' --><!-- template ' . FRAMEWORK_PATH . '/tests/templates/SSViewerTestCommentsInclude.ss -->Included<!-- end template ' . FRAMEWORK_PATH . '/tests/templates/SSViewerTestCommentsInclude.ss --><!-- end include \'SSViewerTestCommentsInclude\' --></div><!-- end template ' . FRAMEWORK_PATH . '/tests/templates/SSViewerTestCommentsWithInclude.ss -->';
$this->assertEquals($result, $expected);
SSViewer::set_source_file_comments(false);

View File

@ -10,11 +10,11 @@ Caution: Seriously outdated, consider using [http://github.com/hafriedlander/jqu
# Requirements
* Custom Prototype 1.4 RC3 (see `sapphire/thirdparty/prototype/prototype.js`)
* Custom Prototype 1.4 RC3 (see `framework/thirdparty/prototype/prototype.js`)
# Tutorial
In Sapphire, I've tried to make Javascript development a lot more well-structured. It's very easy to write spaghetti, but this ultimately prevents maintainability. This page is a guide to better Javascript. (hopefully).
In SilverStripe, I've tried to make Javascript development a lot more well-structured. It's very easy to write spaghetti, but this ultimately prevents maintainability. This page is a guide to better Javascript. (hopefully).
## Required includes

View File

@ -830,7 +830,7 @@ Ajax.Request.prototype = Object.extend(new Ajax.Base(), {
// jquery ondemand integration patch
prototypeAjax = this;
completeHandler = function() {
// Sapphire indication that the session has been lost
// SilverStripe indication that the session has been lost
if(prototypeAjax.transport.responseText && prototypeAjax.transport.responseText.substr(0,12) == 'NOTLOGGEDIN:') {
if(typeof onSessionLost == 'function') onSessionLost();

View File

@ -0,0 +1,33 @@
<?php
class GenericTemplateGlobalProvider implements TemplateGlobalProvider {
/**
* @return array Returns an array of strings of the method names of methods on the call that should be exposed
* as global variables in the templates.
*/
public static function get_template_global_variables() {
return array(
'FrameworkDir',
'FrameworkAdminDir',
'ThirdpartyDir',
'AssetsDir',
);
}
public static function FrameworkDir() {
return FRAMEWORK_DIR;
}
public static function FrameworkAdminDir() {
return FRAMEWORK_ADMIN_DIR;
}
public static function ThirdpartyDir() {
return THIRDPARTY_DIR;
}
public static function AssetsDir() {
return ASSETS_DIR;
}
}

View File

@ -134,7 +134,7 @@ class Requirements {
* Register the given stylesheet file as required.
* See {@link Requirements_Backend::css()}
*
* @param $file String Filenames should be relative to the base, eg, 'sapphire/javascript/tree/tree.css'
* @param $file String Filenames should be relative to the base, eg, 'framework/javascript/tree/tree.css'
* @param $media String Comma-separated list of media-types (e.g. "screen,projector")
* @see http://www.w3.org/TR/REC-CSS2/media.html
*/
@ -479,7 +479,7 @@ class Requirements_Backend {
}
/**
* Register the given javascript file as required.
* Filenames should be relative to the base, eg, 'sapphire/javascript/loader.js'
* Filenames should be relative to the base, eg, 'framework/javascript/loader.js'
*/
public function javascript($file) {
@ -552,7 +552,7 @@ class Requirements_Backend {
/**
* Register the given stylesheet file as required.
*
* @param $file String Filenames should be relative to the base, eg, 'sapphire/javascript/tree/tree.css'
* @param $file String Filenames should be relative to the base, eg, 'framework/javascript/tree/tree.css'
* @param $media String Comma-separated list of media-types (e.g. "screen,projector")
* @see http://www.w3.org/TR/REC-CSS2/media.html
*/
@ -745,10 +745,10 @@ class Requirements_Backend {
}
/**
* Add i18n files from the given javascript directory. Sapphire expects that the given directory
* Add i18n files from the given javascript directory. SilverStripe expects that the given directory
* will contain a number of java script files named by language: en_US.js, de_DE.js, etc.
*
* @param String The javascript lang directory, relative to the site root, e.g., 'sapphire/javascript/lang'
* @param String The javascript lang directory, relative to the site root, e.g., 'framework/javascript/lang'
* @param Boolean Return all relative file paths rather than including them in requirements
* @param Boolean Only include language files, not the base libraries
*/
@ -758,7 +758,7 @@ class Requirements_Backend {
// Include i18n.js even if no languages are found. The fact that
// add_i18n_javascript() was called indicates that the methods in
// here are needed.
if(!$langOnly) $files[] = SAPPHIRE_DIR . '/javascript/i18n.js';
if(!$langOnly) $files[] = FRAMEWORK_DIR . '/javascript/i18n.js';
if(substr($langDir,-1) != '/') $langDir .= '/';
@ -767,7 +767,7 @@ class Requirements_Backend {
// Stub i18n implementation for when i18n is disabled.
} else {
if(!$langOnly) $files[] = SAPPHIRE_DIR . '/javascript/i18nx.js';
if(!$langOnly) $files[] = FRAMEWORK_DIR . '/javascript/i18nx.js';
}
if($return) {

View File

@ -7,7 +7,7 @@ This is the uncompiled parser for the SilverStripe template language, PHP with s
It gets run through the php-peg parser compiler to have those comments turned into code that match parts of the template language,
producing the executable version SSTemplateParser.php
To recompile after changing this file, run this from the 'sapphire/core' directory via command line:
To recompile after changing this file, run this from the 'framework/core' directory via command line:
php ../thirdparty/php-peg/cli.php SSTemplateParser.php.inc > SSTemplateParser.php