IMPR: Namespaces refactoring

This commit is contained in:
Tony Air 2021-03-15 03:45:35 +07:00
parent 252097d9b6
commit 1dfaeb1e30
108 changed files with 222 additions and 212 deletions

View File

@ -14,7 +14,7 @@ SilverStripe\Core\Injector\Injector:
A2nt\SilverStripeMapboxField\MapboxField:
map_style: 'mapbox://styles/mapbox/streets-v9' #'mapbox://styles/mapbox/light-v10'
Site\Elements\MapElement:
App\Elements\MapElement:
map_type: 'google-maps'
BetterBrief\GoogleMapField:

View File

@ -2,52 +2,46 @@
Name: webapp-base-extensions
---
# Basic extensions
SilverStripe\Admin\LeftAndMain:
extensions:
- Site\Extensions\LeftAndMainExtension
- App\Extensions\LeftAndMainExtension
SilverStripe\SiteConfig\SiteConfig:
extensions:
- Site\Extensions\SocialExtension
- Site\Extensions\SiteConfigExtension
- Site\Extensions\NotificationsExtension
- App\Extensions\SocialExtension
- App\Extensions\SiteConfigExtension
- App\Extensions\NotificationsExtension
SilverStripe\CMS\Model\SiteTree:
extensions:
- Site\Extensions\SiteTreeExtension
- App\Extensions\SiteTreeExtension
Sheadawson\Linkable\Models\EmbeddedObject:
extensions:
- Site\Extensions\EmbeddedObjectExtension
- App\Extensions\EmbeddedObjectExtension
SilverStripe\Assets:
extensions:
- Site\Extensions\ImageExtension
- App\Extensions\ImageExtension
Dynamic\FlexSlider\Model\SlideImage:
extensions:
- Site\Extensions\SlideImageExtension
- App\Extensions\SlideImageExtension
SilverStripe\Core\Injector\Injector:
#SilverStripe\UserForms\Model\UserDefinedForm:
# class: Site\Extensions\UserDefinedForm_HiddenClass
# class: App\Extensions\UserDefinedForm_HiddenClass
Sheadawson\Linkable\Forms\EmbeddedObjectField:
class: Site\Extensions\EmbedObjectField
class: App\Extensions\EmbedObjectField
SilverStripe\Forms\CompositeField:
class: Site\Extensions\CompositeFieldExtension
# User Forms module
SilverStripe\UserForms\Model\UserDefinedForm:
show_in_sitetree: false
can_be_root: false
extensions:
- Site\Extensions\UserDefinedFormExtension
class: App\Extensions\CompositeFieldExtension
SilverStripe\UserForms\Form\UserForm:
extensions:
- Site\Extensions\PlaceholderFormExtension
- App\Extensions\PlaceholderFormExtension
DNADesign\ElementalUserForms\Model\ElementForm:
Page:
searchable_objects:
- App\Models\TeamMember
extensions:
- Site\Extensions\UserDefinedFormExtension
- DNADesign\Elemental\Extensions\ElementalPageExtension

View File

@ -17,22 +17,22 @@ SilverStripe\GraphQL\Controller:
SilverStripe\GraphQL\Auth\Handler:
authenticators:
- class: Site\GraphQL\APIKeyAuthenticator
- class: App\GraphQL\APIKeyAuthenticator
priority: 30
SilverStripe\GraphQL\Manager.default:
properties:
Middlewares:
APIKeyMiddleware: Site\GraphQL\APIKeyMiddleware
APIKeyMiddleware: App\GraphQL\APIKeyMiddleware
SilverStripe\GraphQL\Manager:
schemas:
default:
types:
member: 'Site\GraphQL\MemberTypeCreator'
page: 'Site\GraphQL\PageTypeCreator'
element: 'Site\GraphQL\ElementTypeCreator'
member: 'App\GraphQL\MemberTypeCreator'
page: 'App\GraphQL\PageTypeCreator'
element: 'App\GraphQL\ElementTypeCreator'
queries:
readPages: 'Site\GraphQL\PaginatedReadPagesQueryCreator'
readMembers: 'Site\GraphQL\ReadMembersQueryCreator'
paginatedReadMembers: 'Site\GraphQL\PaginatedReadMembersQueryCreator'
readPages: 'App\GraphQL\PaginatedReadPagesQueryCreator'
readMembers: 'App\GraphQL\ReadMembersQueryCreator'
paginatedReadMembers: 'App\GraphQL\PaginatedReadMembersQueryCreator'

View File

@ -4,9 +4,9 @@ After: 'framework/*, cms/*, security_baseline'
---
SilverStripe\Core\Injector\Injector:
SilverStripe\Security\MemberAuthenticator\LostPasswordHandler:
class: Site\Extensions\LostPasswordHandlerExtension
class: App\Extensions\LostPasswordHandlerExtension
SilverStripe\Security\MemberAuthenticator\MemberLoginForm:
class: Site\Extensions\SiteMemberLoginForm
class: App\Extensions\SiteMemberLoginForm
---
Except:
environment: dev

View File

@ -29,14 +29,14 @@ Page:
extensions:
- DNADesign\Elemental\TopPage\SiteTreeExtension
- DNADesign\Elemental\Extensions\ElementalPageExtension
- Site\Extensions\PageFluentExtension
- App\Extensions\PageFluentExtension
DNADesign\Elemental\Models\ElementalArea:
extensions:
- DNADesign\Elemental\TopPage\FluentExtension
- Site\Extensions\ElementalArea
- App\Extensions\ElementalArea
DNADesign\Elemental\Models\BaseElement:
extensions:
- DNADesign\Elemental\TopPage\FluentExtension
- Site\Extensions\ElementRows
- App\Extensions\ElementRows

View File

@ -4,33 +4,44 @@ After:
- elemental
- elemental-list
- elementalvirtual
- webapp-base-extensions
---
# User Forms module
DNADesign\ElementalUserForms\Model\ElementForm:
extensions:
- App\Elements\Extensions\UserDefinedFormExtension
SilverStripe\UserForms\Model\UserDefinedForm:
show_in_sitetree: false
can_be_root: false
extensions:
- App\Elements\Extensions\UserDefinedFormExtension
##################
Page:
searchable_elements:
- DNADesign\Elemental\Models\ElementContent
searchable_objects:
- Site\Models\TeamMember
extensions:
- DNADesign\Elemental\TopPage\SiteTreeExtension
- DNADesign\Elemental\Extensions\ElementalPageExtension
SilverStripe\CMS\Controllers\ContentController:
extensions:
- DNADesign\Elemental\Extensions\ElementalContentControllerExtension
- Site\Elements\ElementalContentControllerExtension
- App\Elements\ElementalContentControllerExtension
url_handlers:
'element/$ID!': 'handleElement'
DNADesign\Elemental\Models\ElementalArea:
extensions:
#- DNADesign\Elemental\TopPage\DataExtension
- Site\Extensions\ElementalArea
- App\Elements\Extensions\ElementalArea
DNADesign\Elemental\Models\BaseElement:
default_global_elements: true
extensions:
#- DNADesign\Elemental\TopPage\DataExtension
- Site\Extensions\ElementRows
- App\Elements\Extensions\ElementRows
SilverStripe\CMS\Model\SiteTree:
allowed_elements:
@ -41,21 +52,21 @@ SilverStripe\CMS\Model\SiteTree:
- Dynamic\Elements\Blog\Elements\ElementBlogPosts
- Dynamic\Elements\Oembed\Elements\ElementOembed
- Dynamic\Elements\Elements\ElementTestimonials
#- Site\Elements\TeamMembersElement
- Site\Elements\SliderElement
- Site\Elements\BlockElement
- Site\Elements\MapElement
#- Site\Elements\AccordionElement
#- App\Elements\TeamMembersElement
- App\Elements\SliderElement
- App\Elements\BlockElement
- App\Elements\MapElement
#- App\Elements\AccordionElement
- DNADesign\ElementalVirtual\Model\ElementVirtual
- Site\Elements\AccordionElement
- Site\Elements\CustomSnippetElement
- Site\Elements\InstagramElement
- App\Elements\AccordionElement
- App\Elements\CustomSnippetElement
- App\Elements\InstagramElement
DNADesign\ElementalList\Model\ElementList:
inline_editable: false
default_global_elements: false
extensions:
- Site\Elements\ElementListExtension
- App\Elements\ElementListExtension
allowed_elements:
- DNADesign\ElementalList\Model\ElementList
- DNADesign\Elemental\Models\ElementContent
@ -64,18 +75,18 @@ DNADesign\ElementalList\Model\ElementList:
- Dynamic\Elements\Blog\Elements\ElementBlogPosts
- Dynamic\Elements\Oembed\Elements\ElementOembed
- Dynamic\Elements\Elements\ElementTestimonials
#- Site\Elements\TeamMembersElement
- Site\Elements\SliderElement
- Site\Elements\BlockElement
- Site\Elements\MapElement
- Site\Elements\AccordionElement
- Site\Elements\CustomSnippetElement
- Site\Elements\InstagramElement
#- App\Elements\TeamMembersElement
- App\Elements\SliderElement
- App\Elements\BlockElement
- App\Elements\MapElement
- App\Elements\AccordionElement
- App\Elements\CustomSnippetElement
- App\Elements\InstagramElement
styles:
whiteframe: 'White Frame'
noframe: 'No Frame'
Site\Elements\AccordionElement:
App\Elements\AccordionElement:
allowed_elements:
- DNADesign\Elemental\Models\ElementContent
@ -83,7 +94,7 @@ DNADesign\Elemental\Models\ElementContent:
default_global_elements: false
inline_editable: false
extensions:
- Site\Extensions\ElementContentWidget
- App\Elements\Extensions\ElementContentWidget
frontend_searchable_fields:
- 'Title:PartialMatch'
- 'HTML:PartialMatch'
@ -91,4 +102,4 @@ DNADesign\Elemental\Models\ElementContent:
Dynamic\Elements\Image\Elements\ElementImage:
inline_editable: false
extensions:
- Site\Extensions\ElementImageWidget
- App\Elements\Extensions\ElementImageWidget

View File

@ -4,19 +4,19 @@ Name: webapp-options-widgets
# Blog + Widgets module extensions
Page:
extensions:
- Site\Widgets\WidgetPageExtension
- App\Widgets\WidgetPageExtension
SilverStripe\Blog\Model\Blog:
extensions:
- Site\Extensions\BlogExtension
- App\Extensions\BlogExtension
SilverStripe\Blog\Model\BlogPost:
extensions:
- Site\Extensions\BlogPostExtension
- App\Extensions\BlogPostExtension
SilverStripe\Widgets\Model\Widget:
icon: '<i class="icon font-icon-p-document"></i>'
extensions:
- Site\Widgets\WidgetExtension
- App\Widgets\WidgetExtension
SilverStripe\Blog\Widgets\BlogArchiveWidget:
icon: '<i class="icon font-icon-p-archive"></i>'
SilverStripe\Blog\Widgets\BlogCategoriesWidget:

View File

@ -3,20 +3,20 @@ Name: webapp-shop
---
SilverStripe\Core\Injector\Injector:
SilverShop\Checkout\SinglePageCheckoutComponentConfig:
class: Site\Models\CheckoutNoDeliveryConfig
class: App\Models\CheckoutNoDeliveryConfig
SilverShop\Extension\ShopConfigExtension:
base_currency: USD
SilverShop\Model\Address:
extensions:
- Site\Extensions\AddressExtension
- App\Extensions\AddressExtension
SilverShop\Cart\ShoppingCartController:
extensions:
- Site\Extensions\ShoppingCartControllerExtension
- App\Extensions\ShoppingCartControllerExtension
Site\Templates\DeferedRequirements:
App\Templates\DeferedRequirements:
custom_requirements:
SilverShop\Page\AccountPageController:
- SilverShop.Page.CheckoutPageController.js

View File

@ -1,7 +1,7 @@
---
Name: webapp-templates-requirements
---
Site\Templates\DeferredRequirements:
App\Templates\DeferredRequirements:
nofontawesome: false
version: false
static_domain: false

View File

@ -9,11 +9,11 @@ SilverStripe\View\SSViewer:
- '$public'
- '$default'
Site\Elements\SliderElement:
App\Elements\SliderElement:
slide_width: 2140
slide_height: 700
# 2x container width to automatically resize images for 2K display
Site\Extensions\ElementRows:
App\Elements\Extensions\ElementRows:
container_max_width: 2280
column_class: 'col-block col-md'

View File

@ -3,7 +3,7 @@
# with all configuration variables presented
# Cuz WebPack compiling script use it to set configuration
Site\Templates\WebpackTemplateProvider:
App\Templates\WebpackTemplateProvider:
APPDIR: './app'
THEMESDIR: './themes'
HOSTNAME: 127.0.0.1

View File

@ -1,10 +1,10 @@
<?php
namespace Site\Controllers;
namespace App\Controllers;
use DNADesign\Elemental\Controllers\ElementController;
use Site\Templates\DeferredRequirements;
use App\Templates\DeferredRequirements;
class MapElementController extends ElementController
{

View File

@ -6,7 +6,7 @@
* Time: 11:54 PM
*/
namespace Site\Elements;
namespace App\Elements;
use DNADesign\ElementalList\Model\ElementList;

View File

@ -6,7 +6,7 @@
* Time: 11:54 PM
*/
namespace Site\Elements;
namespace App\Elements;
use Sheadawson\Linkable\Forms\LinkField;
use Sheadawson\Linkable\Models\Link;

View File

@ -6,7 +6,7 @@
* Time: 11:54 PM
*/
namespace Site\Elements;
namespace App\Elements;
use DNADesign\Elemental\Models\ElementContent;
use SilverStripe\AssetAdmin\Forms\UploadField;

View File

@ -1,7 +1,7 @@
<?php
namespace Site\Elements;
namespace App\Elements;
use SilverStripe\ORM\DataExtension;

View File

@ -1,7 +1,7 @@
<?php
namespace Site\Elements;
namespace App\Elements;
use DNADesign\Elemental\Models\BaseElement;

View File

@ -1,7 +1,7 @@
<?php
namespace Site\Elements;
namespace App\Elements;
use SilverStripe\SiteConfig\SiteConfig;

View File

@ -6,7 +6,7 @@
* Time: 2:35 PM
*/
namespace Site\Extensions;
namespace App\Elements\Extensions;
use SilverStripe\ORM\DataExtension;

View File

@ -6,7 +6,7 @@
* Time: 1:46 AM
*/
namespace Site\Extensions;
namespace App\Elements\Extensions;
use Dynamic\Elements\Image\Elements\ElementImage;
use Sheadawson\Linkable\Forms\LinkField;

View File

@ -6,7 +6,7 @@
* Time: 1:23 PM
*/
namespace Site\Extensions;
namespace App\Elements\Extensions;
use DNADesign\Elemental\Models\BaseElement;
use DNADesign\ElementalList\Model\ElementList;
@ -16,7 +16,7 @@ use SilverStripe\Forms\DropdownField;
use SilverStripe\ORM\DataExtension;
use SilverStripe\Forms\FieldList;
use SilverStripe\Forms\LiteralField;
use Site\Elements\AccordionElement;
use App\Elements\AccordionElement;
class ElementRows extends DataExtension
{
@ -36,6 +36,7 @@ class ElementRows extends DataExtension
public function updateCMSFields(FieldList $fields)
{
$obj = $this->owner;
parent::updateCMSFields($fields);
$fields->removeByName(['AvailableGlobally', 'TopPageLocale', 'TopPageID']);
@ -62,8 +63,7 @@ class ElementRows extends DataExtension
// column size
if ($this->isColumn()) {
$sizes = $this->owner->dbObject('Size');
$defaultSize = $sizes->getDefaultValue();
$sizes = $obj->dbObject('Size');
$sizeDropdown = DropdownField::create(
'Size',
@ -92,11 +92,16 @@ class ElementRows extends DataExtension
);
$tab->push($sizeDropdown);
// set default size
if (!$this->owner->getField('Size')) {
// set default size if size field wasn't set or if it's new object without title set and the size is default
$size = $obj->getField('Size');
if (!$size || (!$obj->getField('Title') && $size === 'auto')) {
$sibling = $this->getSibling();
$sizeDropdown->setValue($sibling ? $sibling->getField('Size') : $defaultSize);
$defaultSize = $sizes->getDefaultValue();
$defaultSize = $sibling ? $sibling->getField('Size') : $defaultSize;
$obj->setField('Size', $defaultSize);
$sizeDropdown->setValue($defaultSize);
}
} else {
$fields->removeByName('Size');
@ -104,7 +109,7 @@ class ElementRows extends DataExtension
// move parent elements
if ($this->isList()) {
$currEls = $this->owner->getField('Elements')->Elements();
$currEls = $obj->getField('Elements')->Elements();
if ($currEls->count()) {
$tab->push(DropdownField::create(
'MoveElementIDToParent',
@ -113,7 +118,7 @@ class ElementRows extends DataExtension
)->setEmptyString('(select an element to move)'));
}
$parentEls = $this->owner->Parent()->Elements()->exclude('ID', $this->owner->ID);
$parentEls = $obj->Parent()->Elements()->exclude('ID', $obj->ID);
if ($parentEls->count()) {
$tab->push(DropdownField::create(
'MoveElementIDFromParent',
@ -129,7 +134,7 @@ class ElementRows extends DataExtension
'ClassName',
'<div class="form-group field text">'
.'<div class="form__field-label">Class</div>'
.'<div class="form__field-holder">'.$this->owner->getField('ClassName').'</div>'
.'<div class="form__field-holder">'.$obj->getField('ClassName').'</div>'
.'</div>'
));
}

View File

@ -6,7 +6,7 @@
* Time: 1:23 PM
*/
namespace Site\Extensions;
namespace App\Elements\Extensions;
use DNADesign\Elemental\Models\BaseElement;
use SilverStripe\ORM\ArrayList;

View File

@ -6,7 +6,7 @@
* Time: 12:55 PM
*/
namespace Site\Extensions;
namespace App\Elements\Extensions;
use SilverStripe\Core\Extension;
use SilverStripe\Forms\CompositeField;
@ -16,7 +16,7 @@ use SilverStripe\Forms\GridField\GridFieldConfig_RelationEditor;
use SilverStripe\Forms\GridField\GridFieldDataColumns;
use SilverStripe\Forms\NumericField;
use SilverStripe\ORM\DataExtension;
use Site\Models\MapPin;
use App\Models\MapPin;
class MapExtension extends DataExtension
{

View File

@ -1,6 +1,6 @@
<?php
namespace Site\Extensions;
namespace App\Elements\Extensions;
use SilverStripe\Forms\FieldList;
use SilverStripe\Forms\GridField\GridFieldDataColumns;

View File

@ -6,7 +6,7 @@
* Time: 11:54 PM
*/
namespace Site\Elements;
namespace App\Elements;
use DNADesign\Elemental\Models\BaseElement;

View File

@ -6,7 +6,7 @@
* Time: 11:54 PM
*/
namespace Site\Elements;
namespace App\Elements;
use A2nt\SilverStripeMapboxField\MapboxField;
use BetterBrief\GoogleMapField;
@ -18,8 +18,8 @@ use SilverStripe\Forms\GridField\GridField;
use SilverStripe\Forms\GridField\GridFieldConfig_RelationEditor;
use SilverStripe\Forms\HTMLEditor\HTMLEditorField;
use SilverStripe\Forms\NumericField;
use Site\Controllers\MapElementController;
use Site\Extensions\MapExtension;
use App\Controllers\MapElementController;
use App\Elements\Extensions\MapExtension;
use SilverStripe\Forms\GridField\GridFieldDataColumns;
class MapElement extends ElementContent

View File

@ -6,7 +6,7 @@
* Time: 11:54 PM
*/
namespace Site\Elements;
namespace App\Elements;
use Dynamic\Elements\Flexslider\Elements\ElementSlideshow;
use Dynamic\FlexSlider\Model\SlideImage;

View File

@ -6,9 +6,9 @@
* Time: 11:54 PM
*/
namespace Site\Elements;
namespace App\Elements;
use DNADesign\Elemental\Models\BaseElement;
use Site\Models\TeamMember;
use App\Models\TeamMember;
class TeamMembersElement extends BaseElement
{
@ -27,4 +27,4 @@ class TeamMembersElement extends BaseElement
{
return TeamMember::get()->sort('RAND()');
}
}
}

View File

@ -6,7 +6,7 @@
* Time: 12:55 PM
*/
namespace Site\Extensions;
namespace App\Extensions;
use SilverStripe\Core\Extension;
@ -26,4 +26,4 @@ class AddressExtension extends Extension
$holder->addExtraClass('col-sm-6');
$fields->push($holder);
}
}
}

View File

@ -1,7 +1,7 @@
<?php
namespace Site\Extensions;
namespace App\Extensions;
use SilverStripe\Blog\Forms\GridField\GridFieldConfigBlogPost;
use SilverStripe\Forms\FieldList;

View File

@ -6,7 +6,7 @@
* Time: 12:10 AM
*/
namespace Site\Extensions;
namespace App\Extensions;
use DNADesign\Elemental\Models\ElementContent;
use SilverStripe\Forms\CheckboxField;

View File

@ -6,7 +6,7 @@
* Time: 1:05 AM
*/
namespace Site\Extensions;
namespace App\Extensions;
use SilverStripe\ORM\HiddenClass;
use Page;
@ -14,4 +14,4 @@ use Page;
class CMSMain_HiddenClass extends Page implements HiddenClass
{
}
}

View File

@ -1,7 +1,7 @@
<?php
namespace Site\Extensions;
namespace App\Extensions;
use SilverStripe\Blog\Forms\GridField\GridFieldConfigBlogPost;
use SilverStripe\Core\Extension;

View File

@ -1,7 +1,7 @@
<?php
namespace Site\Extensions;
namespace App\Extensions;
use Sheadawson\Linkable\Forms\EmbeddedObjectField;
@ -44,4 +44,4 @@ class EmbedObjectField extends EmbeddedObjectField
)
], $fields));
}
}
}

View File

@ -1,7 +1,7 @@
<?php
namespace Site\Extensions;
namespace App\Extensions;
use SilverStripe\Core\Convert;

View File

@ -1,7 +1,7 @@
<?php
namespace Site\Extensions;
namespace App\Extensions;
use SilverStripe\Forms\CheckboxField;
use SilverStripe\Forms\FieldList;

View File

@ -1,6 +1,6 @@
<?php
namespace Site\Extensions;
namespace App\Extensions;
use SilverStripe\CMS\Model\SiteTree;
use SilverStripe\Forms\Form;

View File

@ -1,7 +1,7 @@
<?php
namespace Site\Extensions;
namespace App\Extensions;
use SilverStripe\Forms\CheckboxField;
use SilverStripe\Forms\FieldList;

View File

@ -1,13 +1,13 @@
<?php
namespace Site\Extensions;
namespace App\Extensions;
use SilverStripe\Core\Config\Config;
use SilverStripe\Core\Extension;
use SilverStripe\FontAwesome\FontAwesomeField;
use SilverStripe\View\Requirements;
use Site\Templates\DeferredRequirements;
use App\Templates\DeferredRequirements;
class LeftAndMainExtension extends Extension
{

View File

@ -6,7 +6,7 @@
* Time: 11:37 PM
*/
namespace Site\Extensions;
namespace App\Extensions;
use Sheadawson\Linkable\Forms\LinkField;
use Sheadawson\Linkable\Models\Link;

View File

@ -1,6 +1,6 @@
<?php
namespace Site\Extensions;
namespace App\Extensions;
use Dynamic\Elements\Blog\Elements\ElementBlogPosts;
use Innoweb\Sitemap\Pages\SitemapPage;
@ -25,9 +25,9 @@ use SilverStripe\CMS\Model\SiteTree;
use SilverStripe\Forms\FieldList;
use SilverStripe\Forms\TreeMultiselectField;
use BetterBrief\GoogleMapField;
use Site\Models\Holiday;
use Site\Models\Notification;
use Site\Models\OpeningHour;
use App\Models\Holiday;
use App\Models\Notification;
use App\Models\OpeningHour;
use Symbiote\GridFieldExtensions\GridFieldAddNewInlineButton;
use Symbiote\GridFieldExtensions\GridFieldEditableColumns;
use Symbiote\GridFieldExtensions\GridFieldTitleHeader;
@ -73,7 +73,7 @@ class NotificationsExtension extends DataExtension
LiteralField::create(
'CurrentNotifications',
'<b>Current:</b>'
.$this->owner->renderWith('Site\\Objects\\NotificationsList')
.$this->owner->renderWith('App\\Objects\\NotificationsList')
),
CheckboxField::create('ShowNotifications'),
GridField::create(

View File

@ -1,6 +1,6 @@
<?php
namespace Site\Extensions;
namespace App\Extensions;
use Dynamic\Elements\Blog\Elements\ElementBlogPosts;
use Innoweb\Sitemap\Pages\SitemapPage;
@ -23,8 +23,8 @@ use SilverStripe\CMS\Model\SiteTree;
use SilverStripe\Forms\FieldList;
use SilverStripe\Forms\TreeMultiselectField;
use BetterBrief\GoogleMapField;
use Site\Models\Holiday;
use Site\Models\OpeningHour;
use App\Models\Holiday;
use App\Models\OpeningHour;
use Symbiote\GridFieldExtensions\GridFieldAddNewInlineButton;
use Symbiote\GridFieldExtensions\GridFieldEditableColumns;
use Symbiote\GridFieldExtensions\GridFieldTitleHeader;
@ -80,7 +80,7 @@ class OpenningHoursExtension extends DataExtension
'CurrentOpeningHour',
'<b>Today:</b>'
.'<p class="message notice">'
.$this->owner->renderWith('Site\\Objects\\OpeningHoursList')
.$this->owner->renderWith('App\\Objects\\OpeningHoursList')
.'</p>'
),
CheckboxField::create('ShowOpeningHours'),

View File

@ -1,7 +1,7 @@
<?php
namespace Site\Extensions;
namespace App\Extensions;
use SilverStripe\Blog\Forms\GridField\GridFieldConfigBlogPost;
use SilverStripe\Forms\FieldList;

View File

@ -1,6 +1,6 @@
<?php
namespace Site\Extensions;
namespace App\Extensions;
use SilverStripe\Core\Extension;
use SilverStripe\Forms\CompositeField;

View File

@ -6,7 +6,7 @@
* Time: 1:23 PM
*/
namespace Site\Extensions;
namespace App\Extensions;
use SilverStripe\ORM\DataExtension;

View File

@ -1,6 +1,6 @@
<?php
namespace Site\Extensions;
namespace App\Extensions;
use A2nt\SilverStripeMapboxField\MapboxField;
use Innoweb\Sitemap\Pages\SitemapPage;

View File

@ -1,7 +1,7 @@
<?php
namespace Site\Extensions;
namespace App\Extensions;
use SilverStripe\Control\Director;
@ -48,4 +48,4 @@ class SiteMemberLoginForm extends MemberLoginForm
$this->enableSpamProtection();
}
}
}
}

View File

@ -1,6 +1,6 @@
<?php
namespace Site\Extensions;
namespace App\Extensions;
use SilverStripe\Forms\TextareaField;
use SilverStripe\ORM\DataExtension;

View File

@ -7,7 +7,7 @@
* Ref: Dynamic\FlexSlider\Model\SlideImage
*/
namespace Site\Extensions;
namespace App\Extensions;
use SilverStripe\Forms\CheckboxField;
use SilverStripe\Forms\DatetimeField;

View File

@ -6,7 +6,7 @@
* Time: 11:37 PM
*/
namespace Site\Extensions;
namespace App\Extensions;
use Sheadawson\Linkable\Forms\LinkField;
use Sheadawson\Linkable\Models\Link;

View File

@ -1,6 +1,6 @@
<?php
namespace Site\Extensions;
namespace App\Extensions;
use SilverStripe\ORM\HiddenClass;
use SilverStripe\UserForms\Model\UserDefinedForm;

View File

@ -1,7 +1,7 @@
<?php
namespace Site\GraphQL;
namespace App\GraphQL;
use SilverStripe\Control\Director;
@ -9,7 +9,7 @@ use SilverStripe\Control\HTTPRequest;
use SilverStripe\GraphQL\Auth\AuthenticatorInterface;
use SilverStripe\ORM\ValidationException;
use SilverStripe\Security\Member;
use Site\Templates\WebpackTemplateProvider;
use App\Templates\WebpackTemplateProvider;
class APIKeyAuthenticator implements AuthenticatorInterface
{
@ -30,4 +30,4 @@ class APIKeyAuthenticator implements AuthenticatorInterface
return true;
return false;
}
}
}

View File

@ -1,12 +1,12 @@
<?php
namespace Site\GraphQL;
namespace App\GraphQL;
use GraphQL\Type\Schema;
use SilverStripe\GraphQL\Middleware\QueryMiddleware;
use Site\Templates\WebpackTemplateProvider;
use App\Templates\WebpackTemplateProvider;
class APIKeyMiddleware implements QueryMiddleware
{
@ -20,4 +20,4 @@ class APIKeyMiddleware implements QueryMiddleware
throw new \Exception('Invalid API key token');
}
}
}

View File

@ -1,7 +1,7 @@
<?php
namespace Site\GraphQL;
namespace App\GraphQL;
use GraphQL\Type\Definition\ResolveInfo;

View File

@ -1,7 +1,7 @@
<?php
namespace Site\GraphQL;
namespace App\GraphQL;
use GraphQL\Type\Definition\Type;

View File

@ -1,7 +1,7 @@
<?php
namespace Site\GraphQL;
namespace App\GraphQL;
use GraphQL\Type\Definition\ResolveInfo;

View File

@ -1,7 +1,7 @@
<?php
namespace Site\GraphQL;
namespace App\GraphQL;
use GraphQL\Type\Definition\ResolveInfo;
@ -41,4 +41,4 @@ class PaginatedReadMembersQueryCreator extends PaginatedQueryCreator
return $list;
});
}
}
}

View File

@ -1,7 +1,7 @@
<?php
namespace Site\GraphQL;
namespace App\GraphQL;
use GraphQL\Type\Definition\ResolveInfo;
@ -56,4 +56,4 @@ class PaginatedReadPagesQueryCreator extends PaginatedQueryCreator
return $list;
});
}
}
}

View File

@ -1,7 +1,7 @@
<?php
namespace Site\GraphQL;
namespace App\GraphQL;
use GraphQL\Type\Definition\ResolveInfo;

View File

@ -6,7 +6,7 @@
* Time: 2:55 AM
*/
namespace Site\Models;
namespace App\Models;
use Dynamic\FlexSlider\Model\SlideImage;
use Sheadawson\Linkable\Forms\LinkField;

View File

@ -6,7 +6,7 @@
* Time: 2:55 AM
*/
namespace Site\Models;
namespace App\Models;
use A2nt\SilverStripeMapboxField\MapboxField;
use A2nt\SilverStripeMapboxField\MarkerExtension;
@ -15,7 +15,7 @@ use Sheadawson\Linkable\Models\Link;
use SilverStripe\Forms\CheckboxField;
use SilverStripe\ORM\DataObject;
use SilverStripe\Versioned\Versioned;
use Site\Elements\MapElement;
use App\Elements\MapElement;
use Symbiote\Addressable\Addressable;
class MapPin extends DataObject

View File

@ -6,7 +6,7 @@
* Time: 2:55 AM
*/
namespace Site\Models;
namespace App\Models;
use Dynamic\FlexSlider\Model\SlideImage;
use Sheadawson\Linkable\Forms\LinkField;

View File

@ -6,7 +6,7 @@
* Time: 2:55 AM
*/
namespace Site\Models;
namespace App\Models;
use Dynamic\FlexSlider\Model\SlideImage;
use Sheadawson\Linkable\Forms\LinkField;

View File

@ -6,13 +6,12 @@
* Time: 11:36 PM
*/
namespace Site\Models;
namespace App\Models;
use SilverStripe\Assets\Image;
use SilverStripe\ORM\DataObject;
use SilverStripe\Versioned\Versioned;
use Site\Extensions\SocialExtension;
use Site\Pages\TeamPage;
use App\Extensions\SocialExtension;
class TeamMember extends DataObject
{

View File

@ -1,6 +1,6 @@
<?php
namespace Site\Pages;
namespace App\Pages;
use Page;

View File

@ -1,6 +1,6 @@
<?php
namespace Site\Pages;
namespace App\Pages;
use PageController;

View File

@ -2,7 +2,7 @@
// vendor/silverstripe/errorpage/src/ErrorPage.php
// extends global Page class
//namespace Site\Pages;
//namespace App\Pages;
use Sheadawson\Linkable\Forms\LinkField;
use SilverStripe\CMS\Model\SiteTree;

View File

@ -2,7 +2,7 @@
// vendor/silverstripe/errorpage/src/ErrorPageController.php
// extends global PageController class
//namespace Site\Pages;
//namespace App\Pages;
use SilverStripe\Control\Controller;
use SilverStripe\CMS\Controllers\ContentController;
@ -22,8 +22,8 @@ use SilverStripe\ORM\ArrayList;
use DNADesign\Elemental\Models\ElementContent;
use DNADesign\Elemental\Models\ElementalArea;
use DNADesign\ElementalUserForms\Control\ElementFormController;
use Site\Models\TeamMember;
use Site\Templates\DeferredRequirements;
use App\Models\TeamMember;
use App\Templates\DeferredRequirements;
class PageController extends ContentController
{

View File

@ -6,7 +6,7 @@
* Time: 1:40 PM
*/
namespace Site\Models;
namespace App\Models;
use SilverShop\Checkout\Component\CheckoutComponent;
@ -44,4 +44,4 @@ class CheckoutMapComponent extends CheckoutComponent
{
return [];
}
}
}

View File

@ -6,7 +6,7 @@
* Time: 1:08 PM
*/
namespace Site\Models;
namespace App\Models;
use SilverShop\Checkout\Checkout;
@ -40,4 +40,4 @@ class CheckoutNoDeliveryConfig extends CheckoutComponentConfig
$this->addComponent(CheckoutMapComponent::create());
$this->addComponent(Terms::create());
}
}
}

View File

@ -1,7 +1,7 @@
<?php
namespace Site\Tasks;
namespace App\Tasks;
use SilverStripe\Assets\File;
use SilverStripe\Dev\BuildTask;

View File

@ -1,7 +1,7 @@
<?php
namespace Site\Tasks;
namespace App\Tasks;
use SilverStripe\Control\HTTPRequest;
@ -75,4 +75,4 @@ class BuildTask extends \SilverStripe\Dev\BuildTask
echo '<h2 class="success">Success!</h2>';
}
}
}

View File

@ -1,7 +1,7 @@
<?php
namespace Site\Tasks;
namespace App\Tasks;
use SilverStripe\Assets\File;
use SilverStripe\CMS\Model\SiteTree;

View File

@ -1,7 +1,7 @@
<?php
namespace Site\Tasks;
namespace App\Tasks;
use Endroid\QrCode\ErrorCorrectionLevel;
use Endroid\QrCode\LabelAlignment;

View File

@ -1,7 +1,7 @@
<?php
namespace Site\Tasks;
namespace App\Tasks;
use SilverStripe\Assets\File;
use SilverStripe\Dev\BuildTask;

View File

@ -2,7 +2,7 @@
/** @noinspection PhpUnusedPrivateFieldInspection */
namespace Site\Templates;
namespace App\Templates;
use SilverStripe\Control\Controller;
use SilverStripe\View\TemplateGlobalProvider;

View File

@ -5,7 +5,7 @@
* Directs assets requests to Webpack server or to static files
*/
namespace Site\Templates;
namespace App\Templates;
use SilverStripe\Core\Manifest\ModuleManifest;
use SilverStripe\View\SSViewer;

View File

@ -6,7 +6,7 @@
* Time: 5:31 AM
*/
namespace Site\Tests;
namespace App\Tests;
use SilverStripe\Assets\Upload_Validator;
use SilverStripe\Core\Cache\FilesystemCacheFactory;

View File

@ -1,7 +1,7 @@
<?php
namespace Site\Traits;
namespace App\Traits;
trait PaginatedListing
{

View File

@ -1,7 +1,7 @@
<?php
namespace Site\Widgets;
namespace App\Widgets;
use Sheadawson\Linkable\Forms\LinkField;
use Sheadawson\Linkable\Models\Link;

View File

@ -1,7 +1,7 @@
<?php
namespace Site\Widgets;
namespace App\Widgets;
use Sheadawson\Linkable\Forms\LinkField;
use Sheadawson\Linkable\Models\Link;

View File

@ -1,7 +1,7 @@
<?php
namespace Site\Widgets;
namespace App\Widgets;
use DNADesign\Elemental\Models\BaseElement;
use DNADesign\ElementalList\Model\ElementList;

View File

@ -1,7 +1,7 @@
<?php
namespace Site\Widgets;
namespace App\Widgets;
use Sheadawson\Linkable\Forms\LinkField;
use Sheadawson\Linkable\Models\Link;

View File

@ -1,7 +1,7 @@
<?php
namespace Site\Widgets;
namespace App\Widgets;
use SilverStripe\Forms\CheckboxField;
use SilverStripe\Widgets\Model\Widget;

View File

@ -1,7 +1,7 @@
<?php
namespace Site\Widgets;
namespace App\Widgets;
use DNADesign\Elemental\Controllers\ElementalAreaController;
use DNADesign\Elemental\Forms\ElementalAreaConfig;

View File

@ -1,7 +1,7 @@
<?php
namespace Site\Widgets;
namespace App\Widgets;
use DNADesign\Elemental\Forms\TextCheckboxGroupField;

View File

@ -1,7 +1,7 @@
<?php
namespace Site\Widgets;
namespace App\Widgets;
use DNADesign\Elemental\Forms\ElementalAreaField;
use SilverStripe\Forms\FieldList;

View File

@ -5,7 +5,7 @@
<div class="row">
<% loop $PostsList %>
<div class="col-sm-4">
<% include BlogPostInfo %>
<% include SilverStripe\Blog\Includes\BlogPostInfo %>
</div>
<% end_loop %>
</div>

View File

@ -48,6 +48,6 @@
<% end_if %>
<% with $SiteConfig %>
<% include Site\Objects\NotificationsList NotificationsToday=$NotificationsToday.filter('Area', 'Site') %>
<% include App\Objects\NotificationsList NotificationsToday=$NotificationsToday.filter('Area', 'Site') %>
<% end_with %>
</div>

View File

@ -28,8 +28,8 @@
font-size: 14px;
margin: 0;
padding: 0;
background: #fff;
color: #333;
background: #1c2947;
color: #fff;
overflow-x: hidden;
}
@media (min-width: 2000px) {
@ -52,8 +52,8 @@
justify-content: center;
z-index: 2000;
will-change: opacity;
background: #fff;
color: #212529;
background: #1c2947;
color: #fff;
}
#PageLoading .logo {
width:100px;
@ -62,7 +62,7 @@
#PageLoading .tagline {
margin-top:1rem;
margin-bottom:1rem;
color: #212529;
color: #fff;
font-size:1.8rem;
font-size: 4vh;
letter-spacing: .25em;

View File

@ -3,6 +3,7 @@
*/
const YML_PATH = '/app/_config/webpack.yml';
const CONF_VAR = 'App\\Templates\\WebpackTemplateProvider';
const path = require('path');
const filesystem = require('fs');
@ -10,28 +11,28 @@ const fs = require('fs');
const yaml = require('js-yaml');
const conf = yaml.safeLoad(
fs.readFileSync(path.join(__dirname, YML_PATH), 'utf8'),
fs.readFileSync(path.join(__dirname, YML_PATH), 'utf8'),
);
let themes = [];
// add themes
if (conf['Site\\Templates\\WebpackTemplateProvider'].THEMESDIR) {
const themeDir = conf['Site\\Templates\\WebpackTemplateProvider'].THEMESDIR;
const dir = path.resolve(__dirname, themeDir);
if (conf[CONF_VAR].THEMESDIR) {
const themeDir = conf[CONF_VAR].THEMESDIR;
const dir = path.resolve(__dirname, themeDir);
if (filesystem.existsSync(dir)) {
filesystem.readdirSync(dir).forEach((file) => {
filePath = path.join(themeDir, file);
const stat = filesystem.statSync(filePath);
if (filesystem.existsSync(dir)) {
filesystem.readdirSync(dir).forEach((file) => {
filePath = path.join(themeDir, file);
const stat = filesystem.statSync(filePath);
if (stat && stat.isDirectory()) {
themes.push(filePath);
}
});
}
if (stat && stat.isDirectory()) {
themes.push(filePath);
}
});
}
}
module.exports = {
configuration: conf['Site\\Templates\\WebpackTemplateProvider'],
themes: themes,
configuration: conf[CONF_VAR],
themes: themes,
};