mirror of
https://github.com/silverstripe/silverstripe-widgets
synced 2024-10-22 17:05:54 +02:00
Merge pull request #162 from creative-commoners/pulls/2.0/update-to-ss4
Check module for SS4 compatibility
This commit is contained in:
commit
a0b1f9b1cf
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -4,3 +4,4 @@
|
|||||||
/.gitignore export-ignore
|
/.gitignore export-ignore
|
||||||
/.travis.yml export-ignore
|
/.travis.yml export-ignore
|
||||||
/.scrutinizer.yml export-ignore
|
/.scrutinizer.yml export-ignore
|
||||||
|
/codecov.yml export-ignore
|
||||||
|
@ -2,7 +2,7 @@ language: php
|
|||||||
|
|
||||||
env:
|
env:
|
||||||
global:
|
global:
|
||||||
- COMPOSER_ROOT_VERSION="4.0.x-dev"
|
- COMPOSER_ROOT_VERSION="2.x-dev"
|
||||||
|
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
|
@ -1,10 +1,8 @@
|
|||||||
# Widgets Module
|
# Widgets Module
|
||||||
|
|
||||||
[![Build Status](http://img.shields.io/travis/silverstripe/silverstripe-widgets.svg?style=flat-square)](https://travis-ci.org/silverstripe/silverstripe-widgets)
|
[![Build Status](http://img.shields.io/travis/silverstripe/silverstripe-widgets.svg)](https://travis-ci.org/silverstripe/silverstripe-widgets)
|
||||||
[![Code Quality](http://img.shields.io/scrutinizer/g/silverstripe/silverstripe-widgets.svg?style=flat-square)](https://scrutinizer-ci.com/g/silverstripe/silverstripe-widgets)
|
[![Code Quality](http://img.shields.io/scrutinizer/g/silverstripe/silverstripe-widgets.svg)](https://scrutinizer-ci.com/g/silverstripe/silverstripe-widgets)
|
||||||
[![Code Coverage](https://codecov.io/gh/silverstripe/silverstripe-widgets/branch/master/graph/badge.svg)](https://codecov.io/gh/silverstripe/silverstripe-widgets)
|
[![Code Coverage](https://img.shields.io/codecov/c/github/silverstripe/silverstripe-widgets.svg)](https://codecov.io/gh/silverstripe/silverstripe-widgets)
|
||||||
[![Version](http://img.shields.io/packagist/v/silverstripe/widgets.svg?style=flat-square)](https://packagist.org/packages/silverstripe/widgets)
|
|
||||||
[![License](http://img.shields.io/packagist/l/silverstripe/widgets.svg?style=flat-square)](LICENSE.md)
|
|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
@ -15,6 +13,7 @@ the sidebar of your website.
|
|||||||
|
|
||||||
* SilverStripe 4.0
|
* SilverStripe 4.0
|
||||||
|
|
||||||
|
**Note:** this version is compatible with SilverStripe 4. For SilverStripe 3, please see [the 1.x release line](https://github.com/silverstripe/silverstripe-widgets/tree/1.3).
|
||||||
|
|
||||||
### Installation
|
### Installation
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "silverstripe/widgets",
|
"name": "silverstripe/widgets",
|
||||||
"description": "Widgets are small pieces of functionality such as showing the latest Comments or Flickr Photos. They normally display on the sidebar of your website.",
|
"description": "Widgets are small pieces of functionality such as showing the latest Comments or Flickr Photos. They normally display on the sidebar of your website.",
|
||||||
"type": "silverstripe-module",
|
"type": "silverstripe-vendormodule",
|
||||||
"keywords": ["silverstripe", "widgets", "blog"],
|
"keywords": ["silverstripe", "widgets", "blog"],
|
||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
ar:
|
ar:
|
||||||
Widget:
|
SilverStripe\Widgets\Model\Widget:
|
||||||
PLURALNAME: 'تطبيقات مصغرة'
|
PLURALNAME: 'تطبيقات مصغرة'
|
||||||
SINGULARNAME: 'تطبيق مصغر'
|
SINGULARNAME: 'تطبيق مصغر'
|
||||||
WidgetArea:
|
SilverStripe\Widgets\Model\WidgetArea:
|
||||||
PLURALNAME: 'مساحات التطبيقات المصغرة'
|
PLURALNAME: 'مساحات التطبيقات المصغرة'
|
||||||
SINGULARNAME: 'مساحة التطبيقات المصغرة'
|
SINGULARNAME: 'مساحة التطبيقات المصغرة'
|
||||||
WidgetAreaEditor_ss:
|
SilverStripe\Widgets\Forms\WidgetAreaEditor_ss:
|
||||||
AVAILABLE: 'التطبيقات المصغرة المتاحة'
|
AVAILABLE: 'التطبيقات المصغرة المتاحة'
|
||||||
AVAILWIDGETS: 'اضغط على عنوان تطبيق مصغر بالأسفل لاستخدامه بهذه الصفحة.'
|
AVAILWIDGETS: 'اضغط على عنوان تطبيق مصغر بالأسفل لاستخدامه بهذه الصفحة.'
|
||||||
INUSE: 'التطبيقات المصغرة المستخدمة حاليا'
|
INUSE: 'التطبيقات المصغرة المستخدمة حاليا'
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
de:
|
de:
|
||||||
Widget:
|
SilverStripe\Widgets\Model\Widget:
|
||||||
PLURALNAME: Widgets
|
PLURALNAME: Widgets
|
||||||
SINGULARNAME: Widget
|
SINGULARNAME: Widget
|
||||||
WidgetArea:
|
SilverStripe\Widgets\Model\WidgetArea:
|
||||||
PLURALNAME: Widgetbereiche
|
PLURALNAME: Widgetbereiche
|
||||||
SINGULARNAME: Widgetbereich
|
SINGULARNAME: Widgetbereich
|
||||||
WidgetAreaEditor_ss:
|
SilverStripe\Widgets\Forms\WidgetAreaEditor_ss:
|
||||||
AVAILABLE: 'Vorhandene Widgets'
|
AVAILABLE: 'Vorhandene Widgets'
|
||||||
AVAILWIDGETS: 'Klicke den Widget Titel, um es zu benutzen.'
|
AVAILWIDGETS: 'Klicke den Widget Titel, um es zu benutzen.'
|
||||||
INUSE: 'Benutzte Widgets'
|
INUSE: 'Benutzte Widgets'
|
||||||
|
24
lang/en.yml
24
lang/en.yml
@ -1,19 +1,25 @@
|
|||||||
en:
|
en:
|
||||||
Widget:
|
SilverStripe\Widgets\Extensions\WidgetPageExtension:
|
||||||
PLURALNAME: Widgets
|
INHERITSIDEBAR: 'Inherit Sidebar From Parent'
|
||||||
SINGULARNAME: Widget
|
SilverStripe\Widgets\Forms\WidgetAreaEditor_ss:
|
||||||
WidgetArea:
|
|
||||||
PLURALNAME: 'Widget Areas'
|
|
||||||
SINGULARNAME: 'Widget Area'
|
|
||||||
WidgetAreaEditor_ss:
|
|
||||||
AVAILABLE: 'Available Widgets'
|
AVAILABLE: 'Available Widgets'
|
||||||
AVAILWIDGETS: 'Click a widget title below to use it on this page.'
|
AVAILWIDGETS: 'Click a widget title below to use it on this page.'
|
||||||
INUSE: 'Widgets currently used'
|
INUSE: 'Widgets currently used'
|
||||||
NOAVAIL: 'There are currently no widgets available.'
|
NOAVAIL: 'There are currently no widgets available.'
|
||||||
TOSORT: 'To sort currently used widgets on this page, drag them up and down.'
|
TOSORT: 'To sort currently used widgets on this page, drag them up and down.'
|
||||||
|
SilverStripe\Widgets\Model\Widget:
|
||||||
|
PLURALNAME: Widgets
|
||||||
|
PLURALS:
|
||||||
|
one: 'A Widget'
|
||||||
|
other: '{count} Widgets'
|
||||||
|
SINGULARNAME: Widget
|
||||||
|
SilverStripe\Widgets\Model\WidgetArea:
|
||||||
|
PLURALNAME: 'Widget Areas'
|
||||||
|
PLURALS:
|
||||||
|
one: 'A Widget Area'
|
||||||
|
other: '{count} Widget Areas'
|
||||||
|
SINGULARNAME: 'Widget Area'
|
||||||
WidgetDescription_ss:
|
WidgetDescription_ss:
|
||||||
CLICKTOADDWIDGET: 'Click to add this widget'
|
CLICKTOADDWIDGET: 'Click to add this widget'
|
||||||
WidgetEditor_ss:
|
WidgetEditor_ss:
|
||||||
DELETE: Delete
|
DELETE: Delete
|
||||||
WidgetPageExtension:
|
|
||||||
INHERITSIDEBAR: 'Inherit Sidebar From Parent'
|
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
eo:
|
eo:
|
||||||
Widget:
|
SilverStripe\Widgets\Model\Widget:
|
||||||
PLURALNAME: Fenestraĵoj
|
PLURALNAME: Fenestraĵoj
|
||||||
SINGULARNAME: Fenestraĵo
|
SINGULARNAME: Fenestraĵo
|
||||||
WidgetArea:
|
SilverStripe\Widgets\Model\WidgetArea:
|
||||||
PLURALNAME: 'Fenestraĵaj zonoj'
|
PLURALNAME: 'Fenestraĵaj zonoj'
|
||||||
SINGULARNAME: 'Fenestraĵa zono'
|
SINGULARNAME: 'Fenestraĵa zono'
|
||||||
WidgetAreaEditor_ss:
|
SilverStripe\Widgets\Forms\WidgetAreaEditor_ss:
|
||||||
AVAILABLE: 'Disponeblaj fenestraĵoj'
|
AVAILABLE: 'Disponeblaj fenestraĵoj'
|
||||||
AVAILWIDGETS: 'Alklaku sube titolon de fenestraĵo por uzi ĝin en ĉi tiu paĝo.'
|
AVAILWIDGETS: 'Alklaku sube titolon de fenestraĵo por uzi ĝin en ĉi tiu paĝo.'
|
||||||
INUSE: 'Fenestraĵoj aktuale uzataj'
|
INUSE: 'Fenestraĵoj aktuale uzataj'
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
fa_IR:
|
fa_IR:
|
||||||
Widget:
|
SilverStripe\Widgets\Model\Widget:
|
||||||
PLURALNAME: 'ویجت ها'
|
PLURALNAME: 'ویجت ها'
|
||||||
SINGULARNAME: ویجت
|
SINGULARNAME: ویجت
|
||||||
WidgetArea:
|
SilverStripe\Widgets\Model\WidgetArea:
|
||||||
PLURALNAME: 'محیط ویجت ها'
|
PLURALNAME: 'محیط ویجت ها'
|
||||||
SINGULARNAME: 'محیط ویجت'
|
SINGULARNAME: 'محیط ویجت'
|
||||||
WidgetAreaEditor_ss:
|
SilverStripe\Widgets\Forms\WidgetAreaEditor_ss:
|
||||||
AVAILABLE: 'ویجت های موجود'
|
AVAILABLE: 'ویجت های موجود'
|
||||||
AVAILWIDGETS: 'بر روی عنوان یک ویجت در پایین کلیک کنید تا آن را در این صفحه بکار بگیرید.'
|
AVAILWIDGETS: 'بر روی عنوان یک ویجت در پایین کلیک کنید تا آن را در این صفحه بکار بگیرید.'
|
||||||
INUSE: 'ویجت هایی که در حال حاضر استفاده می شوند'
|
INUSE: 'ویجت هایی که در حال حاضر استفاده می شوند'
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
fi:
|
fi:
|
||||||
Widget:
|
SilverStripe\Widgets\Model\Widget:
|
||||||
PLURALNAME: Vimpaimet
|
PLURALNAME: Vimpaimet
|
||||||
SINGULARNAME: Vimpain
|
SINGULARNAME: Vimpain
|
||||||
WidgetArea:
|
SilverStripe\Widgets\Model\WidgetArea:
|
||||||
PLURALNAME: 'Vimpain alueet'
|
PLURALNAME: 'Vimpain alueet'
|
||||||
SINGULARNAME: 'Vimpain alue'
|
SINGULARNAME: 'Vimpain alue'
|
||||||
WidgetAreaEditor_ss:
|
SilverStripe\Widgets\Forms\WidgetAreaEditor_ss:
|
||||||
AVAILABLE: 'Käytettävissä olevat vimpaimet'
|
AVAILABLE: 'Käytettävissä olevat vimpaimet'
|
||||||
AVAILWIDGETS: 'Napsauta vimpaimen otsikkoa alla ottaaksesi se käyttöön tällä sivulla.'
|
AVAILWIDGETS: 'Napsauta vimpaimen otsikkoa alla ottaaksesi se käyttöön tällä sivulla.'
|
||||||
INUSE: 'Käytössä olevat vimpaimet'
|
INUSE: 'Käytössä olevat vimpaimet'
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
hr:
|
hr:
|
||||||
Widget:
|
SilverStripe\Widgets\Model\Widget:
|
||||||
PLURALNAME: Widgeti
|
PLURALNAME: Widgeti
|
||||||
SINGULARNAME: Widget
|
SINGULARNAME: Widget
|
||||||
WidgetArea:
|
SilverStripe\Widgets\Model\WidgetArea:
|
||||||
PLURALNAME: 'Zone widgeta'
|
PLURALNAME: 'Zone widgeta'
|
||||||
SINGULARNAME: 'Zona widgeta'
|
SINGULARNAME: 'Zona widgeta'
|
||||||
WidgetAreaEditor_ss:
|
SilverStripe\Widgets\Forms\WidgetAreaEditor_ss:
|
||||||
AVAILABLE: 'Dostupni widgeti'
|
AVAILABLE: 'Dostupni widgeti'
|
||||||
AVAILWIDGETS: 'Kliknite na naziv widgeta ispod za korištenje na ovoj stranici'
|
AVAILWIDGETS: 'Kliknite na naziv widgeta ispod za korištenje na ovoj stranici'
|
||||||
INUSE: 'Trenutno korišteni widgeti'
|
INUSE: 'Trenutno korišteni widgeti'
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
it_IT:
|
it_IT:
|
||||||
Widget:
|
SilverStripe\Widgets\Model\Widget:
|
||||||
PLURALNAME: Widgets
|
PLURALNAME: Widgets
|
||||||
SINGULARNAME: Widget
|
SINGULARNAME: Widget
|
||||||
WidgetArea:
|
SilverStripe\Widgets\Model\WidgetArea:
|
||||||
PLURALNAME: 'Aree Widget'
|
PLURALNAME: 'Aree Widget'
|
||||||
SINGULARNAME: 'Area Widget'
|
SINGULARNAME: 'Area Widget'
|
||||||
WidgetAreaEditor_ss:
|
SilverStripe\Widgets\Forms\WidgetAreaEditor_ss:
|
||||||
AVAILABLE: 'Widgets disponibili'
|
AVAILABLE: 'Widgets disponibili'
|
||||||
AVAILWIDGETS: 'Clicca sul titolo di un widget qui sotto per usarlo in questa pagina'
|
AVAILWIDGETS: 'Clicca sul titolo di un widget qui sotto per usarlo in questa pagina'
|
||||||
INUSE: 'Widgets attualmente utilizzati'
|
INUSE: 'Widgets attualmente utilizzati'
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
nl:
|
nl:
|
||||||
WidgetAreaEditor_ss:
|
SilverStripe\Widgets\Forms\WidgetAreaEditor_ss:
|
||||||
AVAILABLE: 'Beschikbare Widgets'
|
AVAILABLE: 'Beschikbare Widgets'
|
||||||
AVAILWIDGETS: 'Klik op een widget titel hieronder, om de widget te gebruiken op deze pagina.'
|
AVAILWIDGETS: 'Klik op een widget titel hieronder, om de widget te gebruiken op deze pagina.'
|
||||||
INUSE: 'Huidige gebruikte Widgets'
|
INUSE: 'Huidige gebruikte Widgets'
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
pl_PL:
|
pl_PL:
|
||||||
WidgetAreaEditor_ss:
|
SilverStripe\Widgets\Forms\WidgetAreaEditor_ss:
|
||||||
AVAILABLE: 'Dostępne widżety'
|
AVAILABLE: 'Dostępne widżety'
|
||||||
AVAILWIDGETS: 'Kliknij w tytuł widżetu, aby używać go na tej stronie.'
|
AVAILWIDGETS: 'Kliknij w tytuł widżetu, aby używać go na tej stronie.'
|
||||||
INUSE: 'Obecnie stosowane widżety'
|
INUSE: 'Obecnie stosowane widżety'
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
ro_RO:
|
ro_RO:
|
||||||
WidgetAreaEditor_ss:
|
SilverStripe\Widgets\Forms\WidgetAreaEditor_ss:
|
||||||
AVAILABLE: 'Widget-uri disponibile'
|
AVAILABLE: 'Widget-uri disponibile'
|
||||||
AVAILWIDGETS: 'Faceți clic pe un titlu widget de mai jos pentru a-l folosi pe aceasta pagina.'
|
AVAILWIDGETS: 'Faceți clic pe un titlu widget de mai jos pentru a-l folosi pe aceasta pagina.'
|
||||||
INUSE: 'Widget-uri utilizate în prezent'
|
INUSE: 'Widget-uri utilizate în prezent'
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
ru:
|
ru:
|
||||||
Widget:
|
SilverStripe\Widgets\Model\Widget:
|
||||||
PLURALNAME: Виджеты
|
PLURALNAME: Виджеты
|
||||||
SINGULARNAME: Виджет
|
SINGULARNAME: Виджет
|
||||||
WidgetArea:
|
SilverStripe\Widgets\Model\WidgetArea:
|
||||||
PLURALNAME: 'Области виджетов'
|
PLURALNAME: 'Области виджетов'
|
||||||
SINGULARNAME: 'Область виджета'
|
SINGULARNAME: 'Область виджета'
|
||||||
WidgetAreaEditor_ss:
|
SilverStripe\Widgets\Forms\WidgetAreaEditor_ss:
|
||||||
AVAILABLE: 'Доступные виджеты'
|
AVAILABLE: 'Доступные виджеты'
|
||||||
AVAILWIDGETS: 'Щелкните заголовок виджета ниже, чтобы использовать его на этой странице.'
|
AVAILWIDGETS: 'Щелкните заголовок виджета ниже, чтобы использовать его на этой странице.'
|
||||||
INUSE: 'Используемые виджеты'
|
INUSE: 'Используемые виджеты'
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
sk:
|
sk:
|
||||||
Widget:
|
SilverStripe\Widgets\Model\Widget:
|
||||||
PLURALNAME: Widgety
|
PLURALNAME: Widgety
|
||||||
SINGULARNAME: Widget
|
SINGULARNAME: Widget
|
||||||
WidgetArea:
|
SilverStripe\Widgets\Model\WidgetArea:
|
||||||
PLURALNAME: 'Oblasti widgetu'
|
PLURALNAME: 'Oblasti widgetu'
|
||||||
SINGULARNAME: 'Oblasť widgetu'
|
SINGULARNAME: 'Oblasť widgetu'
|
||||||
WidgetAreaEditor_ss:
|
SilverStripe\Widgets\Forms\WidgetAreaEditor_ss:
|
||||||
AVAILABLE: 'Dostupné widgety'
|
AVAILABLE: 'Dostupné widgety'
|
||||||
AVAILWIDGETS: 'Kliknite na názov widgetu pre jeho použitie na tejto stránke.'
|
AVAILWIDGETS: 'Kliknite na názov widgetu pre jeho použitie na tejto stránke.'
|
||||||
INUSE: 'Momentálne používané widgety.'
|
INUSE: 'Momentálne používané widgety.'
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
sv:
|
sv:
|
||||||
Widget:
|
SilverStripe\Widgets\Model\Widget:
|
||||||
PLURALNAME: Widgets
|
PLURALNAME: Widgets
|
||||||
SINGULARNAME: Widget
|
SINGULARNAME: Widget
|
||||||
WidgetArea:
|
SilverStripe\Widgets\Model\WidgetArea:
|
||||||
PLURALNAME: Widgetområden
|
PLURALNAME: Widgetområden
|
||||||
SINGULARNAME: Widgetområde
|
SINGULARNAME: Widgetområde
|
||||||
WidgetAreaEditor_ss:
|
SilverStripe\Widgets\Forms\WidgetAreaEditor_ss:
|
||||||
AVAILABLE: 'Tillgängliga widgets'
|
AVAILABLE: 'Tillgängliga widgets'
|
||||||
AVAILWIDGETS: 'Klicka på en widget nedan för att använda den på sidan.'
|
AVAILWIDGETS: 'Klicka på en widget nedan för att använda den på sidan.'
|
||||||
INUSE: 'Använda widgets'
|
INUSE: 'Använda widgets'
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
zh:
|
zh:
|
||||||
Widget:
|
SilverStripe\Widgets\Model\Widget:
|
||||||
PLURALNAME: 小工具
|
PLURALNAME: 小工具
|
||||||
SINGULARNAME: 小工具
|
SINGULARNAME: 小工具
|
||||||
WidgetArea:
|
SilverStripe\Widgets\Model\WidgetArea:
|
||||||
PLURALNAME: 小工具区域
|
PLURALNAME: 小工具区域
|
||||||
SINGULARNAME: 小工具区域
|
SINGULARNAME: 小工具区域
|
||||||
WidgetAreaEditor_ss:
|
SilverStripe\Widgets\Forms\WidgetAreaEditor_ss:
|
||||||
AVAILABLE: 可用的小工具
|
AVAILABLE: 可用的小工具
|
||||||
AVAILWIDGETS: 点击下方的小工具名称即可在此页上使用。
|
AVAILWIDGETS: 点击下方的小工具名称即可在此页上使用。
|
||||||
INUSE: 当前使用的小工具
|
INUSE: 当前使用的小工具
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
Copyright (c) 2016, SilverStripe Limited
|
Copyright (c) 2017, SilverStripe Limited
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||||
|
9
phpcs.xml.dist
Normal file
9
phpcs.xml.dist
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ruleset name="SilverStripe">
|
||||||
|
<description>CodeSniffer ruleset for SilverStripe coding conventions.</description>
|
||||||
|
|
||||||
|
<rule ref="PSR2">
|
||||||
|
<!-- Current exclusions -->
|
||||||
|
<exclude name="PSR1.Methods.CamelCapsMethodName"/>
|
||||||
|
</rule>
|
||||||
|
</ruleset>
|
@ -6,8 +6,6 @@ use SilverStripe\Admin\LeftAndMain;
|
|||||||
use SilverStripe\Control\Controller;
|
use SilverStripe\Control\Controller;
|
||||||
use SilverStripe\Control\Director;
|
use SilverStripe\Control\Director;
|
||||||
use SilverStripe\Core\ClassInfo;
|
use SilverStripe\Core\ClassInfo;
|
||||||
use SilverStripe\i18n\i18n;
|
|
||||||
use SilverStripe\Security\Member;
|
|
||||||
use SilverStripe\Widgets\Model\Widget;
|
use SilverStripe\Widgets\Model\Widget;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -10,7 +10,6 @@ use SilverStripe\Forms\FieldList;
|
|||||||
use SilverStripe\Forms\HiddenField;
|
use SilverStripe\Forms\HiddenField;
|
||||||
use SilverStripe\Forms\TextField;
|
use SilverStripe\Forms\TextField;
|
||||||
use SilverStripe\ORM\DataObject;
|
use SilverStripe\ORM\DataObject;
|
||||||
use SilverStripe\Widgets\Model\WidgetArea;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Widgets let CMS authors drag and drop small pieces of functionality into
|
* Widgets let CMS authors drag and drop small pieces of functionality into
|
||||||
|
@ -4,7 +4,6 @@ namespace SilverStripe\Widgets\Model;
|
|||||||
|
|
||||||
use SilverStripe\ORM\ArrayList;
|
use SilverStripe\ORM\ArrayList;
|
||||||
use SilverStripe\ORM\DataObject;
|
use SilverStripe\ORM\DataObject;
|
||||||
use SilverStripe\Widgets\Model\Widget;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents a set of widgets shown on a page.
|
* Represents a set of widgets shown on a page.
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
<div class="WidgetAreaEditor field" id="WidgetAreaEditor-$Name" name="$Name"<% if MaxWidgets %> maxwidgets="$MaxWidgets"<% end_if %>>
|
<div class="WidgetAreaEditor field" id="WidgetAreaEditor-$Name" name="$Name"<% if $MaxWidgets %> maxwidgets="$MaxWidgets"<% end_if %>>
|
||||||
<input type="hidden" id="$Name" name="$IdxField" value="$Value" />
|
<input type="hidden" id="$Name" name="$IdxField" value="$Value" />
|
||||||
<div class="availableWidgetsHolder">
|
<div class="availableWidgetsHolder">
|
||||||
<h2><% _t('WidgetAreaEditor_ss.AVAILABLE', 'Available Widgets') %></h2>
|
<h2><%t SilverStripe\\Widgets\\Forms\\WidgetAreaEditor_ss.AVAILABLE 'Available Widgets' %></h2>
|
||||||
<p class="message"><% _t('WidgetAreaEditor_ss.AVAILWIDGETS', 'Click a widget title below to use it on this page.') %></p>
|
<p class="message"><%t SilverStripe\\Widgets\\Forms\\WidgetAreaEditor_ss.AVAILWIDGETS 'Click a widget title below to use it on this page.' %></p>
|
||||||
<div class="availableWidgets" id="availableWidgets-$Name">
|
<div class="availableWidgets" id="availableWidgets-$Name">
|
||||||
<% if $AvailableWidgets %>
|
<% if $AvailableWidgets %>
|
||||||
<% loop $AvailableWidgets %>
|
<% loop $AvailableWidgets %>
|
||||||
@ -10,14 +10,14 @@
|
|||||||
<% end_loop %>
|
<% end_loop %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<div class="NoWidgets" id="NoWidgets-$Name">
|
<div class="NoWidgets" id="NoWidgets-$Name">
|
||||||
<p><% _t('WidgetAreaEditor_ss.NOAVAIL', 'There are currently no widgets available.') %></p>
|
<p><%t SilverStripe\\Widgets\\Forms\\WidgetAreaEditor_ss.NOAVAIL 'There are currently no widgets available.' %></p>
|
||||||
</div>
|
</div>
|
||||||
<% end_if %>
|
<% end_if %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="usedWidgetsHolder">
|
<div class="usedWidgetsHolder">
|
||||||
<h2><% _t('WidgetAreaEditor_ss.INUSE', 'Widgets currently used') %></h2>
|
<h2><%t SilverStripe\\Widgets\\Forms\\WidgetAreaEditor_ss.INUSE 'Widgets currently used' %></h2>
|
||||||
<p class="message"><% _t('WidgetAreaEditor_ss.TOSORT', 'To sort currently used widgets on this page, drag them up and down.') %></p>
|
<p class="message"><%t SilverStripe\\Widgets\\Forms\\WidgetAreaEditor_ss.TOSORT 'To sort currently used widgets on this page, drag them up and down.' %></p>
|
||||||
|
|
||||||
<div class="usedWidgets" id="usedWidgets-$Name">
|
<div class="usedWidgets" id="usedWidgets-$Name">
|
||||||
<% if $UsedWidgets %>
|
<% if $UsedWidgets %>
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
<% loop WidgetControllers %>
|
<% loop $WidgetControllers %>
|
||||||
$WidgetHolder
|
$WidgetHolder
|
||||||
<% end_loop %>
|
<% end_loop %>
|
@ -1,5 +1,5 @@
|
|||||||
<div class="Widget" id="$ClassName">
|
<div class="Widget" id="$ClassName">
|
||||||
<h3 title="<% _t('WidgetDescription_ss.CLICKTOADDWIDGET', 'Click to add this widget') %>">$CMSTitle</h3>
|
<h3 title="<%t WidgetDescription_ss.CLICKTOADDWIDGET 'Click to add this widget' %>">$CMSTitle</h3>
|
||||||
<div class="widgetDescription">
|
<div class="widgetDescription">
|
||||||
<p>$Description</p>
|
<p>$Description</p>
|
||||||
</div>
|
</div>
|
||||||
|
@ -10,5 +10,5 @@
|
|||||||
<% end_if %>
|
<% end_if %>
|
||||||
<input type="hidden" name="$Name[Type]" value="$ClassName" />
|
<input type="hidden" name="$Name[Type]" value="$ClassName" />
|
||||||
<input type="hidden" name="$Name[Sort]" value="$Sort" />
|
<input type="hidden" name="$Name[Sort]" value="$Sort" />
|
||||||
<p class="deleteWidget"><span class="widgetDelete btn btn-danger"><% _t('WidgetEditor_ss.DELETE', 'Delete') %></span></p>
|
<p class="deleteWidget"><span class="widgetDelete btn btn-danger"><%t WidgetEditor_ss.DELETE 'Delete' %></span></p>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<div class="WidgetHolder $ClassName<% if FirstLast %> $FirstLast<% end_if %>">
|
<div class="WidgetHolder $ClassName<% if $FirstLast %> $FirstLast<% end_if %>">
|
||||||
<% if Title %><h3>$Title</h3><% end_if %>
|
<% if $Title %><h3>$Title</h3><% end_if %>
|
||||||
$Content
|
$Content
|
||||||
</div>
|
</div>
|
||||||
|
@ -2,17 +2,14 @@
|
|||||||
|
|
||||||
namespace SilverStripe\Widgets\Tests;
|
namespace SilverStripe\Widgets\Tests;
|
||||||
|
|
||||||
use Page;
|
|
||||||
use SilverStripe\CMS\Controllers\ContentController;
|
use SilverStripe\CMS\Controllers\ContentController;
|
||||||
use SilverStripe\CMS\Model\SiteTree;
|
use SilverStripe\CMS\Model\SiteTree;
|
||||||
use SilverStripe\Control\HTTPRequest;
|
use SilverStripe\Control\HTTPRequest;
|
||||||
|
use SilverStripe\Dev\SapphireTest;
|
||||||
use SilverStripe\Forms\FieldList;
|
use SilverStripe\Forms\FieldList;
|
||||||
use SilverStripe\Forms\Form;
|
use SilverStripe\Forms\Form;
|
||||||
use SilverStripe\Dev\SapphireTest;
|
|
||||||
use SilverStripe\Dev\TestOnly;
|
|
||||||
use SilverStripe\Widgets\Extensions\WidgetPageExtension;
|
use SilverStripe\Widgets\Extensions\WidgetPageExtension;
|
||||||
use SilverStripe\Widgets\Forms\WidgetAreaEditor;
|
use SilverStripe\Widgets\Forms\WidgetAreaEditor;
|
||||||
use SilverStripe\Widgets\Model\Widget;
|
|
||||||
use SilverStripe\Widgets\Tests\WidgetAreaEditorTest\FakePage;
|
use SilverStripe\Widgets\Tests\WidgetAreaEditorTest\FakePage;
|
||||||
use SilverStripe\Widgets\Tests\WidgetAreaEditorTest\TestWidget;
|
use SilverStripe\Widgets\Tests\WidgetAreaEditorTest\TestWidget;
|
||||||
|
|
||||||
|
@ -3,13 +3,7 @@
|
|||||||
namespace SilverStripe\Widgets\Tests;
|
namespace SilverStripe\Widgets\Tests;
|
||||||
|
|
||||||
use SilverStripe\Dev\FunctionalTest;
|
use SilverStripe\Dev\FunctionalTest;
|
||||||
use SilverStripe\Widgets\Model\Widget;
|
|
||||||
use SilverStripe\Dev\TestOnly;
|
|
||||||
use SilverStripe\Forms\TextField;
|
|
||||||
use SilverStripe\Forms\FieldList;
|
|
||||||
use SilverStripe\Forms\FormAction;
|
|
||||||
use SilverStripe\Forms\Form;
|
use SilverStripe\Forms\Form;
|
||||||
use SilverStripe\Widgets\Controllers\WidgetController;
|
|
||||||
use SilverStripe\Widgets\Tests\WidgetControllerTest\TestPage;
|
use SilverStripe\Widgets\Tests\WidgetControllerTest\TestPage;
|
||||||
use SilverStripe\Widgets\Tests\WidgetControllerTest\TestWidget;
|
use SilverStripe\Widgets\Tests\WidgetControllerTest\TestWidget;
|
||||||
|
|
||||||
@ -35,7 +29,7 @@ class WidgetControllerTest extends FunctionalTest
|
|||||||
|
|
||||||
$response = $this->get($page->URLSegment);
|
$response = $this->get($page->URLSegment);
|
||||||
|
|
||||||
$formAction = sprintf('%s/widget/%d/Form', $page->URLSegment, $widget->ID);
|
$formAction = sprintf('%s/widget/%d/%s', $page->URLSegment, $widget->ID, 'Form');
|
||||||
$this->assertContains(
|
$this->assertContains(
|
||||||
$formAction,
|
$formAction,
|
||||||
$response->getBody(),
|
$response->getBody(),
|
||||||
|
@ -23,7 +23,7 @@ class TestWidgetController extends WidgetController implements TestOnly
|
|||||||
{
|
{
|
||||||
$widgetform = new Form(
|
$widgetform = new Form(
|
||||||
$this,
|
$this,
|
||||||
'Form',
|
__FUNCTION__,
|
||||||
new FieldList(
|
new FieldList(
|
||||||
new TextField('TestValue')
|
new TextField('TestValue')
|
||||||
),
|
),
|
||||||
|
Loading…
Reference in New Issue
Block a user