-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from jakxnz/proposal/SS4-compatibility
Update module to SS4 conventions
- Loading branch information
Showing
23 changed files
with
632 additions
and
726 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1 @@ | ||
<?php | ||
Object::add_extension('SiteConfig', 'IanSimpson\Admin\ClientAdmin'); | ||
Object::add_extension('SiteConfig', 'IanSimpson\Admin\ScopeAdmin'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,50 @@ | ||
<?php | ||
|
||
namespace IanSimpson\Admin; | ||
namespace IanSimpson\OAuth2\Admin; | ||
|
||
class ClientAdmin extends \DataExtension { | ||
use IanSimpson\OAuth2\Entities\ClientEntity; | ||
use SilverStripe\Forms\FieldList; | ||
use SilverStripe\Forms\GridField\GridField; | ||
use SilverStripe\Forms\GridField\GridFieldAddNewButton; | ||
use SilverStripe\Forms\GridField\GridFieldConfig; | ||
use SilverStripe\Forms\GridField\GridFieldDataColumns; | ||
use SilverStripe\Forms\GridField\GridFieldDeleteAction; | ||
use SilverStripe\Forms\GridField\GridFieldDetailForm; | ||
use SilverStripe\Forms\GridField\GridFieldEditButton; | ||
use SilverStripe\Forms\GridField\GridFieldToolbarHeader; | ||
use SilverStripe\ORM\DataExtension; | ||
|
||
private static $has_many = array( | ||
'Clients' => 'IanSimpson\Entities\ClientEntity', | ||
); | ||
class ClientAdmin extends DataExtension | ||
{ | ||
|
||
public function updateCMSFields(\FieldList $fields) { | ||
private static $has_many = [ | ||
'Clients' => ClientEntity::class, | ||
]; | ||
|
||
$gridFieldConfig = \GridFieldConfig::create(); | ||
$button = new \GridFieldAddNewButton('toolbar-header-right'); | ||
$button->setButtonName('Add New OAuth Client'); | ||
$gridFieldConfig->addComponents( | ||
new \GridFieldToolbarHeader(''), | ||
public function updateCMSFields(FieldList $fields) | ||
{ | ||
$gridFieldConfig = GridFieldConfig::create(); | ||
$button = new GridFieldAddNewButton('toolbar-header-right'); | ||
$button->setButtonName('Add New OAuth Client'); | ||
$gridFieldConfig->addComponents( | ||
new GridFieldToolbarHeader(''), | ||
$button, | ||
new \GridFieldDataColumns(), | ||
new \GridFieldEditButton(), | ||
new \GridFieldDeleteAction(''), | ||
new \GridFieldDetailForm() | ||
); | ||
new GridFieldDataColumns(), | ||
new GridFieldEditButton(), | ||
new GridFieldDeleteAction(''), | ||
new GridFieldDetailForm() | ||
); | ||
|
||
$fields->addFieldToTab("Root.OAuthConfiguration", new \GridField('Clients', 'Clients', $this->owner->Clients(), $gridFieldConfig)); | ||
$fields->addFieldToTab( | ||
"Root.OAuthConfiguration", | ||
new GridField( | ||
'Clients', | ||
'Clients', | ||
$this->owner->Clients(), | ||
$gridFieldConfig | ||
) | ||
); | ||
|
||
return $fields; | ||
} | ||
return $fields; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,50 @@ | ||
<?php | ||
|
||
namespace IanSimpson\Admin; | ||
namespace IanSimpson\OAuth2\Admin; | ||
|
||
class ScopeAdmin extends \DataExtension { | ||
use IanSimpson\OAuth2\Entities\ScopeEntity; | ||
use SilverStripe\Forms\FieldList; | ||
use SilverStripe\Forms\GridField\GridField; | ||
use SilverStripe\Forms\GridField\GridFieldAddNewButton; | ||
use SilverStripe\Forms\GridField\GridFieldConfig; | ||
use SilverStripe\Forms\GridField\GridFieldDataColumns; | ||
use SilverStripe\Forms\GridField\GridFieldDeleteAction; | ||
use SilverStripe\Forms\GridField\GridFieldDetailForm; | ||
use SilverStripe\Forms\GridField\GridFieldEditButton; | ||
use SilverStripe\Forms\GridField\GridFieldToolbarHeader; | ||
use SilverStripe\ORM\DataExtension; | ||
|
||
private static $has_many = array( | ||
'Scopes' => 'IanSimpson\Entities\ScopeEntity', | ||
); | ||
class ScopeAdmin extends DataExtension | ||
{ | ||
|
||
public function updateCMSFields(\FieldList $fields) { | ||
private static $has_many = [ | ||
'Scopes' => ScopeEntity::class, | ||
]; | ||
|
||
$gridFieldConfig = \GridFieldConfig::create(); | ||
$button = new \GridFieldAddNewButton('toolbar-header-right'); | ||
$button->setButtonName('Add New OAuth Scope'); | ||
$gridFieldConfig->addComponents( | ||
new \GridFieldToolbarHeader(''), | ||
public function updateCMSFields(FieldList $fields) | ||
{ | ||
$gridFieldConfig = GridFieldConfig::create(); | ||
$button = new GridFieldAddNewButton('toolbar-header-right'); | ||
$button->setButtonName('Add New OAuth Scope'); | ||
$gridFieldConfig->addComponents( | ||
new GridFieldToolbarHeader(''), | ||
$button, | ||
new \GridFieldDataColumns(), | ||
new \GridFieldEditButton(), | ||
new \GridFieldDeleteAction(''), | ||
new \GridFieldDetailForm() | ||
); | ||
new GridFieldDataColumns(), | ||
new GridFieldEditButton(), | ||
new GridFieldDeleteAction(''), | ||
new GridFieldDetailForm() | ||
); | ||
|
||
$fields->addFieldToTab("Root.OAuthConfiguration", new \GridField('Scopes', 'Scopes', $this->owner->Scopes(), $gridFieldConfig)); | ||
$fields->addFieldToTab( | ||
"Root.OAuthConfiguration", | ||
new GridField( | ||
'Scopes', | ||
'Scopes', | ||
$this->owner->Scopes(), | ||
$gridFieldConfig | ||
) | ||
); | ||
|
||
return $fields; | ||
} | ||
return $fields; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.