mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
Added _manifest_exclude to lang folder (merged from branches/gsoc)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@42577 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
bc246bf484
commit
d3cc97c8a0
@ -425,7 +425,7 @@ JS;
|
||||
$originalItem = Translatable::get_original($className,Session::get("{$id}_originalLangID"));
|
||||
if ($setID) $originalItem->ID = $id;
|
||||
else {
|
||||
$originalItem->ID = 'new'; // to avoid creating and deleting a SiteTree row
|
||||
$originalItem->ID = null;
|
||||
Translatable::creating_from(Session::get($id.'_originalLangID'));
|
||||
}
|
||||
return $originalItem;
|
||||
|
@ -366,11 +366,11 @@ JS;
|
||||
$className = $this->stat('tree_class');
|
||||
$result = '';
|
||||
|
||||
$id = $_REQUEST['ID'];
|
||||
if(substr($id,0,3) != 'new') {
|
||||
$record = DataObject::get_one($className, "`$className`.ID = $id");
|
||||
$SQL_id = Convert::raw2sql($_REQUEST['ID']);
|
||||
if(substr($SQL_id,0,3) != 'new') {
|
||||
$record = DataObject::get_one($className, "`$className`.ID = {$SQL_id}");
|
||||
} else {
|
||||
$record = $this->getNewItem($id, false);
|
||||
$record = $this->getNewItem($SQL_id, false);
|
||||
}
|
||||
|
||||
// We don't want to save a new version if there are no changes
|
||||
@ -428,8 +428,8 @@ JS;
|
||||
// $record->write();
|
||||
|
||||
if(Director::is_ajax()) {
|
||||
if($id != $record->ID) {
|
||||
FormResponse::add("$('sitetree').setNodeIdx(\"$id\", \"$record->ID\");");
|
||||
if($SQL_id != $record->ID) {
|
||||
FormResponse::add("$('sitetree').setNodeIdx(\"{$SQL_id}\", \"$record->ID\");");
|
||||
FormResponse::add("$('Form_EditForm').elements.ID.value = \"$record->ID\";");
|
||||
}
|
||||
|
||||
@ -486,10 +486,13 @@ JS;
|
||||
// If the 'Save & Publish' button was clicked, also publish the page
|
||||
if (isset($urlParams['publish']) && $urlParams['publish'] == 1) {
|
||||
$this->performPublish($record);
|
||||
// BUGFIX: Changed icon sometimes shows after "Save & Publish" button is clicked http://support.silverstripe.com/gsoc/ticket/31
|
||||
$record->setClassName( $record->ClassName );
|
||||
$newClass = $record->ClassName;
|
||||
$publishedRecord = $record->newClassInstance( $newClass );
|
||||
|
||||
if(substr($SQL_id,0,3) != 'new') {
|
||||
$publishedRecord = DataObject::get_one($className, "`$className`.ID = {$SQL_id}");
|
||||
} else {
|
||||
$publishedRecord = $this->getNewItem($SQL_id, false);
|
||||
}
|
||||
|
||||
return $this->tellBrowserAboutPublicationChange($publishedRecord, "Published '$record->Title' successfully");
|
||||
} else {
|
||||
// BUGFIX: Changed icon only shows after Save button is clicked twice http://support.silverstripe.com/gsoc/ticket/76
|
||||
|
@ -1,54 +1,48 @@
|
||||
var _TRANSLATING_LANG = null;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
LangSelector = Class.create();
|
||||
LangSelector.prototype = {
|
||||
|
||||
initialize: function() {
|
||||
this.selector = $('LangSelector');
|
||||
//this.selector.addEventListener("click", this.a, null);
|
||||
|
||||
if(this.selector) this.selector.holder = this;
|
||||
if(this.selector.selectedIndex != 0) {
|
||||
if(this.selectedIndex != 0) {
|
||||
this.showlangtree();
|
||||
_TRANSLATING_LANG = this.selector.value;
|
||||
_TRANSLATING_LANG = this.value;
|
||||
}
|
||||
},
|
||||
|
||||
destroy: function() {
|
||||
if(this.selector) this.selector.holder = null;
|
||||
this.selector = null;
|
||||
},
|
||||
|
||||
onshow: function() {
|
||||
if(this.selector.value) this.showlangtree();
|
||||
if(this.value) this.showlangtree();
|
||||
},
|
||||
|
||||
onchange: function() {
|
||||
if (this.selector.value != _TRANSLATING_LANG) {
|
||||
if (this.selector.selectedIndex != 0) _TRANSLATING_LANG = this.selector.value;
|
||||
else _TRANSLATING_LANG = null;
|
||||
onchange: function(e, val) {
|
||||
if(this.value != _TRANSLATING_LANG) {
|
||||
_TRANSLATING_LANG = this.value;
|
||||
this.showlangtree();
|
||||
}
|
||||
},
|
||||
|
||||
selectValue: function(lang) {
|
||||
this.selector.value = lang;
|
||||
if (this.selector.value != lang) {
|
||||
this.value = lang;
|
||||
if(this.value != lang) {
|
||||
var newLang = document.createElement('option');
|
||||
newLang.text = lang;
|
||||
newLang.value = lang;
|
||||
try {
|
||||
this.selector.add(newLang, null); // standards compliant
|
||||
this.add(newLang, null); // standards compliant
|
||||
} catch(ex) {
|
||||
this.selector.add(newLang); // IE only
|
||||
this.add(newLang); // IE only
|
||||
}
|
||||
this.selector.value = lang;
|
||||
this.value = lang;
|
||||
}
|
||||
},
|
||||
|
||||
showlangtree: function() {
|
||||
$('sitetree').innerHTML=' <img src="cms/images/network-save.gif> loading...';
|
||||
if(this.selector.value) {
|
||||
new Ajax.Request('admin/switchlanguage/' + this.selector.value, {
|
||||
if(this.value) {
|
||||
$('sitetree').innerHTML=' <img src="cms/images/network-save.gif> loading...';
|
||||
new Ajax.Request('admin/switchlanguage/' + this.value, {
|
||||
method : 'post',
|
||||
onSuccess: Ajax.Evaluator,
|
||||
onFailure : Ajax.Evaluator
|
||||
@ -56,16 +50,18 @@ LangSelector.prototype = {
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
LangSelector.applyTo('#LangSelector');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
TranslatorCreator = Class.create();
|
||||
TranslatorCreator.prototype = {
|
||||
|
||||
onSelectionChanged: function(selectedNode) {
|
||||
if (_TRANSLATING_LANG && Element.hasClassName(selectedNode,'untranslated')) {
|
||||
if(_TRANSLATING_LANG && Element.hasClassName(selectedNode,'untranslated')) {
|
||||
$start = confirm('Would you like to start a translation for this page?');
|
||||
if ($start) Element.removeClassName(selectedNode,'untranslated');
|
||||
if($start) Element.removeClassName(selectedNode,'untranslated');
|
||||
return $start;
|
||||
}
|
||||
},
|
||||
@ -75,5 +71,4 @@ TranslatorCreator.prototype = {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
TranslatorCreator.applyTo('#LangSelector_holder');
|
0
lang/_manifest_exclude
Executable file
0
lang/_manifest_exclude
Executable file
Loading…
Reference in New Issue
Block a user