Merge remote-tracking branch 'origin/3.1'

Conflicts:
	forms/HtmlEditorField.php
This commit is contained in:
Ingo Schommer 2013-08-16 13:37:44 +02:00
commit 7ae75c1a89
17 changed files with 113 additions and 106 deletions

View File

@ -231,7 +231,10 @@ form.small .field input.text, form.small .field textarea, form.small .field sele
/** ---------------------------------------------------- Grouped form fields ---------------------------------------------------- */ /** ---------------------------------------------------- Grouped form fields ---------------------------------------------------- */
.fieldgroup .fieldgroup-field { float: left; display: block; padding: 8px 8px 0 0; } .fieldgroup .fieldgroup-field { float: left; display: block; padding: 8px 8px 0 0; }
.fieldgroup .fieldgroup-field .field { border: none; padding-bottom: 0; } .fieldgroup .fieldgroup-field .field { border: none; padding-bottom: 0; }
.fieldgroup .fieldgroup-field label { margin-left: 0; margin-right: 1em; width: auto; } .fieldgroup .fieldgroup-field .fieldholder-small { padding: 0 0 8px 0; }
.fieldgroup .fieldgroup-field .fieldgroup input.text, .fieldgroup .fieldgroup-field .fieldgroup textarea, .fieldgroup .fieldgroup-field .fieldgroup select, .fieldgroup .fieldgroup-field .fieldgroup .TreeDropdownField { margin-left: 0; }
.fieldgroup .fieldgroup-field .fieldholder-small-label { display: block; }
.fieldgroup .fieldgroup-field label { padding: 8px 8px 8px 0; margin-left: 0; margin-right: 1em; width: auto; }
.fieldgroup.stacked .fieldgroup-field { float: none; } .fieldgroup.stacked .fieldgroup-field { float: none; }
.ss-toggle { margin: 8px 0; } .ss-toggle { margin: 8px 0; }
@ -789,6 +792,12 @@ form.import-form label.left { width: 250px; }
.cms #vakata-contextmenu .right, .TreeDropdownField .treedropdownfield-panel #vakata-contextmenu .right { right: 100%; left: auto; } .cms #vakata-contextmenu .right, .TreeDropdownField .treedropdownfield-panel #vakata-contextmenu .right { right: 100%; left: auto; }
.cms #vakata-contextmenu .bottom, .TreeDropdownField .treedropdownfield-panel #vakata-contextmenu .bottom { bottom: -1px; top: auto; } .cms #vakata-contextmenu .bottom, .TreeDropdownField .treedropdownfield-panel #vakata-contextmenu .bottom { bottom: -1px; top: auto; }
.cms #vakata-contextmenu li ul, .TreeDropdownField .treedropdownfield-panel #vakata-contextmenu li ul { display: none; position: absolute; top: -2px; left: 100%; background: #FFF; border: 1px solid silver; -webkit-box-shadow: 0 0 10px #cccccc; -moz-box-shadow: 0 0 10px #cccccc; box-shadow: 0 0 10px #cccccc; } .cms #vakata-contextmenu li ul, .TreeDropdownField .treedropdownfield-panel #vakata-contextmenu li ul { display: none; position: absolute; top: -2px; left: 100%; background: #FFF; border: 1px solid silver; -webkit-box-shadow: 0 0 10px #cccccc; -moz-box-shadow: 0 0 10px #cccccc; box-shadow: 0 0 10px #cccccc; }
.cms #vakata-contextmenu li ul.col-2, .TreeDropdownField .treedropdownfield-panel #vakata-contextmenu li ul.col-2 { width: 360px; }
.cms #vakata-contextmenu li ul.col-2 li, .TreeDropdownField .treedropdownfield-panel #vakata-contextmenu li ul.col-2 li { width: 50%; }
.cms #vakata-contextmenu li ul.col-3, .TreeDropdownField .treedropdownfield-panel #vakata-contextmenu li ul.col-3 { width: 540px; }
.cms #vakata-contextmenu li ul.col-3 li, .TreeDropdownField .treedropdownfield-panel #vakata-contextmenu li ul.col-3 li { width: 33%; }
.cms #vakata-contextmenu li ul li, .TreeDropdownField .treedropdownfield-panel #vakata-contextmenu li ul li { min-width: 180px; float: left; }
.cms #vakata-contextmenu li ul li a, .TreeDropdownField .treedropdownfield-panel #vakata-contextmenu li ul li a { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; -o-text-overflow: ellipsis; }
.cms #vakata-contextmenu li.vakata-separator, .TreeDropdownField .treedropdownfield-panel #vakata-contextmenu li.vakata-separator { min-height: 0; height: 1px; line-height: 1px; font-size: 1px; overflow: hidden; margin: 0 2px; background: #ccc; padding: 0; } .cms #vakata-contextmenu li.vakata-separator, .TreeDropdownField .treedropdownfield-panel #vakata-contextmenu li.vakata-separator { min-height: 0; height: 1px; line-height: 1px; font-size: 1px; overflow: hidden; margin: 0 2px; background: #ccc; padding: 0; }
.cms #vakata-dragged, .TreeDropdownField .treedropdownfield-panel #vakata-dragged { display: block; margin: 0 0 0 0; padding: 4px 4px 4px 24px; position: absolute; top: -2000px; line-height: 16px; z-index: 10000; } .cms #vakata-dragged, .TreeDropdownField .treedropdownfield-panel #vakata-dragged { display: block; margin: 0 0 0 0; padding: 4px 4px 4px 24px; position: absolute; top: -2000px; line-height: 16px; z-index: 10000; }
.cms #vakata-dragged ins, .TreeDropdownField .treedropdownfield-panel #vakata-dragged ins { display: block; text-decoration: none; width: 16px; height: 16px; margin: 0 0 0 0; padding: 0; position: absolute; top: 4px; left: 4px; -moz-border-radius: 4px; border-radius: 4px; -webkit-border-radius: 4px; } .cms #vakata-dragged ins, .TreeDropdownField .treedropdownfield-panel #vakata-dragged ins { display: block; text-decoration: none; width: 16px; height: 16px; margin: 0 0 0 0; padding: 0; position: absolute; top: 4px; left: 4px; -moz-border-radius: 4px; border-radius: 4px; -webkit-border-radius: 4px; }

View File

@ -505,7 +505,22 @@ form.small .field, .field.small {
padding-bottom: 0; padding-bottom: 0;
} }
.fieldholder-small {
padding: 0 0 $grid-y 0;
}
.fieldgroup input.text, .fieldgroup textarea, .fieldgroup select, .fieldgroup .TreeDropdownField {
margin-left: 0;
}
// Style specific label with display block, otherwise
// checkbox falls under the text
.fieldholder-small-label {
display: block;
}
label { label {
padding: $grid-y $grid-x $grid-y 0;
margin-left: 0; margin-left: 0;
margin-right: 1em; margin-right: 1em;
width: auto; width: auto;

View File

@ -337,6 +337,25 @@
background: #FFF; background: #FFF;
border: 1px solid silver; border: 1px solid silver;
@include box-shadow(0 0 10px #CCC); @include box-shadow(0 0 10px #CCC);
&.col-2{
width:360px;
li{
width:50%;
}
}
&.col-3{
width:540px;
li{
width:33%;
}
}
li{
min-width:180px;
float:left;
a{
@include hide-text-overflow;
}
}
} }
li{ li{
&.vakata-separator { &.vakata-separator {

View File

@ -4,7 +4,7 @@
The CMS tree for viewing hierarchical structures (mostly pages) is powered The CMS tree for viewing hierarchical structures (mostly pages) is powered
by the [jstree](http://jstree.com) library. It is configured through by the [jstree](http://jstree.com) library. It is configured through
`sapphire/admin/javascript/LeftAndMain.Tree.js`, as well as some `framework/admin/javascript/LeftAndMain.Tree.js`, as well as some
HTML5 metadata generated on its container (see the `data-hints` attribute). HTML5 metadata generated on its container (see the `data-hints` attribute).
The tree is rendered through `[api:LeftAndMain->getSiteTreeFor()]`, The tree is rendered through `[api:LeftAndMain->getSiteTreeFor()]`,

View File

@ -380,7 +380,7 @@ Note: You can see any additional HTTP headers through the web developer tools in
The CMS tree for viewing hierarchical structures (mostly pages) is powered The CMS tree for viewing hierarchical structures (mostly pages) is powered
by the [jstree](http://jstree.com) library. It is configured through by the [jstree](http://jstree.com) library. It is configured through
`sapphire/admin/javascript/LeftAndMain.Tree.js`, as well as some `framework/admin/javascript/LeftAndMain.Tree.js`, as well as some
HTML5 metadata generated on its container (see the `data-hints` attribute). HTML5 metadata generated on its container (see the `data-hints` attribute).
For more information, see the [Howto: Customize the CMS tree](../howto/customize-cms-tree). For more information, see the [Howto: Customize the CMS tree](../howto/customize-cms-tree).

View File

@ -113,108 +113,37 @@ class HtmlEditorField extends TextareaField {
); );
} }
$linkedPages = array();
$linkedFiles = array();
$htmlValue = Injector::inst()->create('HTMLValue', $this->value); $htmlValue = Injector::inst()->create('HTMLValue', $this->value);
// Sanitise if requested
if($this->config()->sanitise_server_side) { if($this->config()->sanitise_server_side) {
$santiser = Injector::inst()->create('HtmlEditorSanitiser', HtmlEditorConfig::get_active()); $santiser = Injector::inst()->create('HtmlEditorSanitiser', HtmlEditorConfig::get_active());
$santiser->sanitise($htmlValue); $santiser->sanitise($htmlValue);
} }
if(class_exists('SiteTree')) { // Resample images and add default attributes
// Populate link tracking for internal links & links to asset files.
if($links = $htmlValue->getElementsByTagName('a')) foreach($links as $link) {
$href = Director::makeRelative($link->getAttribute('href'));
if($href) {
if(preg_match('/\[sitetree_link,id=([0-9]+)\]/i', $href, $matches)) {
$ID = $matches[1];
// clear out any broken link classes
if($class = $link->getAttribute('class')) {
$link->setAttribute('class',
preg_replace('/(^ss-broken|ss-broken$| ss-broken )/', null, $class));
}
$linkedPages[] = $ID;
if(!DataObject::get_by_id('SiteTree', $ID)) $record->HasBrokenLink = true;
} else if(substr($href, 0, strlen(ASSETS_DIR) + 1) == ASSETS_DIR.'/') {
$candidateFile = File::find(Convert::raw2sql(urldecode($href)));
if($candidateFile) {
$linkedFiles[] = $candidateFile->ID;
} else {
$record->HasBrokenFile = true;
}
} else if($href == '' || $href[0] == '/') {
$record->HasBrokenLink = true;
}
}
}
}
// Resample images, add default attributes and add to assets tracking.
if($images = $htmlValue->getElementsByTagName('img')) foreach($images as $img) { if($images = $htmlValue->getElementsByTagName('img')) foreach($images as $img) {
// strip any ?r=n data from the src attribute // strip any ?r=n data from the src attribute
$img->setAttribute('src', preg_replace('/([^\?]*)\?r=[0-9]+$/i', '$1', $img->getAttribute('src'))); $img->setAttribute('src', preg_replace('/([^\?]*)\?r=[0-9]+$/i', '$1', $img->getAttribute('src')));
if(!$image = File::find($path = urldecode(Director::makeRelative($img->getAttribute('src'))))) {
if(substr($path, 0, strlen(ASSETS_DIR) + 1) == ASSETS_DIR . '/') {
$record->HasBrokenFile = true;
}
continue;
}
// Resample the images if the width & height have changed. // Resample the images if the width & height have changed.
$width = (int)$img->getAttribute('width'); if($image = File::find(urldecode(Director::makeRelative($img->getAttribute('src'))))){
$height = (int)$img->getAttribute('height'); $width = (int)$img->getAttribute('width');
$height = (int)$img->getAttribute('height');
if($image){
if($width && $height && ($width != $image->getWidth() || $height != $image->getHeight())) { if($width && $height && ($width != $image->getWidth() || $height != $image->getHeight())) {
//Make sure that the resized image actually returns an image: //Make sure that the resized image actually returns an image:
$resized=$image->ResizedImage($width, $height); $resized=$image->ResizedImage($width, $height);
if($resized) $img->setAttribute('src', $resized->getRelativePath()); if($resized) $img->setAttribute('src', $resized->getRelativePath());
} }
} }
// Add default empty title & alt attributes. // Add default empty title & alt attributes.
if(!$img->getAttribute('alt')) $img->setAttribute('alt', ''); if(!$img->getAttribute('alt')) $img->setAttribute('alt', '');
if(!$img->getAttribute('title')) $img->setAttribute('title', ''); if(!$img->getAttribute('title')) $img->setAttribute('title', '');
//If the src attribute is not set, then we won't add this to the list:
if($img->getAttribute('src')){
// Add to the tracked files.
$linkedFiles[] = $image->ID;
}
} }
// Save file & link tracking data.
if(class_exists('SiteTree')) {
if($record->ID && $record->many_many('LinkTracking') && $tracker = $record->LinkTracking()) {
$tracker->removeByFilter(sprintf('"FieldName" = \'%s\' AND "SiteTreeID" = %d',
$this->name, $record->ID));
if($linkedPages) foreach($linkedPages as $item) { // Store into record
$SQL_fieldName = Convert::raw2sql($this->name);
DB::query("INSERT INTO \"SiteTree_LinkTracking\" (\"SiteTreeID\",\"ChildID\", \"FieldName\")
VALUES ($record->ID, $item, '$SQL_fieldName')");
}
}
if($record->ID && $record->many_many('ImageTracking') && $tracker = $record->ImageTracking()) {
$tracker->where(
sprintf('"FieldName" = \'%s\' AND "SiteTreeID" = %d', $this->name, $record->ID)
)->removeAll();
$fieldName = $this->name;
if($linkedFiles) foreach($linkedFiles as $item) {
$tracker->add($item, array('FieldName' => $this->name));
}
}
}
$record->{$this->name} = $htmlValue->getContent(); $record->{$this->name} = $htmlValue->getContent();
} }

6
forms/gridfield/GridFieldFilterHeader.php Normal file → Executable file
View File

@ -67,8 +67,8 @@ class GridFieldFilterHeader implements GridField_HTMLProvider, GridField_DataMan
$state = $gridField->State->GridFieldFilterHeader; $state = $gridField->State->GridFieldFilterHeader;
if($actionName === 'filter') { if($actionName === 'filter') {
if(isset($data['filter'])){ if(isset($data['filter'][$gridField->getName()])){
foreach($data['filter'] as $key => $filter ){ foreach($data['filter'][$gridField->getName()] as $key => $filter ){
$state->Columns->$key = $filter; $state->Columns->$key = $filter;
} }
} }
@ -121,7 +121,7 @@ class GridFieldFilterHeader implements GridField_HTMLProvider, GridField_DataMan
if(isset($filterArguments[$columnField])) { if(isset($filterArguments[$columnField])) {
$value = $filterArguments[$columnField]; $value = $filterArguments[$columnField];
} }
$field = new TextField('filter['.$columnField.']', '', $value); $field = new TextField('filter[' . $gridField->getName() . '][' . $columnField . ']', '', $value);
$field->addExtraClass('ss-gridfield-sort'); $field->addExtraClass('ss-gridfield-sort');
$field->addExtraClass('no-change-track'); $field->addExtraClass('no-change-track');

View File

@ -834,7 +834,7 @@ class i18n extends Object implements TemplateGlobalProvider {
'native' => 'македонски' 'native' => 'македонски'
), ),
'mi' => array( 'mi' => array(
'name' => 'Maori', 'name' => 'Māori',
'native' => 'Māori' 'native' => 'Māori'
), ),
'ms' => array( 'ms' => array(
@ -1183,7 +1183,7 @@ class i18n extends Object implements TemplateGlobalProvider {
'native' => 'македонски' 'native' => 'македонски'
), ),
'mi_NZ' => array( 'mi_NZ' => array(
'name' => 'Maori', 'name' => 'Māori',
'native' => 'Māori' 'native' => 'Māori'
), ),
'ms_MY' => array( 'ms_MY' => array(

View File

@ -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. framework/lang/en_US.php. * e.g. framework/lang/en.yml.
* *
* 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.
@ -117,12 +117,15 @@ class i18nTextCollector extends Object {
$modules = array_merge($modules, $themeFolders); $modules = array_merge($modules, $themeFolders);
foreach($modules as $module) { foreach($modules as $module) {
// Only search for calls in folder with a _config.php file (which means they are modules, including // Only search for calls in folder with a _config.php file or _config folder
// themes folder) // (which means they are modules, including themes folder)
$isValidModuleFolder = ( $isValidModuleFolder = (
is_dir("$this->basePath/$module") is_dir("$this->basePath/$module")
&& is_file("$this->basePath/$module/_config.php")
&& substr($module,0,1) != '.' && substr($module,0,1) != '.'
&& (
is_file("$this->basePath/$module/_config.php")
|| is_dir("$this->basePath/$module/_config")
)
) || ( ) || (
substr($module,0,7) == 'themes/' substr($module,0,7) == 'themes/'
&& is_dir("$this->basePath/$module") && is_dir("$this->basePath/$module")

View File

@ -1,4 +1,33 @@
hi: hi:
AssetUploadField:
ChooseFiles: 'फाइलें चुनें'
EDITALL: 'सभी संपादित करें'
EDITANDORGANIZE: 'संपादित और व्यवस्थित करें '
EDITINFO: 'फ़ाइलों को संपादित करें'
FILES: फ़ाइलें
FROMCOMPUTER: 'अपने कंप्यूटर से फाइल चुनें'
FROMCOMPUTERINFO: 'अपने कंप्यूटर से अपलोड करे '
TOTAL: 'कुल '
TOUPLOAD: 'अपलोड करने के लिए फ़ाइलों को चुनें'
UPLOADINPROGRESS: 'कृपया प्रतीक्षा करें ... अपलोड प्रगति में है'
UPLOADOR: या
BBCodeParser:
ALIGNEMENT: सीध
ALIGNEMENTEXAMPLE: 'दाहिनी सीध'
BOLD: 'बोल्ड अक्षर '
BOLDEXAMPLE: बोल्ड
CODE: 'कोड खंड'
CODEDESCRIPTION: 'असंरूपित कोड खंड'
CODEEXAMPLE: 'कोड खंड'
COLORED: 'रंगीन अक्षर'
COLOREDEXAMPLE: 'नीले अक्षर'
EMAILLINK: 'ईमेल लिंक'
EMAILLINKDESCRIPTION: 'एक ईमेल पते के लिए लिंक बनाएं'
IMAGE: छवि
IMAGEDESCRIPTION: 'अपने पोस्ट में एक छवि दिखाइये '
ITALIC: 'तिरछे अक्षर'
ITALICEXAMPLE: तिरछे अक्षर
LINK: 'वेबसाइट लिंक'
Group: Group:
RolesAddEditLink: 'भूमिकाओं का प्रबंधन करे ' RolesAddEditLink: 'भूमिकाओं का प्रबंधन करे '
has_many_Permissions: अनुमतियाँ has_many_Permissions: अनुमतियाँ

View File

@ -155,7 +155,7 @@ class MySQLDatabase extends SS_Database {
} }
public function createDatabase() { public function createDatabase() {
$this->query("CREATE DATABASE \"$this->database\""); $this->query("CREATE DATABASE \"$this->database\" DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci");
$this->query("USE \"$this->database\""); $this->query("USE \"$this->database\"");
$this->tableList = $this->fieldList = $this->indexList = null; $this->tableList = $this->fieldList = $this->indexList = null;

View File

@ -1,4 +1,4 @@
<$Tag class="field CompositeField $extraClass <% if ColumnCount %>multicolumn<% end_if %>"> <$Tag class="CompositeField $extraClass <% if ColumnCount %>multicolumn<% end_if %>">
<% if $Tag == 'fieldset' && $Legend %> <% if $Tag == 'fieldset' && $Legend %>
<legend>$Legend</legend> <legend>$Legend</legend>
<% end_if %> <% end_if %>

View File

@ -1,11 +1,5 @@
<div class="fieldholder-small"> <div class="fieldholder-small">
<% if $RightTitle %> <% if $Title %><label class="fieldholder-small-label" <% if $ID %>for="$ID"<% end_if %>>$Title</label><% end_if %>
<label class="right fieldholder-small-label" <% if $ID %>for="$ID"<% end_if %>>$RightTitle</label>
<% else_if $LeftTitle %>
<label class="left fieldholder-small-label" <% if $ID %>for="$ID"<% end_if %>>$LeftTitle</label>
<% else_if $Title %>
<label class="fieldholder-small-label" <% if $ID %>for="$ID"<% end_if %>>$Title</label>
<% end_if %>
$Field $Field
</div> <% if $RightTitle %><label class="right fieldholder-small-label" <% if $ID %>for="$ID"<% end_if %>>$RightTitle</label><% end_if %>
</div>

View File

@ -0,0 +1,9 @@
<div id="$Name" class="field<% if $extraClass %> $extraClass<% end_if %>">
<% if $Title %><label class="left">$Title</label><% end_if %>
<div class="middleColumn">
$Field
</div>
<% if $RightTitle %><label class="right">$RightTitle</label><% end_if %>
<% if $Message %><span class="message $MessageType">$Message</span><% end_if %>
<% if $Description %><span class="description">$Description</span><% end_if %>
</div>

View File

@ -43,7 +43,7 @@ Feature: Manage files
Scenario: I can delete a file Scenario: I can delete a file
Given I click on "folder1" in the "Files" table Given I click on "folder1" in the "Files" table
And I click on "file1" in the "folder1" table And I click on "file1" in the "folder1" table
And I press the "Delete" button And I press the "Delete" button, confirming the dialog
Then the "folder1" table should not contain "file1" Then the "folder1" table should not contain "file1"
Scenario: I can change the folder of a file Scenario: I can change the folder of a file

View File

@ -51,6 +51,6 @@ Feature: Manage users
Scenario: I can delete an existing user Scenario: I can delete an existing user
When I click the "Users" CMS tab When I click the "Users" CMS tab
And I click "staffmember@test.com" in the "#Root_Users" element And I click "staffmember@test.com" in the "#Root_Users" element
And I press the "Delete" button And I press the "Delete" button, confirming the dialog
Then I should see "admin@test.com" Then I should see "admin@test.com"
And I should not see "staffmember@test.com" And I should not see "staffmember@test.com"

View File

@ -109,7 +109,7 @@ class Zend_Locale_Data_Translation
'Malayalam' => 'ml', 'Malayalam' => 'ml',
'Maltese' => 'mt', 'Maltese' => 'mt',
'Manipuri' => 'mni', 'Manipuri' => 'mni',
'Maori' => 'mi', 'Māori' => 'mi',
'Marathi' => 'mr', 'Marathi' => 'mr',
'Mongolian' => 'mn', 'Mongolian' => 'mn',
'Nepali' => 'ne', 'Nepali' => 'ne',