summaryrefslogtreecommitdiff
path: root/framework/Wsat/TWsatService.php
diff options
context:
space:
mode:
authorDaniel <darthdaniel85@gmail.com>2013-11-18 14:44:44 -0800
committerDaniel <darthdaniel85@gmail.com>2013-11-18 14:44:44 -0800
commit85ca63b0896be3d12a098b44b5ec0c65a5b76a6c (patch)
tree86af33cb199088d65389bfb83cacf94a3db2a88b /framework/Wsat/TWsatService.php
parent7a047bedd98b47a82263e81bf62ef3890947f6ac (diff)
WSAT Login...
Diffstat (limited to 'framework/Wsat/TWsatService.php')
-rw-r--r--framework/Wsat/TWsatService.php25
1 files changed, 22 insertions, 3 deletions
diff --git a/framework/Wsat/TWsatService.php b/framework/Wsat/TWsatService.php
index 009ad302..de2bbdf6 100644
--- a/framework/Wsat/TWsatService.php
+++ b/framework/Wsat/TWsatService.php
@@ -6,6 +6,15 @@
* @version 1.0
* @author Daniel Sampedro darthdaniel85@gmail.com
* @since Prado 3.3
+ *
+ * To use TWsatService, configure it in the application specification like following:
+ * <code>
+ * <services>
+ * <service id="wsat" class="System.Wsat.TWsatService" Password="my_secret_password" />
+ * </services>
+ * </code>
+ * ...and then you need to go to http://localhost/yoursite/index.php?wsat=TWsatLogin
+ * and generate code and configure your site.
*/
class TWsatService extends TPageService {
@@ -13,15 +22,15 @@ class TWsatService extends TPageService {
//-----------------------------------------------------------------------------
public function init($config) {
- if ($this->getApplication()->getMode() === TApplicationMode::Performance
- || $this->getApplication()->getMode() === TApplicationMode::Normal) {
+ if ($this->getApplication()->getMode() === TApplicationMode::Performance || $this->getApplication()->getMode() === TApplicationMode::Normal) {
throw new TInvalidOperationException("You should not use Prado WSAT in any of the production modes.");
}
if (empty($this->_pass)) {
throw new TConfigurationException("You need to specify the Password attribute.");
}
$this->setDefaultPage("TWsatHome");
- parent::init($config);
+ $this->_startThemeManager();
+ parent::init($config);
}
public function getBasePath() {
@@ -29,6 +38,16 @@ class TWsatService extends TPageService {
return realpath($basePath);
}
+ private function _startThemeManager() {
+ $themeManager = new TThemeManager;
+ $themeManager->BasePath = "System.Wsat.themes";
+ $url = Prado::getApplication()->getAssetManager()->publishFilePath(Prado::getPathOfNamespace('System.Wsat'));
+ $themeManager->BaseUrl = $url . DIRECTORY_SEPARATOR . "themes";
+
+ $themeManager->init(null);
+ $this->setThemeManager($themeManager);
+ }
+
public function getPassword() {
return $this->_pass;
}