This repository has been archived by the owner on Aug 4, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor /manage and SlateAdmin backend configuration into namespaced…
… class pair
- Loading branch information
1 parent
d7cdab0
commit 03f937f
Showing
4 changed files
with
43 additions
and
16 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
namespace SlateAdmin; | ||
|
||
|
||
class RequestHandler extends \Emergence\Site\RequestHandler | ||
{ | ||
public static function handleRequest() | ||
{ | ||
$GLOBALS['Session']->requireAccountLevel('Staff'); | ||
return static::sendResponse(WebApp::load()->render(), 'webapps/SlateAdmin'); | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
namespace SlateAdmin; | ||
|
||
|
||
class WebApp extends \Emergence\WebApps\SenchaApp | ||
{ | ||
public static $plugins = []; | ||
|
||
|
||
public static function getPlugins() | ||
{ | ||
return static::$plugins; | ||
} | ||
|
||
public static function load($name = 'SlateAdmin') | ||
{ | ||
return parent::load($name); | ||
} | ||
|
||
public function render() | ||
{ | ||
$response = parent::render(); | ||
|
||
$response->setPayloadKey('plugins', static::getPlugins()); | ||
|
||
return $response; | ||
} | ||
} |
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,7 +1,3 @@ | ||
<?php | ||
|
||
$GLOBALS['Session']->requireAccountLevel('Staff'); | ||
|
||
$app = Emergence\WebApps\App::get('SlateAdmin'); | ||
|
||
Emergence\Site\RequestHandler::sendResponse($app->render(), 'webapps/SlateAdmin'); | ||
SlateAdmin\RequestHandler::handleRequest(); |