├── templates └── SilverWare │ ├── Model │ ├── Panel.ss │ ├── Button.ss │ ├── Link │ │ └── CustomCSS.ss │ ├── Link.ss │ ├── Component │ │ └── CMSPreview.ss │ └── Slide.ss │ ├── Components │ ├── MediaComponent │ │ ├── Video.ss │ │ ├── Photo.ss │ │ └── Link.ss │ ├── CopyrightComponent.ss │ ├── DeveloperComponent.ss │ ├── ScrollToTopButton.ss │ ├── BaseComponent │ │ └── Includes │ │ │ ├── Form.ss │ │ │ ├── Content.ss │ │ │ └── Header.ss │ ├── ContentComponent │ │ ├── Content.ss │ │ ├── Footer.ss │ │ └── Header.ss │ ├── FeatureComponent │ │ └── Includes │ │ │ ├── Icon.ss │ │ │ ├── Summary.ss │ │ │ ├── Footer.ss │ │ │ ├── Image.ss │ │ │ └── Header.ss │ ├── PageComponent.ss │ ├── HeadingComponent.ss │ ├── TableComponent.ss │ ├── MediaComponent.ss │ ├── TagCloudComponent.ss │ ├── BaseComponent.ss │ ├── ContentComponent.ss │ ├── BaseListComponent │ │ ├── Includes │ │ │ └── Alerts.ss │ │ └── CustomCSS.ss │ ├── ImageComponent.ss │ ├── BaseListComponent.ss │ ├── ScrollToTopButton │ │ └── CustomCSS.ss │ └── FeatureComponent.ss │ ├── Lists │ ├── ListItem │ │ └── Includes │ │ │ ├── Content.ss │ │ │ ├── Summary.ss │ │ │ ├── Details.ss │ │ │ ├── Header.ss │ │ │ ├── Footer.ss │ │ │ └── Image.ss │ └── ListItem.ss │ ├── Forms │ ├── ToggleGroup.ss │ └── AutoCompleteField.ss │ └── Extensions │ ├── Style │ └── LinkColorStyle │ │ └── CustomCSS.ss │ └── Model │ └── DetailFieldsExtension │ └── Details.ss ├── media └── bitmap │ ├── silverware-logo.png │ └── silverware-logo@2x.png ├── admin └── client │ ├── src │ ├── images │ │ ├── icons │ │ │ ├── Row.png │ │ │ ├── Button.png │ │ │ ├── Column.png │ │ │ ├── Folder.png │ │ │ ├── Layout.png │ │ │ ├── Link.png │ │ │ ├── Panel.png │ │ │ ├── Slide.png │ │ │ ├── ListPage.png │ │ │ ├── Section.png │ │ │ ├── Template.png │ │ │ ├── Component.png │ │ │ ├── PanelFolder.png │ │ │ ├── AreaComponent.png │ │ │ ├── FooterSection.png │ │ │ ├── HeaderSection.png │ │ │ ├── LayoutFolder.png │ │ │ ├── LayoutSection.png │ │ │ ├── ListComponent.png │ │ │ ├── PageComponent.png │ │ │ ├── TileComponent.png │ │ │ ├── ComponentFolder.png │ │ │ ├── ContentComponent.png │ │ │ ├── FeatureComponent.png │ │ │ ├── HeadingComponent.png │ │ │ ├── ImageComponent.png │ │ │ ├── ListSourceSlide.png │ │ │ ├── MediaComponent.png │ │ │ ├── TableComponent.png │ │ │ ├── TaglineComponent.png │ │ │ ├── TemplateFolder.png │ │ │ ├── TitleComponent.png │ │ │ ├── ToggleComponent.png │ │ │ ├── VirtualComponent.png │ │ │ ├── CopyrightComponent.png │ │ │ ├── DeveloperComponent.png │ │ │ ├── ScrollToTopButton.png │ │ │ └── TagCloudComponent.png │ │ ├── headings │ │ │ ├── h1.png │ │ │ ├── h2.png │ │ │ ├── h3.png │ │ │ ├── h4.png │ │ │ ├── h5.png │ │ │ └── h6.png │ │ ├── status │ │ │ ├── cached.png │ │ │ └── disabled.png │ │ └── textures │ │ │ └── cms_content_header.png │ ├── bundles │ │ ├── preview.js │ │ └── bundle.js │ ├── styles │ │ ├── _variables.scss │ │ ├── forms │ │ │ ├── ViewportsField.scss │ │ │ └── DimensionsField.scss │ │ ├── preview.scss │ │ ├── bundle.scss │ │ ├── preview │ │ │ └── ComponentPreview.scss │ │ └── _admin.scss │ ├── entwine │ │ ├── ListViewExtension.js │ │ └── NumberBadges.js │ └── forms │ │ └── ToggleGroup.js │ └── dist │ ├── images │ ├── icons │ │ ├── Link.png │ │ ├── Panel.png │ │ ├── Row.png │ │ ├── Slide.png │ │ ├── Button.png │ │ ├── Column.png │ │ ├── Folder.png │ │ ├── Layout.png │ │ ├── Section.png │ │ ├── Component.png │ │ ├── ListPage.png │ │ ├── Template.png │ │ ├── LayoutFolder.png │ │ ├── PanelFolder.png │ │ ├── AreaComponent.png │ │ ├── ComponentFolder.png │ │ ├── FooterSection.png │ │ ├── HeaderSection.png │ │ ├── ImageComponent.png │ │ ├── LayoutSection.png │ │ ├── ListComponent.png │ │ ├── ListSourceSlide.png │ │ ├── MediaComponent.png │ │ ├── PageComponent.png │ │ ├── TableComponent.png │ │ ├── TemplateFolder.png │ │ ├── TileComponent.png │ │ ├── TitleComponent.png │ │ ├── ToggleComponent.png │ │ ├── ContentComponent.png │ │ ├── FeatureComponent.png │ │ ├── HeadingComponent.png │ │ ├── ScrollToTopButton.png │ │ ├── TagCloudComponent.png │ │ ├── TaglineComponent.png │ │ ├── VirtualComponent.png │ │ ├── CopyrightComponent.png │ │ └── DeveloperComponent.png │ └── cms_content_header.png │ ├── js │ ├── preview.js │ └── bundle.js │ └── styles │ └── preview.css ├── client └── src │ ├── styles │ ├── _mixins.scss │ ├── components │ │ ├── TableComponent.scss │ │ ├── PageComponent.scss │ │ ├── ImageComponent.scss │ │ ├── ContentComponent.scss │ │ ├── FeatureComponent.scss │ │ ├── TileComponent.scss │ │ ├── ToggleComponent.scss │ │ ├── ScrollToTopButton.scss │ │ ├── MediaComponent.scss │ │ ├── ListComponent.scss │ │ └── BaseListComponent.scss │ ├── mixins │ │ └── _icon-size.scss │ ├── model │ │ ├── Slide.scss │ │ └── Link.scss │ ├── _variables.scss │ ├── bundle.scss │ └── extensions │ │ └── DetailFieldsExtension.scss │ ├── jquery │ └── popovers.js │ ├── bundles │ └── bundle.js │ ├── components │ ├── HeaderSection.js │ ├── ToggleComponent.js │ ├── ScrollToTopButton.js │ └── TagCloudComponent.js │ └── forms │ └── ToggleGroup.js ├── postcss.config.js ├── _config ├── assets.yml ├── cache.yml ├── logging.yml ├── buttons.yml ├── images.yml ├── theme.yml ├── controller.yml ├── model.yml ├── config.yml └── styles.yml ├── _config.php ├── src ├── Tags │ └── TagSource.php ├── Components │ ├── BaseComponentController.php │ ├── TileComponent.php │ └── ListComponent.php ├── Lists │ ├── ListSource.php │ ├── ListWrapper.php │ ├── ListAlert.php │ └── ListFilter.php ├── Grid │ ├── Extensions │ │ ├── GridExtension.php │ │ ├── RowExtension.php │ │ ├── SectionExtension.php │ │ └── ColumnExtension.php │ ├── Frameworks │ │ └── Bootstrap │ │ │ ├── Row.php │ │ │ ├── Section.php │ │ │ └── Framework.php │ └── Grid.php ├── Crumbs │ ├── Crumbable.php │ └── Breadcrumb.php ├── Forms │ ├── PageDropdownField.php │ ├── PageMultiselectField.php │ ├── GridField │ │ └── GridFieldConfig_OrderableEditor.php │ ├── ViewportField.php │ └── FieldSection.php ├── Extensions │ ├── Model │ │ └── PaginatedListExtension.php │ ├── Assets │ │ └── RenderInlineExtension.php │ ├── Forms │ │ ├── AlertMessageExtension.php │ │ └── StatusMessageExtension.php │ ├── Config │ │ └── ServicesConfig.php │ ├── Admin │ │ └── CropPriorityFileFormExtension.php │ └── AreaExtension.php ├── View │ ├── ViewClasses.php │ └── GridAware.php ├── Model │ ├── Layout.php │ ├── ComponentController.php │ └── SectionHolder.php ├── Security │ ├── CMSMainPermissions.php │ └── SiteConfigPermissions.php ├── Sections │ ├── FooterSection.php │ └── HeaderSection.php ├── Pages │ └── ListPage.php ├── ORM │ └── FieldType │ │ ├── DBDimensions.php │ │ └── DBAbsoluteInt.php └── Folders │ ├── PanelFolder.php │ ├── LayoutFolder.php │ ├── TemplateFolder.php │ └── ComponentFolder.php ├── package.json └── composer.json /templates/SilverWare/Model/Panel.ss: -------------------------------------------------------------------------------- 1 | <% loop $AllChildren %>$Me<% end_loop %> 2 | -------------------------------------------------------------------------------- /templates/SilverWare/Components/MediaComponent/Video.ss: -------------------------------------------------------------------------------- 1 |
2 | $Code 3 |
4 | -------------------------------------------------------------------------------- /templates/SilverWare/Model/Button.ss: -------------------------------------------------------------------------------- 1 | $FontIconTag$Title 2 | -------------------------------------------------------------------------------- /media/bitmap/silverware-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/media/bitmap/silverware-logo.png -------------------------------------------------------------------------------- /media/bitmap/silverware-logo@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/media/bitmap/silverware-logo@2x.png -------------------------------------------------------------------------------- /templates/SilverWare/Components/CopyrightComponent.ss: -------------------------------------------------------------------------------- 1 |
2 | $Copyright 3 |
4 | -------------------------------------------------------------------------------- /templates/SilverWare/Components/DeveloperComponent.ss: -------------------------------------------------------------------------------- 1 |
2 | $Developer 3 |
4 | -------------------------------------------------------------------------------- /templates/SilverWare/Components/ScrollToTopButton.ss: -------------------------------------------------------------------------------- 1 | <% include Icon Name=$ButtonIcon %> 2 | -------------------------------------------------------------------------------- /admin/client/src/images/icons/Row.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/src/images/icons/Row.png -------------------------------------------------------------------------------- /admin/client/dist/images/icons/Link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/dist/images/icons/Link.png -------------------------------------------------------------------------------- /admin/client/dist/images/icons/Panel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/dist/images/icons/Panel.png -------------------------------------------------------------------------------- /admin/client/dist/images/icons/Row.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/dist/images/icons/Row.png -------------------------------------------------------------------------------- /admin/client/dist/images/icons/Slide.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/dist/images/icons/Slide.png -------------------------------------------------------------------------------- /admin/client/src/images/headings/h1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/src/images/headings/h1.png -------------------------------------------------------------------------------- /admin/client/src/images/headings/h2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/src/images/headings/h2.png -------------------------------------------------------------------------------- /admin/client/src/images/headings/h3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/src/images/headings/h3.png -------------------------------------------------------------------------------- /admin/client/src/images/headings/h4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/src/images/headings/h4.png -------------------------------------------------------------------------------- /admin/client/src/images/headings/h5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/src/images/headings/h5.png -------------------------------------------------------------------------------- /admin/client/src/images/headings/h6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/src/images/headings/h6.png -------------------------------------------------------------------------------- /admin/client/src/images/icons/Button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/src/images/icons/Button.png -------------------------------------------------------------------------------- /admin/client/src/images/icons/Column.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/src/images/icons/Column.png -------------------------------------------------------------------------------- /admin/client/src/images/icons/Folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/src/images/icons/Folder.png -------------------------------------------------------------------------------- /admin/client/src/images/icons/Layout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/src/images/icons/Layout.png -------------------------------------------------------------------------------- /admin/client/src/images/icons/Link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/src/images/icons/Link.png -------------------------------------------------------------------------------- /admin/client/src/images/icons/Panel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/src/images/icons/Panel.png -------------------------------------------------------------------------------- /admin/client/src/images/icons/Slide.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/src/images/icons/Slide.png -------------------------------------------------------------------------------- /admin/client/dist/images/icons/Button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/dist/images/icons/Button.png -------------------------------------------------------------------------------- /admin/client/dist/images/icons/Column.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/dist/images/icons/Column.png -------------------------------------------------------------------------------- /admin/client/dist/images/icons/Folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/dist/images/icons/Folder.png -------------------------------------------------------------------------------- /admin/client/dist/images/icons/Layout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/dist/images/icons/Layout.png -------------------------------------------------------------------------------- /admin/client/dist/images/icons/Section.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/dist/images/icons/Section.png -------------------------------------------------------------------------------- /admin/client/src/images/icons/ListPage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/src/images/icons/ListPage.png -------------------------------------------------------------------------------- /admin/client/src/images/icons/Section.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/src/images/icons/Section.png -------------------------------------------------------------------------------- /admin/client/src/images/icons/Template.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/src/images/icons/Template.png -------------------------------------------------------------------------------- /admin/client/src/images/status/cached.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/src/images/status/cached.png -------------------------------------------------------------------------------- /admin/client/dist/images/icons/Component.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/dist/images/icons/Component.png -------------------------------------------------------------------------------- /admin/client/dist/images/icons/ListPage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/dist/images/icons/ListPage.png -------------------------------------------------------------------------------- /admin/client/dist/images/icons/Template.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/dist/images/icons/Template.png -------------------------------------------------------------------------------- /admin/client/src/images/icons/Component.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/src/images/icons/Component.png -------------------------------------------------------------------------------- /admin/client/src/images/icons/PanelFolder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/src/images/icons/PanelFolder.png -------------------------------------------------------------------------------- /admin/client/src/images/status/disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/src/images/status/disabled.png -------------------------------------------------------------------------------- /admin/client/dist/images/cms_content_header.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/dist/images/cms_content_header.png -------------------------------------------------------------------------------- /admin/client/dist/images/icons/LayoutFolder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/dist/images/icons/LayoutFolder.png -------------------------------------------------------------------------------- /admin/client/dist/images/icons/PanelFolder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/dist/images/icons/PanelFolder.png -------------------------------------------------------------------------------- /admin/client/src/images/icons/AreaComponent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/src/images/icons/AreaComponent.png -------------------------------------------------------------------------------- /admin/client/src/images/icons/FooterSection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/src/images/icons/FooterSection.png -------------------------------------------------------------------------------- /admin/client/src/images/icons/HeaderSection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/src/images/icons/HeaderSection.png -------------------------------------------------------------------------------- /admin/client/src/images/icons/LayoutFolder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/src/images/icons/LayoutFolder.png -------------------------------------------------------------------------------- /admin/client/src/images/icons/LayoutSection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/src/images/icons/LayoutSection.png -------------------------------------------------------------------------------- /admin/client/src/images/icons/ListComponent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/src/images/icons/ListComponent.png -------------------------------------------------------------------------------- /admin/client/src/images/icons/PageComponent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/src/images/icons/PageComponent.png -------------------------------------------------------------------------------- /admin/client/src/images/icons/TileComponent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/src/images/icons/TileComponent.png -------------------------------------------------------------------------------- /admin/client/dist/images/icons/AreaComponent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/dist/images/icons/AreaComponent.png -------------------------------------------------------------------------------- /admin/client/dist/images/icons/ComponentFolder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/dist/images/icons/ComponentFolder.png -------------------------------------------------------------------------------- /admin/client/dist/images/icons/FooterSection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/dist/images/icons/FooterSection.png -------------------------------------------------------------------------------- /admin/client/dist/images/icons/HeaderSection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/dist/images/icons/HeaderSection.png -------------------------------------------------------------------------------- /admin/client/dist/images/icons/ImageComponent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/dist/images/icons/ImageComponent.png -------------------------------------------------------------------------------- /admin/client/dist/images/icons/LayoutSection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/dist/images/icons/LayoutSection.png -------------------------------------------------------------------------------- /admin/client/dist/images/icons/ListComponent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/dist/images/icons/ListComponent.png -------------------------------------------------------------------------------- /admin/client/dist/images/icons/ListSourceSlide.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/dist/images/icons/ListSourceSlide.png -------------------------------------------------------------------------------- /admin/client/dist/images/icons/MediaComponent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/dist/images/icons/MediaComponent.png -------------------------------------------------------------------------------- /admin/client/dist/images/icons/PageComponent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/dist/images/icons/PageComponent.png -------------------------------------------------------------------------------- /admin/client/dist/images/icons/TableComponent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/dist/images/icons/TableComponent.png -------------------------------------------------------------------------------- /admin/client/dist/images/icons/TemplateFolder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/dist/images/icons/TemplateFolder.png -------------------------------------------------------------------------------- /admin/client/dist/images/icons/TileComponent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/dist/images/icons/TileComponent.png -------------------------------------------------------------------------------- /admin/client/dist/images/icons/TitleComponent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/dist/images/icons/TitleComponent.png -------------------------------------------------------------------------------- /admin/client/dist/images/icons/ToggleComponent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/dist/images/icons/ToggleComponent.png -------------------------------------------------------------------------------- /admin/client/src/images/icons/ComponentFolder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/src/images/icons/ComponentFolder.png -------------------------------------------------------------------------------- /admin/client/src/images/icons/ContentComponent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/src/images/icons/ContentComponent.png -------------------------------------------------------------------------------- /admin/client/src/images/icons/FeatureComponent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/src/images/icons/FeatureComponent.png -------------------------------------------------------------------------------- /admin/client/src/images/icons/HeadingComponent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/src/images/icons/HeadingComponent.png -------------------------------------------------------------------------------- /admin/client/src/images/icons/ImageComponent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/src/images/icons/ImageComponent.png -------------------------------------------------------------------------------- /admin/client/src/images/icons/ListSourceSlide.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/src/images/icons/ListSourceSlide.png -------------------------------------------------------------------------------- /admin/client/src/images/icons/MediaComponent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/src/images/icons/MediaComponent.png -------------------------------------------------------------------------------- /admin/client/src/images/icons/TableComponent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/src/images/icons/TableComponent.png -------------------------------------------------------------------------------- /admin/client/src/images/icons/TaglineComponent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/src/images/icons/TaglineComponent.png -------------------------------------------------------------------------------- /admin/client/src/images/icons/TemplateFolder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/src/images/icons/TemplateFolder.png -------------------------------------------------------------------------------- /admin/client/src/images/icons/TitleComponent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/src/images/icons/TitleComponent.png -------------------------------------------------------------------------------- /admin/client/src/images/icons/ToggleComponent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/src/images/icons/ToggleComponent.png -------------------------------------------------------------------------------- /admin/client/src/images/icons/VirtualComponent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/src/images/icons/VirtualComponent.png -------------------------------------------------------------------------------- /templates/SilverWare/Components/BaseComponent/Includes/Form.ss: -------------------------------------------------------------------------------- 1 | <% if $Form %> 2 |
3 | $Form 4 |
5 | <% end_if %> 6 | -------------------------------------------------------------------------------- /admin/client/dist/images/icons/ContentComponent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/dist/images/icons/ContentComponent.png -------------------------------------------------------------------------------- /admin/client/dist/images/icons/FeatureComponent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/dist/images/icons/FeatureComponent.png -------------------------------------------------------------------------------- /admin/client/dist/images/icons/HeadingComponent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/dist/images/icons/HeadingComponent.png -------------------------------------------------------------------------------- /admin/client/dist/images/icons/ScrollToTopButton.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/dist/images/icons/ScrollToTopButton.png -------------------------------------------------------------------------------- /admin/client/dist/images/icons/TagCloudComponent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/dist/images/icons/TagCloudComponent.png -------------------------------------------------------------------------------- /admin/client/dist/images/icons/TaglineComponent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/dist/images/icons/TaglineComponent.png -------------------------------------------------------------------------------- /admin/client/dist/images/icons/VirtualComponent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/dist/images/icons/VirtualComponent.png -------------------------------------------------------------------------------- /admin/client/src/images/icons/CopyrightComponent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/src/images/icons/CopyrightComponent.png -------------------------------------------------------------------------------- /admin/client/src/images/icons/DeveloperComponent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/src/images/icons/DeveloperComponent.png -------------------------------------------------------------------------------- /admin/client/src/images/icons/ScrollToTopButton.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/src/images/icons/ScrollToTopButton.png -------------------------------------------------------------------------------- /admin/client/src/images/icons/TagCloudComponent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/src/images/icons/TagCloudComponent.png -------------------------------------------------------------------------------- /templates/SilverWare/Components/ContentComponent/Content.ss: -------------------------------------------------------------------------------- 1 | <% if $Content %> 2 |
3 | $Content 4 |
5 | <% end_if %> 6 | -------------------------------------------------------------------------------- /admin/client/dist/images/icons/CopyrightComponent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/dist/images/icons/CopyrightComponent.png -------------------------------------------------------------------------------- /admin/client/dist/images/icons/DeveloperComponent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/dist/images/icons/DeveloperComponent.png -------------------------------------------------------------------------------- /admin/client/src/images/textures/cms_content_header.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praxisnetau/silverware/HEAD/admin/client/src/images/textures/cms_content_header.png -------------------------------------------------------------------------------- /templates/SilverWare/Components/BaseComponent/Includes/Content.ss: -------------------------------------------------------------------------------- 1 | <% if $Content %> 2 |
3 | $Content 4 |
5 | <% end_if %> 6 | -------------------------------------------------------------------------------- /templates/SilverWare/Components/FeatureComponent/Includes/Icon.ss: -------------------------------------------------------------------------------- 1 | <% if $IconShown %> 2 |
3 | $FontIconTag 4 |
5 | <% end_if %> 6 | -------------------------------------------------------------------------------- /templates/SilverWare/Components/PageComponent.ss: -------------------------------------------------------------------------------- 1 |
2 |
3 | $Layout.RAW 4 |
5 |
6 | -------------------------------------------------------------------------------- /templates/SilverWare/Components/HeadingComponent.ss: -------------------------------------------------------------------------------- 1 |
2 |
3 | <$TitleTag>{$FontIconTag}{$Title} 4 |
5 |
6 | -------------------------------------------------------------------------------- /templates/SilverWare/Components/FeatureComponent/Includes/Summary.ss: -------------------------------------------------------------------------------- 1 | <% if $SummaryShown %> 2 |
3 | $SummaryText 4 |
5 | <% end_if %> 6 | -------------------------------------------------------------------------------- /templates/SilverWare/Components/BaseComponent/Includes/Header.ss: -------------------------------------------------------------------------------- 1 | <% if $ShowTitle %> 2 |
3 | <$TitleTag>{$TitleText} 4 |
5 | <% end_if %> 6 | -------------------------------------------------------------------------------- /templates/SilverWare/Components/TableComponent.ss: -------------------------------------------------------------------------------- 1 |
2 | <% loop $Columns %> 3 |
4 | $Child 5 |
6 | <% end_loop %> 7 |
8 | -------------------------------------------------------------------------------- /templates/SilverWare/Lists/ListItem/Includes/Content.ss: -------------------------------------------------------------------------------- 1 | <% if $Renderer.isContentShown($isFirst, $isMiddle, $isLast) && $HasMetaContent %> 2 |
3 | $MetaContent 4 |
5 | <% end_if %> 6 | -------------------------------------------------------------------------------- /templates/SilverWare/Lists/ListItem/Includes/Summary.ss: -------------------------------------------------------------------------------- 1 | <% if $Renderer.isSummaryShown($isFirst, $isMiddle, $isLast) && $HasMetaSummary %> 2 |
3 | $MetaSummary 4 |
5 | <% end_if %> 6 | -------------------------------------------------------------------------------- /client/src/styles/_mixins.scss: -------------------------------------------------------------------------------- 1 | /* SilverWare Mixins 2 | ===================================================================================================================== */ 3 | 4 | // Import Mixins: 5 | 6 | @import "mixins/icon-size"; 7 | -------------------------------------------------------------------------------- /templates/SilverWare/Components/MediaComponent.ss: -------------------------------------------------------------------------------- 1 |
2 | $Embed 3 | <% if $CaptionShown %> 4 |
5 | $CaptionHTML 6 |
7 | <% end_if %> 8 |
9 | -------------------------------------------------------------------------------- /postcss.config.js: -------------------------------------------------------------------------------- 1 | /* PostCSS Configuration 2 | ===================================================================================================================== */ 3 | 4 | module.exports = { 5 | plugins: [ 6 | require('autoprefixer') 7 | ] 8 | }; 9 | -------------------------------------------------------------------------------- /templates/SilverWare/Components/ContentComponent/Footer.ss: -------------------------------------------------------------------------------- 1 | <% if $FooterShown %> 2 | 5 | <% end_if %> 6 | -------------------------------------------------------------------------------- /_config/assets.yml: -------------------------------------------------------------------------------- 1 | --- 2 | Name: silverware-assets 3 | --- 4 | 5 | # Configure File Extensions: 6 | 7 | SilverStripe\Assets\File: 8 | extensions: 9 | - SilverWare\Extensions\Assets\RenderInlineExtension 10 | allowed_extensions: 11 | - svg 12 | -------------------------------------------------------------------------------- /admin/client/src/bundles/preview.js: -------------------------------------------------------------------------------- 1 | /* SilverWare Admin Preview Bundle 2 | ===================================================================================================================== */ 3 | 4 | // Load Styles: 5 | 6 | require('styles/preview.scss'); 7 | -------------------------------------------------------------------------------- /templates/SilverWare/Components/TagCloudComponent.ss: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | -------------------------------------------------------------------------------- /templates/SilverWare/Components/BaseComponent.ss: -------------------------------------------------------------------------------- 1 |
2 | <% include SilverWare\Components\BaseComponent\Header %> 3 | <% include SilverWare\Components\BaseComponent\Content %> 4 | <% include SilverWare\Components\BaseComponent\Form %> 5 |
6 | -------------------------------------------------------------------------------- /templates/SilverWare/Components/FeatureComponent/Includes/Footer.ss: -------------------------------------------------------------------------------- 1 | <% if $FooterShown %> 2 | 5 | <% end_if %> 6 | -------------------------------------------------------------------------------- /templates/SilverWare/Components/MediaComponent/Photo.ss: -------------------------------------------------------------------------------- 1 |
2 | <% if $LinkImage %><% end_if %> 3 | $ImageAltText 4 | <% if $LinkImage %><% end_if %> 5 |
6 | -------------------------------------------------------------------------------- /templates/SilverWare/Components/ContentComponent.ss: -------------------------------------------------------------------------------- 1 |
2 | <% include SilverWare\Components\ContentComponent\Header %> 3 | <% include SilverWare\Components\ContentComponent\Content %> 4 | <% include SilverWare\Components\ContentComponent\Footer %> 5 |
6 | -------------------------------------------------------------------------------- /templates/SilverWare/Forms/ToggleGroup.ss: -------------------------------------------------------------------------------- 1 |
2 | $ToggleField.FieldHolder 3 |
4 |
5 | <% loop $GroupFields %> 6 | $FieldHolder 7 | <% end_loop %> 8 |
9 | -------------------------------------------------------------------------------- /templates/SilverWare/Components/BaseListComponent/Includes/Alerts.ss: -------------------------------------------------------------------------------- 1 | <% if $Parent.HasListAlerts %> 2 |
3 | <% loop $Parent.ListAlertsData %> 4 | <% include Alert Type=$Type, Icon=$Icon, Text=$Text.RAW %> 5 | <% end_loop %> 6 |
7 | <% end_if %> 8 | -------------------------------------------------------------------------------- /client/src/styles/components/TableComponent.scss: -------------------------------------------------------------------------------- 1 | /* Table Component Styles 2 | ===================================================================================================================== */ 3 | 4 | .tablecomponent { 5 | 6 | .row > .column > .component { 7 | margin-bottom: $spacer; 8 | } 9 | 10 | } 11 | -------------------------------------------------------------------------------- /admin/client/src/styles/_variables.scss: -------------------------------------------------------------------------------- 1 | /* SilverWare Admin Variables 2 | ===================================================================================================================== */ 3 | 4 | $color-darker-bg: #f1f3f6; 5 | 6 | $color-text: #66727d; 7 | $color-text-default: #43536d; 8 | 9 | $tab-panel-texture-color: #f6f7f8; 10 | -------------------------------------------------------------------------------- /_config/cache.yml: -------------------------------------------------------------------------------- 1 | --- 2 | Name: silverware-cache 3 | --- 4 | 5 | # Configure Render Cache: 6 | 7 | SilverStripe\Core\Injector\Injector: 8 | Psr\SimpleCache\CacheInterface.SilverWare_render: 9 | factory: SilverStripe\Core\Cache\CacheFactory 10 | constructor: 11 | namespace: 'SilverWare_render' 12 | defaultLifetime: 300 13 | -------------------------------------------------------------------------------- /templates/SilverWare/Lists/ListItem/Includes/Details.ss: -------------------------------------------------------------------------------- 1 | <% if $Renderer.isDetailsShown($isFirst, $isMiddle, $isLast) %> 2 |
3 | <% loop $ListItemDetails %> 4 | <% if $Text %><% include Icon Name=$Icon, FixedWidth=1 %> $Text.RAW<% end_if %> 5 | <% end_loop %> 6 |
7 | <% end_if %> 8 | -------------------------------------------------------------------------------- /templates/SilverWare/Components/ContentComponent/Header.ss: -------------------------------------------------------------------------------- 1 | <% if $ShowTitle %> 2 |
3 | <$TitleTag> 4 | {$FontIconTag} 5 | <% if $LinkTitle %> 6 | {$TitleText} 7 | <% else %> 8 | {$TitleText} 9 | <% end_if %> 10 | 11 |
12 | <% end_if %> 13 | -------------------------------------------------------------------------------- /templates/SilverWare/Components/FeatureComponent/Includes/Image.ss: -------------------------------------------------------------------------------- 1 | <% if $ImageShown %> 2 |
3 | <% if $ImageLinked %><% end_if %> 4 | $Self.Title 5 | <% if $ImageLinked %><% end_if %> 6 |
7 | <% end_if %> 8 | -------------------------------------------------------------------------------- /templates/SilverWare/Model/Link/CustomCSS.ss: -------------------------------------------------------------------------------- 1 | <% loop $LinkImageDimensions %> 2 | 3 | <% if $Breakpoint %>@media (min-width: {$Breakpoint}) {<% end_if %> 4 | 5 | {$Up.CSSID} > img, 6 | {$Up.CSSID} > svg { 7 | width: {$Width}px; 8 | height: {$Height}px; 9 | } 10 | 11 | <% if $Breakpoint %>}<% end_if %> 12 | 13 | <% end_loop %> 14 | -------------------------------------------------------------------------------- /admin/client/src/styles/forms/ViewportsField.scss: -------------------------------------------------------------------------------- 1 | /* Viewports Field Styles 2 | ===================================================================================================================== */ 3 | 4 | .field { 5 | 6 | &.viewports { 7 | 8 | .text, .dropdown { 9 | min-width: 140px; 10 | max-width: 140px; 11 | } 12 | 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /templates/SilverWare/Model/Link.ss: -------------------------------------------------------------------------------- 1 | <% if $HasLinkImage %> 2 | 3 | <% if $HasInlineVector %> 4 | $LinkImage.RenderInline 5 | <% else %> 6 | $Title 7 | <% end_if %> 8 | 9 | <% else %> 10 | $FontIconTag$Title 11 | <% end_if %> 12 | -------------------------------------------------------------------------------- /templates/SilverWare/Forms/AutoCompleteField.ss: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | <% if $Value %> 6 | $Value 7 | <% else %> 8 | $EmptyValue 9 | <% end_if %> 10 | 11 | Clear 12 |
13 | -------------------------------------------------------------------------------- /templates/SilverWare/Lists/ListItem/Includes/Header.ss: -------------------------------------------------------------------------------- 1 | <% if $Renderer.isHeaderShown($isFirst, $isMiddle, $isLast) %> 2 |
3 | <$Renderer.HeadingTag> 4 | <% if $Renderer.LinkTitles %> 5 | $MetaTitle 6 | <% else %> 7 | $MetaTitle 8 | <% end_if %> 9 | 10 |
11 | <% end_if %> 12 | -------------------------------------------------------------------------------- /templates/SilverWare/Components/ImageComponent.ss: -------------------------------------------------------------------------------- 1 |
2 | <% if $LinkImage %><% end_if %> 3 | <% if $HasInlineVector %>$Image.RenderInline<% else %><% end_if %> 4 | <% if $LinkImage %><% end_if %> 5 | <% if $CaptionShown %> 6 |
7 | $Caption 8 |
9 | <% end_if %> 10 |
11 | -------------------------------------------------------------------------------- /_config/logging.yml: -------------------------------------------------------------------------------- 1 | --- 2 | Name: silverware-logging-dev 3 | Only: 4 | environment: dev 5 | --- 6 | 7 | # Configure Debug Logger: 8 | 9 | SilverStripe\Core\Injector\Injector: 10 | Psr\Log\LoggerInterface: 11 | calls: 12 | LogFileHandler: [ pushHandler, [ %$LogFileHandler ] ] 13 | LogFileHandler: 14 | class: Monolog\Handler\StreamHandler 15 | constructor: 16 | - '../silverware-debug.log' 17 | - 'debug' 18 | -------------------------------------------------------------------------------- /admin/client/src/bundles/bundle.js: -------------------------------------------------------------------------------- 1 | /* SilverWare Admin Bundle 2 | ===================================================================================================================== */ 3 | 4 | // Load Styles: 5 | 6 | require('styles/bundle.scss'); 7 | 8 | // Load Scripts: 9 | 10 | require('entwine/NumberBadges.js'); 11 | require('entwine/ListViewExtension.js'); 12 | 13 | // Load Form Fields: 14 | 15 | require('forms/ToggleGroup.js'); 16 | -------------------------------------------------------------------------------- /templates/SilverWare/Components/BaseListComponent/CustomCSS.ss: -------------------------------------------------------------------------------- 1 | <% if $OverlayBackground %> 2 | {$CSSID} .image-overlay { 3 | background-color: $OverlayBackground; 4 | } 5 | <% end_if %> 6 | 7 | <% if $OverlayIconColor %> 8 | {$CSSID} .image-overlay div.icon > i { 9 | color: $OverlayIconColor; 10 | } 11 | <% end_if %> 12 | 13 | <% if $OverlayForeground %> 14 | {$CSSID} .image-overlay div.text > * { 15 | color: $OverlayForeground; 16 | } 17 | <% end_if %> 18 | -------------------------------------------------------------------------------- /client/src/styles/components/PageComponent.scss: -------------------------------------------------------------------------------- 1 | /* Page Component Styles 2 | ===================================================================================================================== */ 3 | 4 | .pagecomponent { 5 | 6 | &.page-title-hidden { 7 | 8 | .content-container > article > header { 9 | display: none; 10 | } 11 | 12 | } 13 | 14 | .content-container > article > div { 15 | margin-bottom: $spacer; 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /_config/buttons.yml: -------------------------------------------------------------------------------- 1 | --- 2 | Name: silverware-buttons 3 | --- 4 | 5 | # Define Button Style: 6 | 7 | SilverWare\Extensions\Style\ButtonStyle: 8 | button_types: 9 | primary: Primary 10 | secondary: Secondary 11 | success: Success 12 | info: Info 13 | warning: Warning 14 | danger: Danger 15 | light: Light 16 | dark: Dark 17 | link: Link 18 | default_button_type: primary 19 | default_button_size: medium 20 | default_button_style: filled 21 | -------------------------------------------------------------------------------- /client/src/styles/components/ImageComponent.scss: -------------------------------------------------------------------------------- 1 | /* Image Component Styles 2 | ===================================================================================================================== */ 3 | 4 | .imagecomponent { 5 | 6 | figure { 7 | 8 | width: 100%; 9 | margin-bottom: 0; 10 | 11 | > figcaption > p:last-child { 12 | margin-bottom: 0; 13 | } 14 | 15 | } 16 | 17 | a.image { 18 | display: block; 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /admin/client/src/styles/preview.scss: -------------------------------------------------------------------------------- 1 | /* SilverWare Admin Preview Bundle 2 | ===================================================================================================================== */ 3 | 4 | // Import SilverStripe Admin Styles: 5 | 6 | @import "~silverstripe-admin/styles/variables"; 7 | //@import "~silverstripe-admin/styles/legacy/themes/default"; 8 | 9 | // Import Local Variables: 10 | 11 | @import "variables"; 12 | 13 | // Import Styles: 14 | 15 | @import "preview/ComponentPreview"; 16 | -------------------------------------------------------------------------------- /templates/SilverWare/Components/BaseListComponent.ss: -------------------------------------------------------------------------------- 1 | <% if $ListItems %> 2 | <% include SilverWare\Components\BaseListComponent\Alerts %> 3 |
4 | <% loop $ListItems %> 5 | $renderListItem($First, $Middle, $Last) 6 | <% end_loop %> 7 |
8 | <% if $PaginateItems %> 9 | <% include Pagination List=$ListItems %> 10 | <% end_if %> 11 | <% else_if $NoDataMessageShown %> 12 | <% include Alert Type='warning', Text=$NoDataMessage %> 13 | <% end_if %> 14 | -------------------------------------------------------------------------------- /_config.php: -------------------------------------------------------------------------------- 1 | =5.6.0 7 | * 8 | * For full copyright and license information, please view the 9 | * LICENSE.md file that was distributed with this source code. 10 | * 11 | * @package SilverWare 12 | * @author Colin Tucker 13 | * @copyright 2017 Praxis Interactive 14 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 15 | * @link https://github.com/praxisnetau/silverware 16 | */ 17 | -------------------------------------------------------------------------------- /templates/SilverWare/Lists/ListItem/Includes/Footer.ss: -------------------------------------------------------------------------------- 1 | <% if $Renderer.isFooterShown($isFirst, $isMiddle, $isLast) %> 2 | 11 | <% end_if %> 12 | -------------------------------------------------------------------------------- /templates/SilverWare/Components/FeatureComponent/Includes/Header.ss: -------------------------------------------------------------------------------- 1 | <% if $HeaderShown %> 2 |
3 | <$HeadingTag class="$HeadingClass"> 4 | <% if $HeadingLinked %> 5 | $HeadingText 6 | <% else %> 7 | $HeadingText 8 | <% end_if %> 9 | 10 | <% if $SubHeadingText %> 11 | <$SubHeadingTag class="$SubHeadingClass"> 12 | $SubHeadingText 13 | 14 | <% end_if %> 15 |
16 | <% end_if %> 17 | -------------------------------------------------------------------------------- /templates/SilverWare/Components/ScrollToTopButton/CustomCSS.ss: -------------------------------------------------------------------------------- 1 | <% loop $ButtonDimensions %> 2 | 3 | <% if $Breakpoint %>@media (min-width: {$Breakpoint}) {<% end_if %> 4 | 5 | {$Up.CSSID} { 6 | <% if $Size %>width: {$Size}px;<% end_if %> 7 | <% if $Size %>height: {$Size}px;<% end_if %> 8 | <% if $Size %>line-height: {$Size}px;<% end_if %> 9 | <% if $IconSize %>font-size: {$IconSize}px;<% end_if %> 10 | } 11 | 12 | <% if $Breakpoint %>}<% end_if %> 13 | 14 | <% end_loop %> 15 | -------------------------------------------------------------------------------- /templates/SilverWare/Components/MediaComponent/Link.ss: -------------------------------------------------------------------------------- 1 |
2 | <% if $HasImage %> 3 | <% if $LinkImage %><% end_if %> 4 | $ImageAltText 5 | <% if $LinkImage %><% end_if %> 6 | <% end_if %> 7 | <% if $TextLinkShown %> 8 | 9 | <% if $IconShown %>$TextLinkIcon.Tag<% end_if %> 10 | $MediaTitle 11 | 12 | <% end_if %> 13 |
14 | -------------------------------------------------------------------------------- /admin/client/src/styles/bundle.scss: -------------------------------------------------------------------------------- 1 | /* SilverWare Admin Bundle 2 | ===================================================================================================================== */ 3 | 4 | // Import SilverStripe Admin Styles: 5 | 6 | @import "~silverstripe-admin/styles/variables"; 7 | //@import "~silverstripe-admin/styles/legacy/themes/default"; 8 | 9 | // Import Local Variables: 10 | 11 | @import "variables"; 12 | 13 | // Import Styles: 14 | 15 | @import "admin"; 16 | @import "forms/DimensionsField"; 17 | @import "forms/ViewportsField"; 18 | -------------------------------------------------------------------------------- /client/src/styles/mixins/_icon-size.scss: -------------------------------------------------------------------------------- 1 | /* Icon Size Mixin 2 | ===================================================================================================================== */ 3 | 4 | @mixin icon-size($size) { 5 | 6 | &.size-#{$size} { 7 | 8 | width: #{$size}px; 9 | height: #{$size}px; 10 | font-size: #{$size * $icon-size-multiplier}px; 11 | line-height: #{$size}px; 12 | 13 | > i.fa { 14 | top: 50%; 15 | position: relative; 16 | transform: translateY(-50%); 17 | } 18 | 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /client/src/styles/components/ContentComponent.scss: -------------------------------------------------------------------------------- 1 | /* Content Component Styles 2 | ===================================================================================================================== */ 3 | 4 | .contentcomponent { 5 | 6 | > header { 7 | 8 | a { 9 | color: inherit; 10 | } 11 | 12 | } 13 | 14 | > div.content { 15 | 16 | &:after { 17 | content: ""; 18 | display: table; 19 | clear: both; 20 | } 21 | 22 | } 23 | 24 | > footer { 25 | margin-top: $spacer; 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /client/src/styles/model/Slide.scss: -------------------------------------------------------------------------------- 1 | /* Slide Styles 2 | ===================================================================================================================== */ 3 | 4 | .component.slide { 5 | 6 | .slide-caption { 7 | 8 | > p:last-child { 9 | margin-bottom: 0; 10 | } 11 | 12 | &.title-after { 13 | 14 | > h1, > h2, > h3, > h4, > h5, > h6 { 15 | margin-bottom: 0; 16 | } 17 | 18 | } 19 | 20 | > footer { 21 | text-align: center; 22 | } 23 | 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /admin/client/dist/js/preview.js: -------------------------------------------------------------------------------- 1 | !function(e){function r(t){if(n[t])return n[t].exports;var o=n[t]={i:t,l:!1,exports:{}};return e[t].call(o.exports,o,o.exports,r),o.l=!0,o.exports}var n={};r.m=e,r.c=n,r.d=function(e,n,t){r.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:t})},r.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(n,"a",n),n},r.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},r.p="/resources/vendor/silverware/silverware/admin/client/dist/",r(r.s=6)}({6:function(e,r,n){n(7)},7:function(e,r){}}); -------------------------------------------------------------------------------- /templates/SilverWare/Lists/ListItem.ss: -------------------------------------------------------------------------------- 1 |
2 | <% include SilverWare\Lists\ListItem\Image %> 3 | <% if not $Renderer.isContentEmpty($isFirst, $isMiddle, $isLast) %> 4 |
5 | <% include SilverWare\Lists\ListItem\Header %> 6 | <% include SilverWare\Lists\ListItem\Details %> 7 | <% include SilverWare\Lists\ListItem\Summary %> 8 | <% include SilverWare\Lists\ListItem\Content %> 9 | <% include SilverWare\Lists\ListItem\Footer %> 10 |
11 | <% end_if %> 12 |
13 | -------------------------------------------------------------------------------- /client/src/jquery/popovers.js: -------------------------------------------------------------------------------- 1 | /* Popovers 2 | ===================================================================================================================== */ 3 | 4 | import $ from 'jquery'; 5 | 6 | $(function() { 7 | 8 | // Dismiss Popovers on Outside Click: 9 | 10 | $('body').on('click', function(e) { 11 | $('[data-toggle="popover"]').each(function() { 12 | if (!$(this).is(e.target) && $(this).has(e.target).length === 0 && $('.popover').has(e.target).length === 0) { 13 | $(this).popover('hide'); 14 | } 15 | }); 16 | }); 17 | 18 | }); 19 | -------------------------------------------------------------------------------- /templates/SilverWare/Components/FeatureComponent.ss: -------------------------------------------------------------------------------- 1 |
2 | <% if $FeatureLinked %><% end_if %> 3 | <% include SilverWare\Components\FeatureComponent\Image %> 4 |
5 | <% include SilverWare\Components\FeatureComponent\Icon %> 6 | <% include SilverWare\Components\FeatureComponent\Header %> 7 | <% include SilverWare\Components\FeatureComponent\Summary %> 8 | <% include SilverWare\Components\FeatureComponent\Footer %> 9 |
10 | <% if $FeatureLinked %>
<% end_if %> 11 |
12 | -------------------------------------------------------------------------------- /admin/client/src/styles/forms/DimensionsField.scss: -------------------------------------------------------------------------------- 1 | /* Dimensions Field Styles 2 | ===================================================================================================================== */ 3 | 4 | .field { 5 | 6 | &.dimensions .by { 7 | 8 | display: inline-block; 9 | line-height: 30px; 10 | margin-right: $spacer / 2; 11 | 12 | &:last-child { 13 | display: none; 14 | } 15 | 16 | .icon::before { 17 | content: "\44"; 18 | font-size: 16px; 19 | font-style: normal; 20 | font-weight: normal; 21 | font-family: "silverstripe"; 22 | } 23 | 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /client/src/bundles/bundle.js: -------------------------------------------------------------------------------- 1 | /* SilverWare Bundle 2 | ===================================================================================================================== */ 3 | 4 | // Load Styles: 5 | 6 | require('styles/bundle.scss'); 7 | 8 | // Load jQuery Scripts: 9 | 10 | require('jquery/popovers.js'); 11 | require('jquery/tagcanvas.js'); 12 | 13 | // Load Form Scripts: 14 | 15 | require('forms/MessageHandler.js'); 16 | require('forms/ToggleGroup.js'); 17 | 18 | // Load Components: 19 | 20 | require('components/HeaderSection.js'); 21 | require('components/ScrollToTopButton.js'); 22 | require('components/TagCloudComponent.js'); 23 | require('components/ToggleComponent.js'); 24 | -------------------------------------------------------------------------------- /client/src/components/HeaderSection.js: -------------------------------------------------------------------------------- 1 | /* Header Section 2 | ===================================================================================================================== */ 3 | 4 | import $ from 'jquery'; 5 | 6 | $(function() { 7 | 8 | // Handle Header Sections: 9 | 10 | $('.headersection').each(function() { 11 | 12 | var $self = $(this); 13 | 14 | // Add or Remove Class on Scroll: 15 | 16 | $(window).scroll(function() { 17 | 18 | if ($(this).scrollTop() > 0) { 19 | $self.addClass('scrolled'); 20 | } else { 21 | $self.removeClass('scrolled'); 22 | } 23 | 24 | }); 25 | 26 | }); 27 | 28 | }); 29 | -------------------------------------------------------------------------------- /client/src/styles/_variables.scss: -------------------------------------------------------------------------------- 1 | /* SilverWare Variables 2 | ===================================================================================================================== */ 3 | 4 | $icon-size-list: 16 24 32 48 64 96 128; 5 | $icon-size-multiplier: 0.5; 6 | 7 | $image-overlay-background: rgba($gray-900, 0.5); 8 | $image-overlay-foreground: $white; 9 | 10 | $detail-fields-name-weight: $font-weight-bold; 11 | $detail-fields-inline-margin: $spacer-half; 12 | 13 | $detail-fields-block-name-font-size: 1rem; 14 | $detail-fields-block-text-font-size: 1rem; 15 | 16 | $detail-fields-inline-name-font-size: 1rem; 17 | $detail-fields-inline-text-font-size: 1rem; 18 | 19 | $detail-fields-inline-color: $gray-600; 20 | -------------------------------------------------------------------------------- /client/src/styles/components/FeatureComponent.scss: -------------------------------------------------------------------------------- 1 | /* Feature Component Styles 2 | ===================================================================================================================== */ 3 | 4 | .featurecomponent { 5 | 6 | article.feature { 7 | 8 | > a.feature { 9 | display: block; 10 | text-decoration: none; 11 | @include hover-focus { 12 | text-decoration: none; 13 | } 14 | @include transition($btn-transition); 15 | } 16 | 17 | div.icon { 18 | margin-bottom: $spacer-half; 19 | } 20 | 21 | div.summary > p:last-child { 22 | margin-bottom: 0; 23 | } 24 | 25 | footer { 26 | margin-top: $spacer; 27 | } 28 | 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /client/src/forms/ToggleGroup.js: -------------------------------------------------------------------------------- 1 | /* Toggle Group 2 | ===================================================================================================================== */ 3 | 4 | import $ from 'jquery'; 5 | 6 | $(function() { 7 | 8 | $('.field.togglegroup').each(function() { 9 | 10 | var $self = $(this); 11 | var $mode = $self.find('.group-toggle').data('show-when-checked'); 12 | 13 | var $toggle = $self.find('.group-toggle input'); 14 | var $fields = $self.find('.group-fields'); 15 | 16 | $fields.toggle($mode ? $toggle.is(':checked') : !$toggle.is(':checked')); 17 | 18 | $toggle.on('click', function() { 19 | $fields.toggle($mode ? $(this).is(':checked') : !$(this).is(':checked')); 20 | }); 21 | 22 | }); 23 | 24 | }); 25 | -------------------------------------------------------------------------------- /_config/images.yml: -------------------------------------------------------------------------------- 1 | --- 2 | Name: silverware-images 3 | --- 4 | 5 | # Define Image Extensions: 6 | 7 | SilverStripe\Assets\Image: 8 | extensions: 9 | - SilverWare\Extensions\Model\CropPriorityExtension 10 | 11 | # Define Admin Extensions: 12 | 13 | SilverStripe\AssetAdmin\Forms\FileFormFactory: 14 | extensions: 15 | - SilverWare\Extensions\Admin\CropPriorityFileFormExtension 16 | 17 | # Define Image Resize Methods: 18 | 19 | SilverWare\Tools\ImageTools: 20 | resize_methods: 21 | crop-width: 'Crop Width' 22 | crop-height: 'Crop Height' 23 | fill: 'Fill' 24 | fill-max: 'Fill Max' 25 | fill-priority: 'Fill Priority' 26 | fit: 'Fit' 27 | fit-max: 'Fit Max' 28 | pad: 'Pad' 29 | scale-width: 'Scale Width' 30 | scale-height: 'Scale Height' 31 | scale-max-width: 'Scale Max Width' 32 | scale-max-height: 'Scale Max Height' 33 | -------------------------------------------------------------------------------- /client/src/components/ToggleComponent.js: -------------------------------------------------------------------------------- 1 | /* Toggle Component 2 | ===================================================================================================================== */ 3 | 4 | import $ from 'jquery'; 5 | 6 | $(function() { 7 | 8 | // Handle Toggle Components: 9 | 10 | $('.togglecomponent').each(function() { 11 | 12 | var $self = $(this); 13 | var $header = $self.find('header'); 14 | 15 | // Detect Start Open Status: 16 | 17 | if ($self.data('start-open')) { 18 | $header.addClass('opened'); 19 | } 20 | 21 | // Handle Header Click: 22 | 23 | $header.on('click', function() { 24 | $(this).toggleClass('opened'); 25 | }); 26 | 27 | // Handle Header Link Click: 28 | 29 | $header.find('a').on('click', function(e) { 30 | e.stopPropagation(); 31 | }); 32 | 33 | }); 34 | 35 | }); 36 | -------------------------------------------------------------------------------- /templates/SilverWare/Model/Component/CMSPreview.ss: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | <% base_tag %> 6 | 7 | 8 | 9 | $MetaTags(false)$Title 10 | 11 | 12 |
13 |
14 |

15 | 16 | <%t SilverWare\Model\Component.PREVIEW 'Preview' %> 17 | ($ComponentType) 18 |

19 |
20 |
21 |
$renderPreview.RAW
22 |
23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /templates/SilverWare/Extensions/Style/LinkColorStyle/CustomCSS.ss: -------------------------------------------------------------------------------- 1 | <% if $HasLinkColors %> 2 | 3 | {$CustomCSSPrefix} { 4 | <% if $ColorForegroundLink %>color: {$ColorForegroundLink};<% end_if %> 5 | <% if $ColorBackgroundLink %>background-color: {$ColorBackgroundLink};<% end_if %> 6 | } 7 | 8 | <% end_if %> 9 | 10 | <% if $HasHoverColors %> 11 | 12 | {$CustomCSSPrefix}:focus, 13 | {$CustomCSSPrefix}:hover { 14 | <% if $ColorForegroundHover %>color: {$ColorForegroundHover};<% end_if %> 15 | <% if $ColorBackgroundHover %>background-color: {$ColorBackgroundHover};<% end_if %> 16 | } 17 | 18 | <% end_if %> 19 | 20 | <% if $HasActiveColors %> 21 | 22 | {$CustomCSSPrefix}:active { 23 | <% if $ColorForegroundActive %>color: {$ColorForegroundActive};<% end_if %> 24 | <% if $ColorBackgroundActive %>background-color: {$ColorBackgroundActive};<% end_if %> 25 | } 26 | 27 | <% end_if %> 28 | -------------------------------------------------------------------------------- /templates/SilverWare/Extensions/Model/DetailFieldsExtension/Details.ss: -------------------------------------------------------------------------------- 1 | <% if $HasDetailFields %> 2 |
3 |
4 | <{$DetailFieldsHeadingTag}>{$DetailFieldsHeadingText} 5 |
6 | 24 |
25 | <% end_if %> 26 | -------------------------------------------------------------------------------- /templates/SilverWare/Model/Slide.ss: -------------------------------------------------------------------------------- 1 | <$Tag $getSlideAttributesHTML($isFirst, $isMiddle, $isLast)> 2 | <% if $LinkShown %><% end_if %> 3 | <% if $ImageShown %> 4 | $Title 5 | <% end_if %> 6 | <% if $TitleOrCaptionShown %> 7 |
8 | <% if $TitleShownBeforeCaption %> 9 | <{$HeadingTag}>{$FontIconTag}{$Title} 10 | <% end_if %> 11 | <% if $CaptionShown %> 12 | $Caption 13 | <% end_if %> 14 | <% if $TitleShownAfterCaption %> 15 | <{$HeadingTag}>{$FontIconTag}{$Title} 16 | <% end_if %> 17 | <% if $FooterLinkShown %> 18 | 21 | <% end_if %> 22 |
23 | <% end_if %> 24 | <% if $LinkShown %><% end_if %> 25 | 26 | -------------------------------------------------------------------------------- /admin/client/dist/styles/preview.css: -------------------------------------------------------------------------------- 1 | .cms-preview-component{overflow:hidden}.cms-preview-component .cms-preview-wrapper{top:0;left:0;right:0;bottom:0;position:absolute}.cms-preview-component .cms-preview-wrapper>header{min-height:53px;padding-left:1.2308rem;white-space:nowrap;font-size:.846rem;background-repeat:repeat;background-position:0 100%;background-color:#f1f3f6;background-image:url(/resources/vendor/silverware/silverware/admin/client/dist/images/cms_content_header.png)}.cms-preview-component .cms-preview-wrapper>header>h1{margin:0;color:#43536d;font-size:1.2em;font-weight:400;line-height:53px}.cms-preview-component .cms-preview-wrapper>header>h1 i,.cms-preview-component .cms-preview-wrapper>header>h1 span.class{color:#66727d}.cms-preview-component .cms-preview-wrapper>div.component{top:53px;bottom:0;width:100%;height:auto;padding:1.2308rem;overflow-x:hidden;overflow-y:auto;position:absolute;background-color:#f6f7f8}.cms-preview-component .cms-preview-wrapper>div.component>div.preview{background-color:#fff;-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px rgba(0,0,0,.2)} -------------------------------------------------------------------------------- /src/Tags/TagSource.php: -------------------------------------------------------------------------------- 1 | =5.6.0 7 | * 8 | * For full copyright and license information, please view the 9 | * LICENSE.md file that was distributed with this source code. 10 | * 11 | * @package SilverWare\Tags 12 | * @author Colin Tucker 13 | * @copyright 2017 Praxis Interactive 14 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 15 | * @link https://github.com/praxisnetau/silverware 16 | */ 17 | 18 | namespace SilverWare\Tags; 19 | 20 | /** 21 | * Interface for classes which can filter items by tags. 22 | * 23 | * @package SilverWare\Lists 24 | * @author Colin Tucker 25 | * @copyright 2017 Praxis Interactive 26 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 27 | * @link https://github.com/praxisnetau/silverware 28 | */ 29 | interface TagSource 30 | { 31 | /** 32 | * Answers a list of tags. 33 | * 34 | * @return SS_List 35 | */ 36 | public function getTags(); 37 | } 38 | -------------------------------------------------------------------------------- /templates/SilverWare/Lists/ListItem/Includes/Image.ss: -------------------------------------------------------------------------------- 1 | <% if $Renderer.isImageShown($isFirst, $isMiddle, $isLast) && $HasMetaImage %> 2 | 25 | <% end_if %> 26 | -------------------------------------------------------------------------------- /src/Components/BaseComponentController.php: -------------------------------------------------------------------------------- 1 | =5.6.0 7 | * 8 | * For full copyright and license information, please view the 9 | * LICENSE.md file that was distributed with this source code. 10 | * 11 | * @package SilverWare\Components 12 | * @author Colin Tucker 13 | * @copyright 2017 Praxis Interactive 14 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 15 | * @link https://github.com/praxisnetau/silverware 16 | */ 17 | 18 | namespace SilverWare\Components; 19 | 20 | use SilverWare\Model\ComponentController; 21 | 22 | /** 23 | * An extension of the component controller class for a base component controller. 24 | * 25 | * @package SilverWare\Components 26 | * @author Colin Tucker 27 | * @copyright 2017 Praxis Interactive 28 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 29 | * @link https://github.com/praxisnetau/silverware 30 | */ 31 | class BaseComponentController extends ComponentController 32 | { 33 | } 34 | -------------------------------------------------------------------------------- /src/Lists/ListSource.php: -------------------------------------------------------------------------------- 1 | =5.6.0 7 | * 8 | * For full copyright and license information, please view the 9 | * LICENSE.md file that was distributed with this source code. 10 | * 11 | * @package SilverWare\Lists 12 | * @author Colin Tucker 13 | * @copyright 2017 Praxis Interactive 14 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 15 | * @link https://github.com/praxisnetau/silverware 16 | */ 17 | 18 | namespace SilverWare\Lists; 19 | 20 | /** 21 | * Interface for classes which provide items for a list component. 22 | * 23 | * @package SilverWare\Lists 24 | * @author Colin Tucker 25 | * @copyright 2017 Praxis Interactive 26 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 27 | * @link https://github.com/praxisnetau/silverware 28 | */ 29 | interface ListSource 30 | { 31 | /** 32 | * Answers a list of items. 33 | * 34 | * @return SS_List 35 | */ 36 | public function getListItems(); 37 | } 38 | -------------------------------------------------------------------------------- /client/src/styles/model/Link.scss: -------------------------------------------------------------------------------- 1 | /* Link Styles 2 | ===================================================================================================================== */ 3 | 4 | .component.link { 5 | 6 | display: inline-block; 7 | text-decoration: none; 8 | 9 | > i.fa { 10 | display: inline-block; 11 | } 12 | 13 | &:hover, 14 | &:focus, 15 | &:active { 16 | text-decoration: none; 17 | } 18 | 19 | } 20 | 21 | .show-icons.hide-text { 22 | 23 | .component.link { 24 | 25 | overflow: hidden; 26 | text-align: center; 27 | transition: color 0.15s ease-in-out 0s, background-color 0.15s ease-in-out 0s, border-color 0.15s ease-in-out 0s; 28 | 29 | > i.fa { 30 | display: block; 31 | } 32 | 33 | @each $size in $icon-size-list { 34 | @include icon-size($size); 35 | } 36 | 37 | } 38 | 39 | } 40 | 41 | .hide-icons { 42 | 43 | .component.link > i.fa { 44 | display: none; 45 | } 46 | 47 | } 48 | 49 | .hide-text { 50 | 51 | .component.link > span.text { 52 | display: none; 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /_config/theme.yml: -------------------------------------------------------------------------------- 1 | --- 2 | Name: silverware-theme 3 | --- 4 | 5 | # Define Theme Styles: 6 | 7 | SilverWare\Extensions\Style\ThemeStyle: 8 | theme_styles: 9 | ColorBackground: 10 | background.primary: Primary 11 | background.secondary: Secondary 12 | background.success: Success 13 | background.info: Info 14 | background.warning: Warning 15 | background.danger: Danger 16 | background.white: White 17 | background.light: Light 18 | background.dark: Dark 19 | ColorForeground: 20 | text.primary: Primary 21 | text.secondary: Secondary 22 | text.success: Success 23 | text.info: Info 24 | text.warning: Warning 25 | text.danger: Danger 26 | text.white: White 27 | text.light: Light 28 | text.dark: Dark 29 | ColorBorder: 30 | border.primary: Primary 31 | border.secondary: Secondary 32 | border.success: Success 33 | border.info: Info 34 | border.warning: Warning 35 | border.danger: Danger 36 | border.white: White 37 | border.light: Light 38 | border.dark: Dark 39 | -------------------------------------------------------------------------------- /src/Grid/Extensions/GridExtension.php: -------------------------------------------------------------------------------- 1 | =5.6.0 7 | * 8 | * For full copyright and license information, please view the 9 | * LICENSE.md file that was distributed with this source code. 10 | * 11 | * @package SilverWare\Grid\Extensions 12 | * @author Colin Tucker 13 | * @copyright 2017 Praxis Interactive 14 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 15 | * @link https://github.com/praxisnetau/silverware 16 | */ 17 | 18 | namespace SilverWare\Grid\Extensions; 19 | 20 | use SilverStripe\ORM\DataExtension; 21 | use SilverWare\View\GridAware; 22 | 23 | /** 24 | * A data extension class which forms an abstract base for grid extensions. 25 | * 26 | * @package SilverWare\Grid\Extensions 27 | * @author Colin Tucker 28 | * @copyright 2017 Praxis Interactive 29 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 30 | * @link https://github.com/praxisnetau/silverware 31 | */ 32 | abstract class GridExtension extends DataExtension 33 | { 34 | use GridAware; 35 | } 36 | -------------------------------------------------------------------------------- /client/src/styles/bundle.scss: -------------------------------------------------------------------------------- 1 | /* SilverWare Bundle 2 | ===================================================================================================================== */ 3 | 4 | // Import SilverWare Theme Files: 5 | 6 | @import "~silverware-theme/styles/variables"; 7 | @import "~silverware-theme/styles/mixins"; 8 | 9 | // Import Bootstrap Styles: 10 | 11 | @import "~bootstrap/scss/mixins"; 12 | @import "~bootstrap/scss/functions"; 13 | @import "~bootstrap/scss/variables"; 14 | 15 | // Import Local Files: 16 | 17 | @import "variables"; 18 | @import "mixins"; 19 | 20 | // Import Component Styles: 21 | 22 | @import "components/BaseListComponent"; 23 | @import "components/ContentComponent"; 24 | @import "components/FeatureComponent"; 25 | @import "components/ImageComponent"; 26 | @import "components/ListComponent"; 27 | @import "components/MediaComponent"; 28 | @import "components/PageComponent"; 29 | @import "components/ScrollToTopButton"; 30 | @import "components/TableComponent"; 31 | @import "components/TileComponent"; 32 | @import "components/ToggleComponent"; 33 | 34 | // Import Extension Styles: 35 | 36 | @import "extensions/DetailFieldsExtension"; 37 | 38 | // Import Model Styles: 39 | 40 | @import "model/Link"; 41 | @import "model/Slide"; 42 | -------------------------------------------------------------------------------- /client/src/styles/components/TileComponent.scss: -------------------------------------------------------------------------------- 1 | /* Tile Component Styles 2 | ===================================================================================================================== */ 3 | 4 | .tilecomponent { 5 | 6 | .items { 7 | 8 | display: flex; 9 | flex-flow: row wrap; 10 | align-items: stretch; 11 | 12 | > article.item { 13 | 14 | display: flex; 15 | flex-direction: column; 16 | 17 | flex: 1 100%; 18 | padding: 2%; 19 | 20 | > section.content { 21 | 22 | margin-top: auto; 23 | 24 | div.details > span { 25 | display: block; 26 | margin-right: 0; 27 | margin-bottom: $spacer-quarter; 28 | } 29 | 30 | } 31 | 32 | } 33 | 34 | } 35 | 36 | @include media-breakpoint-up(sm) { 37 | 38 | .items > article.item { 39 | flex: 1 50%; 40 | } 41 | 42 | } 43 | 44 | @include media-breakpoint-up(md) { 45 | 46 | .items > article.item { 47 | flex: 1 33.3%; 48 | } 49 | 50 | } 51 | 52 | @include media-breakpoint-up(lg) { 53 | 54 | .items > article.item { 55 | flex: 1 25%; 56 | } 57 | 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /client/src/components/ScrollToTopButton.js: -------------------------------------------------------------------------------- 1 | /* Scroll to Top Button 2 | ===================================================================================================================== */ 3 | 4 | import $ from 'jquery'; 5 | 6 | $(function() { 7 | 8 | // Handle Scroll to Top Buttons: 9 | 10 | $('.scrolltotopbutton').each(function() { 11 | 12 | var $button = $(this); 13 | 14 | var offset_show = parseInt($button.data('offset-show')); 15 | var offset_opacity = parseInt($button.data('offset-opacity')); 16 | var scroll_duration = parseInt($button.data('scroll-duration')); 17 | 18 | // Hide or Show Button: 19 | 20 | $(window).scroll(function() { 21 | 22 | if ($(this).scrollTop() > offset_show) { 23 | $button.addClass('is-visible'); 24 | } else { 25 | $button.removeClass('is-visible fade-out'); 26 | } 27 | 28 | if ($(this).scrollTop() > offset_opacity) { 29 | $button.addClass('fade-out'); 30 | } 31 | 32 | }); 33 | 34 | // Animate Scroll to Top: 35 | 36 | $button.on('click', function(e) { 37 | e.preventDefault(); 38 | $('body, html').animate({ scrollTop: 0 }, scroll_duration); 39 | }); 40 | 41 | }); 42 | 43 | }); 44 | -------------------------------------------------------------------------------- /client/src/styles/components/ToggleComponent.scss: -------------------------------------------------------------------------------- 1 | /* Toggle Component Styles 2 | ===================================================================================================================== */ 3 | 4 | .togglecomponent { 5 | 6 | margin: 0 0 $spacer; 7 | border: $border-width solid $border-color; 8 | 9 | > header { 10 | 11 | cursor: pointer; 12 | padding: $spacer; 13 | transition: $transition-base; 14 | 15 | > * { 16 | 17 | margin: 0; 18 | font-size: inherit; 19 | 20 | &:before { 21 | opacity: 0.75; 22 | content: "\f0fe"; 23 | display: inline-block; 24 | padding-right: $spacer-half; 25 | font-family: 'FontAwesome'; 26 | } 27 | 28 | } 29 | 30 | &.opened { 31 | 32 | > *:before { 33 | content: "\f146"; 34 | } 35 | 36 | } 37 | 38 | &.opened + div.content { 39 | display: block; 40 | } 41 | 42 | @include hover-focus { 43 | background-color: rgba(0, 0, 0, 0.1); 44 | } 45 | 46 | } 47 | 48 | > div.content { 49 | 50 | display: none; 51 | padding: $spacer; 52 | 53 | border-top-width: $border-width; 54 | border-top-style: dotted; 55 | border-top-color: inherit; 56 | 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /src/Crumbs/Crumbable.php: -------------------------------------------------------------------------------- 1 | =5.6.0 7 | * 8 | * For full copyright and license information, please view the 9 | * LICENSE.md file that was distributed with this source code. 10 | * 11 | * @package SilverWare\Crumbs 12 | * @author Colin Tucker 13 | * @copyright 2017 Praxis Interactive 14 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 15 | * @link https://github.com/praxisnetau/silverware 16 | */ 17 | 18 | namespace SilverWare\Crumbs; 19 | 20 | /** 21 | * Interface for classes which can be rendered as breadcrumbs within the template. 22 | * 23 | * @package SilverWare\Crumbs 24 | * @author Colin Tucker 25 | * @copyright 2017 Praxis Interactive 26 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 27 | * @link https://github.com/praxisnetau/silverware 28 | */ 29 | interface Crumbable 30 | { 31 | /** 32 | * Answers the menu title for the receiver. 33 | * 34 | * @return string 35 | */ 36 | public function getMenuTitle(); 37 | 38 | /** 39 | * Answers the link for the receiver. 40 | * 41 | * @param string $action 42 | * 43 | * @return string 44 | */ 45 | public function getLink($action = null); 46 | } 47 | -------------------------------------------------------------------------------- /_config/controller.yml: -------------------------------------------------------------------------------- 1 | --- 2 | Name: silverware-controller 3 | --- 4 | 5 | # Configure Content Controller: 6 | 7 | SilverStripe\CMS\Controllers\ContentController: 8 | required_js: 9 | - "silverware/silverware: client/dist/js/bundle.js" 10 | required_css: 11 | - "silverware/silverware: client/dist/styles/bundle.css" 12 | required_themed_js: 13 | - production/js/bundle.js 14 | required_themed_css: 15 | - production/styles/bundle.css 16 | 17 | --- 18 | Name: silverware-controller-dev 19 | Only: 20 | environment: dev 21 | --- 22 | 23 | # Configure Content Controller (dev): 24 | 25 | SilverStripe\CMS\Controllers\ContentController: 26 | dev_server: 27 | host: auto 28 | port: 8080 29 | https: auto 30 | timeout: 10 31 | fallback: true 32 | load_js: true 33 | load_css: true 34 | load_themed_js: true 35 | load_themed_css: false 36 | load_custom_css: true 37 | disable_cache: true 38 | combine_files: true 39 | combined_js: combined.js 40 | combined_css: combined.css 41 | 42 | --- 43 | Name: silverware-controller-live 44 | Except: 45 | environment: dev 46 | --- 47 | 48 | # Configure Content Controller (live): 49 | 50 | SilverStripe\CMS\Controllers\ContentController: 51 | load_js: false 52 | load_css: false 53 | load_themed_js: true 54 | load_themed_css: true 55 | load_custom_css: true 56 | disable_cache: false 57 | -------------------------------------------------------------------------------- /admin/client/src/entwine/ListViewExtension.js: -------------------------------------------------------------------------------- 1 | /* List View Extension 2 | ===================================================================================================================== */ 3 | 4 | import $ from 'jquery'; 5 | 6 | $.entwine('silverware.listviewextension', function($) { 7 | 8 | // Handle List View Extension Fields: 9 | 10 | $('.tabset.silverware-extensions-lists-listviewextension').entwine({ 11 | 12 | onmatch: function() { 13 | 14 | var $self = $(this); 15 | 16 | this.handlePagination(); 17 | 18 | this.getPaginateItemsField().entwine({ 19 | onchange: function(e) { 20 | $self.handlePagination(); 21 | this._super(e); 22 | } 23 | }); 24 | 25 | this._super(); 26 | 27 | }, 28 | 29 | handlePagination: function() { 30 | var mode = this.getPaginateItemsField().val(); 31 | if (mode == 1) { 32 | this.getPaginationHolder().show(); 33 | } else { 34 | this.getPaginationHolder().hide(); 35 | } 36 | }, 37 | 38 | getPaginateItemsField: function() { 39 | return $(this).find('#Form_EditForm_List_PaginateItems'); 40 | }, 41 | 42 | getPaginationHolder: function() { 43 | return $(this).find('#Form_EditForm_List_ItemsPerPage_Holder'); 44 | } 45 | 46 | }); 47 | 48 | }); 49 | -------------------------------------------------------------------------------- /client/src/styles/components/ScrollToTopButton.scss: -------------------------------------------------------------------------------- 1 | /* Scroll to Top Button Styles 2 | ===================================================================================================================== */ 3 | 4 | .scrolltotopbutton { 5 | 6 | opacity: 0; 7 | outline: 0; 8 | right: $spacer; 9 | bottom: $spacer; 10 | width: ($spacer * 4); 11 | height: ($spacer * 4); 12 | z-index: 1000; 13 | position: fixed; 14 | display: block; 15 | overflow: hidden; 16 | visibility: hidden; 17 | white-space: nowrap; 18 | text-align: center; 19 | font-size: 16px; 20 | line-height: ($spacer * 4); 21 | 22 | box-shadow: 0 0 20px rgba(0, 0, 0, 0.2); 23 | 24 | transition: opacity .3s 0s, visibility 0s .3s, color 0.15s ease-in-out 0s, background-color 0.15s ease-in-out 0s; 25 | 26 | &.is-visible { 27 | opacity: 1; 28 | visibility: visible; 29 | } 30 | 31 | &.fade-out { 32 | opacity: 0.5; 33 | } 34 | 35 | &:hover { 36 | opacity: 1; 37 | } 38 | 39 | @include media-breakpoint-up(md) { 40 | width: ($spacer * 5); 41 | height: ($spacer * 5); 42 | right: $spacer-double; 43 | bottom: $spacer-double; 44 | line-height: ($spacer * 5); 45 | } 46 | 47 | @include media-breakpoint-up(lg) { 48 | width: ($spacer * 6); 49 | height: ($spacer * 6); 50 | font-size: 20px; 51 | line-height: ($spacer * 6); 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /_config/model.yml: -------------------------------------------------------------------------------- 1 | --- 2 | Name: silverware-model 3 | --- 4 | 5 | # SilverWare Model: 6 | 7 | SilverStripe\Core\Injector\Injector: 8 | AppFixtureFactory: 9 | class: SilverWare\Dev\FixtureFactory 10 | GridFramework: 11 | class: SilverWare\Grid\Frameworks\Bootstrap\Framework 12 | AbsoluteInt: 13 | class: SilverWare\ORM\FieldType\DBAbsoluteInt 14 | Dimensions: 15 | class: SilverWare\ORM\FieldType\DBDimensions 16 | Viewports: 17 | class: SilverWare\ORM\FieldType\DBViewports 18 | SilverWare\Extensions\Lists\ListSourceExtension: 19 | class: SilverWare\Extensions\Lists\ListSourceExtension 20 | type: prototype 21 | 22 | # Configure Fixture Factory: 23 | 24 | SilverWare\Dev\FixtureFactory: 25 | default_blueprint: SilverWare\Dev\FixtureBlueprint 26 | 27 | # Configure Fixture Blueprint: 28 | 29 | SilverWare\Dev\FixtureBlueprint: 30 | default_parents: 31 | SilverWare\Model\Template: 32 | class: SilverWare\Folders\TemplateFolder 33 | method: find 34 | SilverWare\Model\Layout: 35 | class: SilverWare\Folders\LayoutFolder 36 | method: find 37 | SilverWare\Model\Panel: 38 | class: SilverWare\Folders\PanelFolder 39 | method: find 40 | default_relations: 41 | SilverStripe\SiteConfig\SiteConfig: 42 | class: SilverStripe\SiteConfig\SiteConfig 43 | method: current_site_config 44 | default_identifiers: 45 | SilverWare\Model\PageType: PageClass 46 | verbose: false 47 | -------------------------------------------------------------------------------- /client/src/styles/components/MediaComponent.scss: -------------------------------------------------------------------------------- 1 | /* Media Component Styles 2 | ===================================================================================================================== */ 3 | 4 | .mediacomponent { 5 | 6 | figure { 7 | 8 | width: 100%; 9 | margin-bottom: 0; 10 | 11 | > figcaption > p:last-child { 12 | margin-bottom: 0; 13 | } 14 | 15 | } 16 | 17 | a.text { 18 | 19 | display: block; 20 | 21 | &:hover { 22 | 23 | span { 24 | text-decoration: underline; 25 | } 26 | 27 | text-decoration: none; 28 | 29 | } 30 | 31 | > i.fa { 32 | color: $gray-600; 33 | } 34 | 35 | } 36 | 37 | a.image { 38 | display: block; 39 | } 40 | 41 | a.image + a.text { 42 | margin-top: $spacer-half; 43 | } 44 | 45 | .rich { 46 | 47 | > iframe { 48 | margin: 0 !important; 49 | } 50 | 51 | } 52 | 53 | .video { 54 | 55 | width: 100%; 56 | height: 0; 57 | display: block; 58 | position: relative; 59 | 60 | &.four-three { 61 | padding-bottom: 75%; 62 | } 63 | 64 | &.sixteen-nine { 65 | padding-bottom: 56.25%; 66 | } 67 | 68 | > iframe { 69 | top: 0; 70 | left: 0; 71 | border: 0; 72 | width: 100%; 73 | height: 100%; 74 | position: absolute; 75 | } 76 | 77 | } 78 | 79 | } 80 | -------------------------------------------------------------------------------- /admin/client/src/forms/ToggleGroup.js: -------------------------------------------------------------------------------- 1 | /* Toggle Group 2 | ===================================================================================================================== */ 3 | 4 | import $ from 'jquery'; 5 | 6 | $.entwine('silverware.togglegroup', function($) { 7 | 8 | // Handle Toggle Groups: 9 | 10 | $('.field.togglegroup').entwine({ 11 | 12 | onmatch: function() { 13 | 14 | var $self = $(this); 15 | 16 | $self.doToggle(); 17 | 18 | $self.getToggleInput().entwine({ 19 | 20 | onclick: function(e) { 21 | $self.doToggle(); 22 | this._super(e); 23 | } 24 | 25 | }); 26 | 27 | this._super(); 28 | 29 | }, 30 | 31 | doToggle: function() { 32 | 33 | var $input = $(this.getToggleInput()); 34 | var whenChecked = this.getToggleMode(); 35 | 36 | this.getFields().toggle(whenChecked ? $input.is(':checked') : !$input.is(':checked')); 37 | 38 | }, 39 | 40 | getToggle: function() { 41 | return $(this).find('.group-toggle'); 42 | }, 43 | 44 | getFields: function() { 45 | return $(this).find('.group-fields'); 46 | }, 47 | 48 | getToggleInput: function() { 49 | return this.getToggle().find('input'); 50 | }, 51 | 52 | getToggleMode: function() { 53 | return this.getToggle().data('show-when-checked'); 54 | } 55 | 56 | }); 57 | 58 | }); 59 | -------------------------------------------------------------------------------- /client/src/styles/components/ListComponent.scss: -------------------------------------------------------------------------------- 1 | /* List Component Styles 2 | ===================================================================================================================== */ 3 | 4 | .listcomponent { 5 | 6 | @include media-breakpoint-up(md) { 7 | 8 | .items { 9 | 10 | > article.item { 11 | display: block; 12 | } 13 | 14 | &.image-align-left > article.item, 15 | &.image-align-right > article.item, 16 | &.image-align-stagger > article.item { 17 | 18 | display: flex; 19 | 20 | > div.image { 21 | margin-bottom: 0; 22 | } 23 | 24 | } 25 | 26 | &.image-align-left > article.item.has-image, 27 | &.image-align-stagger > article.item.has-image:nth-child(odd) { 28 | 29 | > div.image { 30 | order: 1; 31 | } 32 | 33 | > section.content { 34 | flex: 1; 35 | order: 2; 36 | margin-top: 0; 37 | margin-left: $spacer; 38 | } 39 | 40 | } 41 | 42 | &.image-align-right > article.item.has-image, 43 | &.image-align-stagger > article.item.has-image:nth-child(even) { 44 | 45 | > div.image { 46 | order: 2; 47 | } 48 | 49 | > section.content { 50 | flex: 1; 51 | order: 1; 52 | margin-top: 0; 53 | margin-right: $spacer; 54 | } 55 | 56 | } 57 | 58 | } 59 | 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /src/Forms/PageDropdownField.php: -------------------------------------------------------------------------------- 1 | =5.6.0 7 | * 8 | * For full copyright and license information, please view the 9 | * LICENSE.md file that was distributed with this source code. 10 | * 11 | * @package SilverWare\Forms 12 | * @author Colin Tucker 13 | * @copyright 2017 Praxis Interactive 14 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 15 | * @link https://github.com/praxisnetau/silverware 16 | */ 17 | 18 | namespace SilverWare\Forms; 19 | 20 | use SilverStripe\Forms\TreeDropdownField; 21 | use Page; 22 | 23 | /** 24 | * An extension of the tree dropdown field which shows pages only. 25 | * 26 | * @package SilverWare\Forms 27 | * @author Colin Tucker 28 | * @copyright 2017 Praxis Interactive 29 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 30 | * @link https://github.com/praxisnetau/silverware 31 | */ 32 | class PageDropdownField extends TreeDropdownField 33 | { 34 | /** 35 | * Constructs the object upon instantiation. 36 | * 37 | * @param string $name 38 | * @param string $title 39 | */ 40 | public function __construct($name, $title = null) 41 | { 42 | // Construct Parent: 43 | 44 | parent::__construct($name, $title, Page::class); 45 | 46 | // Define Filter Function: 47 | 48 | $this->setFilterFunction(function ($node) { 49 | return ($node instanceof Page); 50 | }); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/Forms/PageMultiselectField.php: -------------------------------------------------------------------------------- 1 | =5.6.0 7 | * 8 | * For full copyright and license information, please view the 9 | * LICENSE.md file that was distributed with this source code. 10 | * 11 | * @package SilverWare\Forms 12 | * @author Colin Tucker 13 | * @copyright 2017 Praxis Interactive 14 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 15 | * @link https://github.com/praxisnetau/silverware 16 | */ 17 | 18 | namespace SilverWare\Forms; 19 | 20 | use SilverStripe\Forms\TreeMultiselectField; 21 | use Page; 22 | 23 | /** 24 | * An extension of the tree dropdown field which shows pages only. 25 | * 26 | * @package SilverWare\Forms 27 | * @author Colin Tucker 28 | * @copyright 2017 Praxis Interactive 29 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 30 | * @link https://github.com/praxisnetau/silverware 31 | */ 32 | class PageMultiselectField extends TreeMultiselectField 33 | { 34 | /** 35 | * Constructs the object upon instantiation. 36 | * 37 | * @param string $name 38 | * @param string $title 39 | */ 40 | public function __construct($name, $title = null) 41 | { 42 | // Construct Parent: 43 | 44 | parent::__construct($name, $title, Page::class); 45 | 46 | // Define Filter Function: 47 | 48 | $this->setFilterFunction(function ($node) { 49 | return ($node instanceof Page); 50 | }); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/Grid/Extensions/RowExtension.php: -------------------------------------------------------------------------------- 1 | =5.6.0 7 | * 8 | * For full copyright and license information, please view the 9 | * LICENSE.md file that was distributed with this source code. 10 | * 11 | * @package SilverWare\Grid\Extensions 12 | * @author Colin Tucker 13 | * @copyright 2017 Praxis Interactive 14 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 15 | * @link https://github.com/praxisnetau/silverware 16 | */ 17 | 18 | namespace SilverWare\Grid\Extensions; 19 | 20 | /** 21 | * A grid extension class which forms an abstract base for row extensions. 22 | * 23 | * @package SilverWare\Grid\Extensions 24 | * @author Colin Tucker 25 | * @copyright 2017 Praxis Interactive 26 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 27 | * @link https://github.com/praxisnetau/silverware 28 | */ 29 | abstract class RowExtension extends GridExtension 30 | { 31 | /** 32 | * Answers the container class names for the extended object. 33 | * 34 | * @return array 35 | */ 36 | abstract public function getClassNamesForContainer(); 37 | 38 | /** 39 | * Updates the container class names of the extended object. 40 | * 41 | * @param array $classes Array of container class names from the extended object. 42 | * 43 | * @return void 44 | */ 45 | public function updateContainerClassNames(&$classes) 46 | { 47 | $classes += $this->owner->getClassNamesForContainer(); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/Grid/Extensions/SectionExtension.php: -------------------------------------------------------------------------------- 1 | =5.6.0 7 | * 8 | * For full copyright and license information, please view the 9 | * LICENSE.md file that was distributed with this source code. 10 | * 11 | * @package SilverWare\Grid\Extensions 12 | * @author Colin Tucker 13 | * @copyright 2017 Praxis Interactive 14 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 15 | * @link https://github.com/praxisnetau/silverware 16 | */ 17 | 18 | namespace SilverWare\Grid\Extensions; 19 | 20 | /** 21 | * A grid extension class which forms an abstract base for section extensions. 22 | * 23 | * @package SilverWare\Grid\Extensions 24 | * @author Colin Tucker 25 | * @copyright 2017 Praxis Interactive 26 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 27 | * @link https://github.com/praxisnetau/silverware 28 | */ 29 | abstract class SectionExtension extends GridExtension 30 | { 31 | /** 32 | * Answers the container class names for the extended object. 33 | * 34 | * @return array 35 | */ 36 | abstract public function getClassNamesForContainer(); 37 | 38 | /** 39 | * Updates the container class names of the extended object. 40 | * 41 | * @param array $classes Array of container class names from the extended object. 42 | * 43 | * @return void 44 | */ 45 | public function updateContainerClassNames(&$classes) 46 | { 47 | $classes += $this->owner->getClassNamesForContainer(); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/Lists/ListWrapper.php: -------------------------------------------------------------------------------- 1 | =5.6.0 7 | * 8 | * For full copyright and license information, please view the 9 | * LICENSE.md file that was distributed with this source code. 10 | * 11 | * @package SilverWare\Lists 12 | * @author Colin Tucker 13 | * @copyright 2017 Praxis Interactive 14 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 15 | * @link https://github.com/praxisnetau/silverware 16 | */ 17 | 18 | namespace SilverWare\Lists; 19 | 20 | use SilverStripe\ORM\SS_List; 21 | use SilverStripe\View\ViewableData; 22 | 23 | /** 24 | * A wrapper class to allow regular list objects to operate as list sources. 25 | * 26 | * @package SilverWare\Lists 27 | * @author Colin Tucker 28 | * @copyright 2017 Praxis Interactive 29 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 30 | * @link https://github.com/praxisnetau/silverware 31 | */ 32 | class ListWrapper extends ViewableData implements ListSource 33 | { 34 | /** 35 | * List object being wrapped. 36 | * 37 | * @var SS_List 38 | */ 39 | protected $list; 40 | 41 | /** 42 | * Constructs the object upon instantiation. 43 | * 44 | * @param SS_List $list 45 | */ 46 | public function __construct(SS_List $list) 47 | { 48 | $this->list = $list; 49 | 50 | parent::__construct(); 51 | } 52 | 53 | /** 54 | * Answers a list of items. 55 | * 56 | * @return SS_List 57 | */ 58 | public function getListItems() 59 | { 60 | return $this->list; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /admin/client/src/styles/preview/ComponentPreview.scss: -------------------------------------------------------------------------------- 1 | /* Component Preview Styles 2 | ===================================================================================================================== */ 3 | 4 | .cms-preview-component { 5 | 6 | overflow: hidden; 7 | 8 | .cms-preview-wrapper { 9 | 10 | top: 0; 11 | left: 0; 12 | right: 0; 13 | bottom: 0; 14 | position: absolute; 15 | 16 | > header { 17 | 18 | min-height: $toolbar-total-height; 19 | padding-left: $spacer; 20 | white-space: nowrap; 21 | font-size: $font-size-xs; 22 | 23 | background: { 24 | repeat: repeat; 25 | position: left bottom; 26 | color: $color-darker-bg; 27 | image: url("../images/textures/cms_content_header.png"); 28 | } 29 | 30 | > h1 { 31 | 32 | margin: 0; 33 | color: $color-text-default; 34 | font-size: 1.2em; 35 | font-weight: normal; 36 | line-height: $toolbar-total-height; 37 | 38 | i, span.class { 39 | color: $color-text; 40 | } 41 | 42 | } 43 | 44 | } 45 | 46 | > div.component { 47 | 48 | top: $toolbar-total-height; 49 | bottom: 0; 50 | width: 100%; 51 | height: auto; 52 | padding: $spacer; 53 | overflow-x: hidden; 54 | overflow-y: auto; 55 | position: absolute; 56 | background-color: $tab-panel-texture-color; 57 | 58 | > div.preview { 59 | background-color: $white; 60 | box-shadow: 0px 5px 10px rgba(0, 0, 0, 0.20); 61 | } 62 | 63 | } 64 | 65 | } 66 | 67 | } 68 | -------------------------------------------------------------------------------- /src/Extensions/Model/PaginatedListExtension.php: -------------------------------------------------------------------------------- 1 | =5.6.0 7 | * 8 | * For full copyright and license information, please view the 9 | * LICENSE.md file that was distributed with this source code. 10 | * 11 | * @package SilverWare\Extensions\Model 12 | * @author Colin Tucker 13 | * @copyright 2017 Praxis Interactive 14 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 15 | * @link https://github.com/praxisnetau/silverware 16 | */ 17 | 18 | namespace SilverWare\Extensions\Model; 19 | 20 | use SilverStripe\Core\Extension; 21 | 22 | /** 23 | * An extension which works around a URL ampersand-encoding bug with paginated lists. 24 | * 25 | * @package SilverWare\Extensions\Model 26 | * @author Colin Tucker 27 | * @copyright 2017 Praxis Interactive 28 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 29 | * @link https://github.com/praxisnetau/silverware 30 | */ 31 | class PaginatedListExtension extends Extension 32 | { 33 | /** 34 | * Answers a summarised pagination for the extended object (fixes a bug with URL ampersands). 35 | * 36 | * @param integer $context 37 | * 38 | * @return ArrayList 39 | */ 40 | public function PageSummary($context = 4) 41 | { 42 | $summary = $this->owner->PaginationSummary($context); 43 | 44 | foreach ($summary as $page) { 45 | 46 | if ($page->Link) { 47 | $page->Link = str_replace('&', '&', $page->Link); 48 | } 49 | 50 | } 51 | 52 | return $summary; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/Forms/GridField/GridFieldConfig_OrderableEditor.php: -------------------------------------------------------------------------------- 1 | =5.6.0 7 | * 8 | * For full copyright and license information, please view the 9 | * LICENSE.md file that was distributed with this source code. 10 | * 11 | * @package SilverWare\Forms\GridField 12 | * @author Colin Tucker 13 | * @copyright 2017 Praxis Interactive 14 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 15 | * @link https://github.com/praxisnetau/silverware 16 | */ 17 | 18 | namespace SilverWare\Forms\GridField; 19 | 20 | use SilverStripe\Forms\GridField\GridFieldConfig_RecordEditor; 21 | use Symbiote\GridFieldExtensions\GridFieldOrderableRows; 22 | 23 | /** 24 | * An extension of the grid field config record editor class for an orderable editor config. 25 | * 26 | * @package SilverWare\Forms\GridField 27 | * @author Colin Tucker 28 | * @copyright 2017 Praxis Interactive 29 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 30 | * @link https://github.com/praxisnetau/silverware 31 | */ 32 | class GridFieldConfig_OrderableEditor extends GridFieldConfig_RecordEditor 33 | { 34 | /** 35 | * Constructs the object upon instantiation. 36 | * 37 | * @param integer $itemsPerPage 38 | */ 39 | public function __construct($itemsPerPage = null) 40 | { 41 | // Construct Parent: 42 | 43 | parent::__construct($itemsPerPage); 44 | 45 | // Construct Object: 46 | 47 | $this->addComponent(new GridFieldOrderableRows()); 48 | 49 | // Apply Extensions: 50 | 51 | $this->extend('updateConfig'); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/Forms/ViewportField.php: -------------------------------------------------------------------------------- 1 | =5.6.0 7 | * 8 | * For full copyright and license information, please view the 9 | * LICENSE.md file that was distributed with this source code. 10 | * 11 | * @package SilverWare\Forms 12 | * @author Colin Tucker 13 | * @copyright 2017 Praxis Interactive 14 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 15 | * @link https://github.com/praxisnetau/silverware 16 | */ 17 | 18 | namespace SilverWare\Forms; 19 | 20 | use SilverStripe\Forms\DropdownField; 21 | use SilverWare\ORM\FieldType\DBViewports; 22 | 23 | /** 24 | * An extension of the dropdown field class for a viewport field. 25 | * 26 | * @package SilverWare\Forms 27 | * @author Colin Tucker 28 | * @copyright 2017 Praxis Interactive 29 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 30 | * @link https://github.com/praxisnetau/silverware 31 | */ 32 | class ViewportField extends DropdownField 33 | { 34 | /** 35 | * Extra attributes for the HTML tag. 36 | * 37 | * @var array 38 | */ 39 | protected $extraClasses = [ 40 | 'dropdown' 41 | ]; 42 | 43 | /** 44 | * Defines the source options for the receiver. 45 | * 46 | * @param array|ArrayAccess $source 47 | * 48 | * @return $this 49 | */ 50 | public function setSource($source) 51 | { 52 | return parent::setSource($source ? $source : $this->getDefaultSource()); 53 | } 54 | 55 | /** 56 | * Answers the default source options for the receiver. 57 | * 58 | * @return array 59 | */ 60 | public function getDefaultSource() 61 | { 62 | return DBViewports::singleton()->getViewportOptions(); 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /client/src/components/TagCloudComponent.js: -------------------------------------------------------------------------------- 1 | /* Tag Cloud Component 2 | ===================================================================================================================== */ 3 | 4 | import $ from 'jquery'; 5 | 6 | $(function() { 7 | 8 | // Handle Tag Cloud Components: 9 | 10 | $('.tagcloudcomponent').each(function() { 11 | 12 | var $self = $(this); 13 | var $canvas = $($self.data('canvas')); 14 | 15 | // Initialise Tag Canvas: 16 | 17 | $canvas.tagcanvas({ 18 | depth: parseFloat($self.data('depth')), 19 | zoom: parseFloat($self.data('zoom')), 20 | zoomMin: parseFloat($self.data('zoom-min')), 21 | zoomMax: parseFloat($self.data('zoom-max')), 22 | textColour: $self.data('color-text'), 23 | outlineColour: $self.data('color-outline'), 24 | initial: $self.data('initial'), 25 | weightSizeMin: parseInt($self.data('weight-size-min')), 26 | weightSizeMax: parseInt($self.data('weight-size-max')), 27 | weightFrom: 'data-weight', 28 | weight: $self.data('weight') 29 | }, $self.data('tag-list')); 30 | 31 | }); 32 | 33 | // Define Resize Handler: 34 | 35 | var resizeTagCloud = function() { 36 | 37 | $('.tagcloudcomponent').each(function() { 38 | 39 | var $self = $(this); 40 | var $canvas = $($self.data('canvas')); 41 | 42 | var width = $self.width(); 43 | 44 | $canvas.attr('width', width); 45 | 46 | }); 47 | 48 | }; 49 | 50 | // Attach Resize Handler: 51 | 52 | var id = null; 53 | 54 | $(window).resize(function() { 55 | if (id !== null) clearTimeout(id); 56 | id = setTimeout(resizeTagCloud, 500); 57 | }); 58 | 59 | // Perform Initial Resize: 60 | 61 | $(window).on('load', function() { 62 | resizeTagCloud(); 63 | }); 64 | 65 | }); 66 | -------------------------------------------------------------------------------- /src/Grid/Frameworks/Bootstrap/Row.php: -------------------------------------------------------------------------------- 1 | =5.6.0 7 | * 8 | * For full copyright and license information, please view the 9 | * LICENSE.md file that was distributed with this source code. 10 | * 11 | * @package SilverWare\Grid\Frameworks\Bootstrap 12 | * @author Colin Tucker 13 | * @copyright 2017 Praxis Interactive 14 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 15 | * @link https://github.com/praxisnetau/silverware 16 | */ 17 | 18 | namespace SilverWare\Grid\Frameworks\Bootstrap; 19 | 20 | use SilverWare\Grid\Extensions\RowExtension; 21 | 22 | /** 23 | * A row extension for Bootstrap rows. 24 | * 25 | * @package SilverWare\Grid\Frameworks\Bootstrap 26 | * @author Colin Tucker 27 | * @copyright 2017 Praxis Interactive 28 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 29 | * @link https://github.com/praxisnetau/silverware 30 | */ 31 | class Row extends RowExtension 32 | { 33 | /** 34 | * Updates the given array of class names from the extended object. 35 | * 36 | * @param array $classes 37 | * 38 | * @return void 39 | */ 40 | public function updateClassNames(&$classes) 41 | { 42 | if ($this->owner->isNoGutters()) { 43 | $classes[] = $this->style('row.no-gutters'); 44 | } 45 | } 46 | 47 | /** 48 | * Answers the container class names for the extended object. 49 | * 50 | * @return array 51 | */ 52 | public function getClassNamesForContainer() 53 | { 54 | $classes = ['container']; 55 | 56 | if ($this->owner->isEdgeToEdge()) { 57 | $classes[] = $this->style('row.edge-to-edge'); 58 | } 59 | 60 | return $classes; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/Forms/FieldSection.php: -------------------------------------------------------------------------------- 1 | =5.6.0 7 | * 8 | * For full copyright and license information, please view the 9 | * LICENSE.md file that was distributed with this source code. 10 | * 11 | * @package SilverWare\Forms 12 | * @author Colin Tucker 13 | * @copyright 2017 Praxis Interactive 14 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 15 | * @link https://github.com/praxisnetau/silverware 16 | */ 17 | 18 | namespace SilverWare\Forms; 19 | 20 | use SilverStripe\Forms\CompositeField; 21 | 22 | /** 23 | * An extension of the composite field class for a named section of fields. 24 | * 25 | * @package SilverWare\Forms 26 | * @author Colin Tucker 27 | * @copyright 2017 Praxis Interactive 28 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 29 | * @link https://github.com/praxisnetau/silverware 30 | */ 31 | class FieldSection extends CompositeField 32 | { 33 | /** 34 | * Constructs the object upon instantiation. 35 | * 36 | * @param string $name Name of field. 37 | * @param string $title Title of field. 38 | * @param array|FieldList $children Child fields. 39 | */ 40 | public function __construct($name, $title, $children) 41 | { 42 | // Construct Parent: 43 | 44 | parent::__construct($children); 45 | 46 | // Define Attributes: 47 | 48 | $this->setName($name); 49 | $this->setTitle($title); 50 | } 51 | 52 | /** 53 | * Merges the given array or list of fields with the receiver. 54 | * 55 | * @param array|ArrayAccess $with 56 | * 57 | * @return $this 58 | */ 59 | public function merge($with) 60 | { 61 | $this->children->merge($with); 62 | 63 | return $this; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /src/Grid/Frameworks/Bootstrap/Section.php: -------------------------------------------------------------------------------- 1 | =5.6.0 7 | * 8 | * For full copyright and license information, please view the 9 | * LICENSE.md file that was distributed with this source code. 10 | * 11 | * @package SilverWare\Grid\Frameworks\Bootstrap 12 | * @author Colin Tucker 13 | * @copyright 2017 Praxis Interactive 14 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 15 | * @link https://github.com/praxisnetau/silverware 16 | */ 17 | 18 | namespace SilverWare\Grid\Frameworks\Bootstrap; 19 | 20 | use SilverWare\Grid\Extensions\SectionExtension; 21 | 22 | /** 23 | * A section extension for Bootstrap sections. 24 | * 25 | * @package SilverWare\Grid\Frameworks\Bootstrap 26 | * @author Colin Tucker 27 | * @copyright 2017 Praxis Interactive 28 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 29 | * @link https://github.com/praxisnetau/silverware 30 | */ 31 | class Section extends SectionExtension 32 | { 33 | /** 34 | * Updates the given array of class names from the extended object. 35 | * 36 | * @param array $classes 37 | * 38 | * @return void 39 | */ 40 | public function updateClassNames(&$classes) 41 | { 42 | if ($position = $this->owner->Position) { 43 | $classes[] = $this->style('position', $position); 44 | } 45 | } 46 | 47 | /** 48 | * Answers the container class names for the extended object. 49 | * 50 | * @return array 51 | */ 52 | public function getClassNamesForContainer() 53 | { 54 | $classes = [$this->owner->isFullWidth() ? 'container-fluid' : 'container']; 55 | 56 | if ($this->owner->isEdgeToEdge()) { 57 | $classes[] = $this->style('section.edge-to-edge'); 58 | } 59 | 60 | return $classes; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "silverware", 3 | "version": "1.0.0", 4 | "description": "SilverWare Component Framework.", 5 | "homepage": "https://github.com/praxisnetau/silverware", 6 | "keywords": [ 7 | "silverware", 8 | "component", 9 | "framework", 10 | "silverstripe" 11 | ], 12 | "license": "BSD-3-Clause", 13 | "author": "Praxis Interactive", 14 | "contributors": [ 15 | { 16 | "name": "Colin Tucker", 17 | "email": "colin@praxis.net.au", 18 | "url": "https://www.praxis.net.au" 19 | } 20 | ], 21 | "repository": { 22 | "type": "git", 23 | "url": "https://github.com/praxisnetau/silverware.git" 24 | }, 25 | "bugs": { 26 | "url": "https://github.com/praxisnetau/silverware/issues" 27 | }, 28 | "engines": { 29 | "node": "^8.x" 30 | }, 31 | "scripts": { 32 | "watch": "webpack --env.development --colors --watch", 33 | "build": "webpack --env.production --colors --progress --optimize-minimize" 34 | }, 35 | "dependencies": {}, 36 | "devDependencies": { 37 | "autoprefixer": "^8.2.0", 38 | "babel-core": "^6.26.0", 39 | "babel-loader": "^7.1.4", 40 | "babel-preset-env": "^1.6.1", 41 | "clean-webpack-plugin": "^0.1.19", 42 | "copy-webpack-plugin": "^4.5.1", 43 | "css-loader": "^0.28.11", 44 | "extract-text-webpack-plugin": "^3.0.2", 45 | "file-loader": "^1.1.11", 46 | "node-sass": "^4.8.3", 47 | "postcss-loader": "^2.1.3", 48 | "resolve-url-loader": "^2.3.0", 49 | "sass-loader": "^6.0.7", 50 | "style-loader": "^0.20.3", 51 | "svgo": "^1.0.5", 52 | "svgo-loader": "^2.1.0", 53 | "uglifyjs-webpack-plugin": "^1.2.4", 54 | "url-loader": "^1.0.1", 55 | "webpack": "^3.11.0" 56 | }, 57 | "babel": { 58 | "presets": [ 59 | [ 60 | "env", 61 | { 62 | "modules": false 63 | } 64 | ] 65 | ] 66 | }, 67 | "browserslist": [ 68 | "> 1%", 69 | "last 2 versions" 70 | ] 71 | } 72 | -------------------------------------------------------------------------------- /_config/config.yml: -------------------------------------------------------------------------------- 1 | --- 2 | Name: silverware 3 | --- 4 | 5 | # Page Extensions: 6 | 7 | Page: 8 | extensions: 9 | - SilverWare\Extensions\PageExtension 10 | - SilverWare\Extensions\AreaExtension 11 | - SilverWare\Extensions\Model\MetaDataExtension 12 | - SilverWare\Extensions\Lists\ListItemExtension 13 | disable_metadata_toggle: true 14 | 15 | # Controller Extensions: 16 | 17 | SilverStripe\CMS\Controllers\ContentController: 18 | extensions: 19 | - SilverWare\Extensions\ControllerExtension 20 | - SilverWare\Extensions\Control\BreadcrumbsExtension 21 | 22 | # Configure Admin Extensions: 23 | 24 | SilverStripe\Admin\LeftAndMain: 25 | extensions: 26 | - SilverWare\Extensions\Admin\LeftAndMainExtension 27 | extra_requirements_css: 28 | - "silverware/silverware: admin/client/dist/styles/bundle.css" 29 | extra_requirements_javascript: 30 | - "silverware/silverware: admin/client/dist/js/bundle.js" 31 | themed_editor_css: 32 | - production/styles/editor.css 33 | 34 | # Site Configuration Extensions: 35 | 36 | SilverStripe\SiteConfig\SiteConfig: 37 | extensions: 38 | - SilverWare\Extensions\Config\PageTypeConfig 39 | - SilverWare\Extensions\Config\AppIconConfig 40 | asset_folders: 41 | SilverWare\Extensions\Config\AppIconConfig: Icons 42 | 43 | # Define Default Folders: 44 | 45 | SilverWare\Model\Folder: 46 | default_folders: 47 | - SilverWare\Folders\ComponentFolder 48 | - SilverWare\Folders\TemplateFolder 49 | - SilverWare\Folders\LayoutFolder 50 | - SilverWare\Folders\PanelFolder 51 | 52 | # Form Extensions: 53 | 54 | SilverStripe\Forms\Form: 55 | extensions: 56 | - SilverWare\Extensions\Forms\AlertMessageExtension 57 | 58 | # Field List Extensions: 59 | 60 | SilverStripe\Forms\FieldList: 61 | extensions: 62 | - SilverWare\Extensions\Forms\StatusMessageExtension 63 | 64 | # Paginated List Extensions: 65 | 66 | SilverStripe\ORM\PaginatedList: 67 | extensions: 68 | - SilverWare\Extensions\Model\PaginatedListExtension 69 | -------------------------------------------------------------------------------- /src/Components/TileComponent.php: -------------------------------------------------------------------------------- 1 | =5.6.0 7 | * 8 | * For full copyright and license information, please view the 9 | * LICENSE.md file that was distributed with this source code. 10 | * 11 | * @package SilverWare\Components 12 | * @author Colin Tucker 13 | * @copyright 2017 Praxis Interactive 14 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 15 | * @link https://github.com/praxisnetau/silverware 16 | */ 17 | 18 | namespace SilverWare\Components; 19 | 20 | /** 21 | * An extension of the list component class for a tile component. 22 | * 23 | * @package SilverWare\Components 24 | * @author Colin Tucker 25 | * @copyright 2017 Praxis Interactive 26 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 27 | * @link https://github.com/praxisnetau/silverware 28 | */ 29 | class TileComponent extends BaseListComponent 30 | { 31 | /** 32 | * Human-readable singular name. 33 | * 34 | * @var string 35 | * @config 36 | */ 37 | private static $singular_name = 'Tile Component'; 38 | 39 | /** 40 | * Human-readable plural name. 41 | * 42 | * @var string 43 | * @config 44 | */ 45 | private static $plural_name = 'Tile Components'; 46 | 47 | /** 48 | * Description of this object. 49 | * 50 | * @var string 51 | * @config 52 | */ 53 | private static $description = 'A component to show a list of items as tiles'; 54 | 55 | /** 56 | * Icon file for this object. 57 | * 58 | * @var string 59 | * @config 60 | */ 61 | private static $icon = 'silverware/silverware: admin/client/dist/images/icons/TileComponent.png'; 62 | 63 | /** 64 | * Defines the table name to use for this object. 65 | * 66 | * @var string 67 | * @config 68 | */ 69 | private static $table_name = 'SilverWare_TileComponent'; 70 | } 71 | -------------------------------------------------------------------------------- /src/Extensions/Assets/RenderInlineExtension.php: -------------------------------------------------------------------------------- 1 | =5.6.0 7 | * 8 | * For full copyright and license information, please view the 9 | * LICENSE.md file that was distributed with this source code. 10 | * 11 | * @package SilverWare\Extensions\Assets 12 | * @author Colin Tucker 13 | * @copyright 2017 Praxis Interactive 14 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 15 | * @link https://github.com/praxisnetau/silverware 16 | */ 17 | 18 | namespace SilverWare\Extensions\Assets; 19 | 20 | use SilverStripe\Core\Extension; 21 | use SilverStripe\ORM\FieldType\DBField; 22 | use DOMDocument; 23 | 24 | /** 25 | * An extension which adds inline rendering for vector images to the file class. 26 | * 27 | * @package SilverWare\Extensions\Assets 28 | * @author Colin Tucker 29 | * @copyright 2017 Praxis Interactive 30 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 31 | * @link https://github.com/praxisnetau/silverware 32 | */ 33 | class RenderInlineExtension extends Extension 34 | { 35 | /** 36 | * Renders the content of the extended object inline. 37 | * 38 | * @return DBHTMLText 39 | */ 40 | public function getRenderInline() 41 | { 42 | // Check File Exists / File Extension: 43 | 44 | if ($this->owner->exists() && $this->owner->getExtension() == 'svg') { 45 | 46 | // Create DOM Document: 47 | 48 | $dom = new DOMDocument(); 49 | 50 | // Load SVG Data into DOM: 51 | 52 | $dom->load(BASE_PATH . $this->owner->URL); 53 | 54 | // Normalise SVG Data: 55 | 56 | $dom->normalizeDocument(); 57 | 58 | // Render SVG as HTML: 59 | 60 | return DBField::create_field('HTMLFragment', $dom->saveHTML($dom->documentElement)); 61 | 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "silverware/silverware", 3 | "type": "silverstripe-vendormodule", 4 | "description": "SilverWare Component Framework.", 5 | "homepage": "https://github.com/praxisnetau/silverware", 6 | "keywords": [ 7 | "silverware", 8 | "component", 9 | "framework", 10 | "silverstripe" 11 | ], 12 | "license": "BSD-3-Clause", 13 | "authors": [ 14 | { 15 | "name": "Colin Tucker", 16 | "role": "Developer", 17 | "email": "colin@praxis.net.au", 18 | "homepage": "https://www.praxis.net.au" 19 | } 20 | ], 21 | "require": { 22 | "php": ">=5.6.0", 23 | "embed/embed": "^3.0", 24 | "silverstripe/asset-admin": "^1.0", 25 | "silverstripe/cms": "^4.0", 26 | "silverstripe/framework": "^4.0", 27 | "silverware/colorpicker": "^1.0", 28 | "silverware/font-icons": "^1.0", 29 | "silverware/select2": "^1.0", 30 | "silverware/theme": "^1.0", 31 | "symbiote/silverstripe-gridfieldextensions": "^3.1" 32 | }, 33 | "autoload": { 34 | "psr-4": { 35 | "SilverWare\\Components\\": "src/Components/", 36 | "SilverWare\\Core\\": "src/Core/", 37 | "SilverWare\\Crumbs\\": "src/Crumbs/", 38 | "SilverWare\\Dev\\": "src/Dev/", 39 | "SilverWare\\Extensions\\": "src/Extensions/", 40 | "SilverWare\\Folders\\": "src/Folders/", 41 | "SilverWare\\Forms\\": "src/Forms/", 42 | "SilverWare\\Grid\\": "src/Grid/", 43 | "SilverWare\\Lists\\": "src/Lists/", 44 | "SilverWare\\Model\\": "src/Model/", 45 | "SilverWare\\ORM\\": "src/ORM/", 46 | "SilverWare\\Pages\\": "src/Pages/", 47 | "SilverWare\\Sections\\": "src/Sections/", 48 | "SilverWare\\Security\\": "src/Security/", 49 | "SilverWare\\Tags\\": "src/Sections/", 50 | "SilverWare\\Tools\\": "src/Tools/", 51 | "SilverWare\\View\\": "src/View/" 52 | } 53 | }, 54 | "extra": { 55 | "branch-alias": { 56 | "dev-master": "1.0.x-dev" 57 | }, 58 | "expose": [ 59 | "admin/client/dist", 60 | "client/dist" 61 | ] 62 | }, 63 | "minimum-stability": "dev", 64 | "prefer-stable": true 65 | } 66 | -------------------------------------------------------------------------------- /src/Grid/Grid.php: -------------------------------------------------------------------------------- 1 | =5.6.0 7 | * 8 | * For full copyright and license information, please view the 9 | * LICENSE.md file that was distributed with this source code. 10 | * 11 | * @package SilverWare\Grid 12 | * @author Colin Tucker 13 | * @copyright 2017 Praxis Interactive 14 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 15 | * @link https://github.com/praxisnetau/silverware 16 | */ 17 | 18 | namespace SilverWare\Grid; 19 | 20 | use SilverStripe\Core\Injector\Injector; 21 | use SilverWare\Model\Component; 22 | 23 | /** 24 | * An extension of the component class for grid components. 25 | * 26 | * @package SilverWare\Grid 27 | * @author Colin Tucker 28 | * @copyright 2017 Praxis Interactive 29 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 30 | * @link https://github.com/praxisnetau/silverware 31 | */ 32 | class Grid extends Component 33 | { 34 | /** 35 | * Defines the table name to use for this object. 36 | * 37 | * @var string 38 | * @config 39 | */ 40 | private static $table_name = 'SilverWare_Grid'; 41 | 42 | /** 43 | * Answers the grid framework defined by configuration. 44 | * 45 | * @return Framework 46 | */ 47 | public static function framework() 48 | { 49 | return Injector::inst()->get('GridFramework'); 50 | } 51 | 52 | /** 53 | * Answers the labels for the fields of the receiver. 54 | * 55 | * @param boolean $includerelations Include labels for relations. 56 | * 57 | * @return array 58 | */ 59 | public function fieldLabels($includerelations = true) 60 | { 61 | // Obtain Field Labels (from parent): 62 | 63 | $labels = parent::fieldLabels($includerelations); 64 | 65 | // Define Field Labels: 66 | 67 | $labels['Title'] = _t(__CLASS__ . '.NAME', 'Name'); 68 | 69 | // Answer Field Labels: 70 | 71 | return $labels; 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /client/src/styles/extensions/DetailFieldsExtension.scss: -------------------------------------------------------------------------------- 1 | /* Detail Fields Extension Styles 2 | ===================================================================================================================== */ 3 | 4 | div.detail-fields { 5 | 6 | a { 7 | color: inherit; 8 | } 9 | 10 | > ul { 11 | 12 | margin: 0; 13 | padding: 0; 14 | list-style: none; 15 | 16 | > li > dl, 17 | > li > dl > dd { 18 | margin: 0; 19 | padding: 0; 20 | } 21 | 22 | } 23 | 24 | &.block { 25 | 26 | > ul > li { 27 | 28 | margin-bottom: $spacer; 29 | 30 | dl { 31 | 32 | dt { 33 | font-size: $detail-fields-block-name-font-size; 34 | font-weight: $detail-fields-name-weight; 35 | } 36 | 37 | dd { 38 | font-size: $detail-fields-block-text-font-size; 39 | } 40 | 41 | } 42 | 43 | } 44 | 45 | } 46 | 47 | &.inline { 48 | 49 | > ul > li { 50 | 51 | color: $detail-fields-inline-color; 52 | 53 | display: inline-block; 54 | margin-right: $detail-fields-inline-margin; 55 | 56 | dl { 57 | 58 | dt { 59 | display: inline-block; 60 | font-size: $detail-fields-inline-name-font-size; 61 | } 62 | 63 | dd { 64 | display: inline-block; 65 | font-size: $detail-fields-inline-text-font-size; 66 | } 67 | 68 | } 69 | 70 | } 71 | 72 | } 73 | 74 | &.hide-header { 75 | 76 | > header { 77 | display: none; 78 | } 79 | 80 | } 81 | 82 | &.hide-icons { 83 | 84 | > ul > li { 85 | 86 | dl > dt > i { 87 | display: none; 88 | } 89 | 90 | } 91 | 92 | } 93 | 94 | &.hide-names { 95 | 96 | > ul > li { 97 | 98 | dl > dt > span.name { 99 | display: none; 100 | } 101 | 102 | } 103 | 104 | } 105 | 106 | } 107 | -------------------------------------------------------------------------------- /src/Extensions/Forms/AlertMessageExtension.php: -------------------------------------------------------------------------------- 1 | =5.6.0 7 | * 8 | * For full copyright and license information, please view the 9 | * LICENSE.md file that was distributed with this source code. 10 | * 11 | * @package SilverWare\Extensions\Forms 12 | * @author Colin Tucker 13 | * @copyright 2017 Praxis Interactive 14 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 15 | * @link https://github.com/praxisnetau/silverware 16 | */ 17 | 18 | namespace SilverWare\Extensions\Forms; 19 | 20 | use SilverStripe\Core\Extension; 21 | use SilverStripe\ORM\ValidationResult; 22 | use SilverWare\Tools\ViewTools; 23 | use SilverWare\View\GridAware; 24 | 25 | /** 26 | * An extension which translates form message types into alert classes. 27 | * 28 | * @package SilverWare\Extensions\Forms 29 | * @author Colin Tucker 30 | * @copyright 2017 Praxis Interactive 31 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 32 | * @link https://github.com/praxisnetau/silverware 33 | */ 34 | class AlertMessageExtension extends Extension 35 | { 36 | use GridAware; 37 | 38 | /** 39 | * Answers a string of alert classes for the message type of the extended object. 40 | * 41 | * @return string 42 | */ 43 | public function getAlertMessageType() 44 | { 45 | // Obtain Base Alert Class: 46 | 47 | $classes = $this->styles('alert'); 48 | 49 | // Determine Message Type: 50 | 51 | switch ($this->owner->MessageType) { 52 | case ValidationResult::TYPE_GOOD: 53 | $classes[] = $this->style('alert.success'); 54 | break; 55 | case ValidationResult::TYPE_INFO: 56 | $classes[] = $this->style('alert.info'); 57 | break; 58 | case ValidationResult::TYPE_ERROR: 59 | $classes[] = $this->style('alert.danger'); 60 | break; 61 | default: 62 | $classes[] = $this->style('alert.warning'); 63 | } 64 | 65 | // Answer Classes: 66 | 67 | return ViewTools::singleton()->array2att($classes); 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /src/View/ViewClasses.php: -------------------------------------------------------------------------------- 1 | =5.6.0 7 | * 8 | * For full copyright and license information, please view the 9 | * LICENSE.md file that was distributed with this source code. 10 | * 11 | * @package SilverWare\View 12 | * @author Colin Tucker 13 | * @copyright 2017 Praxis Interactive 14 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 15 | * @link https://github.com/praxisnetau/silverware 16 | */ 17 | 18 | namespace SilverWare\View; 19 | 20 | use SilverWare\Tools\ViewTools; 21 | 22 | /** 23 | * Allows an object to make use of classes for the HTML template. 24 | * 25 | * @package SilverWare\View 26 | * @author Colin Tucker 27 | * @copyright 2017 Praxis Interactive 28 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 29 | * @link https://github.com/praxisnetau/silverware 30 | */ 31 | trait ViewClasses 32 | { 33 | /** 34 | * Magic method to handle access to named properties. 35 | * 36 | * @param string $name Property name. 37 | * 38 | * @return mixed 39 | */ 40 | public function __get($name) 41 | { 42 | // Match HTML Class Name Methods (converts array to string attribute): 43 | 44 | if (substr_compare($name, 'Class', -5) === 0 && $this->hasMethod("get{$name}Names")) { 45 | return ViewTools::singleton()->array2att($this->{"get{$name}Names"}()); 46 | } 47 | 48 | // Answer Parent Result: 49 | 50 | return parent::__get($name); 51 | } 52 | 53 | /** 54 | * Magic method to handle access to named methods. 55 | * 56 | * @param string $name Method name. 57 | * @param array $args Method arguments. 58 | * 59 | * @return mixed 60 | */ 61 | public function __call($name, $args) 62 | { 63 | // Match HTML Class Name Methods (converts array to string attribute): 64 | 65 | if (substr_compare($name, 'Class', -5) === 0 && $this->hasMethod("{$name}Names")) { 66 | return ViewTools::singleton()->array2att($this->{"{$name}Names"}()); 67 | } 68 | 69 | // Answer Parent Result: 70 | 71 | return parent::__call($name, $args); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /src/Components/ListComponent.php: -------------------------------------------------------------------------------- 1 | =5.6.0 7 | * 8 | * For full copyright and license information, please view the 9 | * LICENSE.md file that was distributed with this source code. 10 | * 11 | * @package SilverWare\Components 12 | * @author Colin Tucker 13 | * @copyright 2017 Praxis Interactive 14 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 15 | * @link https://github.com/praxisnetau/silverware 16 | */ 17 | 18 | namespace SilverWare\Components; 19 | 20 | use SilverStripe\Forms\CheckboxField; 21 | use SilverStripe\Forms\DropdownField; 22 | use SilverStripe\Forms\TextField; 23 | use SilverWare\Forms\FieldSection; 24 | 25 | /** 26 | * An extension of the base list component class for a list component. 27 | * 28 | * @package SilverWare\Components 29 | * @author Colin Tucker 30 | * @copyright 2017 Praxis Interactive 31 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 32 | * @link https://github.com/praxisnetau/silverware 33 | */ 34 | class ListComponent extends BaseListComponent 35 | { 36 | /** 37 | * Human-readable singular name. 38 | * 39 | * @var string 40 | * @config 41 | */ 42 | private static $singular_name = 'List Component'; 43 | 44 | /** 45 | * Human-readable plural name. 46 | * 47 | * @var string 48 | * @config 49 | */ 50 | private static $plural_name = 'List Components'; 51 | 52 | /** 53 | * Description of this object. 54 | * 55 | * @var string 56 | * @config 57 | */ 58 | private static $description = 'A component to show a list of items'; 59 | 60 | /** 61 | * Icon file for this object. 62 | * 63 | * @var string 64 | * @config 65 | */ 66 | private static $icon = 'silverware/silverware: admin/client/dist/images/icons/ListComponent.png'; 67 | 68 | /** 69 | * Defines the table name to use for this object. 70 | * 71 | * @var string 72 | * @config 73 | */ 74 | private static $table_name = 'SilverWare_ListComponent'; 75 | 76 | /** 77 | * Defines an ancestor class to hide from the admin interface. 78 | * 79 | * @var string 80 | * @config 81 | */ 82 | private static $hide_ancestor = BaseListComponent::class; 83 | } 84 | -------------------------------------------------------------------------------- /src/Model/Layout.php: -------------------------------------------------------------------------------- 1 | =5.6.0 7 | * 8 | * For full copyright and license information, please view the 9 | * LICENSE.md file that was distributed with this source code. 10 | * 11 | * @package SilverWare\Model 12 | * @author Colin Tucker 13 | * @copyright 2017 Praxis Interactive 14 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 15 | * @link https://github.com/praxisnetau/silverware 16 | */ 17 | 18 | namespace SilverWare\Model; 19 | 20 | use SilverWare\Folders\LayoutFolder; 21 | 22 | /** 23 | * An extension of the section holder class for a layout. 24 | * 25 | * @package SilverWare\Model 26 | * @author Colin Tucker 27 | * @copyright 2017 Praxis Interactive 28 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 29 | * @link https://github.com/praxisnetau/silverware 30 | */ 31 | class Layout extends SectionHolder 32 | { 33 | /** 34 | * Human-readable singular name. 35 | * 36 | * @var string 37 | * @config 38 | */ 39 | private static $singular_name = 'Layout'; 40 | 41 | /** 42 | * Human-readable plural name. 43 | * 44 | * @var string 45 | * @config 46 | */ 47 | private static $plural_name = 'Layouts'; 48 | 49 | /** 50 | * Description of this object. 51 | * 52 | * @var string 53 | * @config 54 | */ 55 | private static $description = 'An individual SilverWare layout'; 56 | 57 | /** 58 | * Icon file for this object. 59 | * 60 | * @var string 61 | * @config 62 | */ 63 | private static $icon = 'silverware/silverware: admin/client/dist/images/icons/Layout.png'; 64 | 65 | /** 66 | * Defines the table name to use for this object. 67 | * 68 | * @var string 69 | * @config 70 | */ 71 | private static $table_name = 'SilverWare_Layout'; 72 | 73 | /** 74 | * Defines an ancestor class to hide from the admin interface. 75 | * 76 | * @var string 77 | * @config 78 | */ 79 | private static $hide_ancestor = SectionHolder::class; 80 | 81 | /** 82 | * Defines the allowed parents for this object. 83 | * 84 | * @var array 85 | * @config 86 | */ 87 | private static $allowed_parents = [ 88 | LayoutFolder::class 89 | ]; 90 | } 91 | -------------------------------------------------------------------------------- /admin/client/src/entwine/NumberBadges.js: -------------------------------------------------------------------------------- 1 | /* Number Badges 2 | ===================================================================================================================== */ 3 | 4 | import $ from 'jquery'; 5 | 6 | $.entwine('silverware.numberbadges', function($) { 7 | 8 | // Handle Tab Badges: 9 | 10 | $('div.ss-tabset').entwine({ 11 | 12 | onmatch: function() { 13 | 14 | this._super(); 15 | 16 | var self = this; 17 | 18 | if (this.attr('data-number-badges')) { 19 | 20 | var badges = $.parseJSON(this.attr('data-number-badges')); 21 | 22 | $.each(badges, function (key, value) { 23 | 24 | if (value) { 25 | 26 | var tab = self.findTab(key); 27 | 28 | if (tab.length) { 29 | tab.append('' + value + ''); 30 | } 31 | 32 | } 33 | 34 | }); 35 | 36 | } 37 | 38 | }, 39 | 40 | findTab: function(name) { 41 | return this.find(this.getTabId(name)); 42 | }, 43 | 44 | getTabId: function(name) { 45 | return 'a#tab-' + name.replace('.', '_'); 46 | } 47 | 48 | }); 49 | 50 | // Handle Tree Badges: 51 | 52 | $('.cms-tree li').entwine({ 53 | 54 | updateBadge: function(value) { 55 | 56 | var $span = this.find('span.status-number-badge'); 57 | 58 | if ($span.length) { 59 | 60 | var id = '#' + this.attr('id'); 61 | 62 | var selector = id + '.status-number-badge > a span.jstree-pageicon::before'; 63 | var content = 'content: "' + (value > 0 ? value : '') + '";'; 64 | 65 | $('head').append(''); 66 | 67 | } 68 | 69 | } 70 | 71 | }); 72 | 73 | // Handle Badge Values: 74 | 75 | $('span.status-number-badge-value').entwine({ 76 | 77 | onmatch: function() { 78 | 79 | this._super(); 80 | 81 | if (!this.data('updated')) { 82 | 83 | var value = parseInt(this.attr('title')); 84 | 85 | this.closest('li').updateBadge(value); 86 | 87 | this.data('updated', true); 88 | 89 | } 90 | 91 | } 92 | 93 | }); 94 | 95 | }); 96 | -------------------------------------------------------------------------------- /src/Security/CMSMainPermissions.php: -------------------------------------------------------------------------------- 1 | =5.6.0 7 | * 8 | * For full copyright and license information, please view the 9 | * LICENSE.md file that was distributed with this source code. 10 | * 11 | * @package SilverWare\Security 12 | * @author Colin Tucker 13 | * @copyright 2017 Praxis Interactive 14 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 15 | * @link https://github.com/praxisnetau/silverware 16 | */ 17 | 18 | namespace SilverWare\Security; 19 | 20 | use SilverStripe\Security\Permission; 21 | 22 | /** 23 | * Enables CRUD operations on the object if the member can access CMSMain. 24 | * 25 | * @package SilverWare\Security 26 | * @author Colin Tucker 27 | * @copyright 2017 Praxis Interactive 28 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 29 | * @link https://github.com/praxisnetau/silverware 30 | */ 31 | trait CMSMainPermissions 32 | { 33 | /** 34 | * Answers true if the member can create a new instance of the receiver. 35 | * 36 | * @param Member $member Optional member object. 37 | * @param array $context Context-specific data. 38 | * 39 | * @return boolean 40 | */ 41 | public function canCreate($member = null, $context = []) 42 | { 43 | return Permission::check('CMS_ACCESS_CMSMain', 'any', $member); 44 | } 45 | 46 | /** 47 | * Answers true if the member can delete the receiver. 48 | * 49 | * @param Member $member 50 | * 51 | * @return boolean 52 | */ 53 | public function canDelete($member = null) 54 | { 55 | return Permission::check('CMS_ACCESS_CMSMain', 'any', $member); 56 | } 57 | 58 | /** 59 | * Answers true if the member can edit the receiver. 60 | * 61 | * @param Member $member 62 | * 63 | * @return boolean 64 | */ 65 | public function canEdit($member = null) 66 | { 67 | return Permission::check('CMS_ACCESS_CMSMain', 'any', $member); 68 | } 69 | 70 | /** 71 | * Answers true if the member can view the receiver. 72 | * 73 | * @param Member $member 74 | * 75 | * @return boolean 76 | */ 77 | public function canView($member = null) 78 | { 79 | return Permission::check('CMS_ACCESS_CMSMain', 'any', $member); 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /src/Security/SiteConfigPermissions.php: -------------------------------------------------------------------------------- 1 | =5.6.0 7 | * 8 | * For full copyright and license information, please view the 9 | * LICENSE.md file that was distributed with this source code. 10 | * 11 | * @package SilverWare\Security 12 | * @author Colin Tucker 13 | * @copyright 2017 Praxis Interactive 14 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 15 | * @link https://github.com/praxisnetau/silverware 16 | */ 17 | 18 | namespace SilverWare\Security; 19 | 20 | use SilverStripe\Security\Permission; 21 | 22 | /** 23 | * Enables CRUD operations on the object if the member can edit site configuration. 24 | * 25 | * @package SilverWare\Security 26 | * @author Colin Tucker 27 | * @copyright 2017 Praxis Interactive 28 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 29 | * @link https://github.com/praxisnetau/silverware 30 | */ 31 | trait SiteConfigPermissions 32 | { 33 | /** 34 | * Answers true if the member can create a new instance of the receiver. 35 | * 36 | * @param Member $member Optional member object. 37 | * @param array $context Context-specific data. 38 | * 39 | * @return boolean 40 | */ 41 | public function canCreate($member = null, $context = []) 42 | { 43 | return Permission::check('EDIT_SITECONFIG', 'any', $member); 44 | } 45 | 46 | /** 47 | * Answers true if the member can delete the receiver. 48 | * 49 | * @param Member $member 50 | * 51 | * @return boolean 52 | */ 53 | public function canDelete($member = null) 54 | { 55 | return Permission::check('EDIT_SITECONFIG', 'any', $member); 56 | } 57 | 58 | /** 59 | * Answers true if the member can edit the receiver. 60 | * 61 | * @param Member $member 62 | * 63 | * @return boolean 64 | */ 65 | public function canEdit($member = null) 66 | { 67 | return Permission::check('EDIT_SITECONFIG', 'any', $member); 68 | } 69 | 70 | /** 71 | * Answers true if the member can view the receiver. 72 | * 73 | * @param Member $member 74 | * 75 | * @return boolean 76 | */ 77 | public function canView($member = null) 78 | { 79 | return Permission::check('EDIT_SITECONFIG', 'any', $member); 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /src/Sections/FooterSection.php: -------------------------------------------------------------------------------- 1 | =5.6.0 7 | * 8 | * For full copyright and license information, please view the 9 | * LICENSE.md file that was distributed with this source code. 10 | * 11 | * @package SilverWare\Sections 12 | * @author Colin Tucker 13 | * @copyright 2017 Praxis Interactive 14 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 15 | * @link https://github.com/praxisnetau/silverware 16 | */ 17 | 18 | namespace SilverWare\Sections; 19 | 20 | use SilverWare\Grid\Section; 21 | use SilverWare\Model\Template; 22 | 23 | /** 24 | * An extension of the section class for a footer section. 25 | * 26 | * @package SilverWare\Sections 27 | * @author Colin Tucker 28 | * @copyright 2017 Praxis Interactive 29 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 30 | * @link https://github.com/praxisnetau/silverware 31 | */ 32 | class FooterSection extends Section 33 | { 34 | /** 35 | * Human-readable singular name. 36 | * 37 | * @var string 38 | * @config 39 | */ 40 | private static $singular_name = 'Footer Section'; 41 | 42 | /** 43 | * Human-readable plural name. 44 | * 45 | * @var string 46 | * @config 47 | */ 48 | private static $plural_name = 'Footer Sections'; 49 | 50 | /** 51 | * Description of this object. 52 | * 53 | * @var string 54 | * @config 55 | */ 56 | private static $description = 'A footer section within a SilverWare template'; 57 | 58 | /** 59 | * Icon file for this object. 60 | * 61 | * @var string 62 | * @config 63 | */ 64 | private static $icon = 'silverware/silverware: admin/client/dist/images/icons/FooterSection.png'; 65 | 66 | /** 67 | * Defines the table name to use for this object. 68 | * 69 | * @var string 70 | * @config 71 | */ 72 | private static $table_name = 'SilverWare_FooterSection'; 73 | 74 | /** 75 | * Defines the allowed parents for this object. 76 | * 77 | * @var array 78 | * @config 79 | */ 80 | private static $allowed_parents = [ 81 | Template::class 82 | ]; 83 | 84 | /** 85 | * Tag name to use when rendering this object. 86 | * 87 | * @var string 88 | * @config 89 | */ 90 | private static $tag = 'footer'; 91 | } 92 | -------------------------------------------------------------------------------- /src/Sections/HeaderSection.php: -------------------------------------------------------------------------------- 1 | =5.6.0 7 | * 8 | * For full copyright and license information, please view the 9 | * LICENSE.md file that was distributed with this source code. 10 | * 11 | * @package SilverWare\Sections 12 | * @author Colin Tucker 13 | * @copyright 2017 Praxis Interactive 14 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 15 | * @link https://github.com/praxisnetau/silverware 16 | */ 17 | 18 | namespace SilverWare\Sections; 19 | 20 | use SilverWare\Grid\Section; 21 | use SilverWare\Model\Template; 22 | 23 | /** 24 | * An extension of the section class for a header section. 25 | * 26 | * @package SilverWare\Sections 27 | * @author Colin Tucker 28 | * @copyright 2017 Praxis Interactive 29 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 30 | * @link https://github.com/praxisnetau/silverware 31 | */ 32 | class HeaderSection extends Section 33 | { 34 | /** 35 | * Human-readable singular name. 36 | * 37 | * @var string 38 | * @config 39 | */ 40 | private static $singular_name = 'Header Section'; 41 | 42 | /** 43 | * Human-readable plural name. 44 | * 45 | * @var string 46 | * @config 47 | */ 48 | private static $plural_name = 'Header Sections'; 49 | 50 | /** 51 | * Description of this object. 52 | * 53 | * @var string 54 | * @config 55 | */ 56 | private static $description = 'A header section within a SilverWare template'; 57 | 58 | /** 59 | * Icon file for this object. 60 | * 61 | * @var string 62 | * @config 63 | */ 64 | private static $icon = 'silverware/silverware: admin/client/dist/images/icons/HeaderSection.png'; 65 | 66 | /** 67 | * Defines the table name to use for this object. 68 | * 69 | * @var string 70 | * @config 71 | */ 72 | private static $table_name = 'SilverWare_HeaderSection'; 73 | 74 | /** 75 | * Defines the allowed parents for this object. 76 | * 77 | * @var array 78 | * @config 79 | */ 80 | private static $allowed_parents = [ 81 | Template::class 82 | ]; 83 | 84 | /** 85 | * Tag name to use when rendering this object. 86 | * 87 | * @var string 88 | * @config 89 | */ 90 | private static $tag = 'header'; 91 | } 92 | -------------------------------------------------------------------------------- /src/Grid/Extensions/ColumnExtension.php: -------------------------------------------------------------------------------- 1 | =5.6.0 7 | * 8 | * For full copyright and license information, please view the 9 | * LICENSE.md file that was distributed with this source code. 10 | * 11 | * @package SilverWare\Grid\Extensions 12 | * @author Colin Tucker 13 | * @copyright 2017 Praxis Interactive 14 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 15 | * @link https://github.com/praxisnetau/silverware 16 | */ 17 | 18 | namespace SilverWare\Grid\Extensions; 19 | 20 | use SilverWare\ORM\FieldType\DBViewports; 21 | 22 | /** 23 | * A grid extension class which forms an abstract base for column extensions. 24 | * 25 | * @package SilverWare\Grid\Extensions 26 | * @author Colin Tucker 27 | * @copyright 2017 Praxis Interactive 28 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 29 | * @link https://github.com/praxisnetau/silverware 30 | */ 31 | abstract class ColumnExtension extends GridExtension 32 | { 33 | /** 34 | * Answers the span class names for the extended object. 35 | * 36 | * @param DBViewports $span Optional viewports field to use instead of extended object field. 37 | * 38 | * @return array 39 | */ 40 | abstract public function getSpanClassNames(DBViewports $span = null); 41 | 42 | /** 43 | * Answers the offset class names for the extended object. 44 | * 45 | * @param DBViewports $offset Optional viewports field to use instead of extended object field. 46 | * 47 | * @return array 48 | */ 49 | abstract public function getOffsetClassNames(DBViewports $offset = null); 50 | 51 | /** 52 | * Answers the combined class names for the extended object. 53 | * 54 | * @return array 55 | */ 56 | public function getColumnClassNames() 57 | { 58 | return array_merge( 59 | $this->owner->getSpanClassNames(), 60 | $this->owner->getOffsetClassNames() 61 | ); 62 | } 63 | 64 | /** 65 | * Updates the class names of the extended object. 66 | * 67 | * @param array $classes Array of class names from the extended object. 68 | * 69 | * @return void 70 | */ 71 | public function updateClassNames(&$classes) 72 | { 73 | $classes = array_merge( 74 | $classes, 75 | $this->getColumnClassNames() 76 | ); 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /src/Extensions/Config/ServicesConfig.php: -------------------------------------------------------------------------------- 1 | =5.6.0 7 | * 8 | * For full copyright and license information, please view the 9 | * LICENSE.md file that was distributed with this source code. 10 | * 11 | * @package SilverWare\Extensions\Config 12 | * @author Colin Tucker 13 | * @copyright 2017 Praxis Interactive 14 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 15 | * @link https://github.com/praxisnetau/silverware 16 | */ 17 | 18 | namespace SilverWare\Extensions\Config; 19 | 20 | use SilverStripe\Forms\FieldList; 21 | use SilverStripe\Forms\TabSet; 22 | use SilverWare\Extensions\ConfigExtension; 23 | 24 | /** 25 | * A config extension which adds services to site configuration. 26 | * 27 | * @package SilverWare\Extensions\Config 28 | * @author Colin Tucker 29 | * @copyright 2017 Praxis Interactive 30 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 31 | * @link https://github.com/praxisnetau/silverware 32 | */ 33 | class ServicesConfig extends ConfigExtension 34 | { 35 | /** 36 | * Updates the CMS fields of the extended object. 37 | * 38 | * @param FieldList $fields List of CMS fields from the extended object. 39 | * 40 | * @return void 41 | */ 42 | public function updateCMSFields(FieldList $fields) 43 | { 44 | // Update Field Objects (from parent): 45 | 46 | parent::updateCMSFields($fields); 47 | 48 | // Create Services Tab Set: 49 | 50 | if (!$fields->fieldByName('Root.SilverWare.Services')) { 51 | 52 | $fields->addFieldToTab( 53 | 'Root.SilverWare', 54 | TabSet::create( 55 | 'Services', 56 | $this->owner->fieldLabel('Services') 57 | ) 58 | ); 59 | 60 | } 61 | } 62 | 63 | /** 64 | * Updates the field labels of the extended object. 65 | * 66 | * @param array $labels Array of field labels from the extended object. 67 | * 68 | * @return void 69 | */ 70 | public function updateFieldLabels(&$labels) 71 | { 72 | // Update Field Labels (from parent): 73 | 74 | parent::updateFieldLabels($labels); 75 | 76 | // Update Field Labels: 77 | 78 | $labels['Services'] = _t(__CLASS__ . '.SERVICES', 'Services'); 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /src/View/GridAware.php: -------------------------------------------------------------------------------- 1 | =5.6.0 7 | * 8 | * For full copyright and license information, please view the 9 | * LICENSE.md file that was distributed with this source code. 10 | * 11 | * @package SilverWare\View 12 | * @author Colin Tucker 13 | * @copyright 2017 Praxis Interactive 14 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 15 | * @link https://github.com/praxisnetau/silverware 16 | */ 17 | 18 | namespace SilverWare\View; 19 | 20 | use SilverWare\Grid\Grid; 21 | use SilverWare\Tools\ViewTools; 22 | 23 | /** 24 | * Allows an object to become aware of the grid framework defined by configuration. 25 | * 26 | * @package SilverWare\View 27 | * @author Colin Tucker 28 | * @copyright 2017 Praxis Interactive 29 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 30 | * @link https://github.com/praxisnetau/silverware 31 | */ 32 | trait GridAware 33 | { 34 | /** 35 | * Answers the grid framework defined by configuration. 36 | * 37 | * @return SilverWare\Grid\Framework 38 | */ 39 | public function grid() 40 | { 41 | return Grid::framework(); 42 | } 43 | 44 | /** 45 | * Answers the style mapped to the given name from the grid framework. 46 | * 47 | * @param string $name Name of style. 48 | * @param string $subname Subname of style (optional). 49 | * 50 | * @return string 51 | */ 52 | public function style($name, $subname = null) 53 | { 54 | return $this->grid()->getStyle($name, $subname); 55 | } 56 | 57 | /** 58 | * Answers the styles mapped to the given names from the grid framework. 59 | * 60 | * @return array|string 61 | */ 62 | public function styles() 63 | { 64 | // Obtain Arguments: 65 | 66 | $args = func_get_args(); 67 | 68 | // Array Argument Passed? 69 | 70 | if (is_array($args[0])) { 71 | 72 | // Obtain Styles: 73 | 74 | $styles = $this->grid()->getStyles($args[0]); 75 | 76 | // Answer as Array or String? (2nd param is true) 77 | 78 | return (isset($args[1]) && $args[1]) ? ViewTools::singleton()->array2att($styles) : $styles; 79 | 80 | } 81 | 82 | // Answer Styles Array: 83 | 84 | return $this->grid()->getStyles($args); 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /src/Pages/ListPage.php: -------------------------------------------------------------------------------- 1 | =5.6.0 7 | * 8 | * For full copyright and license information, please view the 9 | * LICENSE.md file that was distributed with this source code. 10 | * 11 | * @package SilverWare\Pages 12 | * @author Colin Tucker 13 | * @copyright 2017 Praxis Interactive 14 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 15 | * @link https://github.com/praxisnetau/silverware 16 | */ 17 | 18 | namespace SilverWare\Pages; 19 | 20 | use SilverWare\Extensions\Lists\ListViewExtension; 21 | use SilverWare\Extensions\Model\ImageDefaultsExtension; 22 | use Page; 23 | 24 | /** 25 | * An extension of the page class for a list page. 26 | * 27 | * @package SilverWare\Pages 28 | * @author Colin Tucker 29 | * @copyright 2017 Praxis Interactive 30 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 31 | * @link https://github.com/praxisnetau/silverware 32 | */ 33 | class ListPage extends Page 34 | { 35 | /** 36 | * Human-readable singular name. 37 | * 38 | * @var string 39 | * @config 40 | */ 41 | private static $singular_name = 'List Page'; 42 | 43 | /** 44 | * Human-readable plural name. 45 | * 46 | * @var string 47 | * @config 48 | */ 49 | private static $plural_name = 'List Pages'; 50 | 51 | /** 52 | * Description of this object. 53 | * 54 | * @var string 55 | * @config 56 | */ 57 | private static $description = 'Shows the children of this page as a list'; 58 | 59 | /** 60 | * Icon file for this object. 61 | * 62 | * @var string 63 | * @config 64 | */ 65 | private static $icon = 'silverware/silverware: admin/client/dist/images/icons/ListPage.png'; 66 | 67 | /** 68 | * Defines the table name to use for this object. 69 | * 70 | * @var string 71 | * @config 72 | */ 73 | private static $table_name = 'SilverWare_ListPage'; 74 | 75 | /** 76 | * Defines the extension classes to apply to this object. 77 | * 78 | * @var array 79 | * @config 80 | */ 81 | private static $extensions = [ 82 | ListViewExtension::class, 83 | ImageDefaultsExtension::class 84 | ]; 85 | 86 | /** 87 | * Answers the source for the list component. 88 | * 89 | * @return SS_List 90 | */ 91 | public function getListSource() 92 | { 93 | return $this->AllChildren(); 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /src/Extensions/Forms/StatusMessageExtension.php: -------------------------------------------------------------------------------- 1 | =5.6.0 7 | * 8 | * For full copyright and license information, please view the 9 | * LICENSE.md file that was distributed with this source code. 10 | * 11 | * @package SilverWare\Extensions\Forms 12 | * @author Colin Tucker 13 | * @copyright 2017 Praxis Interactive 14 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 15 | * @link https://github.com/praxisnetau/silverware 16 | */ 17 | 18 | namespace SilverWare\Extensions\Forms; 19 | 20 | use SilverStripe\Core\Extension; 21 | use SilverStripe\Forms\LiteralField; 22 | 23 | /** 24 | * An extension which allows status messages to be added to field lists. 25 | * 26 | * @package SilverWare\Extensions\Forms 27 | * @author Colin Tucker 28 | * @copyright 2017 Praxis Interactive 29 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 30 | * @link https://github.com/praxisnetau/silverware 31 | */ 32 | class StatusMessageExtension extends Extension 33 | { 34 | /** 35 | * Adds a status message as a literal field to the extended object. 36 | * 37 | * @param string|array $textOrArray 38 | * @param string $type 39 | * @param string $icon 40 | * @param string $insertBefore 41 | * 42 | * @return void 43 | */ 44 | public function addStatusMessage($textOrArray, $type = 'warning', $icon = 'warning', $insertBefore = 'Root') 45 | { 46 | if (!is_null($textOrArray)) { 47 | 48 | // Obtain Arguments: 49 | 50 | if (is_array($textOrArray)) { 51 | $text = isset($textOrArray['text']) ? $textOrArray['text'] : null; 52 | $type = isset($textOrArray['type']) ? $textOrArray['type'] : null; 53 | $icon = isset($textOrArray['icon']) ? $textOrArray['icon'] : null; 54 | } else { 55 | $text = $textOrArray; 56 | } 57 | 58 | // Add Literal Field: 59 | 60 | $this->owner->insertBefore( 61 | $insertBefore, 62 | LiteralField::create( 63 | 'StatusMessageLiteral', 64 | sprintf( 65 | '

%s

', 66 | $type, 67 | $icon, 68 | $text 69 | ) 70 | ) 71 | ); 72 | 73 | } 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /src/ORM/FieldType/DBDimensions.php: -------------------------------------------------------------------------------- 1 | =5.6.0 7 | * 8 | * For full copyright and license information, please view the 9 | * LICENSE.md file that was distributed with this source code. 10 | * 11 | * @package SilverWare\ORM\FieldType 12 | * @author Colin Tucker 13 | * @copyright 2017 Praxis Interactive 14 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 15 | * @link https://github.com/praxisnetau/silverware 16 | */ 17 | 18 | namespace SilverWare\ORM\FieldType; 19 | 20 | use SilverStripe\ORM\FieldType\DBComposite; 21 | use SilverWare\Forms\DimensionsField; 22 | 23 | /** 24 | * A composite database field used to store dimensions (typically for an image). 25 | * 26 | * @package SilverWare\ORM\FieldType 27 | * @author Colin Tucker 28 | * @copyright 2017 Praxis Interactive 29 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 30 | * @link https://github.com/praxisnetau/silverware 31 | */ 32 | class DBDimensions extends DBComposite 33 | { 34 | /** 35 | * Define constants. 36 | */ 37 | const DIM_WIDTH = 'Width'; 38 | const DIM_HEIGHT = 'Height'; 39 | 40 | /** 41 | * Maps composite field names to field types for this object. 42 | * 43 | * @var array 44 | * @config 45 | */ 46 | private static $composite_db = [ 47 | 'Width' => 'Varchar(8)', 48 | 'Height' => 'Varchar(8)' 49 | ]; 50 | 51 | /** 52 | * Answers a form field instance for automatic form scaffolding. 53 | * 54 | * @param string $title Title of the field instance. 55 | * @param array $params Array of extra parameters. 56 | * 57 | * @return DimensionsField 58 | */ 59 | public function scaffoldFormField($title = null, $params = null) 60 | { 61 | return DimensionsField::create($this->name, $title); 62 | } 63 | 64 | /** 65 | * Answers an array of the dimension field names. 66 | * 67 | * @return array 68 | */ 69 | public function getDimensions() 70 | { 71 | return array_keys($this->compositeDatabaseFields()); 72 | } 73 | 74 | /** 75 | * Answers the label for the specified dimension. 76 | * 77 | * @param string $dim 78 | * 79 | * @return string 80 | */ 81 | public function getDimensionLabel($dim) 82 | { 83 | switch ($dim) { 84 | case self::DIM_WIDTH: 85 | return _t(__CLASS__ . '.WIDTH', 'Width'); 86 | case self::DIM_HEIGHT: 87 | return _t(__CLASS__ . '.HEIGHT', 'Height'); 88 | } 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /src/Extensions/Admin/CropPriorityFileFormExtension.php: -------------------------------------------------------------------------------- 1 | =5.6.0 7 | * 8 | * For full copyright and license information, please view the 9 | * LICENSE.md file that was distributed with this source code. 10 | * 11 | * @package SilverWare\Extensions\Admin 12 | * @author Colin Tucker 13 | * @copyright 2017 Praxis Interactive 14 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 15 | * @link https://github.com/praxisnetau/silverware 16 | */ 17 | 18 | namespace SilverWare\Extensions\Admin; 19 | 20 | use SilverStripe\Assets\Image; 21 | use SilverStripe\Control\Controller; 22 | use SilverStripe\Core\Extension; 23 | use SilverStripe\Forms\DropdownField; 24 | use SilverStripe\Forms\FieldList; 25 | 26 | /** 27 | * An extension class which adds crop priority fields to the file form for images. 28 | * 29 | * @package SilverWare\Extensions\Admin 30 | * @author Colin Tucker 31 | * @copyright 2017 Praxis Interactive 32 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 33 | * @link https://github.com/praxisnetau/silverware 34 | */ 35 | class CropPriorityFileFormExtension extends Extension 36 | { 37 | /** 38 | * Updates the form fields of the extended object. 39 | * 40 | * @param FieldList $fields 41 | * @param Controller $controller 42 | * @param string $name 43 | * @param array $context 44 | * 45 | * @return void 46 | */ 47 | public function updateFormFields(FieldList $fields, Controller $controller, $name, $context) 48 | { 49 | // Check Record Type: 50 | 51 | if ($context['Record'] instanceof Image) { 52 | 53 | // Update Field Objects: 54 | 55 | $fields->insertAfter( 56 | 'ParentID', 57 | DropdownField::create( 58 | 'CropPriority', 59 | _t(__CLASS__ . '.CROPPRIORITY', 'Crop priority'), 60 | $this->getCropPriorityOptions() 61 | ) 62 | ); 63 | 64 | } 65 | } 66 | 67 | /** 68 | * Answers an array of options for the crop priority field. 69 | * 70 | * @return array 71 | */ 72 | public function getCropPriorityOptions() 73 | { 74 | return [ 75 | 'center' => _t(__CLASS__ . '.CENTER', 'Center'), 76 | 'top' => _t(__CLASS__ . '.TOP', 'Top'), 77 | 'left' => _t(__CLASS__ . '.LEFT', 'Left'), 78 | 'right' => _t(__CLASS__ . '.RIGHT', 'Right'), 79 | 'bottom' => _t(__CLASS__ . '.BOTTOM', 'Bottom') 80 | ]; 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /src/Model/ComponentController.php: -------------------------------------------------------------------------------- 1 | =5.6.0 7 | * 8 | * For full copyright and license information, please view the 9 | * LICENSE.md file that was distributed with this source code. 10 | * 11 | * @package SilverWare\Model 12 | * @author Colin Tucker 13 | * @copyright 2017 Praxis Interactive 14 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 15 | * @link https://github.com/praxisnetau/silverware 16 | */ 17 | 18 | namespace SilverWare\Model; 19 | 20 | use SilverStripe\CMS\Controllers\ContentController; 21 | use SilverStripe\Control\HTTPRequest; 22 | use SilverStripe\View\Requirements; 23 | use SilverStripe\View\SSViewer; 24 | use Page; 25 | use PageController; 26 | 27 | /** 28 | * An extension of the content controller class for a SilverWare component controller. 29 | * 30 | * @package SilverWare\Model 31 | * @author Colin Tucker 32 | * @copyright 2017 Praxis Interactive 33 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 34 | * @link https://github.com/praxisnetau/silverware 35 | */ 36 | class ComponentController extends ContentController 37 | { 38 | /** 39 | * Defines the allowed actions for this controller. 40 | * 41 | * @var array 42 | * @config 43 | */ 44 | private static $allowed_actions = [ 45 | 'index' 46 | ]; 47 | 48 | /** 49 | * Default action for a component controller. 50 | * 51 | * @param HTTPRequest $request 52 | * 53 | * @return HTTPResponse 54 | */ 55 | public function index(HTTPRequest $request) 56 | { 57 | if (!$this->isCMSPreview()) { 58 | $this->httpError(404); 59 | } 60 | 61 | return $this->render(); 62 | } 63 | 64 | /** 65 | * Answers a viewer object to render the template for the current page. 66 | * 67 | * @param string $action 68 | * 69 | * @return SSViewer 70 | */ 71 | public function getViewer($action) 72 | { 73 | // Answer Viewer Object (from parent): 74 | 75 | if (!$this->isCMSPreview()) { 76 | return parent::getViewer($action); 77 | } 78 | 79 | // Load Page Requirements (uses theme): 80 | 81 | PageController::create(Page::create())->doInit(); 82 | 83 | // Load Preview Requirements: 84 | 85 | Requirements::css('silverware/silverware: admin/client/dist/styles/preview.css'); 86 | 87 | // Answer Viewer Object (for CMS preview): 88 | 89 | return new SSViewer(sprintf('%s\CMSPreview', Component::class)); 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /admin/client/src/styles/_admin.scss: -------------------------------------------------------------------------------- 1 | /* SilverWare Admin Styles 2 | ===================================================================================================================== */ 3 | 4 | // Tree Styles: 5 | 6 | .cms-tree { 7 | 8 | &.jstree li.hidden { 9 | display: none; 10 | } 11 | 12 | .is-cached > a span.jstree-pageicon::after { 13 | 14 | top: 0; 15 | left: 0; 16 | width: 16px; 17 | height: 16px; 18 | content: url('../images/status/cached.png'); 19 | position: absolute; 20 | 21 | } 22 | 23 | .is-disabled > a span.jstree-pageicon::after { 24 | 25 | top: 0; 26 | left: 0; 27 | width: 16px; 28 | height: 16px; 29 | content: url('../images/status/disabled.png'); 30 | position: absolute; 31 | 32 | } 33 | 34 | .heading-h1 > a span.jstree-pageicon { 35 | background-image: url('../images/headings/h1.png'); 36 | } 37 | 38 | .heading-h2 > a span.jstree-pageicon { 39 | background-image: url('../images/headings/h2.png'); 40 | } 41 | 42 | .heading-h3 > a span.jstree-pageicon { 43 | background-image: url('../images/headings/h3.png'); 44 | } 45 | 46 | .heading-h4 > a span.jstree-pageicon { 47 | background-image: url('../images/headings/h4.png'); 48 | } 49 | 50 | .heading-h5 > a span.jstree-pageicon { 51 | background-image: url('../images/headings/h5.png'); 52 | } 53 | 54 | .heading-h6 > a span.jstree-pageicon { 55 | background-image: url('../images/headings/h6.png'); 56 | } 57 | 58 | } 59 | 60 | // Field Styles: 61 | 62 | .field { 63 | 64 | &.form-group { 65 | &.hidden { 66 | display: none; 67 | } 68 | } 69 | 70 | &.fieldgroup { 71 | > .hidden { 72 | display: none; 73 | } 74 | } 75 | 76 | } 77 | 78 | // Badge Styles: 79 | 80 | .cms-tree { 81 | 82 | .status-number-badge > a span.jstree-pageicon::before { 83 | top: 6px; 84 | right: -3px; 85 | color: $white; 86 | padding: 0 2px; 87 | font-size: 9px; 88 | min-width: 13px; 89 | min-height: 13px; 90 | font-weight: bold; 91 | line-height: 13px; 92 | position: absolute; 93 | text-align: center; 94 | text-shadow: none; 95 | border-radius: 7px; 96 | background-color: $brand-danger; 97 | } 98 | 99 | } 100 | 101 | ul.nav-tabs { 102 | 103 | span.number-badge { 104 | color: $white; 105 | padding: 0 4px; 106 | font-size: 11px; 107 | min-width: 16px; 108 | min-height: 16px; 109 | margin-left: 4px; 110 | line-height: 16px; 111 | border-radius: 8px; 112 | text-align: center; 113 | font-weight: bold; 114 | display: inline-block; 115 | background-color: $brand-danger; 116 | } 117 | 118 | } 119 | 120 | // Message Styles: 121 | 122 | .message { 123 | 124 | &.status { 125 | margin-bottom: ($spacer * 1.5); 126 | } 127 | 128 | } 129 | -------------------------------------------------------------------------------- /admin/client/dist/js/bundle.js: -------------------------------------------------------------------------------- 1 | !function(e){function t(i){if(n[i])return n[i].exports;var s=n[i]={i:i,l:!1,exports:{}};return e[i].call(s.exports,s,s.exports,t),s.l=!0,s.exports}var n={};t.m=e,t.c=n,t.d=function(e,n,i){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:i})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/resources/vendor/silverware/silverware/admin/client/dist/",t(t.s=1)}([function(e,t){e.exports=jQuery},function(e,t,n){n(2),n(3),n(4),n(5)},function(e,t){},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0);n.n(i).a.entwine("silverware.numberbadges",function(e){e("div.ss-tabset").entwine({onmatch:function(){this._super();var t=this;if(this.attr("data-number-badges")){var n=e.parseJSON(this.attr("data-number-badges"));e.each(n,function(e,n){if(n){var i=t.findTab(e);i.length&&i.append(''+n+"")}})}},findTab:function(e){return this.find(this.getTabId(e))},getTabId:function(e){return"a#tab-"+e.replace(".","_")}}),e(".cms-tree li").entwine({updateBadge:function(t){if(this.find("span.status-number-badge").length){var n="#"+this.attr("id")+".status-number-badge > a span.jstree-pageicon::before",i='content: "'+(t>0?t:"")+'";';e("head").append('")}}}),e("span.status-number-badge-value").entwine({onmatch:function(){if(this._super(),!this.data("updated")){var e=parseInt(this.attr("title"));this.closest("li").updateBadge(e),this.data("updated",!0)}}})})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0);n.n(i).a.entwine("silverware.listviewextension",function(e){e(".tabset.silverware-extensions-lists-listviewextension").entwine({onmatch:function(){var t=e(this);this.handlePagination(),this.getPaginateItemsField().entwine({onchange:function(e){t.handlePagination(),this._super(e)}}),this._super()},handlePagination:function(){1==this.getPaginateItemsField().val()?this.getPaginationHolder().show():this.getPaginationHolder().hide()},getPaginateItemsField:function(){return e(this).find("#Form_EditForm_List_PaginateItems")},getPaginationHolder:function(){return e(this).find("#Form_EditForm_List_ItemsPerPage_Holder")}})})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0);n.n(i).a.entwine("silverware.togglegroup",function(e){e(".field.togglegroup").entwine({onmatch:function(){var t=e(this);t.doToggle(),t.getToggleInput().entwine({onclick:function(e){t.doToggle(),this._super(e)}}),this._super()},doToggle:function(){var t=e(this.getToggleInput()),n=this.getToggleMode();this.getFields().toggle(n?t.is(":checked"):!t.is(":checked"))},getToggle:function(){return e(this).find(".group-toggle")},getFields:function(){return e(this).find(".group-fields")},getToggleInput:function(){return this.getToggle().find("input")},getToggleMode:function(){return this.getToggle().data("show-when-checked")}})})}]); -------------------------------------------------------------------------------- /src/Lists/ListAlert.php: -------------------------------------------------------------------------------- 1 | =5.6.0 7 | * 8 | * For full copyright and license information, please view the 9 | * LICENSE.md file that was distributed with this source code. 10 | * 11 | * @package SilverWare\Lists 12 | * @author Colin Tucker 13 | * @copyright 2017 Praxis Interactive 14 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 15 | * @link https://github.com/praxisnetau/silverware 16 | */ 17 | 18 | namespace SilverWare\Lists; 19 | 20 | use SilverStripe\ORM\ArrayList; 21 | use SilverStripe\View\ArrayData; 22 | 23 | /** 24 | * Allows an object to add alert messages to a list component. 25 | * 26 | * @package SilverWare\Lists 27 | * @author Colin Tucker 28 | * @copyright 2017 Praxis Interactive 29 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 30 | * @link https://github.com/praxisnetau/silverware 31 | */ 32 | trait ListAlert 33 | { 34 | /** 35 | * Defines the alerts to be added to the list source. 36 | * 37 | * @var array 38 | */ 39 | protected $listAlerts = []; 40 | 41 | /** 42 | * Defines the value of the listAlerts attribute. 43 | * 44 | * @param array $listAlerts 45 | * 46 | * @return $this 47 | */ 48 | public function setListAlerts($listAlerts) 49 | { 50 | $this->listAlerts = (array) $listAlerts; 51 | 52 | return $this; 53 | } 54 | 55 | /** 56 | * Answers the value of the listAlerts attribute. 57 | * 58 | * @return array 59 | */ 60 | public function getListAlerts() 61 | { 62 | return $this->listAlerts; 63 | } 64 | 65 | /** 66 | * Answers an array list of alerts for the template. 67 | * 68 | * @return ArrayList 69 | */ 70 | public function getListAlertsData() 71 | { 72 | $alerts = ArrayList::create(); 73 | 74 | foreach ($this->getListAlerts() as $alert) { 75 | $alerts->push(ArrayData::create($alert)); 76 | } 77 | 78 | return $alerts; 79 | } 80 | 81 | /** 82 | * Adds an alert with the given details to the array of alerts. 83 | * 84 | * @param string $text 85 | * @param string $type 86 | * @param string $icon 87 | * 88 | * @return $this 89 | */ 90 | public function addListAlert($text, $type = 'primary', $icon = 'info-circle') 91 | { 92 | $this->listAlerts[] = [ 93 | 'Text' => $text, 94 | 'Type' => $type, 95 | 'Icon' => $icon 96 | ]; 97 | 98 | return $this; 99 | } 100 | 101 | /** 102 | * Answers true if the receiver has at least one list alert. 103 | * 104 | * @return boolean 105 | */ 106 | public function hasListAlerts() 107 | { 108 | return !empty($this->listAlerts); 109 | } 110 | } 111 | -------------------------------------------------------------------------------- /src/Extensions/AreaExtension.php: -------------------------------------------------------------------------------- 1 | =5.6.0 7 | * 8 | * For full copyright and license information, please view the 9 | * LICENSE.md file that was distributed with this source code. 10 | * 11 | * @package SilverWare\Extensions 12 | * @author Colin Tucker 13 | * @copyright 2017 Praxis Interactive 14 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 15 | * @link https://github.com/praxisnetau/silverware 16 | */ 17 | 18 | namespace SilverWare\Extensions; 19 | 20 | use SilverStripe\Core\ClassInfo; 21 | use SilverStripe\ORM\DataExtension; 22 | use SilverWare\Components\AreaComponent; 23 | use SilverWare\Model\Panel; 24 | use Page; 25 | 26 | /** 27 | * A data extension class which adds area and panel functionality to extended objects. 28 | * 29 | * @package SilverWare\Extensions 30 | * @author Colin Tucker 31 | * @copyright 2017 Praxis Interactive 32 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 33 | * @link https://github.com/praxisnetau/silverware 34 | */ 35 | class AreaExtension extends DataExtension 36 | { 37 | /** 38 | * Defines the reciprocal many-many associations for the extended object. 39 | * 40 | * @var array 41 | * @config 42 | */ 43 | private static $belongs_many_many = [ 44 | 'Panels' => Panel::class 45 | ]; 46 | 47 | /** 48 | * Answers the panel associated with the given area component. 49 | * 50 | * @param AreaComponent $area 51 | * 52 | * @return Panel 53 | */ 54 | public function getPanelForArea(AreaComponent $area) 55 | { 56 | // Answer Panel from Children: 57 | 58 | foreach ($this->owner->getChildPanels() as $panel) { 59 | 60 | if ($panel->hasArea($area)) { 61 | return $panel; 62 | } 63 | 64 | } 65 | 66 | // Answer Panel from Owner: 67 | 68 | foreach ($this->owner->Panels() as $panel) { 69 | 70 | if ($panel->hasArea($area)) { 71 | return $panel; 72 | } 73 | 74 | } 75 | 76 | // Answer Panel from Parent: 77 | 78 | if (($parent = $this->owner->getParent()) && $parent instanceof Page) { 79 | 80 | if (($panel = $parent->getPanelForArea($area)) && $panel->isInherited()) { 81 | return $panel; 82 | } 83 | 84 | } 85 | 86 | // Answer Panel for All Pages: 87 | 88 | return $area->getFolderPanels()->find('ShowOn', 'AllPages'); 89 | } 90 | 91 | /** 92 | * Answers a list of child panels from the extended object. 93 | * 94 | * @return ArrayList 95 | */ 96 | public function getChildPanels() 97 | { 98 | return $this->owner->AllChildren()->filter('ClassName', ClassInfo::subclassesFor(Panel::class)); 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /src/Lists/ListFilter.php: -------------------------------------------------------------------------------- 1 | =5.6.0 7 | * 8 | * For full copyright and license information, please view the 9 | * LICENSE.md file that was distributed with this source code. 10 | * 11 | * @package SilverWare\Lists 12 | * @author Colin Tucker 13 | * @copyright 2017 Praxis Interactive 14 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 15 | * @link https://github.com/praxisnetau/silverware 16 | */ 17 | 18 | namespace SilverWare\Lists; 19 | 20 | /** 21 | * Allows an object to filter the items within a list component. 22 | * 23 | * @package SilverWare\Lists 24 | * @author Colin Tucker 25 | * @copyright 2017 Praxis Interactive 26 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 27 | * @link https://github.com/praxisnetau/silverware 28 | */ 29 | trait ListFilter 30 | { 31 | /** 32 | * Defines the filters to be applied to the list source. 33 | * 34 | * @var array 35 | */ 36 | protected $listFilters = []; 37 | 38 | /** 39 | * Defines the where clauses to be applied to the list source. 40 | * 41 | * @var array 42 | */ 43 | protected $listWhere = []; 44 | 45 | /** 46 | * Defines the value of the listFilters attribute. 47 | * 48 | * @param array $listFilters 49 | * 50 | * @return $this 51 | */ 52 | public function setListFilters($listFilters) 53 | { 54 | $this->listFilters = (array) $listFilters; 55 | 56 | return $this; 57 | } 58 | 59 | /** 60 | * Answers the value of the listFilters attribute. 61 | * 62 | * @return array 63 | */ 64 | public function getListFilters() 65 | { 66 | return $this->listFilters; 67 | } 68 | 69 | /** 70 | * Defines the value of the listWhere attribute. 71 | * 72 | * @param array $listWhere 73 | * 74 | * @return $this 75 | */ 76 | public function setListWhere($listWhere) 77 | { 78 | $this->listWhere = (array) $listWhere; 79 | 80 | return $this; 81 | } 82 | 83 | /** 84 | * Answers the value of the listWhere attribute. 85 | * 86 | * @return array 87 | */ 88 | public function getListWhere() 89 | { 90 | return $this->listWhere; 91 | } 92 | 93 | /** 94 | * Adds the given filter array to the array of filters. 95 | * 96 | * @param array $filter 97 | * 98 | * @return $this 99 | */ 100 | public function addListFilter($filter = []) 101 | { 102 | $this->listFilters[] = $filter; 103 | 104 | return $this; 105 | } 106 | 107 | /** 108 | * Adds the given where clause array to the array of where clauses. 109 | * 110 | * @param array $where 111 | * 112 | * @return $this 113 | */ 114 | public function addListWhere($where = []) 115 | { 116 | $this->listWhere[] = $where; 117 | 118 | return $this; 119 | } 120 | } 121 | -------------------------------------------------------------------------------- /src/Folders/PanelFolder.php: -------------------------------------------------------------------------------- 1 | =5.6.0 7 | * 8 | * For full copyright and license information, please view the 9 | * LICENSE.md file that was distributed with this source code. 10 | * 11 | * @package SilverWare\Folders 12 | * @author Colin Tucker 13 | * @copyright 2017 Praxis Interactive 14 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 15 | * @link https://github.com/praxisnetau/silverware 16 | */ 17 | 18 | namespace SilverWare\Folders; 19 | 20 | use SilverWare\Model\Folder; 21 | use SilverWare\Model\Panel; 22 | 23 | /** 24 | * An extension of the folder class for a panel folder. 25 | * 26 | * @package SilverWare\Folders 27 | * @author Colin Tucker 28 | * @copyright 2017 Praxis Interactive 29 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 30 | * @link https://github.com/praxisnetau/silverware 31 | */ 32 | class PanelFolder extends Folder 33 | { 34 | /** 35 | * Human-readable singular name. 36 | * 37 | * @var string 38 | * @config 39 | */ 40 | private static $singular_name = 'Panel Folder'; 41 | 42 | /** 43 | * Human-readable plural name. 44 | * 45 | * @var string 46 | * @config 47 | */ 48 | private static $plural_name = 'Panel Folders'; 49 | 50 | /** 51 | * Description of this object. 52 | * 53 | * @var string 54 | * @config 55 | */ 56 | private static $description = 'Holds a series of SilverWare panels'; 57 | 58 | /** 59 | * Icon file for this object. 60 | * 61 | * @var string 62 | * @config 63 | */ 64 | private static $icon = 'silverware/silverware: admin/client/dist/images/icons/PanelFolder.png'; 65 | 66 | /** 67 | * Defines the table name to use for this object. 68 | * 69 | * @var string 70 | * @config 71 | */ 72 | private static $table_name = 'SilverWare_PanelFolder'; 73 | 74 | /** 75 | * Defines an ancestor class to hide from the admin interface. 76 | * 77 | * @var string 78 | * @config 79 | */ 80 | private static $hide_ancestor = Folder::class; 81 | 82 | /** 83 | * Defines the default child class for this object. 84 | * 85 | * @var string 86 | * @config 87 | */ 88 | private static $default_child = Panel::class; 89 | 90 | /** 91 | * Defines the allowed children for this object. 92 | * 93 | * @var array|string 94 | * @config 95 | */ 96 | private static $allowed_children = [ 97 | Panel::class 98 | ]; 99 | 100 | /** 101 | * Populates the default values for the fields of the receiver. 102 | * 103 | * @return void 104 | */ 105 | public function populateDefaults() 106 | { 107 | // Populate Defaults (from parent): 108 | 109 | parent::populateDefaults(); 110 | 111 | // Populate Defaults: 112 | 113 | $this->Title = _t(__CLASS__ . '.DEFAULTTITLE', 'Panels'); 114 | } 115 | } 116 | -------------------------------------------------------------------------------- /src/Folders/LayoutFolder.php: -------------------------------------------------------------------------------- 1 | =5.6.0 7 | * 8 | * For full copyright and license information, please view the 9 | * LICENSE.md file that was distributed with this source code. 10 | * 11 | * @package SilverWare\Folders 12 | * @author Colin Tucker 13 | * @copyright 2017 Praxis Interactive 14 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 15 | * @link https://github.com/praxisnetau/silverware 16 | */ 17 | 18 | namespace SilverWare\Folders; 19 | 20 | use SilverWare\Model\Folder; 21 | use SilverWare\Model\Layout; 22 | 23 | /** 24 | * An extension of the folder class for a layout folder. 25 | * 26 | * @package SilverWare\Folders 27 | * @author Colin Tucker 28 | * @copyright 2017 Praxis Interactive 29 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 30 | * @link https://github.com/praxisnetau/silverware 31 | */ 32 | class LayoutFolder extends Folder 33 | { 34 | /** 35 | * Human-readable singular name. 36 | * 37 | * @var string 38 | * @config 39 | */ 40 | private static $singular_name = 'Layout Folder'; 41 | 42 | /** 43 | * Human-readable plural name. 44 | * 45 | * @var string 46 | * @config 47 | */ 48 | private static $plural_name = 'Layout Folders'; 49 | 50 | /** 51 | * Description of this object. 52 | * 53 | * @var string 54 | * @config 55 | */ 56 | private static $description = 'Holds a series of SilverWare layouts'; 57 | 58 | /** 59 | * Icon file for this object. 60 | * 61 | * @var string 62 | * @config 63 | */ 64 | private static $icon = 'silverware/silverware: admin/client/dist/images/icons/LayoutFolder.png'; 65 | 66 | /** 67 | * Defines the table name to use for this object. 68 | * 69 | * @var string 70 | * @config 71 | */ 72 | private static $table_name = 'SilverWare_LayoutFolder'; 73 | 74 | /** 75 | * Defines an ancestor class to hide from the admin interface. 76 | * 77 | * @var string 78 | * @config 79 | */ 80 | private static $hide_ancestor = Folder::class; 81 | 82 | /** 83 | * Defines the default child class for this object. 84 | * 85 | * @var string 86 | * @config 87 | */ 88 | private static $default_child = Layout::class; 89 | 90 | /** 91 | * Defines the allowed children for this object. 92 | * 93 | * @var array|string 94 | * @config 95 | */ 96 | private static $allowed_children = [ 97 | Layout::class 98 | ]; 99 | 100 | /** 101 | * Populates the default values for the fields of the receiver. 102 | * 103 | * @return void 104 | */ 105 | public function populateDefaults() 106 | { 107 | // Populate Defaults (from parent): 108 | 109 | parent::populateDefaults(); 110 | 111 | // Populate Defaults: 112 | 113 | $this->Title = _t(__CLASS__ . '.DEFAULTTITLE', 'Layouts'); 114 | } 115 | } 116 | -------------------------------------------------------------------------------- /src/Grid/Frameworks/Bootstrap/Framework.php: -------------------------------------------------------------------------------- 1 | =5.6.0 7 | * 8 | * For full copyright and license information, please view the 9 | * LICENSE.md file that was distributed with this source code. 10 | * 11 | * @package SilverWare\Grid\Frameworks\Bootstrap 12 | * @author Colin Tucker 13 | * @copyright 2017 Praxis Interactive 14 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 15 | * @link https://github.com/praxisnetau/silverware 16 | */ 17 | 18 | namespace SilverWare\Grid\Frameworks\Bootstrap; 19 | 20 | use SilverWare\Grid\Column as GridColumn; 21 | use SilverWare\Grid\Framework as GridFramework; 22 | use SilverWare\Grid\Row as GridRow; 23 | use SilverWare\Grid\Section as GridSection; 24 | 25 | /** 26 | * An extension of the framework class for the Bootstrap framework. 27 | * 28 | * @package SilverWare\Grid\Frameworks\Bootstrap 29 | * @author Colin Tucker 30 | * @copyright 2017 Praxis Interactive 31 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 32 | * @link https://github.com/praxisnetau/silverware 33 | */ 34 | class Framework extends GridFramework 35 | { 36 | /** 37 | * Maps grid classes to the extensions applied by this framework. 38 | * 39 | * @var array 40 | * @config 41 | */ 42 | private static $class_extensions = [ 43 | GridRow::class => Row::class, 44 | GridColumn::class => Column::class, 45 | GridSection::class => Section::class 46 | ]; 47 | 48 | /** 49 | * Determines whether the framework uses column offset values. 50 | * 51 | * @var boolean 52 | * @config 53 | */ 54 | private static $use_column_offset = false; 55 | 56 | /** 57 | * Answers the text alignment class for the specified viewport and value. 58 | * 59 | * @param string $viewport 60 | * @param string $value 61 | * 62 | * @return string 63 | */ 64 | public function getTextAlignmentClass($viewport, $value) 65 | { 66 | if ($value) { 67 | 68 | $class = [$this->getStyle('text')]; 69 | 70 | $class[] = $this->getStyle('viewport', $viewport); 71 | 72 | $class[] = $this->getStyle('align', $value); 73 | 74 | return implode('-', array_filter($class)); 75 | 76 | } 77 | } 78 | 79 | /** 80 | * Answers the image alignment class for the specified viewport and value. 81 | * 82 | * @param string $viewport 83 | * @param string $value 84 | * 85 | * @return string 86 | */ 87 | public function getImageAlignmentClass($viewport, $value) 88 | { 89 | if ($value) { 90 | 91 | $class = [$this->getStyle('image')]; 92 | 93 | $class[] = $this->getStyle('viewport', $viewport); 94 | 95 | $class[] = $this->getStyle('align', $value); 96 | 97 | return implode('-', array_filter($class)); 98 | 99 | } 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /src/Folders/TemplateFolder.php: -------------------------------------------------------------------------------- 1 | =5.6.0 7 | * 8 | * For full copyright and license information, please view the 9 | * LICENSE.md file that was distributed with this source code. 10 | * 11 | * @package SilverWare\Folders 12 | * @author Colin Tucker 13 | * @copyright 2017 Praxis Interactive 14 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 15 | * @link https://github.com/praxisnetau/silverware 16 | */ 17 | 18 | namespace SilverWare\Folders; 19 | 20 | use SilverWare\Model\Folder; 21 | use SilverWare\Model\Template; 22 | 23 | /** 24 | * An extension of the folder class for a template folder. 25 | * 26 | * @package SilverWare\Folders 27 | * @author Colin Tucker 28 | * @copyright 2017 Praxis Interactive 29 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 30 | * @link https://github.com/praxisnetau/silverware 31 | */ 32 | class TemplateFolder extends Folder 33 | { 34 | /** 35 | * Human-readable singular name. 36 | * 37 | * @var string 38 | * @config 39 | */ 40 | private static $singular_name = 'Template Folder'; 41 | 42 | /** 43 | * Human-readable plural name. 44 | * 45 | * @var string 46 | * @config 47 | */ 48 | private static $plural_name = 'Template Folders'; 49 | 50 | /** 51 | * Description of this object. 52 | * 53 | * @var string 54 | * @config 55 | */ 56 | private static $description = 'Holds a series of SilverWare templates'; 57 | 58 | /** 59 | * Icon file for this object. 60 | * 61 | * @var string 62 | * @config 63 | */ 64 | private static $icon = 'silverware/silverware: admin/client/dist/images/icons/TemplateFolder.png'; 65 | 66 | /** 67 | * Defines the table name to use for this object. 68 | * 69 | * @var string 70 | * @config 71 | */ 72 | private static $table_name = 'SilverWare_TemplateFolder'; 73 | 74 | /** 75 | * Defines an ancestor class to hide from the admin interface. 76 | * 77 | * @var string 78 | * @config 79 | */ 80 | private static $hide_ancestor = Folder::class; 81 | 82 | /** 83 | * Defines the default child class for this object. 84 | * 85 | * @var string 86 | * @config 87 | */ 88 | private static $default_child = Template::class; 89 | 90 | /** 91 | * Defines the allowed children for this object. 92 | * 93 | * @var array|string 94 | * @config 95 | */ 96 | private static $allowed_children = [ 97 | Template::class 98 | ]; 99 | 100 | /** 101 | * Populates the default values for the fields of the receiver. 102 | * 103 | * @return void 104 | */ 105 | public function populateDefaults() 106 | { 107 | // Populate Defaults (from parent): 108 | 109 | parent::populateDefaults(); 110 | 111 | // Populate Defaults: 112 | 113 | $this->Title = _t(__CLASS__ . '.DEFAULTTITLE', 'Templates'); 114 | } 115 | } 116 | -------------------------------------------------------------------------------- /client/src/styles/components/BaseListComponent.scss: -------------------------------------------------------------------------------- 1 | /* Base List Component Styles 2 | ===================================================================================================================== */ 3 | 4 | .baselistcomponent { 5 | 6 | .items { 7 | 8 | > article.item { 9 | 10 | margin-bottom: $spacer; 11 | 12 | &:last-child { 13 | margin-bottom: 0; 14 | } 15 | 16 | > div.image { 17 | 18 | position: relative; 19 | margin-bottom: $spacer; 20 | 21 | a { 22 | display: inline-block; 23 | } 24 | 25 | img { 26 | margin: 0; 27 | display: inline-block; 28 | } 29 | 30 | div.image-overlay { 31 | 32 | top: 0; 33 | left: 0; 34 | right: 0; 35 | bottom: 0; 36 | width: 100%; 37 | height: 100%; 38 | opacity: 0; 39 | overflow: hidden; 40 | position: absolute; 41 | transition: .5s ease; 42 | background-color: $image-overlay-background; 43 | 44 | > div.inner { 45 | 46 | top: 50%; 47 | left: 0; 48 | width: 100%; 49 | position: absolute; 50 | transform: translateY(-50%); 51 | 52 | > div.icon { 53 | font-size: 32px; 54 | text-align: center; 55 | color: $image-overlay-foreground; 56 | } 57 | 58 | > div.text { 59 | 60 | text-align: center; 61 | padding: 0 $spacer; 62 | 63 | > * { 64 | margin: 0; 65 | padding: 0; 66 | font-size: $font-size-lg; 67 | color: $image-overlay-foreground; 68 | } 69 | 70 | } 71 | 72 | } 73 | 74 | } 75 | 76 | &:hover, 77 | a:focus { 78 | 79 | div.image-overlay { 80 | opacity: 1; 81 | } 82 | 83 | } 84 | 85 | } 86 | 87 | > section.content { 88 | 89 | header { 90 | 91 | margin-bottom: $spacer-half; 92 | 93 | > * { 94 | margin-bottom: 0; 95 | } 96 | 97 | a { 98 | color: inherit; 99 | } 100 | 101 | } 102 | 103 | div.details { 104 | 105 | color: $gray-600; 106 | 107 | > span { 108 | margin-right: $spacer-half; 109 | } 110 | 111 | a { 112 | color: inherit; 113 | } 114 | 115 | } 116 | 117 | footer { 118 | margin-top: $spacer; 119 | } 120 | 121 | > div { 122 | margin-bottom: $spacer-half; 123 | } 124 | 125 | } 126 | 127 | } 128 | 129 | } 130 | 131 | ul.pagination { 132 | margin-top: $spacer-double; 133 | margin-bottom: 0; 134 | } 135 | 136 | } 137 | -------------------------------------------------------------------------------- /src/Model/SectionHolder.php: -------------------------------------------------------------------------------- 1 | =5.6.0 7 | * 8 | * For full copyright and license information, please view the 9 | * LICENSE.md file that was distributed with this source code. 10 | * 11 | * @package SilverWare\Model 12 | * @author Colin Tucker 13 | * @copyright 2017 Praxis Interactive 14 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 15 | * @link https://github.com/praxisnetau/silverware 16 | */ 17 | 18 | namespace SilverWare\Model; 19 | 20 | use SilverWare\Grid\Section; 21 | 22 | /** 23 | * An extension of the component class for a section holder. 24 | * 25 | * @package SilverWare\Model 26 | * @author Colin Tucker 27 | * @copyright 2017 Praxis Interactive 28 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 29 | * @link https://github.com/praxisnetau/silverware 30 | */ 31 | class SectionHolder extends Component 32 | { 33 | /** 34 | * Human-readable singular name. 35 | * 36 | * @var string 37 | * @config 38 | */ 39 | private static $singular_name = 'Section Holder'; 40 | 41 | /** 42 | * Human-readable plural name. 43 | * 44 | * @var string 45 | * @config 46 | */ 47 | private static $plural_name = 'Section Holders'; 48 | 49 | /** 50 | * Defines the table name to use for this object. 51 | * 52 | * @var string 53 | * @config 54 | */ 55 | private static $table_name = 'SilverWare_SectionHolder'; 56 | 57 | /** 58 | * Defines the default child class for this object. 59 | * 60 | * @var string 61 | * @config 62 | */ 63 | private static $default_child = Section::class; 64 | 65 | /** 66 | * Defines the allowed children for this object. 67 | * 68 | * @var array|string 69 | * @config 70 | */ 71 | private static $allowed_children = [ 72 | Section::class 73 | ]; 74 | 75 | /** 76 | * Defines an ancestor class to hide from the admin interface. 77 | * 78 | * @var string 79 | * @config 80 | */ 81 | private static $hide_ancestor = Component::class; 82 | 83 | /** 84 | * Answers the labels for the fields of the receiver. 85 | * 86 | * @param boolean $includerelations Include labels for relations. 87 | * 88 | * @return array 89 | */ 90 | public function fieldLabels($includerelations = true) 91 | { 92 | // Obtain Field Labels (from parent): 93 | 94 | $labels = parent::fieldLabels($includerelations); 95 | 96 | // Define Field Labels: 97 | 98 | $labels['Title'] = _t(__CLASS__ . '.NAME', 'Name'); 99 | 100 | // Answer Field Labels: 101 | 102 | return $labels; 103 | } 104 | 105 | /** 106 | * Renders the component for the HTML template. 107 | * 108 | * @param string $layout Page layout passed from template. 109 | * @param string $title Page title passed from template. 110 | * 111 | * @return DBHTMLText|string 112 | */ 113 | public function renderSelf($layout = null, $title = null) 114 | { 115 | return $this->renderChildren($layout, $title); 116 | } 117 | } 118 | -------------------------------------------------------------------------------- /src/Crumbs/Breadcrumb.php: -------------------------------------------------------------------------------- 1 | =5.6.0 7 | * 8 | * For full copyright and license information, please view the 9 | * LICENSE.md file that was distributed with this source code. 10 | * 11 | * @package SilverWare\Crumbs 12 | * @author Colin Tucker 13 | * @copyright 2017 Praxis Interactive 14 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 15 | * @link https://github.com/praxisnetau/silverware 16 | */ 17 | 18 | namespace SilverWare\Crumbs; 19 | 20 | use SilverStripe\Control\Controller; 21 | use SilverStripe\View\ViewableData; 22 | 23 | /** 24 | * An extension of the viewable data class for a breadcrumb. 25 | * 26 | * @package SilverWare\Crumbs 27 | * @author Colin Tucker 28 | * @copyright 2017 Praxis Interactive 29 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 30 | * @link https://github.com/praxisnetau/silverware 31 | */ 32 | class Breadcrumb extends ViewableData implements Crumbable 33 | { 34 | /** 35 | * The link for the breadcrumb. 36 | * 37 | * @var string 38 | */ 39 | protected $link; 40 | 41 | /** 42 | * The title for the breadcrumb. 43 | * 44 | * @var string 45 | */ 46 | protected $title; 47 | 48 | /** 49 | * Constructs the object upon instantiation. 50 | * 51 | * @param string $link 52 | * @param string $title 53 | */ 54 | public function __construct($link = null, $title = null) 55 | { 56 | // Construct Parent: 57 | 58 | parent::__construct(); 59 | 60 | // Construct Object: 61 | 62 | $this->setLink($link); 63 | $this->setTitle($title); 64 | } 65 | 66 | /** 67 | * Defines the link of the receiver. 68 | * 69 | * @param string $link 70 | * 71 | * @return $this 72 | */ 73 | public function setLink($link) 74 | { 75 | $this->link = (string) $link; 76 | 77 | return $this; 78 | } 79 | 80 | /** 81 | * Defines the title of the receiver. 82 | * 83 | * @param string $title 84 | * 85 | * @return $this 86 | */ 87 | public function setTitle($title) 88 | { 89 | $this->title = (string) $title; 90 | 91 | return $this; 92 | } 93 | 94 | /** 95 | * Defines the link and title of the receiver. 96 | * 97 | * @param string $link 98 | * @param string $title 99 | * 100 | * @return $this 101 | */ 102 | public function setItem($link, $title) 103 | { 104 | $this->setLink($link); 105 | $this->setTitle($title); 106 | 107 | return $this; 108 | } 109 | 110 | /** 111 | * Answers the menu title for the receiver. 112 | * 113 | * @return string 114 | */ 115 | public function getMenuTitle() 116 | { 117 | return $this->title; 118 | } 119 | 120 | /** 121 | * Answers the link for the receiver. 122 | * 123 | * @param string $action 124 | * 125 | * @return string 126 | */ 127 | public function getLink($action = null) 128 | { 129 | return Controller::join_links($this->link, $action); 130 | } 131 | } 132 | -------------------------------------------------------------------------------- /_config/styles.yml: -------------------------------------------------------------------------------- 1 | --- 2 | Name: silverware-styles 3 | --- 4 | 5 | # Bootstrap Styles: 6 | 7 | SilverWare\Grid\Frameworks\Bootstrap\Framework: 8 | breakpoints: 9 | small: 576px 10 | medium: 768px 11 | large: 992px 12 | huge: 1200px 13 | style_mappings: 14 | alert: 15 | alert: alert 16 | info: alert-info 17 | success: alert-success 18 | warning: alert-warning 19 | danger: alert-danger 20 | align: 21 | left: left 22 | center: center 23 | right: right 24 | justify: justify 25 | background: 26 | primary: bg-primary 27 | secondary: bg-secondary 28 | success: bg-success 29 | info: bg-info 30 | warning: bg-warning 31 | danger: bg-danger 32 | white: bg-white 33 | light: bg-light 34 | dark: bg-dark 35 | border: 36 | border: border 37 | primary: border-primary 38 | secondary: border-secondary 39 | success: border-success 40 | info: border-info 41 | warning: border-warning 42 | danger: border-danger 43 | white: border-white 44 | light: border-light 45 | dark: border-dark 46 | button: 47 | button: btn 48 | primary: btn-primary 49 | secondary: btn-secondary 50 | success: btn-success 51 | danger: btn-danger 52 | warning: btn-warning 53 | info: btn-info 54 | light: btn-light 55 | dark: btn-dark 56 | link: btn-link 57 | outline-primary: btn-outline-primary 58 | outline-secondary: btn-outline-secondary 59 | outline-success: btn-outline-success 60 | outline-danger: btn-outline-danger 61 | outline-warning: btn-outline-warning 62 | outline-info: btn-outline-info 63 | outline-light: btn-outline-light 64 | outline-dark: btn-outline-dark 65 | small: btn-sm 66 | large: btn-lg 67 | column: 68 | column: column 69 | edge-to-edge: pl-0 pr-0 70 | content: 71 | content: content 72 | typography: typography 73 | feature: 74 | body: card-body 75 | feature: card 76 | heading: card-title 77 | sub-heading: card-subtitle 78 | image-top: card-img-top 79 | figure: 80 | figure: figure 81 | image: figure-img 82 | caption: figure-caption 83 | image: 84 | image: image 85 | fluid: img-fluid 86 | link: 87 | image: link-image 88 | pagination: 89 | small: pagination-sm 90 | large: pagination-lg 91 | position: 92 | fixed-top: fixed-top 93 | fixed-bottom: fixed-bottom 94 | sticky-top: sticky-top 95 | rounded: 96 | rounded: rounded 97 | top: rounded-top 98 | right: rounded-right 99 | bottom: rounded-bottom 100 | left: rounded-left 101 | circle: rounded-circle 102 | row: 103 | row: row 104 | no-gutters: no-gutters 105 | edge-to-edge: pl-0 pr-0 106 | section: 107 | edge-to-edge: pl-0 pr-0 108 | text: 109 | text: text 110 | primary: text-primary 111 | secondary: text-secondary 112 | success: text-success 113 | info: text-info 114 | warning: text-warning 115 | danger: text-danger 116 | white: text-white 117 | light: text-light 118 | dark: text-dark 119 | viewport: 120 | small: sm 121 | medium: md 122 | large: lg 123 | huge: xl 124 | -------------------------------------------------------------------------------- /src/ORM/FieldType/DBAbsoluteInt.php: -------------------------------------------------------------------------------- 1 | =5.6.0 7 | * 8 | * For full copyright and license information, please view the 9 | * LICENSE.md file that was distributed with this source code. 10 | * 11 | * @package SilverWare\ORM\FieldType 12 | * @author Colin Tucker 13 | * @copyright 2017 Praxis Interactive 14 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 15 | * @link https://github.com/praxisnetau/silverware 16 | */ 17 | 18 | namespace SilverWare\ORM\FieldType; 19 | 20 | use SilverStripe\Forms\TextField; 21 | use SilverStripe\ORM\Connect\MySQLDatabase; 22 | use SilverStripe\ORM\DB; 23 | use SilverStripe\ORM\FieldType\DBField; 24 | 25 | /** 26 | * A database field used to store an absolute integer (which may also be null). 27 | * 28 | * @package SilverWare\ORM\FieldType 29 | * @author Colin Tucker 30 | * @copyright 2017 Praxis Interactive 31 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 32 | * @link https://github.com/praxisnetau/silverware 33 | */ 34 | class DBAbsoluteInt extends DBField 35 | { 36 | /** 37 | * Adds the field to the underlying database. 38 | * 39 | * @return void 40 | */ 41 | public function requireField() 42 | { 43 | // Obtain Charset and Collation: 44 | 45 | $charset = MySQLDatabase::config()->charset; 46 | $collation = MySQLDatabase::config()->collation; 47 | 48 | // Define Field Specification: 49 | 50 | $spec = [ 51 | 'type' => 'varchar', 52 | 'parts' => [ 53 | 'datatype' => 'varchar', 54 | 'precision' => 11, 55 | 'collate' => $collation, 56 | 'character set' => $charset, 57 | 'arrayValue' => $this->arrayValue 58 | ] 59 | ]; 60 | 61 | // Require Database Field: 62 | 63 | DB::require_field($this->tableName, $this->name, $spec); 64 | } 65 | 66 | /** 67 | * Answers the value as a formatted number string. 68 | * 69 | * @return string 70 | */ 71 | public function Formatted() 72 | { 73 | return number_format($this->value); 74 | } 75 | 76 | /** 77 | * Answers the value as a 'nice' number string. 78 | * 79 | * @return string 80 | */ 81 | public function Nice() 82 | { 83 | return sprintf('%d', $this->value); 84 | } 85 | 86 | /** 87 | * Answers a form field instance for automatic form scaffolding. 88 | * 89 | * @param string $title Title of the field instance. 90 | * @param array $params Array of extra parameters. 91 | * 92 | * @return TextField 93 | */ 94 | public function scaffoldFormField($title = null, $params = null) 95 | { 96 | return TextField::create($this->name, $title); 97 | } 98 | 99 | /** 100 | * Answers true if the field value is not considered to be a 'null' value. 101 | * 102 | * @return boolean 103 | */ 104 | public function exists() 105 | { 106 | return is_numeric($this->value); 107 | } 108 | 109 | /** 110 | * Prepares the specified value to be stored within the database. 111 | * 112 | * @param string $value 113 | * 114 | * @return integer 115 | */ 116 | public function prepValueForDB($value) 117 | { 118 | return (int) abs($value); 119 | } 120 | } 121 | -------------------------------------------------------------------------------- /src/Folders/ComponentFolder.php: -------------------------------------------------------------------------------- 1 | =5.6.0 7 | * 8 | * For full copyright and license information, please view the 9 | * LICENSE.md file that was distributed with this source code. 10 | * 11 | * @package SilverWare\Folders 12 | * @author Colin Tucker 13 | * @copyright 2017 Praxis Interactive 14 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 15 | * @link https://github.com/praxisnetau/silverware 16 | */ 17 | 18 | namespace SilverWare\Folders; 19 | 20 | use SilverWare\Model\Component; 21 | use SilverWare\Model\Folder; 22 | 23 | /** 24 | * An extension of the folder class for a component folder. 25 | * 26 | * @package SilverWare\Folders 27 | * @author Colin Tucker 28 | * @copyright 2017 Praxis Interactive 29 | * @license https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause 30 | * @link https://github.com/praxisnetau/silverware 31 | */ 32 | class ComponentFolder extends Folder 33 | { 34 | /** 35 | * Human-readable singular name. 36 | * 37 | * @var string 38 | * @config 39 | */ 40 | private static $singular_name = 'Component Folder'; 41 | 42 | /** 43 | * Human-readable plural name. 44 | * 45 | * @var string 46 | * @config 47 | */ 48 | private static $plural_name = 'Component Folders'; 49 | 50 | /** 51 | * Description of this object. 52 | * 53 | * @var string 54 | * @config 55 | */ 56 | private static $description = 'Holds a series of SilverWare component instances'; 57 | 58 | /** 59 | * Icon file for this object. 60 | * 61 | * @var string 62 | * @config 63 | */ 64 | private static $icon = 'silverware/silverware: admin/client/dist/images/icons/ComponentFolder.png'; 65 | 66 | /** 67 | * Defines the table name to use for this object. 68 | * 69 | * @var string 70 | * @config 71 | */ 72 | private static $table_name = 'SilverWare_ComponentFolder'; 73 | 74 | /** 75 | * Defines an ancestor class to hide from the admin interface. 76 | * 77 | * @var string 78 | * @config 79 | */ 80 | private static $hide_ancestor = Folder::class; 81 | 82 | /** 83 | * Defines the allowed children for this object. 84 | * 85 | * @var array|string 86 | * @config 87 | */ 88 | private static $allowed_children = [ 89 | Component::class 90 | ]; 91 | 92 | /** 93 | * Determines whether or not to hide the folder from the CMS tree. 94 | * 95 | * @var boolean 96 | * @config 97 | */ 98 | private static $hide_from_tree = true; 99 | 100 | /** 101 | * Populates the default values for the fields of the receiver. 102 | * 103 | * @return void 104 | */ 105 | public function populateDefaults() 106 | { 107 | // Populate Defaults (from parent): 108 | 109 | parent::populateDefaults(); 110 | 111 | // Populate Defaults: 112 | 113 | $this->Title = _t(__CLASS__ . '.DEFAULTTITLE', 'Components'); 114 | } 115 | 116 | /** 117 | * Answers a string of CSS classes to apply to the receiver in the CMS tree. 118 | * 119 | * @return string 120 | */ 121 | public function CMSTreeClasses() 122 | { 123 | $classes = parent::CMSTreeClasses(); 124 | 125 | if ($this->config()->hide_from_tree) { 126 | $classes .= ' hidden'; 127 | } 128 | 129 | return $classes; 130 | } 131 | } 132 | --------------------------------------------------------------------------------