From 1fca4911e14adb69e08f3fcec2514b1e4e9e297b Mon Sep 17 00:00:00 2001 From: Normann Lou Date: Mon, 16 Jul 2012 15:18:31 +1200 Subject: [PATCH 1/2] BUGFIX: replace 'sapphire' with 'framework' in those legacy fields: TableField, TableListField and ComplexTableField. --- forms/ComplexTableField.php | 12 ++++++------ forms/TableListField.php | 12 ++++-------- javascript/TableField.js | 4 ++-- javascript/TableListField.js | 4 ++-- 4 files changed, 14 insertions(+), 18 deletions(-) diff --git a/forms/ComplexTableField.php b/forms/ComplexTableField.php index cfa10d4ac..3ec2deb1a 100644 --- a/forms/ComplexTableField.php +++ b/forms/ComplexTableField.php @@ -129,20 +129,20 @@ class ComplexTableField extends TableListField { public $actions = array( 'show' => array( 'label' => 'Show', - 'icon' => 'sapphire/images/show.png', - 'icon_disabled' => 'sapphire/images/show_disabled.png', + 'icon' => 'framework/images/show.png', + 'icon_disabled' => 'framework/images/show_disabled.png', 'class' => 'popuplink showlink', ), 'edit' => array( 'label' => 'Edit', - 'icon' => 'sapphire/images/edit.gif', - 'icon_disabled' => 'sapphire/images/edit_disabled.gif', + 'icon' => 'framework/images/edit.gif', + 'icon_disabled' => 'framework/images/edit_disabled.gif', 'class' => 'popuplink editlink', ), 'delete' => array( 'label' => 'Delete', - 'icon' => 'sapphire/images/delete.gif', - 'icon_disabled' => 'sapphire/images/delete_disabled.gif', + 'icon' => 'framework/images/delete.gif', + 'icon_disabled' => 'framework/images/delete_disabled.gif', 'class' => 'popuplink deletelink', ), ); diff --git a/forms/TableListField.php b/forms/TableListField.php index 928cf7366..82196c021 100644 --- a/forms/TableListField.php +++ b/forms/TableListField.php @@ -104,8 +104,8 @@ class TableListField extends FormField { * array( * 'delete' => array( * 'label' => 'Delete', - * 'icon' => 'sapphire/images/delete.gif', - * 'icon_disabled' => 'sapphire/images/delete_disabled.gif', + * 'icon' => 'framework/images/delete.gif', + * 'icon_disabled' => 'framework/images/delete_disabled.gif', * 'class' => 'deletelink', * ) * ) @@ -113,8 +113,8 @@ class TableListField extends FormField { public $actions = array( 'delete' => array( 'label' => 'Delete', - 'icon' => 'sapphire/images/delete.gif', - 'icon_disabled' => 'sapphire/images/delete_disabled.gif', + 'icon' => 'framework/images/delete.gif', + 'icon_disabled' => 'framework/images/delete_disabled.gif', 'class' => 'deletelink' ) ); @@ -238,9 +238,6 @@ class TableListField extends FormField { */ public function __construct($name, $sourceClass = null, $fieldList = null, $sourceFilter = null, $sourceSort = null, $sourceJoin = null) { - if(FRAMEWORK_DIR != 'sapphire' && !SapphireTest::is_running_test()) { - user_error('TableListField requires FRAMEWORK_DIR to be sapphire.', E_USER_WARNING); - } if($sourceClass) { // You can optionally pass a list @@ -1106,7 +1103,6 @@ JS Requirements::css(CMS_DIR . '/css/typography.css'); Requirements::css(CMS_DIR . '/css/cms_right.css'); } - Requirements::css('sapphire/css/TableListField_print.css'); $this->cachedSourceItems = null; $oldShowPagination = $this->showPagination; diff --git a/javascript/TableField.js b/javascript/TableField.js index 1a5ccc30a..d78bf440f 100644 --- a/javascript/TableField.js +++ b/javascript/TableField.js @@ -61,10 +61,10 @@ TableField.prototype = { return false; } - // TODO ajaxErrorHandler and loading-image are dependent on cms, but formfield is in sapphire + // TODO ajaxErrorHandler and loading-image are dependent on cms, but formfield is in framework var confirmed = confirm(ss.i18n._t('TABLEFIELD.DELETECONFIRMMESSAGE', 'Are you sure you want to delete this record?')); if(confirmed){ - img.setAttribute("src",'sapphire/images/network-save.gif'); // TODO doesn't work + img.setAttribute("src",'framework/images/network-save.gif'); // TODO doesn't work jQuery.ajax({ 'url': link.getAttribute("href"), 'method': 'post', diff --git a/javascript/TableListField.js b/javascript/TableListField.js index 1ab1dc3f7..e2fcbe88d 100644 --- a/javascript/TableListField.js +++ b/javascript/TableListField.js @@ -92,11 +92,11 @@ TableListField.prototype = { var row = Event.findElement(e,"tr"); var self = this; - // TODO ajaxErrorHandler and loading-image are dependent on cms, but formfield is in sapphire + // TODO ajaxErrorHandler and loading-image are dependent on cms, but formfield is in framework var confirmed = confirm(ss.i18n._t('TABLEFIELD.DELETECONFIRMMESSAGE', 'Are you sure you want to delete this record?')); if(confirmed) { - img.setAttribute("src",'sapphire/images/network-save.gif'); // TODO doesn't work + img.setAttribute("src",'framework/images/network-save.gif'); // TODO doesn't work jQuery.ajax({ 'url': link.getAttribute("href"), 'method': 'post', From 9aaa6b1a7ba30f87a2a2810066f9a32909a101fd Mon Sep 17 00:00:00 2001 From: Normann Lou Date: Fri, 5 Oct 2012 17:00:39 +1300 Subject: [PATCH 2/2] ENHANCEMENT: change those harded-coded 'sapphire' to 'framework' either in javascript code or inline document, or a href propty. --- dev/install/config-form.html | 10 +++++----- dev/install/php5-required.html | 2 +- forms/DateField.php | 2 +- javascript/i18n.js | 2 +- javascript/i18nx.js | 2 +- tests/core/manifest/ClassLoaderTest.php | 2 +- thirdparty/greybox/greybox.js | 4 ++-- .../zend_translate_railsyaml/tests/TestHelper.php | 2 +- 8 files changed, 13 insertions(+), 13 deletions(-) diff --git a/dev/install/config-form.html b/dev/install/config-form.html index 9cfecc056..2b008df00 100644 --- a/dev/install/config-form.html +++ b/dev/install/config-form.html @@ -32,7 +32,7 @@

You aren't currently able to install the software. Please see below for details.
- If you are having problems meeting the requirements, see the server requirements. + If you are having problems meeting the requirements, see the server requirements.

Your php.ini file is located at

@@ -46,7 +46,7 @@ hasWarnings()) { ?>

There are some issues that we recommend you look at before installing, however, you are still able to install the software. -
Please see below for details. If you are having problems meeting the requirements, see the server requirements.

+
Please see below for details. If you are having problems meeting the requirements, see the server requirements.

hasErrors() && !$adminReq->hasErrors()) { ?>

You're ready to install! Please confirm the configuration options below. Install SilverStripe

@@ -71,7 +71,7 @@ showTable(); ?>

- Read more about our server requirements. + Read more about our server requirements.

@@ -178,7 +178,7 @@
> - +
@@ -244,7 +244,7 @@

Theme selection Step 4 of 5

You can change the theme or download another from the SilverStripe website after installation.

    -
  • checked="checked">
  • +
  • checked="checked">
  • checked="checked">

Confirm Install Step 5 of 5

diff --git a/dev/install/php5-required.html b/dev/install/php5-required.html index 658caa2da..8db360a21 100644 --- a/dev/install/php5-required.html +++ b/dev/install/php5-required.html @@ -1,7 +1,7 @@ PHP 5.3.2 is required - +
diff --git a/forms/DateField.php b/forms/DateField.php index 7fd8ac472..36155cfff 100644 --- a/forms/DateField.php +++ b/forms/DateField.php @@ -37,7 +37,7 @@ require_once 'Zend/Date.php'; * configuration accordingly. Changing the locale through {@link setLocale()} will not update the * `dateformat` configuration automatically. * - * See http://doc.silverstripe.org/sapphire/en/topics/i18n for more information about localizing form fields. + * See http://doc.silverstripe.org/framework/en/topics/i18n for more information about localizing form fields. * * # Usage * diff --git a/javascript/i18n.js b/javascript/i18n.js index e039e9657..cb99aa58b 100644 --- a/javascript/i18n.js +++ b/javascript/i18n.js @@ -4,7 +4,7 @@ if(typeof(ss) == 'undefined') ss = {}; * Lightweight clientside i18n implementation. * Caution: Only available after DOM loaded because we need to detect the language * - * For non-i18n stub implementation, see sapphire/javascript/i18nx.js + * For non-i18n stub implementation, see framework/javascript/i18nx.js * * Based on jQuery i18n plugin: 1.0.0 Feb-10-2008 * diff --git a/javascript/i18nx.js b/javascript/i18nx.js index c66886a11..13e97037a 100644 --- a/javascript/i18nx.js +++ b/javascript/i18nx.js @@ -2,7 +2,7 @@ if(typeof(ss) == 'undefined') ss = {}; /** * Stub implementation for ss.i18n code. - * Use instead of sapphire/javascript/i18n.js + * Use instead of framework/javascript/i18n.js * if you want to use any SilverStripe javascript * without internationalization support. */ diff --git a/tests/core/manifest/ClassLoaderTest.php b/tests/core/manifest/ClassLoaderTest.php index bcf4c6c3b..edcfa2c98 100644 --- a/tests/core/manifest/ClassLoaderTest.php +++ b/tests/core/manifest/ClassLoaderTest.php @@ -2,7 +2,7 @@ /** * Tests for the {@link SS_ClassManifest} class. * - * @package sapphire + * @package framework * @subpackage tests */ class ClassLoaderTest extends SapphireTest { diff --git a/thirdparty/greybox/greybox.js b/thirdparty/greybox/greybox.js index 80342d984..af33ecca7 100644 --- a/thirdparty/greybox/greybox.js +++ b/thirdparty/greybox/greybox.js @@ -20,9 +20,9 @@ var GB_ONLY_ONE = null; // modified 2006-01-06 by Silverstripe Ltd. try { var theBaseHref = document.getElementsByTagName("base")[0].href; - var GB_IMG_DIR = theBaseHref + "sapphire/thirdparty/greybox/"; + var GB_IMG_DIR = theBaseHref + "framework/thirdparty/greybox/"; } catch(err) { - var GB_IMG_DIR = "sapphire/thirdparty/greybox/"; + var GB_IMG_DIR = "framework/thirdparty/greybox/"; } function GreyBox() { diff --git a/thirdparty/zend_translate_railsyaml/tests/TestHelper.php b/thirdparty/zend_translate_railsyaml/tests/TestHelper.php index ec5e3f966..4706a7b3e 100644 --- a/thirdparty/zend_translate_railsyaml/tests/TestHelper.php +++ b/thirdparty/zend_translate_railsyaml/tests/TestHelper.php @@ -46,7 +46,7 @@ error_reporting(E_ALL | E_STRICT); * distribution. */ $ds = DIRECTORY_SEPARATOR; -$zfRoot = realpath(dirname(dirname(dirname(__FILE__)))) . $ds . 'sapphire' . $ds . 'thirdparty'; +$zfRoot = realpath(dirname(dirname(dirname(__FILE__)))) . $ds . 'framework' . $ds . 'thirdparty'; $zfCoreLibrary = "$zfRoot"; $zfCoreTests = "$zfRoot/tests"; $zfCustomLibrary = realpath(dirname(dirname(__FILE__))) . $ds . 'library';