API-CHANGE sapphire folder can now be renamed.

This commit is contained in:
Simon Welsh 2012-04-12 20:36:25 +12:00 committed by Sean Harvey
parent b8e86ae261
commit c4e018928e
18 changed files with 33 additions and 33 deletions

View File

@ -1,6 +1,6 @@
## Overview
PHP5 Content Management System (CMS), see [http://silverstripe.org](http://silverstripe.org). Requires the [`sapphire`](http://github.com/silverstripe/sapphire) module and a [`silverstripe-installer`](http://github.com/silverstripe/silverstripe-installer) base project.
PHP5 Content Management System (CMS), see [http://silverstripe.org](http://silverstripe.org). Requires the [`framework`](http://github.com/silverstripe/sapphire) module and a [`silverstripe-installer`](http://github.com/silverstripe/silverstripe-installer) base project.
## Installation ##
@ -33,4 +33,4 @@ and [installation from source](http://doc.silverstripe.org/sapphire/en/installat
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
OF SUCH DAMAGE.
OF SUCH DAMAGE.

View File

@ -62,13 +62,13 @@ class AssetAdmin extends LeftAndMain implements PermissionProvider{
Requirements::javascript(CMS_DIR . '/javascript/CMSMain.GridField.js');
Requirements::add_i18n_javascript(CMS_DIR . '/javascript/lang', false, true);
Requirements::css(CMS_DIR . "/css/screen.css");
$frameworkDir = FRAMEWORK_DIR;
Requirements::customScript(<<<JS
_TREE_ICONS = {};
_TREE_ICONS['Folder'] = {
fileIcon: 'sapphire/javascript/tree/images/page-closedfolder.gif',
openFolderIcon: 'sapphire/javascript/tree/images/page-openfolder.gif',
closedFolderIcon: 'sapphire/javascript/tree/images/page-closedfolder.gif'
fileIcon: '$frameworkDir/javascript/tree/images/page-closedfolder.gif',
openFolderIcon: '$frameworkDir/javascript/tree/images/page-openfolder.gif',
closedFolderIcon: '$frameworkDir/javascript/tree/images/page-closedfolder.gif'
};
JS
);

View File

@ -52,8 +52,8 @@ class CMSFileAddController extends LeftAndMain {
* @todo what template is used here? AssetAdmin_UploadContent.ss doesn't seem to be used anymore
*/
public function getEditForm($id = null, $fields = null) {
Requirements::javascript(SAPPHIRE_DIR . '/javascript/AssetUploadField.js');
Requirements::css(SAPPHIRE_DIR . '/css/AssetUploadField.css');
Requirements::javascript(FRAMEWORK_DIR . '/javascript/AssetUploadField.js');
Requirements::css(FRAMEWORK_DIR . '/css/AssetUploadField.css');
$folder = $this->currentPage();

View File

@ -1163,12 +1163,12 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
* @return string
*/
public function CMSVersion() {
$cmsVersion = file_get_contents(BASE_PATH . '/cms/silverstripe_version');
$cmsVersion = file_get_contents(CMS_PATH . '/silverstripe_version');
if(!$cmsVersion) $cmsVersion = _t('LeftAndMain.VersionUnknown');
$sapphireVersion = file_get_contents(BASE_PATH . '/cms/silverstripe_version');
$sapphireVersion = file_get_contents(CMS_PATH . '/silverstripe_version');
if(!$sapphireVersion) $sapphireVersion = _t('LeftAndMain.VersionUnknown');
return sprintf(
"cms: %s, sapphire: %s",
"cms: %s, framework: %s",
$cmsVersion,
$sapphireVersion
);

View File

@ -339,7 +339,7 @@ class ContentController extends Controller {
if(Director::isDev() || Permission::check('CMS_ACCESS_CMSMain') || Permission::check('VIEW_DRAFT_CONTENT')) {
if($this->dataRecord) {
Requirements::css(CMS_DIR . '/css/SilverStripeNavigator.css');
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery/jquery.js');
Requirements::javascript(FRAMEWORK_DIR . '/thirdparty/jquery/jquery.js');
Requirements::javascript(CMS_DIR . '/javascript/SilverStripeNavigator.js');
$return = $nav = SilverStripeNavigator::get_for_record($this->dataRecord);

View File

@ -50,7 +50,7 @@ class ReportAdmin extends LeftAndMain implements PermissionProvider {
HtmlEditorConfig::get('cms')->setOption('Lang', i18n::get_tinymce_lang());
// Always block the HtmlEditorField.js otherwise it will be sent with an ajax request
Requirements::block(SAPPHIRE_DIR . '/javascript/HtmlEditorField.js');
Requirements::block(FRAMEWORK_DIR . '/javascript/HtmlEditorField.js');
}
/**

View File

@ -2687,8 +2687,8 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
function provideI18nEntities() {
$entities = parent::provideI18nEntities();
if(isset($entities['Page.SINGULARNAME'])) $entities['Page.SINGULARNAME'][3] = 'sapphire';
if(isset($entities['Page.PLURALNAME'])) $entities['Page.PLURALNAME'][3] = 'sapphire';
if(isset($entities['Page.SINGULARNAME'])) $entities['Page.SINGULARNAME'][3] = FRAMEWORK_DIR;
if(isset($entities['Page.PLURALNAME'])) $entities['Page.PLURALNAME'][3] = FRAMEWORK_DIR;
$types = self::page_type_classes();
foreach($types as $type) {

View File

@ -50,7 +50,7 @@ class FilesystemPublisher extends StaticPublisher {
/**
* @param $destFolder The folder to save the cached site into.
* This needs to be set in sapphire/static-main.php as well through the {@link $cacheBaseDir} variable.
* This needs to be set in framework/static-main.php as well through the {@link $cacheBaseDir} variable.
* @param $fileExtension The file extension to use, e.g 'html'.
* If omitted, then each page will be placed in its own directory,
* with the filename 'index.html'. If you set the extension to PHP, then a simple PHP script will
@ -69,7 +69,7 @@ class FilesystemPublisher extends StaticPublisher {
/**
* Transforms relative or absolute URLs to their static path equivalent.
* This needs to be the same logic that's used to look up these paths through
* sapphire/static-main.php. Does not include the {@link $destFolder} prefix.
* framework/static-main.php. Does not include the {@link $destFolder} prefix.
* Replaces various special characters in the resulting filename similar to {@link SiteTree::generateURLSegment()}.
*
* Examples (without $domain_based_caching):

View File

@ -39,6 +39,7 @@ class RsyncMultiHostPublisher extends FilesystemPublisher {
function publishPages($urls) {
parent::publishPages($urls);
$base = Director::baseFolder();
$framework = FRAMEWORK_DIR;
// Get variable that can turn off the rsync component of publication
if(isset($_GET['norsync']) && $_GET['norsync']) return;
@ -53,8 +54,8 @@ class RsyncMultiHostPublisher extends FilesystemPublisher {
$rsyncOutput = `cd $base; rsync -av -e ssh --exclude /.htaccess --exclude /web.config --exclude '*.php' --exclude '*.svn' --exclude '*.git' --exclude '*~' $extraArg --delete . $target`;
// Then transfer "safe" PHP from the cache/ directory
$rsyncOutput .= `cd $base; rsync -av -e ssh --exclude '*.svn' --exclude '*~' $extraArg --delete cache $target`;
// Transfer sapphire/static-main.php to the target
$rsyncOutput .= `cd $base; rsync -av -e ssh --delete sapphire/static-main.php $target/sapphire`;
// Transfer framework/static-main.php to the target
$rsyncOutput .= `cd $base; rsync -av -e ssh --delete $framework/static-main.php $target/$framework`;
if(StaticPublisher::echo_progress()) echo $rsyncOutput;
}
}

View File

@ -44,5 +44,5 @@ RewriteRule .* /cache/index.html [L]
RewriteCond %{REQUEST_URI} !(\.gif)|(\.jpg)|(\.png)|(\.css)|(\.js)|(\.php)$
RewriteCond %{REQUEST_URI} ^(.*)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .* sapphire/main.php?url=%1&%{QUERY_STRING} [L]
### SILVERSTRIPE END ###
RewriteRule .* framework/main.php?url=%1&%{QUERY_STRING} [L]
### SILVERSTRIPE END ###

View File

@ -133,7 +133,7 @@ class Widget extends DataObject {
* within a {@link ContentController}.
*
* ## Forms
* You can add forms like in any other sapphire controller.
* You can add forms like in any other SilverStripe controller.
* If you need access to the widget from within a form,
* you can use `$this->controller->getWidget()` inside the form logic.
* Note: Widget controllers currently only work on {@link Page} objects,

View File

@ -1,4 +1,4 @@
/** Style custom to the CMSMain admin interface. CMSMain extends the built in sapphire admin section styles. As much as possible we want to use those built in styles. If anything in this file can be implemented in a generic way then it should be include in the admin scss files. @package cms */
/** Style custom to the CMSMain admin interface. CMSMain extends the built in SilverStripe admin section styles. As much as possible we want to use those built in styles. If anything in this file can be implemented in a generic way then it should be include in the admin scss files. @package cms */
/** ------------------------------------------------------------------ Page History Section. ----------------------------------------------------------------- */
#cms-page-history-versions tr.loading { color: #999; }
#cms-page-history-versions tr.loading td:hover { cursor: none; }

View File

@ -1,7 +1,7 @@
/** This file is the central collection of included modules, links to custom SCSS files, and any global SCSS variable definitions. DO NOT ADD stylesheet rules to this file directly! Note: By prefixing files with an underscore, they won't create individual CSS files. */
/** ----------------------------- Core Compass Libraries ------------------------------ */
/** ----------------------------- CMS Components ------------------------------ */
/** Style custom to the CMSMain admin interface. CMSMain extends the built in sapphire admin section styles. As much as possible we want to use those built in styles. If anything in this file can be implemented in a generic way then it should be include in the admin scss files. @package cms */
/** Style custom to the CMSMain admin interface. CMSMain extends the built in SilverStripe admin section styles. As much as possible we want to use those built in styles. If anything in this file can be implemented in a generic way then it should be include in the admin scss files. @package cms */
/** ------------------------------------------------------------------ Page History Section. ----------------------------------------------------------------- */
#cms-page-history-versions tr.loading { color: #999; }
#cms-page-history-versions tr.loading td:hover { cursor: none; }
@ -29,5 +29,5 @@
.cms .AssetAdmin #Form_EditForm_File td.bottom-all { padding: 0.7em; }
.cms .AssetAdmin #Form_EditForm_File td.col-StripThumbnail { padding: 0; width: 32px; height: 32px; display: block; }
.cms .AssetAdmin #Form_EditForm_File td.col-StripThumbnail img { width: 32px; height: 32px; }
.cms .AssetAdmin #Form_EditForm_File tr[data-class=Folder] td.col-StripThumbnail { background: transparent url(../../sapphire/admin/images/sprites-32x32/blue-folder-horizontal.png) no-repeat top left; }
.cms .AssetAdmin #Form_EditForm_File tr[data-class=File] td.col-StripThumbnail { background: transparent url(../../sapphire/admin/images/sprites-32x32/blue-document.png) no-repeat top left; }
.cms .AssetAdmin #Form_EditForm_File tr[data-class=Folder] td.col-StripThumbnail { background: transparent url(../images/treeicons/blue-folder-horizontal.png) no-repeat top left; }
.cms .AssetAdmin #Form_EditForm_File tr[data-class=File] td.col-StripThumbnail { background: transparent url(../images/treeicons/blue-document.png) no-repeat top left; }

Binary file not shown.

After

Width:  |  Height:  |  Size: 813 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -87,17 +87,16 @@
height: 32px;
}
}
// TODO Figure out how to share sprites and SCSS rules between sapphire/admin/scss and cms/scss
tr[data-class=Folder] {
td.col-StripThumbnail {
background: transparent url(../../sapphire/admin/images/sprites-32x32/blue-folder-horizontal.png) no-repeat top left;
background: transparent url(../images/treeicons/blue-folder-horizontal.png) no-repeat top left;
}
}
tr[data-class=File] {
td.col-StripThumbnail {
background: transparent url(../../sapphire/admin/images/sprites-32x32/blue-document.png) no-repeat top left;
background: transparent url(../images/treeicons/blue-document.png) no-repeat top left;
}
}
}
}

View File

@ -1,6 +1,6 @@
/**
* Style custom to the CMSMain admin interface. CMSMain extends the built in
* sapphire admin section styles. As much as possible we want to use those
* SilverStripe admin section styles. As much as possible we want to use those
* built in styles. If anything in this file can be implemented in a generic
* way then it should be include in the admin scss files.
*
@ -42,4 +42,4 @@
padding: 2px;
color: darken(#FDD, 30%);
}
}
}

View File

@ -61,7 +61,7 @@ in the other stage:<br />
}
function index() {
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery/jquery.js');
Requirements::javascript(FRAMEWORK_DIR . '/thirdparty/jquery/jquery.js');
Requirements::customCSS('#OrphanIDs .middleColumn {width: auto;}');
Requirements::customCSS('#OrphanIDs label {display: inline;}');