mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
API-CHANGE sapphire folder can now be renamed.
This commit is contained in:
parent
f8082e4814
commit
3a6341a251
@ -5,13 +5,13 @@ Requires a [`silverstripe-installer`](http://github.com/silverstripe/silverstrip
|
|||||||
|
|
||||||
## Installation ##
|
## Installation ##
|
||||||
|
|
||||||
See [installation on different platforms](http://doc.silverstripe.org/sapphire/en/installation/),
|
See [installation on different platforms](http://doc.silverstripe.org/framework/en/installation/),
|
||||||
and [installation from source](http://doc.silverstripe.org/sapphire/en/installation/from-source).
|
and [installation from source](http://doc.silverstripe.org/framework/en/installation/from-source).
|
||||||
|
|
||||||
## Links ##
|
## Links ##
|
||||||
|
|
||||||
* [Requirements](http://doc.silverstripe.org/sapphire/en/installation/server-requirements)
|
* [Requirements](http://doc.silverstripe.org/framework/en/installation/server-requirements)
|
||||||
* [Changelogs](http://doc.silverstripe.org/sapphire/en/changelogs/)
|
* [Changelogs](http://doc.silverstripe.org/framework/en/changelogs/)
|
||||||
* [Bugtracker](http://open.silverstripe.org)
|
* [Bugtracker](http://open.silverstripe.org)
|
||||||
* [Forums](http://silverstripe.org/forums)
|
* [Forums](http://silverstripe.org/forums)
|
||||||
* [Developer Mailinglist](https://groups.google.com/forum/#!forum/silverstripe-dev)
|
* [Developer Mailinglist](https://groups.google.com/forum/#!forum/silverstripe-dev)
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
<?php
|
<?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).
|
* module).
|
||||||
*
|
*
|
||||||
* For example you can register the authentication methods you wish to use
|
* 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
|
* 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'));
|
ShortcodeParser::get('default')->register('file_link', array('File', 'link_shortcode_handler'));
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ DatabaseAdapterRegistry::register(
|
|||||||
array(
|
array(
|
||||||
'class' => 'MySQLDatabase',
|
'class' => 'MySQLDatabase',
|
||||||
'title' => 'MySQL 5.0+',
|
'title' => 'MySQL 5.0+',
|
||||||
'helperPath' => 'sapphire/dev/install/MySQLDatabaseConfigurationHelper.php',
|
'helperPath' => FRAMEWORK_PATH . '/dev/install/MySQLDatabaseConfigurationHelper.php',
|
||||||
'supported' => function_exists('mysql_connect'),
|
'supported' => function_exists('mysql_connect'),
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
@ -22,7 +22,8 @@ HtmlEditorConfig::get('cms')->setOptions(array(
|
|||||||
|
|
||||||
'use_native_selects' => true, // fancy selects are bug as of SS 2.3.0
|
'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]",
|
'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');
|
HtmlEditorConfig::get('cms')->enablePlugins('media', 'fullscreen');
|
||||||
|
@ -209,7 +209,7 @@ class LeftAndMain extends Controller implements PermissionProvider {
|
|||||||
$htmlEditorConfig->setOption('language', i18n::get_tinymce_lang());
|
$htmlEditorConfig->setOption('language', i18n::get_tinymce_lang());
|
||||||
if(!$htmlEditorConfig->getOption('content_css')) {
|
if(!$htmlEditorConfig->getOption('content_css')) {
|
||||||
$cssFiles = array();
|
$cssFiles = array();
|
||||||
$cssFiles[] = 'sapphire/admin/css/editor.css';
|
$cssFiles[] = FRAMEWORK_ADMIN_DIR . '/css/editor.css';
|
||||||
|
|
||||||
// Use theme from the site config
|
// Use theme from the site config
|
||||||
if(class_exists('SiteConfig') && ($config = SiteConfig::current_site_config()) && $config->Theme) {
|
if(class_exists('SiteConfig') && ($config = SiteConfig::current_site_config()) && $config->Theme) {
|
||||||
@ -241,32 +241,32 @@ class LeftAndMain extends Controller implements PermissionProvider {
|
|||||||
array(
|
array(
|
||||||
THIRDPARTY_DIR . '/jquery/jquery.js',
|
THIRDPARTY_DIR . '/jquery/jquery.js',
|
||||||
THIRDPARTY_DIR . '/jquery-livequery/jquery.livequery.js',
|
THIRDPARTY_DIR . '/jquery-livequery/jquery.livequery.js',
|
||||||
SAPPHIRE_DIR . '/javascript/jquery-ondemand/jquery.ondemand.js',
|
FRAMEWORK_DIR . '/javascript/jquery-ondemand/jquery.ondemand.js',
|
||||||
SAPPHIRE_DIR . '/admin/javascript/lib.js',
|
FRAMEWORK_ADMIN_DIR . '/javascript/lib.js',
|
||||||
THIRDPARTY_DIR . '/jquery-ui/jquery-ui.js',
|
THIRDPARTY_DIR . '/jquery-ui/jquery-ui.js',
|
||||||
THIRDPARTY_DIR . '/json-js/json2.js',
|
THIRDPARTY_DIR . '/json-js/json2.js',
|
||||||
THIRDPARTY_DIR . '/jquery-entwine/dist/jquery.entwine-dist.js',
|
THIRDPARTY_DIR . '/jquery-entwine/dist/jquery.entwine-dist.js',
|
||||||
THIRDPARTY_DIR . '/jquery-cookie/jquery.cookie.js',
|
THIRDPARTY_DIR . '/jquery-cookie/jquery.cookie.js',
|
||||||
THIRDPARTY_DIR . '/jquery-query/jquery.query.js',
|
THIRDPARTY_DIR . '/jquery-query/jquery.query.js',
|
||||||
THIRDPARTY_DIR . '/jquery-form/jquery.form.js',
|
THIRDPARTY_DIR . '/jquery-form/jquery.form.js',
|
||||||
SAPPHIRE_ADMIN_DIR . '/thirdparty/jquery-notice/jquery.notice.js',
|
FRAMEWORK_ADMIN_DIR . '/thirdparty/jquery-notice/jquery.notice.js',
|
||||||
SAPPHIRE_ADMIN_DIR . '/thirdparty/jsizes/lib/jquery.sizes.js',
|
FRAMEWORK_ADMIN_DIR . '/thirdparty/jsizes/lib/jquery.sizes.js',
|
||||||
SAPPHIRE_ADMIN_DIR . '/thirdparty/jlayout/lib/jlayout.border.js',
|
FRAMEWORK_ADMIN_DIR . '/thirdparty/jlayout/lib/jlayout.border.js',
|
||||||
SAPPHIRE_ADMIN_DIR . '/thirdparty/jlayout/lib/jquery.jlayout.js',
|
FRAMEWORK_ADMIN_DIR . '/thirdparty/jlayout/lib/jquery.jlayout.js',
|
||||||
SAPPHIRE_ADMIN_DIR . '/thirdparty/history-js/scripts/uncompressed/history.js',
|
FRAMEWORK_ADMIN_DIR . '/thirdparty/history-js/scripts/uncompressed/history.js',
|
||||||
SAPPHIRE_ADMIN_DIR . '/thirdparty/history-js/scripts/uncompressed/history.adapter.jquery.js',
|
FRAMEWORK_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/history-js/scripts/uncompressed/history.html4.js',
|
||||||
THIRDPARTY_DIR . '/jstree/jquery.jstree.js',
|
THIRDPARTY_DIR . '/jstree/jquery.jstree.js',
|
||||||
SAPPHIRE_ADMIN_DIR . '/thirdparty/chosen/chosen/chosen.jquery.js',
|
FRAMEWORK_ADMIN_DIR . '/thirdparty/chosen/chosen/chosen.jquery.js',
|
||||||
SAPPHIRE_ADMIN_DIR . '/thirdparty/jquery-hoverIntent/jquery.hoverIntent.js',
|
FRAMEWORK_ADMIN_DIR . '/thirdparty/jquery-hoverIntent/jquery.hoverIntent.js',
|
||||||
SAPPHIRE_ADMIN_DIR . '/javascript/jquery-changetracker/lib/jquery.changetracker.js',
|
FRAMEWORK_ADMIN_DIR . '/javascript/jquery-changetracker/lib/jquery.changetracker.js',
|
||||||
SAPPHIRE_DIR . '/javascript/TreeDropdownField.js',
|
FRAMEWORK_DIR . '/javascript/TreeDropdownField.js',
|
||||||
SAPPHIRE_DIR . '/javascript/DateField.js',
|
FRAMEWORK_DIR . '/javascript/DateField.js',
|
||||||
SAPPHIRE_DIR . '/javascript/HtmlEditorField.js',
|
FRAMEWORK_DIR . '/javascript/HtmlEditorField.js',
|
||||||
SAPPHIRE_DIR . '/javascript/TabSet.js',
|
FRAMEWORK_DIR . '/javascript/TabSet.js',
|
||||||
SAPPHIRE_DIR . '/javascript/i18n.js',
|
FRAMEWORK_DIR . '/javascript/i18n.js',
|
||||||
SAPPHIRE_ADMIN_DIR . '/javascript/ssui.core.js',
|
FRAMEWORK_ADMIN_DIR . '/javascript/ssui.core.js',
|
||||||
SAPPHIRE_DIR . '/javascript/GridField.js',
|
FRAMEWORK_DIR . '/javascript/GridField.js',
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -276,36 +276,36 @@ class LeftAndMain extends Controller implements PermissionProvider {
|
|||||||
'leftandmain.js',
|
'leftandmain.js',
|
||||||
array_unique(array_merge(
|
array_unique(array_merge(
|
||||||
array(
|
array(
|
||||||
SAPPHIRE_ADMIN_DIR . '/javascript/LeftAndMain.js',
|
FRAMEWORK_ADMIN_DIR . '/javascript/LeftAndMain.js',
|
||||||
SAPPHIRE_ADMIN_DIR . '/javascript/LeftAndMain.Panel.js',
|
FRAMEWORK_ADMIN_DIR . '/javascript/LeftAndMain.Panel.js',
|
||||||
SAPPHIRE_ADMIN_DIR . '/javascript/LeftAndMain.Tree.js',
|
FRAMEWORK_ADMIN_DIR . '/javascript/LeftAndMain.Tree.js',
|
||||||
SAPPHIRE_ADMIN_DIR . '/javascript/LeftAndMain.Ping.js',
|
FRAMEWORK_ADMIN_DIR . '/javascript/LeftAndMain.Ping.js',
|
||||||
SAPPHIRE_ADMIN_DIR . '/javascript/LeftAndMain.Content.js',
|
FRAMEWORK_ADMIN_DIR . '/javascript/LeftAndMain.Content.js',
|
||||||
SAPPHIRE_ADMIN_DIR . '/javascript/LeftAndMain.EditForm.js',
|
FRAMEWORK_ADMIN_DIR . '/javascript/LeftAndMain.EditForm.js',
|
||||||
SAPPHIRE_ADMIN_DIR . '/javascript/LeftAndMain.Menu.js',
|
FRAMEWORK_ADMIN_DIR . '/javascript/LeftAndMain.Menu.js',
|
||||||
SAPPHIRE_ADMIN_DIR . '/javascript/LeftAndMain.AddForm.js',
|
FRAMEWORK_ADMIN_DIR . '/javascript/LeftAndMain.AddForm.js',
|
||||||
SAPPHIRE_ADMIN_DIR . '/javascript/LeftAndMain.Preview.js',
|
FRAMEWORK_ADMIN_DIR . '/javascript/LeftAndMain.Preview.js',
|
||||||
SAPPHIRE_ADMIN_DIR . '/javascript/LeftAndMain.BatchActions.js',
|
FRAMEWORK_ADMIN_DIR . '/javascript/LeftAndMain.BatchActions.js',
|
||||||
),
|
),
|
||||||
Requirements::add_i18n_javascript(SAPPHIRE_DIR . '/javascript/lang', true, true),
|
Requirements::add_i18n_javascript(FRAMEWORK_DIR . '/javascript/lang', true, true),
|
||||||
Requirements::add_i18n_javascript(SAPPHIRE_ADMIN_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(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(THIRDPARTY_DIR . '/jstree/themes/apple/style.css');
|
||||||
Requirements::css(SAPPHIRE_DIR . '/css/TreeDropdownField.css');
|
Requirements::css(FRAMEWORK_DIR . '/css/TreeDropdownField.css');
|
||||||
Requirements::css(SAPPHIRE_ADMIN_DIR . '/css/screen.css');
|
Requirements::css(FRAMEWORK_ADMIN_DIR . '/css/screen.css');
|
||||||
Requirements::css(SAPPHIRE_DIR . '/css/GridField.css');
|
Requirements::css(FRAMEWORK_DIR . '/css/GridField.css');
|
||||||
|
|
||||||
// Browser-specific requirements
|
// Browser-specific requirements
|
||||||
$ie = isset($_SERVER['HTTP_USER_AGENT']) ? strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') : false;
|
$ie = isset($_SERVER['HTTP_USER_AGENT']) ? strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') : false;
|
||||||
if($ie) {
|
if($ie) {
|
||||||
$version = substr($_SERVER['HTTP_USER_AGENT'], $ie + 5, 3);
|
$version = substr($_SERVER['HTTP_USER_AGENT'], $ie + 5, 3);
|
||||||
if($version == 7) Requirements::css('sapphire/admin/css/ie7.css');
|
if($version == 7) Requirements::css(FRAMEWORK_ADMIN_DIR . '/css/ie7.css');
|
||||||
else if($version == 8) Requirements::css('sapphire/admin/css/ie8.css');
|
else if($version == 8) Requirements::css(FRAMEWORK_ADMIN_DIR . '/css/ie8.css');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Custom requirements
|
// Custom requirements
|
||||||
@ -1078,7 +1078,7 @@ class LeftAndMain extends Controller implements PermissionProvider {
|
|||||||
$form->setActions(null);
|
$form->setActions(null);
|
||||||
|
|
||||||
Requirements::clear();
|
Requirements::clear();
|
||||||
Requirements::css(SAPPHIRE_ADMIN_DIR . '/css/LeftAndMain_printable.css');
|
Requirements::css(FRAMEWORK_ADMIN_DIR . '/css/LeftAndMain_printable.css');
|
||||||
return array(
|
return array(
|
||||||
"PrintForm" => $form
|
"PrintForm" => $form
|
||||||
);
|
);
|
||||||
@ -1175,11 +1175,11 @@ class LeftAndMain extends Controller implements PermissionProvider {
|
|||||||
if(defined('CMS_PATH') && file_exists(CMS_PATH . '/silverstripe_version')) {
|
if(defined('CMS_PATH') && file_exists(CMS_PATH . '/silverstripe_version')) {
|
||||||
$sapphireVersion = file_get_contents(CMS_PATH . '/silverstripe_version');
|
$sapphireVersion = file_get_contents(CMS_PATH . '/silverstripe_version');
|
||||||
} else {
|
} else {
|
||||||
$sapphireVersion = file_get_contents(SAPPHIRE_PATH . '/silverstripe_version');
|
$sapphireVersion = file_get_contents(FRAMEWORK_PATH . '/silverstripe_version');
|
||||||
}
|
}
|
||||||
if(!$sapphireVersion) $sapphireVersion = _t('LeftAndMain.VersionUnknown', 'unknown');
|
if(!$sapphireVersion) $sapphireVersion = _t('LeftAndMain.VersionUnknown', 'unknown');
|
||||||
return sprintf(
|
return sprintf(
|
||||||
"sapphire: %s",
|
"SilverStripe: %s",
|
||||||
$sapphireVersion
|
$sapphireVersion
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -1313,7 +1313,7 @@ class LeftAndMain extends Controller implements PermissionProvider {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Register the given javascript file as required in the CMS.
|
* 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) {
|
public static function require_javascript($file) {
|
||||||
self::$extra_requirements['javascript'][] = array($file);
|
self::$extra_requirements['javascript'][] = array($file);
|
||||||
|
@ -57,8 +57,8 @@ class MemberImportForm extends Form {
|
|||||||
|
|
||||||
parent::__construct($controller, $name, $fields, $actions, $validator);
|
parent::__construct($controller, $name, $fields, $actions, $validator);
|
||||||
|
|
||||||
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_ADMIN_DIR . '/javascript/MemberImportForm.js');
|
Requirements::javascript(FRAMEWORK_ADMIN_DIR . '/javascript/MemberImportForm.js');
|
||||||
|
|
||||||
$this->addExtraClass('cms');
|
$this->addExtraClass('cms');
|
||||||
$this->addExtraClass('import-form');
|
$this->addExtraClass('import-form');
|
||||||
|
@ -110,7 +110,7 @@ abstract class ModelAdmin extends LeftAndMain {
|
|||||||
user_error('ModelAdmin::init(): Invalid Model class', E_USER_ERROR);
|
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) {
|
function getEditForm($id = null, $fields = null) {
|
||||||
|
@ -31,7 +31,7 @@ class SecurityAdmin extends LeftAndMain implements PermissionProvider {
|
|||||||
|
|
||||||
public function init() {
|
public function init() {
|
||||||
parent::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) {
|
public function getEditForm($id = null, $fields = null) {
|
||||||
@ -133,12 +133,12 @@ class SecurityAdmin extends LeftAndMain implements PermissionProvider {
|
|||||||
|
|
||||||
public function memberimport() {
|
public function memberimport() {
|
||||||
Requirements::clear();
|
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/jquery.js');
|
||||||
Requirements::javascript(THIRDPARTY_DIR . '/jquery-livequery/jquery.livequery.js');
|
Requirements::javascript(THIRDPARTY_DIR . '/jquery-livequery/jquery.livequery.js');
|
||||||
Requirements::css(SAPPHIRE_ADMIN_DIR . '/css/MemberImportForm.css');
|
Requirements::css(FRAMEWORK_ADMIN_DIR . '/css/MemberImportForm.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_ADMIN_DIR . '/javascript/MemberImportForm.js');
|
Requirements::javascript(FRAMEWORK_ADMIN_DIR . '/javascript/MemberImportForm.js');
|
||||||
|
|
||||||
return $this->renderWith('BlankPage', array(
|
return $this->renderWith('BlankPage', array(
|
||||||
'Form' => $this->MemberImportForm()->forTemplate(),
|
'Form' => $this->MemberImportForm()->forTemplate(),
|
||||||
@ -164,12 +164,12 @@ class SecurityAdmin extends LeftAndMain implements PermissionProvider {
|
|||||||
|
|
||||||
public function groupimport() {
|
public function groupimport() {
|
||||||
Requirements::clear();
|
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/jquery.js');
|
||||||
Requirements::javascript(THIRDPARTY_DIR . '/jquery-livequery/jquery.livequery.js');
|
Requirements::javascript(THIRDPARTY_DIR . '/jquery-livequery/jquery.livequery.js');
|
||||||
Requirements::css(SAPPHIRE_ADMIN_DIR . '/css/MemberImportForm.css');
|
Requirements::css(FRAMEWORK_ADMIN_DIR . '/css/MemberImportForm.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_ADMIN_DIR . '/javascript/MemberImportForm.js');
|
Requirements::javascript(FRAMEWORK_ADMIN_DIR . '/javascript/MemberImportForm.js');
|
||||||
|
|
||||||
return $this->renderWith('BlankPage', array(
|
return $this->renderWith('BlankPage', array(
|
||||||
'Content' => ' ',
|
'Content' => ' ',
|
||||||
|
@ -159,10 +159,10 @@
|
|||||||
},
|
},
|
||||||
'themes': {
|
'themes': {
|
||||||
'theme': 'apple',
|
'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,
|
// 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': [
|
'plugins': [
|
||||||
'html_data', 'ui', 'dnd', 'crrm', 'themes',
|
'html_data', 'ui', 'dnd', 'crrm', 'themes',
|
||||||
'checkbox' // checkboxes are hidden unless .multiple is set
|
'checkbox' // checkboxes are hidden unless .multiple is set
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/**
|
/**
|
||||||
* This file defines common styles for form elements used throughout the CMS interface.
|
* 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
|
* @package sapphire
|
||||||
* @subpackage admin
|
* @subpackage admin
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<div class="ss-loading-screen">
|
<div class="ss-loading-screen">
|
||||||
<div class="loading-logo">
|
<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>
|
<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>
|
||||||
</div>
|
</div>
|
@ -7,7 +7,7 @@
|
|||||||
<title>$Title</title>
|
<title>$Title</title>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body class="loading cms" lang="$Locale.RFC1766">
|
<body class="loading cms" lang="$Locale.RFC1766" data-frameworkpath="$FrameworkDir">
|
||||||
|
|
||||||
<% include CMSLoadingScreen %>
|
<% include CMSLoadingScreen %>
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
*/
|
*/
|
||||||
class LeftAndMainTest extends FunctionalTest {
|
class LeftAndMainTest extends FunctionalTest {
|
||||||
|
|
||||||
static $fixture_file = 'sapphire/admin/tests/LeftAndMainTest.yml';
|
static $fixture_file = 'LeftAndMainTest.yml';
|
||||||
|
|
||||||
protected $extraDataObjects = array('LeftAndMainTest_Object');
|
protected $extraDataObjects = array('LeftAndMainTest_Object');
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
class ModelAdminTest extends FunctionalTest {
|
class ModelAdminTest extends FunctionalTest {
|
||||||
static $fixture_file = 'sapphire/admin/tests/ModelAdminTest.yml';
|
static $fixture_file = 'ModelAdminTest.yml';
|
||||||
|
|
||||||
protected $extraDataObjects = array(
|
protected $extraDataObjects = array(
|
||||||
'ModelAdminTest_Admin',
|
'ModelAdminTest_Admin',
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
*/
|
*/
|
||||||
class SecurityAdminTest extends FunctionalTest {
|
class SecurityAdminTest extends FunctionalTest {
|
||||||
|
|
||||||
static $fixture_file = 'sapphire/admin/tests/LeftAndMainTest.yml';
|
static $fixture_file = 'LeftAndMainTest.yml';
|
||||||
|
|
||||||
protected $extraDataObjects = array('LeftAndMainTest_Object');
|
protected $extraDataObjects = array('LeftAndMainTest_Object');
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?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.
|
* This is most commonly used in developing RESTful APIs.
|
||||||
*
|
*
|
||||||
* @package sapphire
|
* @package sapphire
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
<?php
|
<?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
|
* 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
|
* 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.
|
* applications.
|
||||||
*
|
*
|
||||||
* Enabling restful access on a model will also enable a SOAP API, see {@link SOAPModelAccess}.
|
* Enabling restful access on a model will also enable a SOAP API, see {@link SOAPModelAccess}.
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
/**
|
/**
|
||||||
* File similar to main.php designed for command-line scripts
|
* 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
|
* @package sapphire
|
||||||
* @subpackage core
|
* @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");
|
require_once("core/Core.php");
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Configure Sapphire from the _ss_environment.php file.
|
* Configure SilverStripe from the _ss_environment.php file.
|
||||||
* Usage: Put "require_once('../sapphire/conf/ConfigureFromEnv.php');" into your _config.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
|
* If you include this file, you will be able to use the following defines in _ss_environment.php to control
|
||||||
* your site.
|
* your site.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* Base controller class.
|
* 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
|
* 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.
|
* the appropriate action - either by calling the action method, or displaying the action's template.
|
||||||
*
|
*
|
||||||
|
@ -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,
|
* 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.
|
* 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()}
|
* 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
|
* to set it implicitly, based on the value of $_SERVER['HTTP_HOST']. If the HTTP_HOST value is one of the servers listed, then
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
* Set on controllers on construction time, typically overwritten
|
* Set on controllers on construction time, typically overwritten
|
||||||
* by {@link Controller->handleRequest()} and {@link Controller->handleAction()} later on.
|
* by {@link Controller->handleRequest()} and {@link Controller->handleAction()} later on.
|
||||||
*
|
*
|
||||||
* @param sapphire
|
* @package sapphire
|
||||||
* @subpackage control
|
* @subpackage control
|
||||||
*/
|
*/
|
||||||
class NullHTTPRequest extends SS_HTTPRequest {
|
class NullHTTPRequest extends SS_HTTPRequest {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?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.
|
* 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
|
* 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.
|
* 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
|
* 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
|
* 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"
|
* Group #36: "admin/crm/SearchForm/field/Groups/treesegment/36"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* Provides introspection information about the class tree.
|
* 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.
|
* and without the caching it creates an unfortunate performance hit.
|
||||||
*
|
*
|
||||||
* @package sapphire
|
* @package sapphire
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?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:
|
* It takes care of:
|
||||||
* - Including _ss_environment.php
|
* - Including _ss_environment.php
|
||||||
@ -20,12 +20,12 @@
|
|||||||
* - MODULES_PATH: Not used at the moment
|
* - MODULES_PATH: Not used at the moment
|
||||||
* - THEMES_DIR: Path relative to webroot, e.g. "themes"
|
* - THEMES_DIR: Path relative to webroot, e.g. "themes"
|
||||||
* - THEMES_PATH: Absolute filepath, e.g. "/var/www/my-webroot/themes"
|
* - THEMES_PATH: Absolute filepath, e.g. "/var/www/my-webroot/themes"
|
||||||
* - SAPPHIRE_DIR: Path relative to webroot, e.g. "sapphire"
|
* - FRAMEWORK_DIR: Path relative to webroot, e.g. "framework"
|
||||||
* - SAPPHIRE_PATH:Absolute filepath, e.g. "/var/www/my-webroot/sapphire"
|
* - FRAMEWORK_PATH:Absolute filepath, e.g. "/var/www/my-webroot/framework"
|
||||||
* - SAPPHIRE_ADMIN_DIR:
|
* - FRAMEWORK_ADMIN_DIR: Path relative to webroot, e.g. "framework/admin"
|
||||||
* - SAPPHIRE_ADMIN_PATH:
|
* - FRAMEWORK_ADMIN_PATH: Absolute filepath, e.g. "/var/www/my-webroot/framework/admin"
|
||||||
* - THIRDPARTY_DIR: Path relative to webroot, e.g. "sapphire/thirdparty"
|
* - THIRDPARTY_DIR: Path relative to webroot, e.g. "framework/thirdparty"
|
||||||
* - THIRDPARTY_PATH: Absolute filepath, e.g. "/var/www/my-webroot/sapphire/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
|
* @todo This file currently contains a lot of bits and pieces, and its various responsibilities should probably be
|
||||||
* moved into different subsystems.
|
* moved into different subsystems.
|
||||||
@ -124,7 +124,7 @@ if(!isset($_SERVER['HTTP_HOST'])) {
|
|||||||
* Define system paths
|
* Define system paths
|
||||||
*/
|
*/
|
||||||
if(!defined('BASE_PATH')) {
|
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);
|
$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.
|
// 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
|
// This likely only happens on chrooted environemnts
|
||||||
@ -155,11 +155,22 @@ define('MODULES_DIR', 'modules');
|
|||||||
define('MODULES_PATH', BASE_PATH . '/' . MODULES_DIR);
|
define('MODULES_PATH', BASE_PATH . '/' . MODULES_DIR);
|
||||||
define('THEMES_DIR', 'themes');
|
define('THEMES_DIR', 'themes');
|
||||||
define('THEMES_PATH', BASE_PATH . '/' . THEMES_DIR);
|
define('THEMES_PATH', BASE_PATH . '/' . THEMES_DIR);
|
||||||
define('SAPPHIRE_DIR', 'sapphire');
|
// Relies on this being in a subdir of the framework.
|
||||||
define('SAPPHIRE_PATH', BASE_PATH . '/' . SAPPHIRE_DIR);
|
// If it isn't, or is symlinked to a folder with a different name, you must define FRAMEWORK_DIR
|
||||||
define('SAPPHIRE_ADMIN_DIR', 'sapphire/admin');
|
if(!defined('FRAMEWORK_DIR')) {
|
||||||
define('SAPPHIRE_ADMIN_PATH', BASE_PATH . '/' . SAPPHIRE_ADMIN_DIR);
|
define('FRAMEWORK_DIR', basename(dirname(dirname(__FILE__))));
|
||||||
define('THIRDPARTY_DIR', SAPPHIRE_DIR . '/thirdparty');
|
}
|
||||||
|
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('THIRDPARTY_PATH', BASE_PATH . '/' . THIRDPARTY_DIR);
|
||||||
define('ASSETS_DIR', 'assets');
|
define('ASSETS_DIR', 'assets');
|
||||||
define('ASSETS_PATH', BASE_PATH . '/' . ASSETS_DIR);
|
define('ASSETS_PATH', BASE_PATH . '/' . ASSETS_DIR);
|
||||||
@ -202,14 +213,14 @@ if(function_exists('mb_http_output')) {
|
|||||||
|
|
||||||
if(defined('CUSTOM_INCLUDE_PATH')) {
|
if(defined('CUSTOM_INCLUDE_PATH')) {
|
||||||
$includePath = CUSTOM_INCLUDE_PATH . PATH_SEPARATOR
|
$includePath = CUSTOM_INCLUDE_PATH . PATH_SEPARATOR
|
||||||
. BASE_PATH . '/sapphire' . PATH_SEPARATOR
|
. FRAMEWORK_PATH . PATH_SEPARATOR
|
||||||
. BASE_PATH . '/sapphire/parsers' . PATH_SEPARATOR
|
. FRAMEWORK_PATH . '/parsers' . PATH_SEPARATOR
|
||||||
. BASE_PATH . '/sapphire/thirdparty' . PATH_SEPARATOR
|
. THIRDPARTY_PATH . PATH_SEPARATOR
|
||||||
. get_include_path();
|
. get_include_path();
|
||||||
} else {
|
} else {
|
||||||
$includePath = BASE_PATH . '/sapphire' . PATH_SEPARATOR
|
$includePath = FRAMEWORK_PATH . PATH_SEPARATOR
|
||||||
. BASE_PATH . '/sapphire/parsers' . PATH_SEPARATOR
|
. FRAMEWORK_PATH . '/parsers' . PATH_SEPARATOR
|
||||||
. BASE_PATH . '/sapphire/thirdparty' . PATH_SEPARATOR
|
. THIRDPARTY_PATH . PATH_SEPARATOR
|
||||||
. get_include_path();
|
. 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
|
* 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,
|
* @param $base The base path to use as the basis for the temp folder name. Defaults to BASE_PATH,
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?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
|
* This class provides a number of pattern implementations, as well as methods and fixes to add extra psuedo-static
|
||||||
* and method functionality to PHP.
|
* and method functionality to PHP.
|
||||||
|
@ -246,7 +246,7 @@ class SS_ClassManifest {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns an array of module names mapped to their paths.
|
* 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
|
* @return array
|
||||||
*/
|
*/
|
||||||
|
@ -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();
|
server side call, like Requirements::css();
|
||||||
@import url("typography.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 */
|
/** 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; }
|
.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 */
|
/* added block/width so tree values don't disappear in ie7 */
|
||||||
.SelectionGroup div.TreeDropdownField ul.tree li { display: block; width: 100%; }
|
.SelectionGroup div.TreeDropdownField ul.tree li { display: block; width: 100%; }
|
||||||
|
@ -17,14 +17,14 @@
|
|||||||
#right form .hasmanyfile .clear { clear: both; }
|
#right form .hasmanyfile .clear { clear: both; }
|
||||||
|
|
||||||
/* ICONS */
|
/* 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; }
|
||||||
|
@ -7,7 +7,6 @@
|
|||||||
* To disable the task (in the case of potentially destructive updates or deletes), declare
|
* To disable the task (in the case of potentially destructive updates or deletes), declare
|
||||||
* the $Disabled property on the subclass.
|
* the $Disabled property on the subclass.
|
||||||
*
|
*
|
||||||
* @todo move from sapphire/testing to sapphire/dev or sapphire/development?
|
|
||||||
* @package sapphire
|
* @package sapphire
|
||||||
* @subpackage dev
|
* @subpackage dev
|
||||||
*/
|
*/
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* A base for bulk loaders of content into the SilverStripe database.
|
* 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,
|
* You can configure column-handling,
|
||||||
*
|
*
|
||||||
|
@ -94,7 +94,7 @@ class DevelopmentAdmin extends Controller {
|
|||||||
|
|
||||||
$renderer = DebugView::create();
|
$renderer = DebugView::create();
|
||||||
$renderer->writeHeader();
|
$renderer->writeHeader();
|
||||||
$renderer->writeInfo("Sapphire Development Tools", Director::absoluteBaseURL());
|
$renderer->writeInfo("SilverStripe Development Tools", Director::absoluteBaseURL());
|
||||||
$base = Director::baseURL();
|
$base = Director::baseURL();
|
||||||
|
|
||||||
echo '<div class="options"><ul>';
|
echo '<div class="options"><ul>';
|
||||||
@ -106,7 +106,7 @@ class DevelopmentAdmin extends Controller {
|
|||||||
|
|
||||||
// CLI mode
|
// CLI mode
|
||||||
} else {
|
} 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";
|
echo "You can execute any of the following commands:\n\n";
|
||||||
foreach($actions as $action => $description) {
|
foreach($actions as $action => $description) {
|
||||||
echo " sake dev/$action: $description\n";
|
echo " sake dev/$action: $description\n";
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?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.
|
* requests, form submission, and can validate resulting HTML, looking up content by CSS selector.
|
||||||
*
|
*
|
||||||
* The example below shows how it works.
|
* The example below shows how it works.
|
||||||
|
@ -121,7 +121,7 @@ class JSTestRunner extends Controller {
|
|||||||
function runTests($tests) {
|
function runTests($tests) {
|
||||||
$this->setUp();
|
$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));
|
self::$default_reporter->writeInfo("All Tests", "Running test cases: " . implode(", ", $tests));
|
||||||
|
|
||||||
foreach($tests as $test) {
|
foreach($tests as $test) {
|
||||||
|
@ -17,18 +17,8 @@ class SapphireInfo extends Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function Version() {
|
function Version() {
|
||||||
$sapphireVersionFile = file_get_contents(BASE_PATH . '/sapphire/silverstripe_version');
|
$sapphireVersion = file_get_contents(FRAMEWORK_PATH . '/silverstripe_version');
|
||||||
|
if(!$sapphireVersion) $sapphireVersion = _t('LeftAndMain.VersionUnknown', 'unknown');
|
||||||
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";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return $sapphireVersion;
|
return $sapphireVersion;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ class SapphireREPL extends Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function index() {
|
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 */
|
/* Try using PHP_Shell if it exists */
|
||||||
@ -46,7 +46,7 @@ class SapphireREPL extends Controller {
|
|||||||
if( empty( $__shell ) ) {
|
if( empty( $__shell ) ) {
|
||||||
set_error_handler(array($this, 'error_handler'));
|
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) {
|
while(true) {
|
||||||
echo SS_Cli::text("?> ", "cyan");
|
echo SS_Cli::text("?> ", "cyan");
|
||||||
echo SS_Cli::start_colour("yellow");
|
echo SS_Cli::start_colour("yellow");
|
||||||
|
@ -36,7 +36,7 @@ class TaskRunner extends Controller {
|
|||||||
if(!Director::is_cli()) {
|
if(!Director::is_cli()) {
|
||||||
$renderer = new DebugView();
|
$renderer = new DebugView();
|
||||||
$renderer->writeHeader();
|
$renderer->writeHeader();
|
||||||
$renderer->writeInfo("Sapphire Development Tools: Tasks", Director::absoluteBaseURL());
|
$renderer->writeInfo("SilverStripe Development Tools: Tasks", Director::absoluteBaseURL());
|
||||||
$base = Director::absoluteBaseURL();
|
$base = Director::absoluteBaseURL();
|
||||||
|
|
||||||
echo "<ul>";
|
echo "<ul>";
|
||||||
@ -51,7 +51,7 @@ class TaskRunner extends Controller {
|
|||||||
$renderer->writeFooter();
|
$renderer->writeFooter();
|
||||||
// CLI mode
|
// CLI mode
|
||||||
} else {
|
} else {
|
||||||
echo "SAPPHIRE DEVELOPMENT TOOLS: Tasks\n--------------------------\n\n";
|
echo "SILVERSTRIPE DEVELOPMENT TOOLS: Tasks\n--------------------------\n\n";
|
||||||
foreach($tasks as $task) {
|
foreach($tasks as $task) {
|
||||||
echo " * $task: sake dev/tasks/" . $task['class'] . "\n";
|
echo " * $task: sake dev/tasks/" . $task['class'] . "\n";
|
||||||
}
|
}
|
||||||
|
@ -63,12 +63,9 @@ class TestRunner extends Controller {
|
|||||||
* @see http://www.phpunit.de/manual/current/en/appendixes.configuration.html#appendixes.configuration.blacklist-whitelist
|
* @see http://www.phpunit.de/manual/current/en/appendixes.configuration.html#appendixes.configuration.blacklist-whitelist
|
||||||
*/
|
*/
|
||||||
static $coverage_filter_dirs = array(
|
static $coverage_filter_dirs = array(
|
||||||
'cms/thirdparty',
|
'*/thirdparty',
|
||||||
'cms/tests',
|
'*/tests',
|
||||||
'cms/lang',
|
'*/lang',
|
||||||
'sapphire/thirdparty',
|
|
||||||
'sapphire/tests',
|
|
||||||
'sapphire/lang',
|
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -198,7 +195,7 @@ class TestRunner extends Controller {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Run coverage tests for one or more "modules".
|
* 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) {
|
function coverageModule($request) {
|
||||||
$this->module($request, true);
|
$this->module($request, true);
|
||||||
@ -229,7 +226,7 @@ class TestRunner extends Controller {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Run tests for one or more "modules".
|
* 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) {
|
function module($request, $coverage = false) {
|
||||||
self::use_test_manifest();
|
self::use_test_manifest();
|
||||||
@ -285,7 +282,7 @@ class TestRunner extends Controller {
|
|||||||
restore_error_handler();
|
restore_error_handler();
|
||||||
|
|
||||||
|
|
||||||
self::$default_reporter->writeHeader("Sapphire Test Runner");
|
self::$default_reporter->writeHeader("SilverStripe Test Runner");
|
||||||
if (count($classList) > 1) {
|
if (count($classList) > 1) {
|
||||||
self::$default_reporter->writeInfo("All Tests", "Running test cases: ",implode(", ", $classList));
|
self::$default_reporter->writeInfo("All Tests", "Running test cases: ",implode(", ", $classList));
|
||||||
} else
|
} else
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
<head>
|
<head>
|
||||||
<title>SilverStripe CMS / Framework Installation</title>
|
<title>SilverStripe CMS / Framework Installation</title>
|
||||||
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
|
<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="<?php echo FRAMEWORK_NAME; ?>/thirdparty/jquery/jquery.js"></script>
|
||||||
<script type="text/javascript" src="sapphire/dev/install/install.js"></script>
|
<script type="text/javascript" src="<?php echo FRAMEWORK_NAME; ?>/dev/install/install.js"></script>
|
||||||
<link rel="stylesheet" type="text/css" href="sapphire/dev/install/css/install.css">
|
<link rel="stylesheet" type="text/css" href="<?php echo FRAMEWORK_NAME; ?>/dev/install/css/install.css">
|
||||||
<link rel="shortcut icon" href="favicon.ico">
|
<link rel="shortcut icon" href="favicon.ico">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
@ -276,7 +276,7 @@
|
|||||||
|
|
||||||
<span id="saving_top" style="display: none">
|
<span id="saving_top" style="display: none">
|
||||||
|
|
||||||
<img src="sapphire/images/network-save.gif">
|
<img src="<?php echo FRAMEWORK_NAME; ?>/images/network-save.gif">
|
||||||
(this will take a minute or so)
|
(this will take a minute or so)
|
||||||
</span>
|
</span>
|
||||||
</p>
|
</p>
|
||||||
|
@ -12,11 +12,12 @@
|
|||||||
/**
|
/**
|
||||||
* PHP version check. Make sure we've got at least PHP 5.3.2 in the most friendly way possible
|
* 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', '<')) {
|
if (version_compare(phpversion(), '5.3.2', '<')) {
|
||||||
header("HTTP/1.1 500 Server Error");
|
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();
|
die();
|
||||||
}
|
}
|
||||||
|
|
||||||
include('sapphire/dev/install/install.php5');
|
include(FRAMEWORK_NAME . '/dev/install/install.php5');
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* SilverStripe CMS Installer
|
* 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
|
// 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(FRAMEWORK_NAME . '/core/Object.php');
|
||||||
include_once('sapphire/view/TemplateGlobalProvider.php');
|
include_once(FRAMEWORK_NAME . '/view/TemplateGlobalProvider.php');
|
||||||
include_once('sapphire/i18n/i18n.php');
|
include_once(FRAMEWORK_NAME . '/i18n/i18n.php');
|
||||||
include_once('sapphire/dev/install/DatabaseConfigurationHelper.php');
|
include_once(FRAMEWORK_NAME . '/dev/install/DatabaseConfigurationHelper.php');
|
||||||
include_once('sapphire/dev/install/DatabaseAdapterRegistry.php');
|
include_once(FRAMEWORK_NAME . '/dev/install/DatabaseAdapterRegistry.php');
|
||||||
|
|
||||||
// Set default locale, but try and sniff from the user agent
|
// Set default locale, but try and sniff from the user agent
|
||||||
$locales = i18n::$common_locales;
|
$locales = i18n::$common_locales;
|
||||||
@ -135,14 +135,8 @@ if(file_exists('mysite/_config.php')) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(file_exists('sapphire/silverstripe_version')) {
|
if(file_exists(FRAMEWORK_NAME . '/silverstripe_version')) {
|
||||||
$sapphireVersionFile = file_get_contents('sapphire/silverstripe_version');
|
$silverstripe_version = file_get_contents(FRAMEWORK_NAME . '/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];
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
$silverstripe_version = "unknown";
|
$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']) {
|
if((isset($_REQUEST['go']) || $installFromCli) && !$req->hasErrors() && !$dbReq->hasErrors() && $adminConfig['username'] && $adminConfig['password']) {
|
||||||
// Confirm before reinstalling
|
// Confirm before reinstalling
|
||||||
if(!$installFromCli && $alreadyInstalled) {
|
if(!$installFromCli && $alreadyInstalled) {
|
||||||
include('sapphire/dev/install/config-form.html');
|
include(FRAMEWORK_NAME . '/dev/install/config-form.html');
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$inst = new Installer();
|
$inst = new Installer();
|
||||||
@ -205,7 +199,7 @@ if((isset($_REQUEST['go']) || $installFromCli) && !$req->hasErrors() && !$dbReq-
|
|||||||
|
|
||||||
// Show the config form
|
// Show the config form
|
||||||
} else {
|
} 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()));
|
$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
|
// 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?",
|
"Does the webserver know where files are stored?",
|
||||||
"The webserver isn't letting me identify where files are stored.",
|
"The webserver isn't letting me identify where files are stored.",
|
||||||
$this->getBaseDir()
|
$this->getBaseDir()
|
||||||
));
|
));
|
||||||
|
|
||||||
$this->requireModule('mysite', array("File permissions", "mysite/ directory exists?"));
|
$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) {
|
if($isApache) {
|
||||||
$this->requireWriteable('.htaccess', array("File permissions", "Is the .htaccess file writeable?", null));
|
$this->requireWriteable('.htaccess', array("File permissions", "Is the .htaccess file writeable?", null));
|
||||||
@ -944,8 +938,8 @@ class Installer extends InstallRequirements {
|
|||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>Installing SilverStripe...</title>
|
<title>Installing SilverStripe...</title>
|
||||||
<link rel="stylesheet" type="text/css" href="sapphire/dev/install/css/install.css" />
|
<link rel="stylesheet" type="text/css" href="<?php echo FRAMEWORK_NAME; ?>/dev/install/css/install.css" />
|
||||||
<script src="sapphire/thirdparty/jquery/jquery.js"></script>
|
<script src="<?php echo FRAMEWORK_NAME; ?>/thirdparty/jquery/jquery.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="install-header">
|
<div class="install-header">
|
||||||
@ -978,14 +972,8 @@ class Installer extends InstallRequirements {
|
|||||||
flush();
|
flush();
|
||||||
|
|
||||||
if(isset($config['stats'])) {
|
if(isset($config['stats'])) {
|
||||||
if(file_exists('sapphire/silverstripe_version')) {
|
if(file_exists(FRAMEWORK_NAME . '/silverstripe_version')) {
|
||||||
$sapphireVersionFile = file_get_contents('sapphire/silverstripe_version');
|
$silverstripe_version = file_get_contents(FRAMEWORK_NAME . '/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];
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
$silverstripe_version = "unknown";
|
$silverstripe_version = "unknown";
|
||||||
}
|
}
|
||||||
@ -1117,9 +1105,9 @@ PHP
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load the sapphire runtime
|
// Load the SilverStripe runtime
|
||||||
$_SERVER['SCRIPT_FILENAME'] = dirname(realpath($_SERVER['SCRIPT_FILENAME'])) . '/sapphire/main.php';
|
$_SERVER['SCRIPT_FILENAME'] = dirname(realpath($_SERVER['SCRIPT_FILENAME'])) . '/' . FRAMEWORK_NAME . '/main.php';
|
||||||
chdir('sapphire');
|
chdir(FRAMEWORK_NAME);
|
||||||
|
|
||||||
// Rebuild the manifest
|
// Rebuild the manifest
|
||||||
$_GET['flush'] = true;
|
$_GET['flush'] = true;
|
||||||
@ -1207,7 +1195,7 @@ HTML;
|
|||||||
|
|
||||||
if($base != '.') $baseClause = "RewriteBase '$base'\n";
|
if($base != '.') $baseClause = "RewriteBase '$base'\n";
|
||||||
else $baseClause = "";
|
else $baseClause = "";
|
||||||
|
$modulePath = FRAMEWORK_NAME;
|
||||||
$rewrite = <<<TEXT
|
$rewrite = <<<TEXT
|
||||||
<Files *.ss>
|
<Files *.ss>
|
||||||
Order deny,allow
|
Order deny,allow
|
||||||
@ -1233,7 +1221,7 @@ ErrorDocument 500 /assets/error-500.html
|
|||||||
$baseClause
|
$baseClause
|
||||||
RewriteCond %{REQUEST_URI} ^(.*)$
|
RewriteCond %{REQUEST_URI} ^(.*)$
|
||||||
RewriteCond %{REQUEST_FILENAME} !-f
|
RewriteCond %{REQUEST_FILENAME} !-f
|
||||||
RewriteRule .* sapphire/main.php?url=%1&%{QUERY_STRING} [L]
|
RewriteRule .* $modulePath/main.php?url=%1&%{QUERY_STRING} [L]
|
||||||
</IfModule>
|
</IfModule>
|
||||||
TEXT;
|
TEXT;
|
||||||
|
|
||||||
@ -1258,6 +1246,7 @@ TEXT;
|
|||||||
* so that rewriting capability can be use.
|
* so that rewriting capability can be use.
|
||||||
*/
|
*/
|
||||||
function createWebConfig() {
|
function createWebConfig() {
|
||||||
|
$modulePath = FRAMEWORK_NAME;
|
||||||
$content = <<<TEXT
|
$content = <<<TEXT
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<configuration>
|
<configuration>
|
||||||
@ -1276,7 +1265,7 @@ TEXT;
|
|||||||
<conditions>
|
<conditions>
|
||||||
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
|
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
|
||||||
</conditions>
|
</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>
|
</rule>
|
||||||
</rules>
|
</rules>
|
||||||
</rewrite>
|
</rewrite>
|
||||||
|
@ -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.
|
* the results of the unit tests.
|
||||||
*
|
*
|
||||||
* This method calls @see beforeRunTests and @see afterRunTests.
|
* This method calls @see beforeRunTests and @see afterRunTests.
|
||||||
@ -211,6 +211,22 @@ class PhpUnitWrapper implements IPhpUnitWrapper {
|
|||||||
$this->getSuite()->run($this->getFrameworkTestResults());
|
$this->getSuite()->run($this->getFrameworkTestResults());
|
||||||
$this->aferRunTests();
|
$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()) {
|
if(!PhpUnitWrapper::has_php_unit()) {
|
||||||
/**
|
/**
|
||||||
* PHPUnit is a testing framework that can be installed using PEAR.
|
* 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
|
* @package sapphire
|
||||||
* @subpackage testing
|
* @subpackage testing
|
||||||
|
@ -29,9 +29,18 @@ class PhpUnitWrapper_3_4 extends PhpUnitWrapper {
|
|||||||
|
|
||||||
if($this->getCoverageStatus()) {
|
if($this->getCoverageStatus()) {
|
||||||
// blacklist selected folders from coverage report
|
// blacklist selected folders from coverage report
|
||||||
|
$modules = $this->moduleDirectories();
|
||||||
|
|
||||||
foreach(TestRunner::$coverage_filter_dirs as $dir) {
|
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);
|
PHPUnit_Util_Filter::addDirectoryToFilter(BASE_PATH . '/' . $dir);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
PHPUnit_Util_Filter::addDirectoryToFilter(BASE_PATH . '/' . $dir);
|
||||||
|
}
|
||||||
|
}
|
||||||
$this->getFrameworkTestResults()->collectCodeCoverageInformation(true);
|
$this->getFrameworkTestResults()->collectCodeCoverageInformation(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -39,10 +39,18 @@ class PhpUnitWrapper_3_5 extends PhpUnitWrapper {
|
|||||||
$coverage = $this->coverage;
|
$coverage = $this->coverage;
|
||||||
|
|
||||||
$filter = $coverage->filter();
|
$filter = $coverage->filter();
|
||||||
|
$modules = $this->moduleDirectories();
|
||||||
|
|
||||||
foreach(TestRunner::$coverage_filter_dirs as $dir) {
|
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->addDirectoryToBlacklist(BASE_PATH . '/' . $dir);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$filter->addFileToBlacklist(__FILE__, 'PHPUNIT');
|
$filter->addFileToBlacklist(__FILE__, 'PHPUNIT');
|
||||||
|
|
||||||
|
@ -647,7 +647,7 @@ class Email_BounceHandler extends Controller {
|
|||||||
return;
|
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) {
|
if( $_REQUEST['Key'] != EMAIL_BOUNCEHANDLER_KEY) {
|
||||||
echo 'Error: Access validation failed. Invalid "Key" specified.';
|
echo 'Error: Access validation failed. Invalid "Key" specified.';
|
||||||
return;
|
return;
|
||||||
|
@ -447,7 +447,7 @@ function getMimeType($filename) {
|
|||||||
*/
|
*/
|
||||||
function loadMimeTypes() {
|
function loadMimeTypes() {
|
||||||
$mimetypePathCustom = '/etc/mime.types';
|
$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);
|
$mimeTypes = file_exists($mimetypePathGeneric) ? file($mimetypePathGeneric) : file($mimetypePathCustom);
|
||||||
foreach($mimeTypes as $typeSpec) {
|
foreach($mimeTypes as $typeSpec) {
|
||||||
if(($typeSpec = trim($typeSpec)) && substr($typeSpec,0,1) != "#") {
|
if(($typeSpec = trim($typeSpec)) && substr($typeSpec,0,1) != "#") {
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* This class handles the representation of a file on the filesystem within the framework.
|
* This class handles the representation of a file on the filesystem within the framework.
|
||||||
* Most of the methods also handle the {@link Folder} subclass.
|
* 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
|
* 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).
|
* 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,
|
* Typically both files and folders should be created first on the filesystem,
|
||||||
* and then reflected in as database records. Folders can be created recursively
|
* 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,
|
* Ensure that you always set a "Filename" property when writing to the database,
|
||||||
* leaving it out can lead to unexpected results.
|
* 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,
|
* Return the relative URL of an icon for the file type,
|
||||||
* based on the {@link appCategory()} value.
|
* 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
|
* @return String
|
||||||
*/
|
*/
|
||||||
function Icon() {
|
function Icon() {
|
||||||
$ext = $this->Extension;
|
$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();
|
$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";
|
$ext = "generic";
|
||||||
}
|
}
|
||||||
|
|
||||||
return SAPPHIRE_DIR . "/images/app_icons/{$ext}_32.gif";
|
return FRAMEWORK_DIR . "/images/app_icons/{$ext}_32.gif";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
* to avoid touching the filesystem.
|
* to avoid touching the filesystem.
|
||||||
*
|
*
|
||||||
* See {@link File} documentation for more details about the
|
* 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
|
* @package sapphire
|
||||||
* @subpackage filesystem
|
* @subpackage filesystem
|
||||||
|
@ -31,8 +31,8 @@ class AjaxUniqueTextField extends TextField {
|
|||||||
function Field($properties = array()) {
|
function Field($properties = array()) {
|
||||||
Requirements::javascript(THIRDPARTY_DIR . "/prototype/prototype.js");
|
Requirements::javascript(THIRDPARTY_DIR . "/prototype/prototype.js");
|
||||||
Requirements::javascript(THIRDPARTY_DIR . "/behaviour/behaviour.js");
|
Requirements::javascript(THIRDPARTY_DIR . "/behaviour/behaviour.js");
|
||||||
Requirements::add_i18n_javascript(SAPPHIRE_DIR . '/javascript/lang');
|
Requirements::add_i18n_javascript(FRAMEWORK_DIR . '/javascript/lang');
|
||||||
Requirements::javascript(SAPPHIRE_DIR . "/javascript/UniqueFields.js");
|
Requirements::javascript(FRAMEWORK_DIR . "/javascript/UniqueFields.js");
|
||||||
|
|
||||||
$url = Convert::raw2att( $this->validateURL );
|
$url = Convert::raw2att( $this->validateURL );
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ class CheckboxSetField extends OptionsetField {
|
|||||||
* e.g. SQLMap, ArrayList or an array.
|
* e.g. SQLMap, ArrayList or an array.
|
||||||
*/
|
*/
|
||||||
function Field($properties = array()) {
|
function Field($properties = array()) {
|
||||||
Requirements::css(SAPPHIRE_DIR . '/css/CheckboxSetField.css');
|
Requirements::css(FRAMEWORK_DIR . '/css/CheckboxSetField.css');
|
||||||
|
|
||||||
$source = $this->source;
|
$source = $this->source;
|
||||||
$values = $this->value;
|
$values = $this->value;
|
||||||
@ -286,4 +286,5 @@ class CheckboxSetField extends OptionsetField {
|
|||||||
function ExtraOptions() {
|
function ExtraOptions() {
|
||||||
return FormField::ExtraOptions();
|
return FormField::ExtraOptions();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -211,12 +211,12 @@ class ComplexTableField extends TableListField {
|
|||||||
Requirements::javascript(THIRDPARTY_DIR . "/behaviour/behaviour.js");
|
Requirements::javascript(THIRDPARTY_DIR . "/behaviour/behaviour.js");
|
||||||
Requirements::javascript(THIRDPARTY_DIR . "/greybox/AmiJS.js");
|
Requirements::javascript(THIRDPARTY_DIR . "/greybox/AmiJS.js");
|
||||||
Requirements::javascript(THIRDPARTY_DIR . "/greybox/greybox.js");
|
Requirements::javascript(THIRDPARTY_DIR . "/greybox/greybox.js");
|
||||||
Requirements::add_i18n_javascript(SAPPHIRE_DIR . '/javascript/lang');
|
Requirements::add_i18n_javascript(FRAMEWORK_DIR . '/javascript/lang');
|
||||||
Requirements::javascript(SAPPHIRE_DIR . '/javascript/TableListField.js');
|
Requirements::javascript(FRAMEWORK_DIR . '/javascript/TableListField.js');
|
||||||
Requirements::javascript(SAPPHIRE_DIR . "/javascript/ComplexTableField.js");
|
Requirements::javascript(FRAMEWORK_DIR . "/javascript/ComplexTableField.js");
|
||||||
Requirements::css(THIRDPARTY_DIR . "/greybox/greybox.css");
|
Requirements::css(THIRDPARTY_DIR . "/greybox/greybox.css");
|
||||||
Requirements::css(SAPPHIRE_DIR . "/css/TableListField.css");
|
Requirements::css(FRAMEWORK_DIR . "/css/TableListField.css");
|
||||||
Requirements::css(SAPPHIRE_DIR . "/css/ComplexTableField.css");
|
Requirements::css(FRAMEWORK_DIR . "/css/ComplexTableField.css");
|
||||||
|
|
||||||
// set caption if required
|
// set caption if required
|
||||||
if($this->popupCaption) {
|
if($this->popupCaption) {
|
||||||
@ -834,13 +834,13 @@ class ComplexTableField_Popup extends Form {
|
|||||||
function forTemplate() {
|
function forTemplate() {
|
||||||
$ret = parent::forTemplate();
|
$ret = parent::forTemplate();
|
||||||
|
|
||||||
Requirements::css(SAPPHIRE_DIR . '/css/ComplexTableField_popup.css');
|
Requirements::css(FRAMEWORK_DIR . '/css/ComplexTableField_popup.css');
|
||||||
Requirements::javascript(SAPPHIRE_DIR . "/thirdparty/prototype/prototype.js");
|
Requirements::javascript(FRAMEWORK_DIR . "/thirdparty/prototype/prototype.js");
|
||||||
Requirements::javascript(SAPPHIRE_DIR . "/thirdparty/behaviour/behaviour.js");
|
Requirements::javascript(FRAMEWORK_DIR . "/thirdparty/behaviour/behaviour.js");
|
||||||
Requirements::javascript(SAPPHIRE_DIR . "/thirdparty/scriptaculous/scriptaculous.js");
|
Requirements::javascript(FRAMEWORK_DIR . "/thirdparty/scriptaculous/scriptaculous.js");
|
||||||
Requirements::javascript(SAPPHIRE_DIR . "/thirdparty/scriptaculous/scriptaculous/controls.js");
|
Requirements::javascript(FRAMEWORK_DIR . "/thirdparty/scriptaculous/scriptaculous/controls.js");
|
||||||
Requirements::add_i18n_javascript(SAPPHIRE_DIR . '/javascript/lang');
|
Requirements::add_i18n_javascript(FRAMEWORK_DIR . '/javascript/lang');
|
||||||
Requirements::javascript(SAPPHIRE_DIR . "/javascript/ComplexTableField_popup.js");
|
Requirements::javascript(FRAMEWORK_DIR . "/javascript/ComplexTableField_popup.js");
|
||||||
|
|
||||||
// Append requirements from instance callbacks
|
// Append requirements from instance callbacks
|
||||||
$parent = $this->getParentController();
|
$parent = $this->getParentController();
|
||||||
|
@ -94,9 +94,9 @@ class ConfirmedPasswordField extends FormField {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function Field($properties = array()) {
|
function Field($properties = array()) {
|
||||||
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery/jquery.js');
|
Requirements::javascript(FRAMEWORK_DIR . '/thirdparty/jquery/jquery.js');
|
||||||
Requirements::javascript(SAPPHIRE_DIR . '/javascript/ConfirmedPasswordField.js');
|
Requirements::javascript(FRAMEWORK_DIR . '/javascript/ConfirmedPasswordField.js');
|
||||||
Requirements::css(SAPPHIRE_DIR . '/css/ConfirmedPasswordField.css');
|
Requirements::css(FRAMEWORK_DIR . '/css/ConfirmedPasswordField.css');
|
||||||
|
|
||||||
$content = '';
|
$content = '';
|
||||||
|
|
||||||
|
@ -504,7 +504,7 @@ class DateField_View_JQuery extends Object {
|
|||||||
if($this->getField()->getConfig('showcalendar')) {
|
if($this->getField()->getConfig('showcalendar')) {
|
||||||
Requirements::javascript(THIRDPARTY_DIR . '/jquery/jquery.js');
|
Requirements::javascript(THIRDPARTY_DIR . '/jquery/jquery.js');
|
||||||
Requirements::css(THIRDPARTY_DIR . '/jquery-ui-themes/smoothness/jquery-ui.css');
|
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)
|
// Include language files (if required)
|
||||||
$lang = $this->getLang();
|
$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;
|
return $html;
|
||||||
|
@ -85,7 +85,7 @@ class DatetimeField extends FormField {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function Field($properties = array()) {
|
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() : '';
|
$tzField = ($this->getConfig('usertimezone')) ? $this->timezoneField->FieldHolder() : '';
|
||||||
return $this->dateField->FieldHolder() .
|
return $this->dateField->FieldHolder() .
|
||||||
|
@ -61,10 +61,10 @@ class FileIFrameField extends FileField {
|
|||||||
public function Field($properties = array()) {
|
public function Field($properties = array()) {
|
||||||
Deprecation::notice('3.0', 'Use UploadField');
|
Deprecation::notice('3.0', 'Use UploadField');
|
||||||
|
|
||||||
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::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(FRAMEWORK_DIR . '/thirdparty/jquery/jquery.js');
|
||||||
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery-ui/jquery-ui.js');
|
Requirements::javascript(FRAMEWORK_DIR . '/thirdparty/jquery-ui/jquery-ui.js');
|
||||||
|
|
||||||
|
|
||||||
if($this->form->getRecord() && $this->form->getRecord()->exists()) {
|
if($this->form->getRecord() && $this->form->getRecord()->exists()) {
|
||||||
@ -113,11 +113,11 @@ class FileIFrameField extends FileField {
|
|||||||
public function iframe() {
|
public function iframe() {
|
||||||
// clear the requirements added by any parent controllers
|
// clear the requirements added by any parent controllers
|
||||||
Requirements::clear();
|
Requirements::clear();
|
||||||
Requirements::add_i18n_javascript('sapphire/javascript/lang');
|
Requirements::add_i18n_javascript(FRAMEWORK_DIR . '/javascript/lang');
|
||||||
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery/jquery.js');
|
Requirements::javascript(THIRDPARTY_DIR . '/jquery/jquery.js');
|
||||||
Requirements::javascript('sapphire/javascript/FileIFrameField.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');
|
return $this->renderWith('FileIframeField_iframe');
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* Base class for all forms.
|
* 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
|
* 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.
|
* of form whose actions are handled by the parent controller.
|
||||||
*
|
*
|
||||||
|
@ -67,10 +67,10 @@ class HasManyComplexTableField extends ComplexTableField {
|
|||||||
function FieldHolder($properties = array()) {
|
function FieldHolder($properties = array()) {
|
||||||
$ret = parent::FieldHolder($properties);
|
$ret = parent::FieldHolder($properties);
|
||||||
|
|
||||||
Requirements::add_i18n_javascript(SAPPHIRE_DIR . '/javascript/lang');
|
Requirements::add_i18n_javascript(FRAMEWORK_DIR . '/javascript/lang');
|
||||||
Requirements::javascript(SAPPHIRE_DIR . "/javascript/HasManyFileField.js");
|
Requirements::javascript(FRAMEWORK_DIR . "/javascript/HasManyFileField.js");
|
||||||
Requirements::javascript(SAPPHIRE_DIR . '/javascript/RelationComplexTableField.js');
|
Requirements::javascript(FRAMEWORK_DIR . '/javascript/RelationComplexTableField.js');
|
||||||
Requirements::css(SAPPHIRE_DIR . '/css/HasManyFileField.css');
|
Requirements::css(FRAMEWORK_DIR . '/css/HasManyFileField.css');
|
||||||
|
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
@ -81,8 +81,6 @@ class HtmlEditorConfig {
|
|||||||
'safari_warning' => false,
|
'safari_warning' => false,
|
||||||
'relative_urls' => true,
|
'relative_urls' => true,
|
||||||
'verify_html' => true,
|
'verify_html' => true,
|
||||||
|
|
||||||
'spellchecker_rpc_url' => 'sapphire/thirdparty/tinymce-spellchecker/rpc.php'
|
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -255,11 +255,11 @@ class HtmlEditorField_Toolbar extends RequestHandler {
|
|||||||
function __construct($controller, $name) {
|
function __construct($controller, $name) {
|
||||||
parent::__construct();
|
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-ui/jquery-ui.js');
|
||||||
Requirements::javascript(THIRDPARTY_DIR . '/jquery-entwine/dist/jquery.entwine-dist.js');
|
Requirements::javascript(THIRDPARTY_DIR . '/jquery-entwine/dist/jquery.entwine-dist.js');
|
||||||
Requirements::javascript(SAPPHIRE_ADMIN_DIR . '/javascript/ssui.core.js');
|
Requirements::javascript(FRAMEWORK_ADMIN_DIR . '/javascript/ssui.core.js');
|
||||||
Requirements::javascript(SAPPHIRE_DIR ."/javascript/HtmlEditorField.js");
|
Requirements::javascript(FRAMEWORK_DIR ."/javascript/HtmlEditorField.js");
|
||||||
|
|
||||||
Requirements::css(THIRDPARTY_DIR . '/jquery-ui-themes/smoothness/jquery-ui.css');
|
Requirements::css(THIRDPARTY_DIR . '/jquery-ui-themes/smoothness/jquery-ui.css');
|
||||||
|
|
||||||
@ -389,7 +389,7 @@ class HtmlEditorField_Toolbar extends RequestHandler {
|
|||||||
$fromCMS->addExtraClass('content');
|
$fromCMS->addExtraClass('content');
|
||||||
$selectComposite->addExtraClass('content-select');
|
$selectComposite->addExtraClass('content-select');
|
||||||
|
|
||||||
Requirements::css(SAPPHIRE_DIR . '/css/AssetUploadField.css');
|
Requirements::css(FRAMEWORK_DIR . '/css/AssetUploadField.css');
|
||||||
$computerUploadField = Object::create('UploadField', 'AssetUploadField', '');
|
$computerUploadField = Object::create('UploadField', 'AssetUploadField', '');
|
||||||
$computerUploadField->setConfig('previewMaxWidth', 40);
|
$computerUploadField->setConfig('previewMaxWidth', 40);
|
||||||
$computerUploadField->setConfig('previewMaxHeight', 30);
|
$computerUploadField->setConfig('previewMaxHeight', 30);
|
||||||
|
@ -28,7 +28,7 @@ class ImageFormAction extends FormAction {
|
|||||||
|
|
||||||
function Field($properties = array()) {
|
function Field($properties = array()) {
|
||||||
Requirements::javascript(THIRDPARTY_DIR . '/jquery/jquery.js');
|
Requirements::javascript(THIRDPARTY_DIR . '/jquery/jquery.js');
|
||||||
Requirements::javascript(SAPPHIRE_DIR . '/javascript/ImageFormAction.js');
|
Requirements::javascript(FRAMEWORK_DIR . '/javascript/ImageFormAction.js');
|
||||||
|
|
||||||
$classClause = '';
|
$classClause = '';
|
||||||
if($this->className) $classClause = $this->className . ' ';
|
if($this->className) $classClause = $this->className . ' ';
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* Render a button that will submit the form its contained in through ajax.
|
* 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.
|
* 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
|
* @package forms
|
||||||
* @subpackage actions
|
* @subpackage actions
|
||||||
@ -29,7 +29,7 @@ class InlineFormAction extends FormField {
|
|||||||
|
|
||||||
function Field($properties = array()) {
|
function Field($properties = array()) {
|
||||||
if($this->includeDefaultJS) {
|
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}\" />";
|
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.
|
* which routes to an "admin-custom"-URL.
|
||||||
*
|
*
|
||||||
* @param $bool boolean
|
* @param $bool boolean
|
||||||
|
@ -74,7 +74,7 @@ class NullableField extends FormField {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* (non-PHPdoc)
|
* (non-PHPdoc)
|
||||||
* @see sapphire/forms/FormField#Field()
|
* @see framework/forms/FormField#Field()
|
||||||
*/
|
*/
|
||||||
function Field($properties = array()) {
|
function Field($properties = array()) {
|
||||||
if ( $this->isReadonly()) {
|
if ( $this->isReadonly()) {
|
||||||
@ -114,7 +114,7 @@ class NullableField extends FormField {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* (non-PHPdoc)
|
* (non-PHPdoc)
|
||||||
* @see sapphire/forms/FormField#debug()
|
* @see framework/forms/FormField#debug()
|
||||||
*/
|
*/
|
||||||
function debug() {
|
function debug() {
|
||||||
$result = "$this->class ($this->name: $this->title : <font style='color:red;'>$this->message</font>) = ";
|
$result = "$this->class ($this->name: $this->title : <font style='color:red;'>$this->message</font>) = ";
|
||||||
|
@ -25,7 +25,7 @@ class SelectionGroup extends CompositeField {
|
|||||||
|
|
||||||
parent::__construct($items);
|
parent::__construct($items);
|
||||||
|
|
||||||
Requirements::css(SAPPHIRE_DIR . '/css/SelectionGroup.css');
|
Requirements::css(FRAMEWORK_DIR . '/css/SelectionGroup.css');
|
||||||
}
|
}
|
||||||
|
|
||||||
function FieldSet() {
|
function FieldSet() {
|
||||||
@ -69,8 +69,8 @@ class SelectionGroup extends CompositeField {
|
|||||||
|
|
||||||
function FieldHolder($properties = array()) {
|
function FieldHolder($properties = array()) {
|
||||||
Requirements::javascript(THIRDPARTY_DIR .'/jquery/jquery.js');
|
Requirements::javascript(THIRDPARTY_DIR .'/jquery/jquery.js');
|
||||||
Requirements::javascript(SAPPHIRE_DIR . '/javascript/SelectionGroup.js');
|
Requirements::javascript(FRAMEWORK_DIR . '/javascript/SelectionGroup.js');
|
||||||
Requirements::css(SAPPHIRE_DIR . '/css/SelectionGroup.css');
|
Requirements::css(FRAMEWORK_DIR . '/css/SelectionGroup.css');
|
||||||
|
|
||||||
$obj = $properties ? $this->customise($properties) : $this;
|
$obj = $properties ? $this->customise($properties) : $this;
|
||||||
|
|
||||||
|
@ -68,15 +68,15 @@ class TabSet extends CompositeField {
|
|||||||
* The HTML is a standardised format, containing a <ul;
|
* The HTML is a standardised format, containing a <ul;
|
||||||
*/
|
*/
|
||||||
public function FieldHolder($properties = array()) {
|
public function FieldHolder($properties = array()) {
|
||||||
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery/jquery.js');
|
Requirements::javascript(FRAMEWORK_DIR . '/thirdparty/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(SAPPHIRE_DIR . '/thirdparty/jquery-cookie/jquery.cookie.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;
|
$obj = $properties ? $this->customise($properties) : $this;
|
||||||
|
|
||||||
|
@ -464,13 +464,13 @@ class TableField extends TableListField {
|
|||||||
* Sets the template to be rendered with
|
* Sets the template to be rendered with
|
||||||
*/
|
*/
|
||||||
function FieldHolder($properties = array()) {
|
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(THIRDPARTY_DIR . "/prototype/prototype.js");
|
||||||
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/behaviour/behaviour.js');
|
Requirements::javascript(FRAMEWORK_DIR . '/thirdparty/behaviour/behaviour.js');
|
||||||
Requirements::add_i18n_javascript(SAPPHIRE_DIR . '/javascript/lang');
|
Requirements::add_i18n_javascript(FRAMEWORK_DIR . '/javascript/lang');
|
||||||
Requirements::javascript(SAPPHIRE_DIR . '/javascript/TableListField.js');
|
Requirements::javascript(FRAMEWORK_DIR . '/javascript/TableListField.js');
|
||||||
Requirements::javascript(SAPPHIRE_DIR . '/javascript/TableField.js');
|
Requirements::javascript(FRAMEWORK_DIR . '/javascript/TableField.js');
|
||||||
Requirements::css(SAPPHIRE_DIR . '/css/TableListField.css');
|
Requirements::css(FRAMEWORK_DIR . '/css/TableListField.css');
|
||||||
|
|
||||||
$obj = $properties ? $this->customise($properties) : $this;
|
$obj = $properties ? $this->customise($properties) : $this;
|
||||||
return $obj->renderWith($this->template);
|
return $obj->renderWith($this->template);
|
||||||
|
@ -237,6 +237,9 @@ class TableListField extends FormField {
|
|||||||
*/
|
*/
|
||||||
function __construct($name, $sourceClass = null, $fieldList = null, $sourceFilter = null,
|
function __construct($name, $sourceClass = null, $fieldList = null, $sourceFilter = null,
|
||||||
$sourceSort = null, $sourceJoin = null) {
|
$sourceSort = null, $sourceJoin = null) {
|
||||||
|
if(FRAMEWORK_DIR != 'sapphire') {
|
||||||
|
user_error('TableListField requires FRAMEWORK_DIR to be sapphire.', E_USER_WARNING);
|
||||||
|
}
|
||||||
|
|
||||||
if($sourceClass) {
|
if($sourceClass) {
|
||||||
// You can optionally pass a list
|
// You can optionally pass a list
|
||||||
@ -279,12 +282,12 @@ class TableListField extends FormField {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function FieldHolder($properties = array()) {
|
function FieldHolder($properties = array()) {
|
||||||
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery/jquery.js');
|
Requirements::javascript(FRAMEWORK_DIR . '/thirdparty/jquery/jquery.js');
|
||||||
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/prototype/prototype.js');
|
Requirements::javascript(FRAMEWORK_DIR . '/thirdparty/prototype/prototype.js');
|
||||||
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/behaviour/behaviour.js');
|
Requirements::javascript(FRAMEWORK_DIR . '/thirdparty/behaviour/behaviour.js');
|
||||||
Requirements::add_i18n_javascript(SAPPHIRE_DIR . '/javascript/lang');
|
Requirements::add_i18n_javascript(FRAMEWORK_DIR . '/javascript/lang');
|
||||||
Requirements::javascript(SAPPHIRE_DIR . '/javascript/TableListField.js');
|
Requirements::javascript(FRAMEWORK_DIR . '/javascript/TableListField.js');
|
||||||
Requirements::css(SAPPHIRE_DIR . '/css/TableListField.css');
|
Requirements::css(FRAMEWORK_DIR . '/css/TableListField.css');
|
||||||
|
|
||||||
if($this->clickAction) {
|
if($this->clickAction) {
|
||||||
$id = $this->id();
|
$id = $this->id();
|
||||||
@ -1055,7 +1058,7 @@ JS
|
|||||||
Requirements::css(CMS_DIR . '/css/typography.css');
|
Requirements::css(CMS_DIR . '/css/typography.css');
|
||||||
Requirements::css(CMS_DIR . '/css/cms_right.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;
|
$this->cachedSourceItems = null;
|
||||||
$oldShowPagination = $this->showPagination;
|
$oldShowPagination = $this->showPagination;
|
||||||
|
@ -22,9 +22,9 @@ class ToggleCompositeField extends CompositeField {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function FieldHolder($properties = array()) {
|
public function FieldHolder($properties = array()) {
|
||||||
Requirements::javascript(SAPPHIRE_DIR . "/thirdparty/prototype/prototype.js");
|
Requirements::javascript(FRAMEWORK_DIR . "/thirdparty/prototype/prototype.js");
|
||||||
Requirements::javascript(SAPPHIRE_DIR . "/thirdparty/behaviour/behaviour.js");
|
Requirements::javascript(FRAMEWORK_DIR . "/thirdparty/behaviour/behaviour.js");
|
||||||
Requirements::javascript(SAPPHIRE_DIR . "/javascript/ToggleCompositeField.js");
|
Requirements::javascript(FRAMEWORK_DIR . "/javascript/ToggleCompositeField.js");
|
||||||
|
|
||||||
$obj = $properties ? $this->customise($properties) : $this;
|
$obj = $properties ? $this->customise($properties) : $this;
|
||||||
|
|
||||||
|
@ -49,9 +49,9 @@ class ToggleField extends ReadonlyField {
|
|||||||
function Field($properties = array()) {
|
function Field($properties = array()) {
|
||||||
$content = '';
|
$content = '';
|
||||||
|
|
||||||
Requirements::javascript(SAPPHIRE_DIR . "/thirdparty/prototype/prototype.js");
|
Requirements::javascript(FRAMEWORK_DIR . "/thirdparty/prototype/prototype.js");
|
||||||
Requirements::javascript(SAPPHIRE_DIR . "/thirdparty/behaviour/behaviour.js");
|
Requirements::javascript(FRAMEWORK_DIR . "/thirdparty/behaviour/behaviour.js");
|
||||||
Requirements::javascript(SAPPHIRE_DIR . "/javascript/ToggleField.js");
|
Requirements::javascript(FRAMEWORK_DIR . "/javascript/ToggleField.js");
|
||||||
|
|
||||||
if($this->startClosed) $this->addExtraClass('startClosed');
|
if($this->startClosed) $this->addExtraClass('startClosed');
|
||||||
|
|
||||||
|
@ -161,15 +161,15 @@ class TreeDropdownField extends FormField {
|
|||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function Field($properties = array()) {
|
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(FRAMEWORK_DIR . '/thirdparty/jquery/jquery.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::javascript(SAPPHIRE_DIR . '/thirdparty/jstree/jquery.jstree.js');
|
Requirements::javascript(FRAMEWORK_DIR . '/thirdparty/jstree/jquery.jstree.js');
|
||||||
Requirements::javascript(SAPPHIRE_DIR . '/javascript/TreeDropdownField.js');
|
Requirements::javascript(FRAMEWORK_DIR . '/javascript/TreeDropdownField.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::css(SAPPHIRE_DIR . '/css/TreeDropdownField.css');
|
Requirements::css(FRAMEWORK_DIR . '/css/TreeDropdownField.css');
|
||||||
|
|
||||||
$record = $this->Value() ? $this->objectForKey($this->Value()) : null;
|
$record = $this->Value() ? $this->objectForKey($this->Value()) : null;
|
||||||
if($record) {
|
if($record) {
|
||||||
|
@ -79,15 +79,15 @@ class TreeMultiselectField extends TreeDropdownField {
|
|||||||
* formfield can contain multiple values.
|
* formfield can contain multiple values.
|
||||||
*/
|
*/
|
||||||
function Field($properties = array()) {
|
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(FRAMEWORK_DIR . '/thirdparty/jquery/jquery.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::javascript(SAPPHIRE_DIR . '/thirdparty/jstree/jquery.jstree.js');
|
Requirements::javascript(FRAMEWORK_DIR . '/thirdparty/jstree/jquery.jstree.js');
|
||||||
Requirements::javascript(SAPPHIRE_DIR . '/javascript/TreeDropdownField.js');
|
Requirements::javascript(FRAMEWORK_DIR . '/javascript/TreeDropdownField.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::css(SAPPHIRE_DIR . '/css/TreeDropdownField.css');
|
Requirements::css(FRAMEWORK_DIR . '/css/TreeDropdownField.css');
|
||||||
|
|
||||||
$value = '';
|
$value = '';
|
||||||
$itemList = '';
|
$itemList = '';
|
||||||
|
@ -321,8 +321,8 @@ class UploadField extends FileField {
|
|||||||
Requirements::javascript(THIRDPARTY_DIR . '/jquery/jquery.js');
|
Requirements::javascript(THIRDPARTY_DIR . '/jquery/jquery.js');
|
||||||
Requirements::javascript(THIRDPARTY_DIR . '/jquery-ui/jquery-ui.js');
|
Requirements::javascript(THIRDPARTY_DIR . '/jquery-ui/jquery-ui.js');
|
||||||
Requirements::javascript(THIRDPARTY_DIR . '/jquery-entwine/dist/jquery.entwine-dist.js');
|
Requirements::javascript(THIRDPARTY_DIR . '/jquery-entwine/dist/jquery.entwine-dist.js');
|
||||||
Requirements::javascript(SAPPHIRE_DIR . '/javascript/i18n.js');
|
Requirements::javascript(FRAMEWORK_DIR . '/javascript/i18n.js');
|
||||||
Requirements::javascript(SAPPHIRE_ADMIN_DIR . '/javascript/ssui.core.js');
|
Requirements::javascript(FRAMEWORK_ADMIN_DIR . '/javascript/ssui.core.js');
|
||||||
|
|
||||||
Requirements::combine_files('uploadfield.js', array(
|
Requirements::combine_files('uploadfield.js', array(
|
||||||
THIRDPARTY_DIR . '/javascript-templates/tmpl.js',
|
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/cors/jquery.xdr-transport.js',
|
||||||
THIRDPARTY_DIR . '/jquery-fileupload/jquery.fileupload.js',
|
THIRDPARTY_DIR . '/jquery-fileupload/jquery.fileupload.js',
|
||||||
THIRDPARTY_DIR . '/jquery-fileupload/jquery.fileupload-ui.js',
|
THIRDPARTY_DIR . '/jquery-fileupload/jquery.fileupload-ui.js',
|
||||||
SAPPHIRE_DIR . '/javascript/UploadField_uploadtemplate.js',
|
FRAMEWORK_DIR . '/javascript/UploadField_uploadtemplate.js',
|
||||||
SAPPHIRE_DIR . '/javascript/UploadField_downloadtemplate.js',
|
FRAMEWORK_DIR . '/javascript/UploadField_downloadtemplate.js',
|
||||||
SAPPHIRE_DIR . '/javascript/UploadField.js',
|
FRAMEWORK_DIR . '/javascript/UploadField.js',
|
||||||
));
|
));
|
||||||
Requirements::css(THIRDPARTY_DIR . '/jquery-ui-themes/smoothness/jquery-ui.css'); // TODO hmmm, remove it?
|
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(
|
$config = array(
|
||||||
'url' => $this->Link('upload'),
|
'url' => $this->Link('upload'),
|
||||||
@ -715,7 +715,7 @@ class UploadField_ItemHandler extends RequestHandler {
|
|||||||
$items = $this->parent->getItems();
|
$items = $this->parent->getItems();
|
||||||
if($this->parent->managesRelation() && !$items->byID($item->ID)) return $this->httpError(403);
|
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(
|
return $this->customise(array(
|
||||||
'Form' => $this->EditForm()
|
'Form' => $this->EditForm()
|
||||||
|
@ -92,7 +92,7 @@ abstract class Validator extends Object {
|
|||||||
* - 'message': Validation message (optionally localized)
|
* - 'message': Validation message (optionally localized)
|
||||||
* - 'messageType': Arbitrary type of the message which is rendered as a CSS class in the FormField template,
|
* - '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
|
* 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
|
* @return array
|
||||||
*/
|
*/
|
||||||
|
@ -291,15 +291,15 @@ class GridField extends FormField {
|
|||||||
*/
|
*/
|
||||||
public function FieldHolder($properties = array()) {
|
public function FieldHolder($properties = array()) {
|
||||||
Requirements::css(THIRDPARTY_DIR . '/jquery-ui-themes/smoothness/jquery-ui.css');
|
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(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(THIRDPARTY_DIR . '/json-js/json2.js');
|
||||||
Requirements::javascript(SAPPHIRE_DIR . '/javascript/i18n.js');
|
Requirements::javascript(FRAMEWORK_DIR . '/javascript/i18n.js');
|
||||||
Requirements::add_i18n_javascript(SAPPHIRE_DIR . '/javascript/lang');
|
Requirements::add_i18n_javascript(FRAMEWORK_DIR . '/javascript/lang');
|
||||||
Requirements::javascript(THIRDPARTY_DIR . '/jquery-entwine/dist/jquery.entwine-dist.js');
|
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
|
// Get columns
|
||||||
$columns = $this->getColumns();
|
$columns = $this->getColumns();
|
||||||
|
@ -84,7 +84,7 @@ class GridFieldPrintButton implements GridField_HTMLProvider, GridField_ActionPr
|
|||||||
public function handlePrint($gridField, $request = null) {
|
public function handlePrint($gridField, $request = null) {
|
||||||
set_time_limit(60);
|
set_time_limit(60);
|
||||||
Requirements::clear();
|
Requirements::clear();
|
||||||
Requirements::css(SAPPHIRE_DIR . '/css/GridField_print.css');
|
Requirements::css(FRAMEWORK_DIR . '/css/GridField_print.css');
|
||||||
if($data = $this->generatePrintData($gridField)){
|
if($data = $this->generatePrintData($gridField)){
|
||||||
return $data->renderWith("GridField_print");
|
return $data->renderWith("GridField_print");
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
* <% sprintf(_t('MyNamespace.MYENTITY','Counting %s things'),$ThingsCount) %>
|
* <% sprintf(_t('MyNamespace.MYENTITY','Counting %s things'),$ThingsCount) %>
|
||||||
* </code>
|
* </code>
|
||||||
*
|
*
|
||||||
* Javascript (see sapphire/javascript/i18n.js):
|
* Javascript (see framework/javascript/i18n.js):
|
||||||
* <code>
|
* <code>
|
||||||
* ss.i18n._t('MyEntity.MyNamespace','My default natural language value');
|
* ss.i18n._t('MyEntity.MyNamespace','My default natural language value');
|
||||||
* </code>
|
* </code>
|
||||||
@ -87,8 +87,8 @@ class i18n extends Object implements TemplateGlobalProvider {
|
|||||||
/**
|
/**
|
||||||
* Use javascript i18n through the ss.i18n class (enabled by default).
|
* Use javascript i18n through the ss.i18n class (enabled by default).
|
||||||
* If set to TRUE, includes javascript requirements for the base library
|
* 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)
|
* (framework/javascript/i18n.js) and all necessary lang files (e.g. framework/lang/de_DE.js)
|
||||||
* plus fallbacks to the default locale (e.g. sapphire/lang/en_US.js).
|
* plus fallbacks to the default locale (e.g. framework/lang/en_US.js).
|
||||||
* If set to FALSE, only includes a stub implementation
|
* If set to FALSE, only includes a stub implementation
|
||||||
* which is necessary. Mainly disabled to save bandwidth
|
* which is necessary. Mainly disabled to save bandwidth
|
||||||
* in a frontend context when website is in single language.
|
* in a frontend context when website is in single language.
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
* Collects all found entities (and their natural language text for the default locale)
|
* 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,
|
* 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
|
* The collector needs to be run whenever you make new translatable
|
||||||
* entities available. Please don't alter the arrays in language tables manually.
|
* 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
|
// Search for calls in code files if these exists
|
||||||
if(is_dir("$this->basePath/$module/code")) {
|
if(is_dir("$this->basePath/$module/code")) {
|
||||||
$fileList = $this->getFilesRecursive("$this->basePath/$module/code");
|
$fileList = $this->getFilesRecursive("$this->basePath/$module/code");
|
||||||
} else if($module == 'sapphire' || substr($module, 0, 7) == 'themes/') {
|
} else if($module == FRAMEWORK_DIR || substr($module, 0, 7) == 'themes/') {
|
||||||
// sapphire doesn't have the usual module structure, so we'll scan all subfolders
|
// framework doesn't have the usual module structure, so we'll scan all subfolders
|
||||||
$fileList = $this->getFilesRecursive("$this->basePath/$module");
|
$fileList = $this->getFilesRecursive("$this->basePath/$module");
|
||||||
}
|
}
|
||||||
foreach($fileList as $filePath) {
|
foreach($fileList as $filePath) {
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
* @subpackage i18n
|
* @subpackage i18n
|
||||||
*/
|
*/
|
||||||
|
|
||||||
i18n::include_locale_file('sapphire', 'en_US');
|
i18n::include_locale_file(FRAMEWORK_DIR, 'en_US');
|
||||||
|
|
||||||
global $lang;
|
global $lang;
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
* @subpackage i18n
|
* @subpackage i18n
|
||||||
*/
|
*/
|
||||||
|
|
||||||
i18n::include_locale_file('sapphire', 'en_US');
|
i18n::include_locale_file(FRAMEWORK_DIR, 'en_US');
|
||||||
|
|
||||||
global $lang;
|
global $lang;
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
* @subpackage i18n
|
* @subpackage i18n
|
||||||
*/
|
*/
|
||||||
|
|
||||||
i18n::include_locale_file('sapphire', 'en_US');
|
i18n::include_locale_file(FRAMEWORK_DIR, 'en_US');
|
||||||
|
|
||||||
global $lang;
|
global $lang;
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
* @subpackage i18n
|
* @subpackage i18n
|
||||||
*/
|
*/
|
||||||
|
|
||||||
i18n::include_locale_file('sapphire', 'en_US');
|
i18n::include_locale_file(FRAMEWORK_DIR, 'en_US');
|
||||||
|
|
||||||
global $lang;
|
global $lang;
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
* @subpackage i18n
|
* @subpackage i18n
|
||||||
*/
|
*/
|
||||||
|
|
||||||
i18n::include_locale_file('sapphire', 'en_US');
|
i18n::include_locale_file(FRAMEWORK_DIR, 'en_US');
|
||||||
|
|
||||||
global $lang;
|
global $lang;
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
* @subpackage i18n
|
* @subpackage i18n
|
||||||
*/
|
*/
|
||||||
|
|
||||||
i18n::include_locale_file('sapphire', 'en_US');
|
i18n::include_locale_file(FRAMEWORK_DIR, 'en_US');
|
||||||
|
|
||||||
global $lang;
|
global $lang;
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
* @subpackage i18n
|
* @subpackage i18n
|
||||||
*/
|
*/
|
||||||
|
|
||||||
i18n::include_locale_file('sapphire', 'en_US');
|
i18n::include_locale_file(FRAMEWORK_DIR, 'en_US');
|
||||||
|
|
||||||
global $lang;
|
global $lang;
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
* @subpackage i18n
|
* @subpackage i18n
|
||||||
*/
|
*/
|
||||||
|
|
||||||
i18n::include_locale_file('sapphire', 'en_US');
|
i18n::include_locale_file(FRAMEWORK_DIR, 'en_US');
|
||||||
|
|
||||||
global $lang;
|
global $lang;
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
* @subpackage i18n
|
* @subpackage i18n
|
||||||
*/
|
*/
|
||||||
|
|
||||||
i18n::include_locale_file('sapphire', 'en_US');
|
i18n::include_locale_file(FRAMEWORK_DIR, 'en_US');
|
||||||
|
|
||||||
global $lang;
|
global $lang;
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
* @subpackage i18n
|
* @subpackage i18n
|
||||||
*/
|
*/
|
||||||
|
|
||||||
i18n::include_locale_file('sapphire', 'en_US');
|
i18n::include_locale_file(FRAMEWORK_DIR, 'en_US');
|
||||||
|
|
||||||
global $lang;
|
global $lang;
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
* @subpackage i18n
|
* @subpackage i18n
|
||||||
*/
|
*/
|
||||||
|
|
||||||
i18n::include_locale_file('sapphire', 'en_US');
|
i18n::include_locale_file(FRAMEWORK_DIR, 'en_US');
|
||||||
|
|
||||||
global $lang;
|
global $lang;
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
* @subpackage i18n
|
* @subpackage i18n
|
||||||
*/
|
*/
|
||||||
|
|
||||||
i18n::include_locale_file('sapphire', 'en_US');
|
i18n::include_locale_file(FRAMEWORK_DIR, 'en_US');
|
||||||
|
|
||||||
global $lang;
|
global $lang;
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
* @subpackage i18n
|
* @subpackage i18n
|
||||||
*/
|
*/
|
||||||
|
|
||||||
i18n::include_locale_file('sapphire', 'en_US');
|
i18n::include_locale_file(FRAMEWORK_DIR, 'en_US');
|
||||||
|
|
||||||
global $lang;
|
global $lang;
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
* @subpackage i18n
|
* @subpackage i18n
|
||||||
*/
|
*/
|
||||||
|
|
||||||
i18n::include_locale_file('sapphire', 'en_US');
|
i18n::include_locale_file(FRAMEWORK_DIR, 'en_US');
|
||||||
|
|
||||||
global $lang;
|
global $lang;
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
* @subpackage i18n
|
* @subpackage i18n
|
||||||
*/
|
*/
|
||||||
|
|
||||||
i18n::include_locale_file('sapphire', 'en_US');
|
i18n::include_locale_file(FRAMEWORK_DIR, 'en_US');
|
||||||
|
|
||||||
global $lang;
|
global $lang;
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
* @subpackage i18n
|
* @subpackage i18n
|
||||||
*/
|
*/
|
||||||
|
|
||||||
i18n::include_locale_file('sapphire', 'en_US');
|
i18n::include_locale_file(FRAMEWORK_DIR, 'en_US');
|
||||||
|
|
||||||
global $lang;
|
global $lang;
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
* @subpackage i18n
|
* @subpackage i18n
|
||||||
*/
|
*/
|
||||||
|
|
||||||
i18n::include_locale_file('sapphire', 'en_US');
|
i18n::include_locale_file(FRAMEWORK_DIR, 'en_US');
|
||||||
|
|
||||||
global $lang;
|
global $lang;
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
* @subpackage i18n
|
* @subpackage i18n
|
||||||
*/
|
*/
|
||||||
|
|
||||||
i18n::include_locale_file('sapphire', 'en_US');
|
i18n::include_locale_file(FRAMEWORK_DIR, 'en_US');
|
||||||
|
|
||||||
global $lang;
|
global $lang;
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
* @subpackage i18n
|
* @subpackage i18n
|
||||||
*/
|
*/
|
||||||
|
|
||||||
i18n::include_locale_file('sapphire', 'en_US');
|
i18n::include_locale_file(FRAMEWORK_DIR, 'en_US');
|
||||||
|
|
||||||
global $lang;
|
global $lang;
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
* @subpackage i18n
|
* @subpackage i18n
|
||||||
*/
|
*/
|
||||||
|
|
||||||
i18n::include_locale_file('sapphire', 'en_US');
|
i18n::include_locale_file(FRAMEWORK_DIR, 'en_US');
|
||||||
|
|
||||||
global $lang;
|
global $lang;
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
* @subpackage i18n
|
* @subpackage i18n
|
||||||
*/
|
*/
|
||||||
|
|
||||||
i18n::include_locale_file('sapphire', 'en_US');
|
i18n::include_locale_file(FRAMEWORK_DIR, 'en_US');
|
||||||
|
|
||||||
global $lang;
|
global $lang;
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
* @subpackage i18n
|
* @subpackage i18n
|
||||||
*/
|
*/
|
||||||
|
|
||||||
i18n::include_locale_file('sapphire', 'en_US');
|
i18n::include_locale_file(FRAMEWORK_DIR, 'en_US');
|
||||||
|
|
||||||
global $lang;
|
global $lang;
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
* @subpackage i18n
|
* @subpackage i18n
|
||||||
*/
|
*/
|
||||||
|
|
||||||
i18n::include_locale_file('sapphire', 'en_US');
|
i18n::include_locale_file(FRAMEWORK_DIR, 'en_US');
|
||||||
|
|
||||||
global $lang;
|
global $lang;
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
* @subpackage i18n
|
* @subpackage i18n
|
||||||
*/
|
*/
|
||||||
|
|
||||||
i18n::include_locale_file('sapphire', 'en_US');
|
i18n::include_locale_file(FRAMEWORK_DIR, 'en_US');
|
||||||
|
|
||||||
global $lang;
|
global $lang;
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
* @subpackage i18n
|
* @subpackage i18n
|
||||||
*/
|
*/
|
||||||
|
|
||||||
i18n::include_locale_file('sapphire', 'en_US');
|
i18n::include_locale_file(FRAMEWORK_DIR, 'en_US');
|
||||||
|
|
||||||
global $lang;
|
global $lang;
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
* @subpackage i18n
|
* @subpackage i18n
|
||||||
*/
|
*/
|
||||||
|
|
||||||
i18n::include_locale_file('sapphire', 'en_US');
|
i18n::include_locale_file(FRAMEWORK_DIR, 'en_US');
|
||||||
|
|
||||||
global $lang;
|
global $lang;
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
* @subpackage i18n
|
* @subpackage i18n
|
||||||
*/
|
*/
|
||||||
|
|
||||||
i18n::include_locale_file('sapphire', 'en_US');
|
i18n::include_locale_file(FRAMEWORK_DIR, 'en_US');
|
||||||
|
|
||||||
global $lang;
|
global $lang;
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
* @subpackage i18n
|
* @subpackage i18n
|
||||||
*/
|
*/
|
||||||
|
|
||||||
i18n::include_locale_file('sapphire', 'en_US');
|
i18n::include_locale_file(FRAMEWORK_DIR, 'en_US');
|
||||||
|
|
||||||
global $lang;
|
global $lang;
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
* @subpackage i18n
|
* @subpackage i18n
|
||||||
*/
|
*/
|
||||||
|
|
||||||
i18n::include_locale_file('sapphire', 'en_US');
|
i18n::include_locale_file(FRAMEWORK_DIR, 'en_US');
|
||||||
|
|
||||||
global $lang;
|
global $lang;
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
* @subpackage i18n
|
* @subpackage i18n
|
||||||
*/
|
*/
|
||||||
|
|
||||||
i18n::include_locale_file('sapphire', 'en_US');
|
i18n::include_locale_file(FRAMEWORK_DIR, 'en_US');
|
||||||
|
|
||||||
global $lang;
|
global $lang;
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
* @subpackage i18n
|
* @subpackage i18n
|
||||||
*/
|
*/
|
||||||
|
|
||||||
i18n::include_locale_file('sapphire', 'en_US');
|
i18n::include_locale_file(FRAMEWORK_DIR, 'en_US');
|
||||||
|
|
||||||
global $lang;
|
global $lang;
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
* @subpackage i18n
|
* @subpackage i18n
|
||||||
*/
|
*/
|
||||||
|
|
||||||
i18n::include_locale_file('sapphire', 'en_US');
|
i18n::include_locale_file(FRAMEWORK_DIR, 'en_US');
|
||||||
|
|
||||||
global $lang;
|
global $lang;
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
* @subpackage i18n
|
* @subpackage i18n
|
||||||
*/
|
*/
|
||||||
|
|
||||||
i18n::include_locale_file('sapphire', 'en_US');
|
i18n::include_locale_file(FRAMEWORK_DIR, 'en_US');
|
||||||
|
|
||||||
global $lang;
|
global $lang;
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
* @subpackage i18n
|
* @subpackage i18n
|
||||||
*/
|
*/
|
||||||
|
|
||||||
i18n::include_locale_file('sapphire', 'en_US');
|
i18n::include_locale_file(FRAMEWORK_DIR, 'en_US');
|
||||||
|
|
||||||
global $lang;
|
global $lang;
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
* @subpackage i18n
|
* @subpackage i18n
|
||||||
*/
|
*/
|
||||||
|
|
||||||
i18n::include_locale_file('sapphire', 'en_US');
|
i18n::include_locale_file(FRAMEWORK_DIR, 'en_US');
|
||||||
|
|
||||||
global $lang;
|
global $lang;
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
* @subpackage i18n
|
* @subpackage i18n
|
||||||
*/
|
*/
|
||||||
|
|
||||||
i18n::include_locale_file('sapphire', 'en_US');
|
i18n::include_locale_file(FRAMEWORK_DIR, 'en_US');
|
||||||
|
|
||||||
global $lang;
|
global $lang;
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
* @subpackage i18n
|
* @subpackage i18n
|
||||||
*/
|
*/
|
||||||
|
|
||||||
i18n::include_locale_file('sapphire', 'en_US');
|
i18n::include_locale_file(FRAMEWORK_DIR, 'en_US');
|
||||||
|
|
||||||
global $lang;
|
global $lang;
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
* @subpackage i18n
|
* @subpackage i18n
|
||||||
*/
|
*/
|
||||||
|
|
||||||
i18n::include_locale_file('sapphire', 'en_US');
|
i18n::include_locale_file(FRAMEWORK_DIR, 'en_US');
|
||||||
|
|
||||||
global $lang;
|
global $lang;
|
||||||
|
|
||||||
|
8
main.php
8
main.php
@ -41,9 +41,9 @@ if (version_compare(phpversion(), '5.3.2', '<')) {
|
|||||||
*
|
*
|
||||||
* CONFIGURING THE WEBSERVER
|
* CONFIGURING THE WEBSERVER
|
||||||
*
|
*
|
||||||
* To use Sapphire, every request that doesn't point directly to a file should be rewritten to
|
* To use SilverStripe, 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
|
* framework/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 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
|
* 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.
|
* 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");
|
require_once("core/Core.php");
|
||||||
|
|
||||||
|
@ -1138,7 +1138,7 @@ class MySQLQuery extends SS_Query {
|
|||||||
private $handle;
|
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 database The database object that created this query.
|
||||||
* @param handle the internal mysql handle that is points to the resultset.
|
* @param handle the internal mysql handle that is points to the resultset.
|
||||||
*/
|
*/
|
||||||
|
@ -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
|
* @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)
|
* @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 = '...') {
|
public function Summary($maxWords = 50, $flex = 15, $add = '...') {
|
||||||
$str = false;
|
$str = false;
|
||||||
@ -106,7 +106,7 @@ class HTMLText extends Text {
|
|||||||
*
|
*
|
||||||
* This is the HTML aware equivilent to Text#FirstSentence
|
* 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() {
|
function FirstSentence() {
|
||||||
/* Use summary's html processing logic to get the first paragraph */
|
/* Use summary's html processing logic to get the first paragraph */
|
||||||
|
@ -29,13 +29,16 @@ class BBCodeParser extends TextParser {
|
|||||||
protected static $allowSimilies = false;
|
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/');
|
* but this can be overridden by setting BBCodeParser::set_icon_folder('themes/yourtheme/images/');
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected static $smilies_location = 'sapphire/images/smilies';
|
protected static $smilies_location = null;
|
||||||
|
|
||||||
static function smilies_location() {
|
static function smilies_location() {
|
||||||
|
if(!BBCodeParser::$smilies_location) {
|
||||||
|
return FRAMEWORK_DIR . '/images/smilies';
|
||||||
|
}
|
||||||
return BBCodeParser::$smilies_location;
|
return BBCodeParser::$smilies_location;
|
||||||
}
|
}
|
||||||
static function set_icon_folder($path) {
|
static function set_icon_folder($path) {
|
||||||
|
19
sake
19
sake
@ -2,26 +2,29 @@
|
|||||||
|
|
||||||
# Check for an argument
|
# Check for an argument
|
||||||
if [ ${1:-""} = "" ]; then
|
if [ ${1:-""} = "" ]; then
|
||||||
echo "Sapphire Sake
|
echo "SilverStripe Sake
|
||||||
|
|
||||||
Usage: $0 (command-url) (params)
|
Usage: $0 (command-url) (params)
|
||||||
Executes a Sapphire command"
|
Executes a SilverStripe command"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Set $sapphire and $base
|
# Set $framework and $base
|
||||||
sakedir=`dirname $0`
|
sakedir=`dirname $0`
|
||||||
if [ -f $sakedir/cli-script.php ]; then
|
if [ -f $sakedir/cli-script.php ]; then
|
||||||
sapphire=$sakedir
|
framework=$sakedir
|
||||||
base=`dirname $sakedir`
|
base=`dirname $sakedir`
|
||||||
|
elif [ -d ./framework ]; then
|
||||||
|
framework=./framework
|
||||||
|
base=.
|
||||||
elif [ -d ./sapphire ]; then
|
elif [ -d ./sapphire ]; then
|
||||||
sapphire=./sapphire
|
framework=./sapphire
|
||||||
base=.
|
base=.
|
||||||
elif [ -f ./cli-script.php ]; then
|
elif [ -f ./cli-script.php ]; then
|
||||||
sapphire=.
|
framework=.
|
||||||
base=..
|
base=..
|
||||||
else
|
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
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -102,4 +105,4 @@ fi
|
|||||||
################################################################################################
|
################################################################################################
|
||||||
## Basic execution
|
## Basic execution
|
||||||
|
|
||||||
$php $sapphire/cli-script.php ${*}
|
$php $framework/cli-script.php ${*}
|
||||||
|
@ -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();
|
server side call, like Requirements::css();
|
||||||
@import url("typography.css");
|
@import url("typography.css");
|
||||||
*/
|
*/
|
||||||
@ -124,7 +124,7 @@ html>body div.TreeDropdownField div.tree_holder {
|
|||||||
|
|
||||||
div.TreeDropdownField a.editLink {
|
div.TreeDropdownField a.editLink {
|
||||||
border-width: 1px 1px 1px 0;
|
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;
|
width: 19px;
|
||||||
height: 21px;
|
height: 21px;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
@ -77,21 +77,21 @@
|
|||||||
#right form .hasmanyfile .currentFiles a.pdf {
|
#right form .hasmanyfile .currentFiles a.pdf {
|
||||||
padding: 2px;
|
padding: 2px;
|
||||||
padding-left: 20px;
|
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[href$=".DOC"],
|
#right form .hasmanyfile .currentFiles a[href$=".DOC"],
|
||||||
#right form .hasmanyfile .currentFiles a.doc {
|
#right form .hasmanyfile .currentFiles a.doc {
|
||||||
padding: 2px;
|
padding: 2px;
|
||||||
padding-left: 20px;
|
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[href$=".XLS"],
|
#right form .hasmanyfile .currentFiles a[href$=".XLS"],
|
||||||
#right form .hasmanyfile .currentFiles a.xls {
|
#right form .hasmanyfile .currentFiles a.xls {
|
||||||
padding: 2px;
|
padding: 2px;
|
||||||
padding-left: 20px;
|
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"],
|
||||||
#right form .hasmanyfile .currentFiles a[href$=".GZ"],
|
#right form .hasmanyfile .currentFiles a[href$=".GZ"],
|
||||||
@ -102,7 +102,7 @@
|
|||||||
#right form .hasmanyfile .currentFiles a.archive {
|
#right form .hasmanyfile .currentFiles a.archive {
|
||||||
padding: 2px;
|
padding: 2px;
|
||||||
padding-left: 20px;
|
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"],
|
||||||
#right form .hasmanyfile .currentFiles a[href$=".JPG"],
|
#right form .hasmanyfile .currentFiles a[href$=".JPG"],
|
||||||
@ -113,12 +113,12 @@
|
|||||||
#right form .hasmanyfile .currentFiles a.image {
|
#right form .hasmanyfile .currentFiles a.image {
|
||||||
padding: 2px;
|
padding: 2px;
|
||||||
padding-left: 20px;
|
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[href$=".EXE"],
|
#right form .hasmanyfile .currentFiles a[href$=".EXE"],
|
||||||
#right form .hasmanyfile .currentFiles a.application {
|
#right form .hasmanyfile .currentFiles a.application {
|
||||||
padding: 2px;
|
padding: 2px;
|
||||||
padding-left: 20px;
|
padding-left: 20px;
|
||||||
background: url(../../sapphire/images/icons/application.png) no-repeat left center;
|
background: url(../images/icons/application.png) no-repeat left center;
|
||||||
}
|
}
|
||||||
|
@ -60,7 +60,7 @@ class Group extends DataObject {
|
|||||||
* @return FieldList
|
* @return FieldList
|
||||||
*/
|
*/
|
||||||
public function getCMSFields() {
|
public function getCMSFields() {
|
||||||
Requirements::javascript(SAPPHIRE_DIR . '/javascript/PermissionCheckboxSetField.js');
|
Requirements::javascript(FRAMEWORK_DIR . '/javascript/PermissionCheckboxSetField.js');
|
||||||
|
|
||||||
$fields = new FieldList(
|
$fields = new FieldList(
|
||||||
new TabSet("Root",
|
new TabSet("Root",
|
||||||
|
@ -1433,7 +1433,7 @@ class Member_GroupSet extends ManyManyList {
|
|||||||
class Member_ProfileForm extends Form {
|
class Member_ProfileForm extends Form {
|
||||||
|
|
||||||
function __construct($controller, $name, $member) {
|
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 = $member->getCMSFields();
|
||||||
$fields->push(new HiddenField('ID','ID',$member->ID));
|
$fields->push(new HiddenField('ID','ID',$member->ID));
|
||||||
|
@ -71,8 +71,8 @@ class PermissionCheckboxSetField extends FormField {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function Field($properties = array()) {
|
function Field($properties = array()) {
|
||||||
Requirements::css(SAPPHIRE_DIR . '/css/CheckboxSetField.css');
|
Requirements::css(FRAMEWORK_DIR . '/css/CheckboxSetField.css');
|
||||||
Requirements::javascript(SAPPHIRE_DIR . '/javascript/PermissionCheckboxSetField.js');
|
Requirements::javascript(FRAMEWORK_DIR . '/javascript/PermissionCheckboxSetField.js');
|
||||||
|
|
||||||
$uninheritedCodes = array();
|
$uninheritedCodes = array();
|
||||||
$inheritedCodes = array();
|
$inheritedCodes = array();
|
||||||
|
@ -362,16 +362,16 @@ class Security extends Controller {
|
|||||||
// with the tabstrip library otherwise
|
// with the tabstrip library otherwise
|
||||||
$link_base = Director::absoluteURL($this->Link("login"));
|
$link_base = Director::absoluteURL($this->Link("login"));
|
||||||
|
|
||||||
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery/jquery.js');
|
Requirements::javascript(FRAMEWORK_DIR . '/thirdparty/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(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(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 id="Form_EditForm">';
|
||||||
$content .= '<div class="ss-tabset">';
|
$content .= '<div class="ss-tabset">';
|
||||||
|
@ -35,7 +35,7 @@ if (
|
|||||||
) {
|
) {
|
||||||
// Define system paths (copied from Core.php)
|
// Define system paths (copied from Core.php)
|
||||||
if(!defined('BASE_PATH')) {
|
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);
|
define('BASE_PATH', rtrim(dirname(dirname(__FILE__))), DIRECTORY_SEPARATOR);
|
||||||
}
|
}
|
||||||
if(!defined('BASE_URL')) {
|
if(!defined('BASE_URL')) {
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
* You can test your task from the command line by running the following command
|
* You can test your task from the command line by running the following command
|
||||||
* (replace <MyTask> is the classname of your task):
|
* (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:
|
* To perform all Daily tasks, run from the command line:
|
||||||
*
|
*
|
||||||
@ -39,16 +39,16 @@
|
|||||||
*
|
*
|
||||||
* <code>
|
* <code>
|
||||||
* # Quarter-hourly task (every hour at 25 minutes past) (remove space between first * and /15)
|
* # 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)
|
* # 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)
|
* # 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)
|
* # 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>
|
* </code>
|
||||||
*
|
*
|
||||||
* @todo Improve documentation
|
* @todo Improve documentation
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<% base_tag %>
|
<% base_tag %>
|
||||||
<link rel="stylesheet" href="sapphire/css/CodeViewer.css" />
|
<link rel="stylesheet" href="$FrameworkDir/css/CodeViewer.css" />
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
$Content
|
$Content
|
||||||
|
@ -17,9 +17,9 @@
|
|||||||
<span class="sortLink <% if SortBy %><% else %>sortLinkHidden<% end_if %>">
|
<span class="sortLink <% if SortBy %><% else %>sortLinkHidden<% end_if %>">
|
||||||
<a href="$SortLink">
|
<a href="$SortLink">
|
||||||
<% if SortDirection = desc %>
|
<% 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 %>
|
<% 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 %>
|
<% end_if %>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
@ -49,7 +49,7 @@
|
|||||||
<td colspan="$ItemCount">
|
<td colspan="$ItemCount">
|
||||||
<input type="hidden" id="{$id}_PopupHeight" value="$PopupHeight" disabled="disabled">
|
<input type="hidden" id="{$id}_PopupHeight" value="$PopupHeight" disabled="disabled">
|
||||||
<input type="hidden" id="{$id}_PopupWidth" value="$PopupWidth" 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) %>
|
<% sprintf(_t('ADDITEM', 'Add %s', PR_MEDIUM, 'Add [name]'),$Title) %>
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<% if Paginator.PrevLink %>
|
<% if Paginator.PrevLink %>
|
||||||
<td id="ComplexTableField_Pagination_Previous">
|
<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>
|
</td>
|
||||||
<% end_if %>
|
<% end_if %>
|
||||||
<% if xdsfdsf %>
|
<% if xdsfdsf %>
|
||||||
@ -32,7 +32,7 @@
|
|||||||
<% end_if %>
|
<% end_if %>
|
||||||
<% if Paginator.NextLink %>
|
<% if Paginator.NextLink %>
|
||||||
<td id="ComplexTableField_Pagination_Next">
|
<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>
|
</td>
|
||||||
<% end_if %>
|
<% end_if %>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -1,17 +1,17 @@
|
|||||||
<% if ShowPagination %>
|
<% if ShowPagination %>
|
||||||
<% if TotalCount %>
|
<% if TotalCount %>
|
||||||
<div class="PageControls">
|
<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>
|
<% 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="sapphire/images/pagination/record-first-g.png" alt="<% _t('VIEWFIRST', 'View first') %> $PageSize" /></span><% end_if %>
|
<% 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="sapphire/images/pagination/record-prev.png" alt="<% _t('VIEWPREVIOUS', 'View previous') %> $PageSize" /></a>
|
<% 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="sapphire/images/pagination/record-prev-g.png" alt="<% _t('VIEWPREVIOUS', 'View previous') %> $PageSize" /><% end_if %>
|
<% else %><img class="Prev" src="$FrameworkDir/images/pagination/record-prev-g.png" alt="<% _t('VIEWPREVIOUS', 'View previous') %> $PageSize" /><% end_if %>
|
||||||
<span class="Count">
|
<span class="Count">
|
||||||
<% _t('DISPLAYING', 'Displaying') %> $FirstItem <% _t('TO', 'to') %> $LastItem <% _t('OF', 'of') %> $TotalCount
|
<% _t('DISPLAYING', 'Displaying') %> $FirstItem <% _t('TO', 'to') %> $LastItem <% _t('OF', 'of') %> $TotalCount
|
||||||
</span>
|
</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>
|
<% 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="sapphire/images/pagination/record-next-g.png" alt="<% _t('VIEWNEXT', 'View next') %> $PageSize" /><% end_if %>
|
<% 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="sapphire/images/pagination/record-last.png" alt="<% _t('VIEWLAST', 'View last') %> $PageSize" /></a>
|
<% 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="sapphire/images/pagination/record-last-g.png" alt="<% _t('VIEWLAST', 'View last') %> $PageSize" /></span><% end_if %>
|
<% else %><span class="Last"><img src="$FrameworkDir/images/pagination/record-last-g.png" alt="<% _t('VIEWLAST', 'View last') %> $PageSize" /></span><% end_if %>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<% end_if %>
|
<% end_if %>
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
<td colspan="$ItemCount">
|
<td colspan="$ItemCount">
|
||||||
<input type="hidden" id="{$id}_PopupHeight" value="$PopupHeight" disabled="disabled">
|
<input type="hidden" id="{$id}_PopupHeight" value="$PopupHeight" disabled="disabled">
|
||||||
<input type="hidden" id="{$id}_PopupWidth" value="$PopupWidth" 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>
|
</td>
|
||||||
<% if Can(show) %><td width="18"> </td><% end_if %>
|
<% if Can(show) %><td width="18"> </td><% end_if %>
|
||||||
<% if Can(edit) %><td width="18"> </td><% end_if %>
|
<% if Can(edit) %><td width="18"> </td><% end_if %>
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>Sapphire Application Information</title>
|
<title>SilverStripe Application Information</title>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<h1>Sapphire Application Information</h1>
|
<h1>SilverStripe Application Information</h1>
|
||||||
|
|
||||||
<dl>
|
<dl>
|
||||||
<dt>Sapphire version:</dt> <dd>$Version</dd>
|
<dt>SilverStripe version:</dt> <dd>$Version</dd>
|
||||||
<dt>Environment type:</dt> <dd>$EnvironmentType</dd>
|
<dt>Environment type:</dt> <dd>$EnvironmentType</dd>
|
||||||
<dt>Site URL:</dt> <dd>$BaseURL</dd>
|
<dt>Site URL:</dt> <dd>$BaseURL</dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
<% if Can(add) %>
|
<% if Can(add) %>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="$ItemCount">
|
<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) %>
|
<% sprintf(_t('ADDITEM','Add %s'),$Title) %>
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
@ -47,7 +47,7 @@
|
|||||||
<td class="$FieldClass $extraClass $ClassName $Title tablecolumn">$Field</td>
|
<td class="$FieldClass $extraClass $ClassName $Title tablecolumn">$Field</td>
|
||||||
<% end_control %>
|
<% end_control %>
|
||||||
<td style="display: none">$ExtraData</td>
|
<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>
|
</tr>
|
||||||
<% end_control %>
|
<% end_control %>
|
||||||
<% else %>
|
<% else %>
|
||||||
|
@ -24,9 +24,9 @@
|
|||||||
</span>
|
</span>
|
||||||
<span class="sortLink <% if SortBy %><% else %>sortLinkHidden<% end_if %>">
|
<span class="sortLink <% if SortBy %><% else %>sortLinkHidden<% end_if %>">
|
||||||
<% if SortDirection = desc %>
|
<% 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 %>
|
<% 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 %>
|
<% end_if %>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<% base_tag %>
|
<% base_tag %>
|
||||||
<link rel="stylesheet" href="sapphire/css/TestViewer.css" />
|
<link rel="stylesheet" href="$FrameworkDir/css/TestViewer.css" />
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
$Content
|
$Content
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<div id="$Name" class="$Type $extraClass">
|
<div id="$Name" class="$Type $extraClass">
|
||||||
<h$HeadingLevel style="cursor: pointer;" class="trigger$ClosedClass">
|
<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="triggerClosed" src="$FrameworkDir/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="triggerOpened" src="$FrameworkDir/images/toggle-open.gif" alt="-" style="display:none;" title="<% _t('HIDE', 'Hide') %>" />
|
||||||
$Title
|
$Title
|
||||||
</h$HeadingLevel>
|
</h$HeadingLevel>
|
||||||
<div class="contentMore">
|
<div class="contentMore">
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
* to group or testsuite definitions in a custom phpunit.xml file.
|
* to group or testsuite definitions in a custom phpunit.xml file.
|
||||||
*
|
*
|
||||||
* Usage:
|
* Usage:
|
||||||
* - "phpunit sapphire/tests/FullTestSuite.php"
|
* - "phpunit framework/tests/FullTestSuite.php"
|
||||||
* (all tests)
|
* (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)
|
* (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
|
* See http://www.phpunit.de/manual/current/en/organizing-tests.html#organizing-tests.testsuite
|
||||||
@ -27,7 +27,7 @@ class FullTestSuite {
|
|||||||
* @return PHPUnit_Framework_TestSuite
|
* @return PHPUnit_Framework_TestSuite
|
||||||
*/
|
*/
|
||||||
public static function suite() {
|
public static function suite() {
|
||||||
require_once('sapphire/tests/bootstrap.php');
|
require_once(dirname(__FILE__) . '/bootstrap.php');
|
||||||
|
|
||||||
$suite = new PHPUnit_Framework_TestSuite();
|
$suite = new PHPUnit_Framework_TestSuite();
|
||||||
if(isset($_GET['module'])) {
|
if(isset($_GET['module'])) {
|
||||||
@ -47,7 +47,7 @@ class FullTestSuite {
|
|||||||
* @return Array
|
* @return Array
|
||||||
*/
|
*/
|
||||||
public static function get_all_tests() {
|
public static function get_all_tests() {
|
||||||
require_once('sapphire/tests/bootstrap.php');
|
require_once(dirname(__FILE__) . '/bootstrap.php');
|
||||||
|
|
||||||
TestRunner::use_test_manifest();
|
TestRunner::use_test_manifest();
|
||||||
$tests = ClassInfo::subclassesFor('SapphireTest');
|
$tests = ClassInfo::subclassesFor('SapphireTest');
|
||||||
@ -58,13 +58,13 @@ class FullTestSuite {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Run tests for one or more "modules".
|
* 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
|
* @param String $nameStr
|
||||||
* @return Array
|
* @return Array
|
||||||
*/
|
*/
|
||||||
protected static function get_module_tests($namesStr) {
|
protected static function get_module_tests($namesStr) {
|
||||||
require_once('sapphire/tests/bootstrap.php');
|
require_once(dirname(__FILE__) . '/bootstrap.php');
|
||||||
|
|
||||||
$tests = array();
|
$tests = array();
|
||||||
$names = explode(',', $namesStr);
|
$names = explode(',', $namesStr);
|
||||||
|
@ -24,7 +24,7 @@ class PhpSyntaxTest extends SapphireTest {
|
|||||||
$settingTests = array('short_open_tag=Off','short_open_tag=On -d asp_tags=On');
|
$settingTests = array('short_open_tag=Off','short_open_tag=On -d asp_tags=On');
|
||||||
|
|
||||||
$files = $this->getAllFiles('php');
|
$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) {
|
foreach($files as $i => $file) {
|
||||||
$CLI_file = escapeshellarg($file);
|
$CLI_file = escapeshellarg($file);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?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.
|
// hardcoded assumptions about folder depth of the executing script.
|
||||||
|
|
||||||
// Make sure display_errors is on
|
// Make sure display_errors is on
|
||||||
@ -9,10 +9,13 @@ ini_set('display_errors', 1);
|
|||||||
global $_SERVER;
|
global $_SERVER;
|
||||||
if (!$_SERVER) $_SERVER = array();
|
if (!$_SERVER) $_SERVER = array();
|
||||||
|
|
||||||
$_SERVER['SCRIPT_FILENAME'] = getcwd() . DIRECTORY_SEPARATOR . 'sapphire' . DIRECTORY_SEPARATOR . 'cli-script.php';
|
$frameworkPath = dirname(dirname(__FILE__));
|
||||||
$_SERVER['SCRIPT_NAME'] = '.' . DIRECTORY_SEPARATOR . 'sapphire' . DIRECTORY_SEPARATOR . 'cli-script.php';
|
$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.
|
// Copied from cli-script.php, to enable same behaviour through phpunit runner.
|
||||||
if(isset($_SERVER['argv'][2])) {
|
if(isset($_SERVER['argv'][2])) {
|
||||||
@ -34,7 +37,7 @@ if(isset($_SERVER['argv'][2])) {
|
|||||||
$_GET['flush'] = 1;
|
$_GET['flush'] = 1;
|
||||||
|
|
||||||
// Connect to database
|
// Connect to database
|
||||||
require_once(getcwd()."/sapphire/core/Core.php");
|
require_once($frameworkPath . "/core/Core.php");
|
||||||
global $databaseConfig;
|
global $databaseConfig;
|
||||||
DB::connect($databaseConfig);
|
DB::connect($databaseConfig);
|
||||||
|
|
||||||
|
@ -251,7 +251,7 @@ class DirectorTest extends SapphireTest {
|
|||||||
'SERVER_PROTOCOL' => 'HTTP/1.1',
|
'SERVER_PROTOCOL' => 'HTTP/1.1',
|
||||||
'REQUEST_METHOD' => 'GET',
|
'REQUEST_METHOD' => 'GET',
|
||||||
'REQUEST_URI' => '/',
|
'REQUEST_URI' => '/',
|
||||||
'SCRIPT_NAME' => '/sapphire/main.php',
|
'SCRIPT_NAME' => FRAMEWORK_DIR . '/main.php',
|
||||||
'CONTENT_TYPE' => 'text/xml',
|
'CONTENT_TYPE' => 'text/xml',
|
||||||
'CONTENT_LENGTH' => 10
|
'CONTENT_LENGTH' => 10
|
||||||
);
|
);
|
||||||
|
@ -24,10 +24,10 @@ class ClassInfoTest extends SapphireTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function testClassesForFolder() {
|
function testClassesForFolder() {
|
||||||
//$baseFolder = Director::baseFolder() . '/' . SAPPHIRE_DIR . '/tests/_ClassInfoTest';
|
//$baseFolder = Director::baseFolder() . '/' . FRAMEWORK_DIR . '/tests/_ClassInfoTest';
|
||||||
//$manifestInfo = ManifestBuilder::get_manifest_info($baseFolder);
|
//$manifestInfo = ManifestBuilder::get_manifest_info($baseFolder);
|
||||||
|
|
||||||
$classes = ClassInfo::classes_for_folder('sapphire/tests');
|
$classes = ClassInfo::classes_for_folder(FRAMEWORK_DIR . '/tests');
|
||||||
$this->assertContains(
|
$this->assertContains(
|
||||||
'classinfotest',
|
'classinfotest',
|
||||||
$classes,
|
$classes,
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?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.
|
* directory is determined throughout the framework.
|
||||||
*
|
*
|
||||||
* @package sapphire
|
* @package sapphire
|
||||||
|
@ -23,12 +23,12 @@ class NamespacedClassManifestTest extends SapphireTest {
|
|||||||
|
|
||||||
public function testGetItemPath() {
|
public function testGetItemPath() {
|
||||||
$expect = array(
|
$expect = array(
|
||||||
'SAPPHIRE\TEST\CLASSA' => 'module/classes/ClassA.php',
|
'SILVERSTRIPE\TEST\CLASSA' => 'module/classes/ClassA.php',
|
||||||
'Sapphire\Test\ClassA' => 'module/classes/ClassA.php',
|
'Silverstripe\Test\ClassA' => 'module/classes/ClassA.php',
|
||||||
'sapphire\test\classa' => 'module/classes/ClassA.php',
|
'silverstripe\test\classa' => 'module/classes/ClassA.php',
|
||||||
'SAPPHIRE\TEST\INTERFACEA' => 'module/interfaces/InterfaceA.php',
|
'SILVERSTRIPE\TEST\INTERFACEA' => 'module/interfaces/InterfaceA.php',
|
||||||
'Sapphire\Test\InterfaceA' => 'module/interfaces/InterfaceA.php',
|
'Silverstripe\Test\InterfaceA' => 'module/interfaces/InterfaceA.php',
|
||||||
'sapphire\test\interfacea' => 'module/interfaces/InterfaceA.php'
|
'silverstripe\test\interfacea' => 'module/interfaces/InterfaceA.php'
|
||||||
);
|
);
|
||||||
|
|
||||||
foreach ($expect as $name => $path) {
|
foreach ($expect as $name => $path) {
|
||||||
@ -38,14 +38,14 @@ class NamespacedClassManifestTest extends SapphireTest {
|
|||||||
|
|
||||||
public function testGetClasses() {
|
public function testGetClasses() {
|
||||||
$expect = array(
|
$expect = array(
|
||||||
'sapphire\test\classa' => "{$this->base}/module/classes/ClassA.php",
|
'silverstripe\test\classa' => "{$this->base}/module/classes/ClassA.php",
|
||||||
'sapphire\test\classb' => "{$this->base}/module/classes/ClassB.php",
|
'silverstripe\test\classb' => "{$this->base}/module/classes/ClassB.php",
|
||||||
'sapphire\test\classc' => "{$this->base}/module/classes/ClassC.php",
|
'silverstripe\test\classc' => "{$this->base}/module/classes/ClassC.php",
|
||||||
'sapphire\test\classd' => "{$this->base}/module/classes/ClassD.php",
|
'silverstripe\test\classd' => "{$this->base}/module/classes/ClassD.php",
|
||||||
'sapphire\test\classe' => "{$this->base}/module/classes/ClassE.php",
|
'silverstripe\test\classe' => "{$this->base}/module/classes/ClassE.php",
|
||||||
'sapphire\test\classf' => "{$this->base}/module/classes/ClassF.php",
|
'silverstripe\test\classf' => "{$this->base}/module/classes/ClassF.php",
|
||||||
'sapphire\test\classg' => "{$this->base}/module/classes/ClassG.php",
|
'silverstripe\test\classg' => "{$this->base}/module/classes/ClassG.php",
|
||||||
'sapphire\test\classh' => "{$this->base}/module/classes/ClassH.php"
|
'silverstripe\test\classh' => "{$this->base}/module/classes/ClassH.php"
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->assertEquals($expect, $this->manifest->getClasses());
|
$this->assertEquals($expect, $this->manifest->getClasses());
|
||||||
@ -53,13 +53,13 @@ class NamespacedClassManifestTest extends SapphireTest {
|
|||||||
|
|
||||||
public function testGetClassNames() {
|
public function testGetClassNames() {
|
||||||
$this->assertEquals(
|
$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());
|
$this->manifest->getClassNames());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testGetDescendants() {
|
public function testGetDescendants() {
|
||||||
$expect = array(
|
$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());
|
$this->assertEquals($expect, $this->manifest->getDescendants());
|
||||||
@ -67,8 +67,8 @@ class NamespacedClassManifestTest extends SapphireTest {
|
|||||||
|
|
||||||
public function testGetDescendantsOf() {
|
public function testGetDescendantsOf() {
|
||||||
$expect = array(
|
$expect = array(
|
||||||
'SAPPHIRE\TEST\CLASSA' => array('sapphire\test\ClassB', 'sapphire\test\ClassH'),
|
'SILVERSTRIPE\TEST\CLASSA' => array('silverstripe\test\ClassB', 'silverstripe\test\ClassH'),
|
||||||
'sapphire\test\classa' => array('sapphire\test\ClassB', 'sapphire\test\ClassH'),
|
'silverstripe\test\classa' => array('silverstripe\test\ClassB', 'silverstripe\test\ClassH'),
|
||||||
);
|
);
|
||||||
|
|
||||||
foreach ($expect as $class => $desc) {
|
foreach ($expect as $class => $desc) {
|
||||||
@ -78,28 +78,28 @@ class NamespacedClassManifestTest extends SapphireTest {
|
|||||||
|
|
||||||
public function testGetInterfaces() {
|
public function testGetInterfaces() {
|
||||||
$expect = array(
|
$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());
|
$this->assertEquals($expect, $this->manifest->getInterfaces());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testGetImplementors() {
|
public function testGetImplementors() {
|
||||||
$expect = array(
|
$expect = array(
|
||||||
'sapphire\test\interfacea' => array('sapphire\test\ClassE'),
|
'silverstripe\test\interfacea' => array('silverstripe\test\ClassE'),
|
||||||
'interfacea' => array('sapphire\test\ClassF'),
|
'interfacea' => array('silverstripe\test\ClassF'),
|
||||||
'sapphire\test\subtest\interfacea' => array('sapphire\test\ClassG')
|
'silverstripe\test\subtest\interfacea' => array('silverstripe\test\ClassG')
|
||||||
);
|
);
|
||||||
$this->assertEquals($expect, $this->manifest->getImplementors());
|
$this->assertEquals($expect, $this->manifest->getImplementors());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testGetImplementorsOf() {
|
public function testGetImplementorsOf() {
|
||||||
$expect = array(
|
$expect = array(
|
||||||
'SAPPHIRE\TEST\INTERFACEA' => array('sapphire\test\ClassE'),
|
'SILVERSTRIPE\TEST\INTERFACEA' => array('silverstripe\test\ClassE'),
|
||||||
'sapphire\test\interfacea' => array('sapphire\test\ClassE'),
|
'silverstripe\test\interfacea' => array('silverstripe\test\ClassE'),
|
||||||
'INTERFACEA' => array('sapphire\test\ClassF'),
|
'INTERFACEA' => array('silverstripe\test\ClassF'),
|
||||||
'interfacea' => array('sapphire\test\ClassF'),
|
'interfacea' => array('silverstripe\test\ClassF'),
|
||||||
'SAPPHIRE\TEST\SUBTEST\INTERFACEA' => array('sapphire\test\ClassG'),
|
'SILVERSTRIPE\TEST\SUBTEST\INTERFACEA' => array('silverstripe\test\ClassG'),
|
||||||
'sapphire\test\subtest\interfacea' => array('sapphire\test\ClassG'),
|
'silverstripe\test\subtest\interfacea' => array('silverstripe\test\ClassG'),
|
||||||
);
|
);
|
||||||
|
|
||||||
foreach ($expect as $interface => $impl) {
|
foreach ($expect as $interface => $impl) {
|
||||||
|
@ -56,7 +56,7 @@ PHP
|
|||||||
return token_get_all(<<<PHP
|
return token_get_all(<<<PHP
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace sapphire\\test;
|
namespace silverstripe\\test;
|
||||||
|
|
||||||
class ClassA {
|
class ClassA {
|
||||||
|
|
||||||
@ -179,6 +179,6 @@ PHP
|
|||||||
$matches = $parser->findAll($tokens);
|
$matches = $parser->findAll($tokens);
|
||||||
|
|
||||||
$this->assertEquals(array(), $matches);
|
$this->assertEquals(array(), $matches);
|
||||||
$this->assertEquals(array('sapphire', '\\', 'test'), $namespacedMatches[0]['namespaceName']);
|
$this->assertEquals(array('silverstripe', '\\', 'test'), $namespacedMatches[0]['namespaceName']);
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -3,6 +3,6 @@
|
|||||||
* @ignore
|
* @ignore
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace sapphire\test;
|
namespace silverstripe\test;
|
||||||
|
|
||||||
class ClassA { }
|
class ClassA { }
|
@ -3,6 +3,6 @@
|
|||||||
* @ignore
|
* @ignore
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace sapphire\test;
|
namespace silverstripe\test;
|
||||||
|
|
||||||
class ClassB extends ClassA { }
|
class ClassB extends ClassA { }
|
@ -3,6 +3,6 @@
|
|||||||
* @ignore
|
* @ignore
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace sapphire\test;
|
namespace silverstripe\test;
|
||||||
|
|
||||||
class ClassC extends \ClassA { }
|
class ClassC extends \ClassA { }
|
@ -3,6 +3,6 @@
|
|||||||
* @ignore
|
* @ignore
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace sapphire\test;
|
namespace silverstripe\test;
|
||||||
|
|
||||||
class ClassD extends subtest\ClassC { }
|
class ClassD extends subtest\ClassC { }
|
@ -3,6 +3,6 @@
|
|||||||
* @ignore
|
* @ignore
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace sapphire\test;
|
namespace silverstripe\test;
|
||||||
|
|
||||||
class ClassE implements InterfaceA { }
|
class ClassE implements InterfaceA { }
|
@ -3,6 +3,6 @@
|
|||||||
* @ignore
|
* @ignore
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace sapphire\test;
|
namespace silverstripe\test;
|
||||||
|
|
||||||
class ClassF implements \InterfaceA { }
|
class ClassF implements \InterfaceA { }
|
@ -3,6 +3,6 @@
|
|||||||
* @ignore
|
* @ignore
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace sapphire\test;
|
namespace silverstripe\test;
|
||||||
|
|
||||||
class ClassG implements subtest\InterfaceA { }
|
class ClassG implements subtest\InterfaceA { }
|
@ -3,6 +3,6 @@
|
|||||||
* @ignore
|
* @ignore
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace sapphire\test;
|
namespace silverstripe\test;
|
||||||
|
|
||||||
class ClassH extends \sapphire\test\ClassA { }
|
class ClassH extends \silverstripe\test\ClassA { }
|
||||||
|
@ -3,6 +3,6 @@
|
|||||||
* @ignore
|
* @ignore
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace sapphire\test;
|
namespace silverstripe\test;
|
||||||
|
|
||||||
interface InterfaceA { }
|
interface InterfaceA { }
|
@ -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');
|
$this->assertEquals($player->Biography, 'He\'s a good guy', 'test updating of duplicate imports within the same import works');
|
||||||
|
|
||||||
// load with updated data
|
// 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);
|
$results = $loader->load($filepath);
|
||||||
|
|
||||||
// HACK need to update the loaded record from the database
|
// HACK need to update the loaded record from the database
|
||||||
|
@ -53,7 +53,7 @@ class DeprecationTest extends SapphireTest {
|
|||||||
function testNonMatchingModuleNotifcationVersionDoesntAffectNotice() {
|
function testNonMatchingModuleNotifcationVersionDoesntAffectNotice() {
|
||||||
Deprecation::notification_version('1.0.0');
|
Deprecation::notification_version('1.0.0');
|
||||||
Deprecation::notification_version('3.0.0', 'mysite');
|
Deprecation::notification_version('3.0.0', 'mysite');
|
||||||
$this->callThatOriginatesFromSapphire();
|
$this->callThatOriginatesFromFramework();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -61,12 +61,12 @@ class DeprecationTest extends SapphireTest {
|
|||||||
*/
|
*/
|
||||||
function testMatchingModuleNotifcationVersionAffectsNotice() {
|
function testMatchingModuleNotifcationVersionAffectsNotice() {
|
||||||
Deprecation::notification_version('1.0.0');
|
Deprecation::notification_version('1.0.0');
|
||||||
Deprecation::notification_version('3.0.0', 'sapphire');
|
Deprecation::notification_version('3.0.0', 'framework');
|
||||||
$this->callThatOriginatesFromSapphire();
|
$this->callThatOriginatesFromFramework();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function callThatOriginatesFromSapphire() {
|
protected function callThatOriginatesFromFramework() {
|
||||||
$this->assertEquals(DeprecationTest_Deprecation::get_module(), 'sapphire');
|
$this->assertEquals(DeprecationTest_Deprecation::get_module(), 'framework');
|
||||||
Deprecation::notice('2.0', 'Deprecation test passed');
|
Deprecation::notice('2.0', 'Deprecation test passed');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
class LookupFieldTest extends SapphireTest {
|
class LookupFieldTest extends SapphireTest {
|
||||||
|
|
||||||
static $fixture_file = 'sapphire/tests/forms/LookupFieldTest.yml';
|
static $fixture_file = 'LookupFieldTest.yml';
|
||||||
|
|
||||||
function testNullValueWithNumericArraySource() {
|
function testNullValueWithNumericArraySource() {
|
||||||
$source = array(1 => 'one', 2 => 'two', 3 => 'three');
|
$source = array(1 => 'one', 2 => 'two', 3 => 'three');
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
class GridFieldAddExistingAutocompleterTest extends FunctionalTest {
|
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');
|
protected $extraDataObjects = array('GridFieldTest_Team', 'GridFieldTest_Player');
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ class GridFieldDeleteActionTest extends SapphireTest {
|
|||||||
protected $form;
|
protected $form;
|
||||||
|
|
||||||
/** @var string */
|
/** @var string */
|
||||||
public static $fixture_file = 'sapphire/tests/forms/gridfield/GridFieldActionTest.yml';
|
public static $fixture_file = 'GridFieldActionTest.yml';
|
||||||
|
|
||||||
/** @var array */
|
/** @var array */
|
||||||
protected $extraDataObjects = array('GridFieldAction_Delete_Team', 'GridFieldAction_Edit_Team');
|
protected $extraDataObjects = array('GridFieldAction_Delete_Team', 'GridFieldAction_Edit_Team');
|
||||||
|
@ -12,7 +12,7 @@ class GridFieldEditButtonTest extends SapphireTest {
|
|||||||
protected $form;
|
protected $form;
|
||||||
|
|
||||||
/** @var string */
|
/** @var string */
|
||||||
public static $fixture_file = 'sapphire/tests/forms/gridfield/GridFieldActionTest.yml';
|
public static $fixture_file = 'GridFieldActionTest.yml';
|
||||||
|
|
||||||
/** @var array */
|
/** @var array */
|
||||||
protected $extraDataObjects = array('GridFieldAction_Delete_Team', 'GridFieldAction_Edit_Team');
|
protected $extraDataObjects = array('GridFieldAction_Delete_Team', 'GridFieldAction_Edit_Team');
|
||||||
|
@ -7,7 +7,7 @@ class i18nTest extends SapphireTest {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string $tmpBasePath Used to write language files.
|
* @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.
|
* in case something goes wrong with the file parsing.
|
||||||
*/
|
*/
|
||||||
protected $alternateBaseSavePath;
|
protected $alternateBaseSavePath;
|
||||||
|
@ -7,7 +7,7 @@ class i18nTextCollectorTest extends SapphireTest {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string $tmpBasePath Used to write language files.
|
* @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.
|
* in case something goes wrong with the file parsing.
|
||||||
*/
|
*/
|
||||||
protected $alternateBaseSavePath;
|
protected $alternateBaseSavePath;
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
class DataDifferencerTest extends SapphireTest {
|
class DataDifferencerTest extends SapphireTest {
|
||||||
|
|
||||||
static $fixture_file = 'sapphire/tests/model/DataDifferencerTest.yml';
|
static $fixture_file = 'DataDifferencerTest.yml';
|
||||||
|
|
||||||
protected $extraDataObjects = array(
|
protected $extraDataObjects = array(
|
||||||
'DataDifferencerTest_Object',
|
'DataDifferencerTest_Object',
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
DataDifferencerTest_MockImage:
|
DataDifferencerTest_MockImage:
|
||||||
image1:
|
image1:
|
||||||
Filename: sapphire/tests/model/testimages/test_image.png
|
Filename: framework/tests/model/testimages/test_image.png
|
||||||
image2:
|
image2:
|
||||||
Filename: sapphire/tests/model/testimages/test.image.with.dots.png
|
Filename: framework/tests/model/testimages/test.image.with.dots.png
|
||||||
DataDifferencerTest_HasOneRelationObject:
|
DataDifferencerTest_HasOneRelationObject:
|
||||||
relobj1:
|
relobj1:
|
||||||
Title: obj1
|
Title: obj1
|
||||||
|
@ -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
|
|
@ -1,9 +1,9 @@
|
|||||||
<% if FailTest %>
|
<% if $FailTest %>
|
||||||
<% require css(sapphire/tests/forms/RequirementsTest_a.css) %>
|
<% require css(framework/tests/forms/RequirementsTest_a.css) %>
|
||||||
<% require javascript(sapphire/tests/forms/RequirementsTest_b.js) %>
|
<% require javascript(framework/tests/forms/RequirementsTest_b.js) %>
|
||||||
<% require javascript(sapphire/tests/forms/RequirementsTest_c.js) %>
|
<% require javascript(framework/tests/forms/RequirementsTest_c.js) %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<% require javascript(sapphire/tests/forms/RequirementsTest_a.js) %>
|
<% require javascript(framework/tests/forms/RequirementsTest_a.js) %>
|
||||||
<% require css(sapphire/tests/forms/RequirementsTest_b.css) %>
|
<% require css(framework/tests/forms/RequirementsTest_b.css) %>
|
||||||
<% require css(sapphire/tests/forms/RequirementsTest_c.css) %>
|
<% require css(framework/tests/forms/RequirementsTest_c.css) %>
|
||||||
<% end_if %>
|
<% end_if %>
|
||||||
|
@ -10,13 +10,13 @@ class YamlFixtureTest extends SapphireTest {
|
|||||||
);
|
);
|
||||||
|
|
||||||
function testAbsoluteFixturePath() {
|
function testAbsoluteFixturePath() {
|
||||||
$absPath = Director::baseFolder() . '/sapphire/tests/testing/YamlFixtureTest.yml';
|
$absPath = FRAMEWORK_PATH . '/tests/testing/YamlFixtureTest.yml';
|
||||||
$obj = new YamlFixture($absPath);
|
$obj = new YamlFixture($absPath);
|
||||||
$this->assertEquals($absPath, $obj->getFixtureFile());
|
$this->assertEquals($absPath, $obj->getFixtureFile());
|
||||||
}
|
}
|
||||||
|
|
||||||
function testRelativeFixturePath() {
|
function testRelativeFixturePath() {
|
||||||
$relPath = 'sapphire/tests/testing/YamlFixtureTest.yml';
|
$relPath = FRAMEWORK_DIR . '/tests/testing/YamlFixtureTest.yml';
|
||||||
$obj = new YamlFixture($relPath);
|
$obj = new YamlFixture($relPath);
|
||||||
$this->assertEquals(Director::baseFolder() . '/' . $relPath, $obj->getFixtureFile());
|
$this->assertEquals(Director::baseFolder() . '/' . $relPath, $obj->getFixtureFile());
|
||||||
}
|
}
|
||||||
@ -25,7 +25,7 @@ class YamlFixtureTest extends SapphireTest {
|
|||||||
* @expectedException InvalidArgumentException
|
* @expectedException InvalidArgumentException
|
||||||
*/
|
*/
|
||||||
function testFailsWithInvalidFixturePath() {
|
function testFailsWithInvalidFixturePath() {
|
||||||
$invalidPath = 'sapphire/tests/testing/invalid.yml';
|
$invalidPath = FRAMEWORK_DIR . '/tests/testing/invalid.yml';
|
||||||
$obj = new YamlFixture($invalidPath);
|
$obj = new YamlFixture($invalidPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,8 +41,8 @@ class SSViewerTest extends SapphireTest {
|
|||||||
|
|
||||||
function testRequirements() {
|
function testRequirements() {
|
||||||
$requirements = $this->getMock("Requirements_Backend", array("javascript", "css"));
|
$requirements = $this->getMock("Requirements_Backend", array("javascript", "css"));
|
||||||
$jsFile = 'sapphire/tests/forms/a.js';
|
$jsFile = FRAMEWORK_DIR . '/tests/forms/a.js';
|
||||||
$cssFile = 'sapphire/tests/forms/a.js';
|
$cssFile = FRAMEWORK_DIR . '/tests/forms/a.js';
|
||||||
|
|
||||||
$requirements->expects($this->once())->method('javascript')->with($jsFile);
|
$requirements->expects($this->once())->method('javascript')->with($jsFile);
|
||||||
$requirements->expects($this->once())->method('css')->with($cssFile);
|
$requirements->expects($this->once())->method('css')->with($cssFile);
|
||||||
@ -943,10 +943,10 @@ after')
|
|||||||
|
|
||||||
$result = $view->process($data);
|
$result = $view->process($data);
|
||||||
$expected = '<!doctype html>
|
$expected = '<!doctype html>
|
||||||
<html><!-- template ' . BASE_PATH . '/sapphire/tests/templates/SSViewerTestCommentsFullSource.ss -->
|
<html><!-- template ' . FRAMEWORK_PATH . '/tests/templates/SSViewerTestCommentsFullSource.ss -->
|
||||||
<head></head>
|
<head></head>
|
||||||
<body></body>
|
<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);
|
$this->assertEquals($result, $expected);
|
||||||
|
|
||||||
@ -954,14 +954,14 @@ after')
|
|||||||
$data = new ArrayData(array());
|
$data = new ArrayData(array());
|
||||||
|
|
||||||
$result = $view->process($data);
|
$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);
|
$this->assertEquals($result, $expected);
|
||||||
|
|
||||||
$view = new SSViewer(array('SSViewerTestCommentsWithInclude'));
|
$view = new SSViewer(array('SSViewerTestCommentsWithInclude'));
|
||||||
$data = new ArrayData(array());
|
$data = new ArrayData(array());
|
||||||
|
|
||||||
$result = $view->process($data);
|
$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);
|
$this->assertEquals($result, $expected);
|
||||||
|
|
||||||
SSViewer::set_source_file_comments(false);
|
SSViewer::set_source_file_comments(false);
|
||||||
|
4
thirdparty/behaviour/README.md
vendored
4
thirdparty/behaviour/README.md
vendored
@ -10,11 +10,11 @@ Caution: Seriously outdated, consider using [http://github.com/hafriedlander/jqu
|
|||||||
|
|
||||||
# Requirements
|
# Requirements
|
||||||
|
|
||||||
* Custom Prototype 1.4 RC3 (see `sapphire/thirdparty/prototype/prototype.js`)
|
* Custom Prototype 1.4 RC3 (see `framework/thirdparty/prototype/prototype.js`)
|
||||||
|
|
||||||
# Tutorial
|
# 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
|
## Required includes
|
||||||
|
|
||||||
|
2
thirdparty/prototype/prototype.js
vendored
2
thirdparty/prototype/prototype.js
vendored
@ -830,7 +830,7 @@ Ajax.Request.prototype = Object.extend(new Ajax.Base(), {
|
|||||||
// jquery ondemand integration patch
|
// jquery ondemand integration patch
|
||||||
prototypeAjax = this;
|
prototypeAjax = this;
|
||||||
completeHandler = function() {
|
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(prototypeAjax.transport.responseText && prototypeAjax.transport.responseText.substr(0,12) == 'NOTLOGGEDIN:') {
|
||||||
if(typeof onSessionLost == 'function') onSessionLost();
|
if(typeof onSessionLost == 'function') onSessionLost();
|
||||||
|
|
||||||
|
33
view/GenericTemplateGlobalProvider.php
Normal file
33
view/GenericTemplateGlobalProvider.php
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -134,7 +134,7 @@ class Requirements {
|
|||||||
* Register the given stylesheet file as required.
|
* Register the given stylesheet file as required.
|
||||||
* See {@link Requirements_Backend::css()}
|
* 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")
|
* @param $media String Comma-separated list of media-types (e.g. "screen,projector")
|
||||||
* @see http://www.w3.org/TR/REC-CSS2/media.html
|
* @see http://www.w3.org/TR/REC-CSS2/media.html
|
||||||
*/
|
*/
|
||||||
@ -479,7 +479,7 @@ class Requirements_Backend {
|
|||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Register the given javascript file as required.
|
* 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) {
|
public function javascript($file) {
|
||||||
@ -552,7 +552,7 @@ class Requirements_Backend {
|
|||||||
/**
|
/**
|
||||||
* Register the given stylesheet file as required.
|
* 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")
|
* @param $media String Comma-separated list of media-types (e.g. "screen,projector")
|
||||||
* @see http://www.w3.org/TR/REC-CSS2/media.html
|
* @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.
|
* 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 Return all relative file paths rather than including them in requirements
|
||||||
* @param Boolean Only include language files, not the base libraries
|
* @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
|
// Include i18n.js even if no languages are found. The fact that
|
||||||
// add_i18n_javascript() was called indicates that the methods in
|
// add_i18n_javascript() was called indicates that the methods in
|
||||||
// here are needed.
|
// here are needed.
|
||||||
if(!$langOnly) $files[] = SAPPHIRE_DIR . '/javascript/i18n.js';
|
if(!$langOnly) $files[] = FRAMEWORK_DIR . '/javascript/i18n.js';
|
||||||
|
|
||||||
if(substr($langDir,-1) != '/') $langDir .= '/';
|
if(substr($langDir,-1) != '/') $langDir .= '/';
|
||||||
|
|
||||||
@ -767,7 +767,7 @@ class Requirements_Backend {
|
|||||||
|
|
||||||
// Stub i18n implementation for when i18n is disabled.
|
// Stub i18n implementation for when i18n is disabled.
|
||||||
} else {
|
} else {
|
||||||
if(!$langOnly) $files[] = SAPPHIRE_DIR . '/javascript/i18nx.js';
|
if(!$langOnly) $files[] = FRAMEWORK_DIR . '/javascript/i18nx.js';
|
||||||
}
|
}
|
||||||
|
|
||||||
if($return) {
|
if($return) {
|
||||||
|
@ -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,
|
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
|
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
|
php ../thirdparty/php-peg/cli.php SSTemplateParser.php.inc > SSTemplateParser.php
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user