diff --git a/admin/css/screen.css b/admin/css/screen.css index e598a33a2..d89460116 100644 --- a/admin/css/screen.css +++ b/admin/css/screen.css @@ -231,7 +231,10 @@ form.small .field input.text, form.small .field textarea, form.small .field sele /** ---------------------------------------------------- Grouped form fields ---------------------------------------------------- */ .fieldgroup .fieldgroup-field { float: left; display: block; padding: 8px 8px 0 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; } .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 .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.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-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; } diff --git a/admin/scss/_forms.scss b/admin/scss/_forms.scss index 95487c318..1c479ef20 100644 --- a/admin/scss/_forms.scss +++ b/admin/scss/_forms.scss @@ -505,7 +505,22 @@ form.small .field, .field.small { 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 { + padding: $grid-y $grid-x $grid-y 0; margin-left: 0; margin-right: 1em; width: auto; diff --git a/admin/scss/_tree.scss b/admin/scss/_tree.scss index ad2749277..19990a997 100644 --- a/admin/scss/_tree.scss +++ b/admin/scss/_tree.scss @@ -337,6 +337,25 @@ background: #FFF; border: 1px solid silver; @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{ &.vakata-separator { diff --git a/docs/en/howto/customize-cms-tree.md b/docs/en/howto/customize-cms-tree.md index 01d26af0a..4651a59b6 100644 --- a/docs/en/howto/customize-cms-tree.md +++ b/docs/en/howto/customize-cms-tree.md @@ -4,7 +4,7 @@ The CMS tree for viewing hierarchical structures (mostly pages) is powered 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). The tree is rendered through `[api:LeftAndMain->getSiteTreeFor()]`, diff --git a/docs/en/reference/cms-architecture.md b/docs/en/reference/cms-architecture.md index d9fb6417a..4697cd5fd 100644 --- a/docs/en/reference/cms-architecture.md +++ b/docs/en/reference/cms-architecture.md @@ -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 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). For more information, see the [Howto: Customize the CMS tree](../howto/customize-cms-tree). diff --git a/forms/HtmlEditorField.php b/forms/HtmlEditorField.php index bc8f88173..c9bb3604a 100644 --- a/forms/HtmlEditorField.php +++ b/forms/HtmlEditorField.php @@ -113,108 +113,37 @@ class HtmlEditorField extends TextareaField { ); } - $linkedPages = array(); - $linkedFiles = array(); - $htmlValue = Injector::inst()->create('HTMLValue', $this->value); + // Sanitise if requested if($this->config()->sanitise_server_side) { $santiser = Injector::inst()->create('HtmlEditorSanitiser', HtmlEditorConfig::get_active()); $santiser->sanitise($htmlValue); } - if(class_exists('SiteTree')) { - // 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. + // Resample images and add default attributes if($images = $htmlValue->getElementsByTagName('img')) foreach($images as $img) { // strip any ?r=n data from the src attribute $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. - $width = (int)$img->getAttribute('width'); - $height = (int)$img->getAttribute('height'); - - if($image){ + if($image = File::find(urldecode(Director::makeRelative($img->getAttribute('src'))))){ + $width = (int)$img->getAttribute('width'); + $height = (int)$img->getAttribute('height'); + if($width && $height && ($width != $image->getWidth() || $height != $image->getHeight())) { //Make sure that the resized image actually returns an image: $resized=$image->ResizedImage($width, $height); if($resized) $img->setAttribute('src', $resized->getRelativePath()); } } - + // Add default empty title & alt attributes. if(!$img->getAttribute('alt')) $img->setAttribute('alt', ''); 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) { - $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)); - } - } - } - + // Store into record $record->{$this->name} = $htmlValue->getContent(); } diff --git a/forms/gridfield/GridFieldFilterHeader.php b/forms/gridfield/GridFieldFilterHeader.php old mode 100644 new mode 100755 index c79aea580..e566ced38 --- a/forms/gridfield/GridFieldFilterHeader.php +++ b/forms/gridfield/GridFieldFilterHeader.php @@ -67,8 +67,8 @@ class GridFieldFilterHeader implements GridField_HTMLProvider, GridField_DataMan $state = $gridField->State->GridFieldFilterHeader; if($actionName === 'filter') { - if(isset($data['filter'])){ - foreach($data['filter'] as $key => $filter ){ + if(isset($data['filter'][$gridField->getName()])){ + foreach($data['filter'][$gridField->getName()] as $key => $filter ){ $state->Columns->$key = $filter; } } @@ -121,7 +121,7 @@ class GridFieldFilterHeader implements GridField_HTMLProvider, GridField_DataMan if(isset($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('no-change-track'); diff --git a/i18n/i18n.php b/i18n/i18n.php index 5dda41eb0..2000b344e 100644 --- a/i18n/i18n.php +++ b/i18n/i18n.php @@ -834,7 +834,7 @@ class i18n extends Object implements TemplateGlobalProvider { 'native' => 'македонски' ), 'mi' => array( - 'name' => 'Maori', + 'name' => 'Māori', 'native' => 'Māori' ), 'ms' => array( @@ -1183,7 +1183,7 @@ class i18n extends Object implements TemplateGlobalProvider { 'native' => 'македонски' ), 'mi_NZ' => array( - 'name' => 'Maori', + 'name' => 'Māori', 'native' => 'Māori' ), 'ms_MY' => array( diff --git a/i18n/i18nTextCollector.php b/i18n/i18nTextCollector.php index 313f49fcf..8741bbd2c 100644 --- a/i18n/i18nTextCollector.php +++ b/i18n/i18nTextCollector.php @@ -8,7 +8,7 @@ * * 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, - * e.g. framework/lang/en_US.php. + * e.g. framework/lang/en.yml. * * The collector needs to be run whenever you make new translatable * 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); foreach($modules as $module) { - // Only search for calls in folder with a _config.php file (which means they are modules, including - // themes folder) + // Only search for calls in folder with a _config.php file or _config folder + // (which means they are modules, including themes folder) $isValidModuleFolder = ( is_dir("$this->basePath/$module") - && is_file("$this->basePath/$module/_config.php") && substr($module,0,1) != '.' + && ( + is_file("$this->basePath/$module/_config.php") + || is_dir("$this->basePath/$module/_config") + ) ) || ( substr($module,0,7) == 'themes/' && is_dir("$this->basePath/$module") diff --git a/lang/hi.yml b/lang/hi.yml index bb55be880..f194fd4b4 100644 --- a/lang/hi.yml +++ b/lang/hi.yml @@ -1,4 +1,33 @@ 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: RolesAddEditLink: 'भूमिकाओं का प्रबंधन करे ' has_many_Permissions: अनुमतियाँ diff --git a/model/MySQLDatabase.php b/model/MySQLDatabase.php index 7ec6d5bb7..3ed99ec72 100644 --- a/model/MySQLDatabase.php +++ b/model/MySQLDatabase.php @@ -155,7 +155,7 @@ class MySQLDatabase extends SS_Database { } 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->tableList = $this->fieldList = $this->indexList = null; diff --git a/templates/forms/CompositeField_holder_small.ss b/templates/forms/CompositeField_holder_small.ss index 9f5e38629..43e4c4586 100644 --- a/templates/forms/CompositeField_holder_small.ss +++ b/templates/forms/CompositeField_holder_small.ss @@ -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 %> $Legend <% end_if %> diff --git a/templates/forms/FormField_holder_small.ss b/templates/forms/FormField_holder_small.ss index 101a190c5..25644a0c4 100644 --- a/templates/forms/FormField_holder_small.ss +++ b/templates/forms/FormField_holder_small.ss @@ -1,11 +1,5 @@
- <% if $RightTitle %> - - <% else_if $LeftTitle %> - - <% else_if $Title %> - - <% end_if %> - + <% if $Title %><% end_if %> $Field -
+ <% if $RightTitle %><% end_if %> + \ No newline at end of file diff --git a/templates/forms/OptionsetField_holder.ss b/templates/forms/OptionsetField_holder.ss new file mode 100644 index 000000000..685fce6b3 --- /dev/null +++ b/templates/forms/OptionsetField_holder.ss @@ -0,0 +1,9 @@ +
+ <% if $Title %><% end_if %> +
+ $Field +
+ <% if $RightTitle %><% end_if %> + <% if $Message %>$Message<% end_if %> + <% if $Description %>$Description<% end_if %> +
diff --git a/tests/behat/features/manage-files.feature b/tests/behat/features/manage-files.feature index c56938475..4a4675e04 100644 --- a/tests/behat/features/manage-files.feature +++ b/tests/behat/features/manage-files.feature @@ -43,7 +43,7 @@ Feature: Manage files Scenario: I can delete a file Given I click on "folder1" in the "Files" 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" Scenario: I can change the folder of a file diff --git a/tests/behat/features/manage-users.feature b/tests/behat/features/manage-users.feature index 7b4a7e2d7..99d608d3f 100644 --- a/tests/behat/features/manage-users.feature +++ b/tests/behat/features/manage-users.feature @@ -51,6 +51,6 @@ Feature: Manage users Scenario: I can delete an existing user When I click the "Users" CMS tab 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" And I should not see "staffmember@test.com" \ No newline at end of file diff --git a/thirdparty/Zend/Locale/Data/Translation.php b/thirdparty/Zend/Locale/Data/Translation.php index 916abff3f..0db97088d 100644 --- a/thirdparty/Zend/Locale/Data/Translation.php +++ b/thirdparty/Zend/Locale/Data/Translation.php @@ -109,7 +109,7 @@ class Zend_Locale_Data_Translation 'Malayalam' => 'ml', 'Maltese' => 'mt', 'Manipuri' => 'mni', - 'Maori' => 'mi', + 'Māori' => 'mi', 'Marathi' => 'mr', 'Mongolian' => 'mn', 'Nepali' => 'ne',