Permalink
Browse files

Site and Applicaiton Configuration and Registry

  • Loading branch information...
1 parent ec690ab commit 45c5f3359a39fae2bf8fe83da0038515f48ccd62 Amy Stephen committed Apr 27, 2012
@@ -191,18 +191,14 @@ protected function initialise()
return false;
}
+ $this->base_url = Services::Registry()->get('Site', 'base_url');
+
/** SSL Check */
$continue = $this->sslCheck();
if ($continue == false) {
return false;
}
- /** Retrieve Site data and save in registry */
- $continue = $this->setSiteData();
- if ($continue == false) {
- return false;
- }
-
/** Verify that this site is authorised to access this application */
$continue = $this->getSiteApplicationAuthorisation();
if ($continue == false) {
@@ -262,15 +258,16 @@ protected function authorise()
protected function execute()
{
$action = Services::Registry()->get('Request', 'action', 'display');
- echo $action;
- die;
+
/** Display Action */
if ($action == 'display') {
+
$continue = $this->display();
if ($continue == false) {
Services::Debug()->set('Application execute Display failed');
return false;
+
} else {
Services::Debug()->set('Application execute Display succeeded');
return true;
@@ -283,6 +280,7 @@ protected function execute()
if ($continue == false) {
Services::Debug()->set('Application execute ' . $action . ' failed');
return false;
+
} else {
Services::Debug()->set('Application execute ' . $action . ' succeeded');
return true;
@@ -751,40 +749,6 @@ protected function sslCheck()
}
/**
- * Retrieve Site data and save in registry
- *
- * @return mixed
- * @since 1.0
- * @throws \RuntimeException
- */
- protected function setSiteData()
- {
- $m = new TableModel ('Sites', SITE_ID);
-
- $m->query->where($m->db->qn('id') . ' = ' . (int)SITE_ID);
-
- $results = $m->loadAssoc();
-
- if ($results === false) {
- throw new \RuntimeException ('Application setSiteData() query problem');
- }
-
- /** Registry for Custom Fields and Metadata */
- $xml = Services::Registry()->loadFile('Sites');
-
- Services::Registry()->loadField('SiteCustomfields', 'custom_fields',
- $results['custom_fields'], $xml->custom_fields);
- Services::Registry()->loadField('SiteMetadata', 'meta',
- $results['metadata'], $xml->metadata);
- Services::Registry()->loadField('SiteParameters', 'parameters',
- $results['parameters'], $xml->parameter);
-
- $this->base_url = $results['base_url'];
-
- return true;
- }
-
- /**
* Verify that this site is authorised to access this application
*
* @returns boolean
@@ -8,19 +8,6 @@
<registry>ApplicationCustomfields</registry>
<registry>ApplicationMetadata</registry>
- <registry>Configuration</registry>
-
- <registry>User</registry>
- <registry>UserCustomfields</registry>
- <registry>UserMetadata</registry>
- <registry>UserParameters</registry>
-
- <registry>Theme</registry>
- <registry>ThemeCustomfields</registry>
- <registry>ThemeMetadata</registry>
- <registry>ThemeParameters</registry>
- <registry>Page</registry>
-
<registry>Request</registry>
<registry>RequestCatalog</registry>
<registry>RequestExtension</registry>
@@ -36,16 +23,32 @@
<registry>RequestTemplate</registry>
<registry>RequestWrap</registry>
+ <registry>Configuration</registry>
+
+ <registry>User</registry>
+ <registry>UserCustomfields</registry>
+ <registry>UserMetadata</registry>
+ <registry>UserParameters</registry>
+
+ <registry>Theme</registry>
+ <registry>ThemeCustomfields</registry>
+ <registry>ThemeMetadata</registry>
+ <registry>ThemeParameters</registry>
+
+ <registry>Page</registry>
+
<registry>Catalog</registry>
<registry>Extension</registry>
<registry>ExtensionCustomfields</registry>
<registry>ExtensionMetadata</registry>
<registry>ExtensionParameters</registry>
+
<registry>Source</registry>
<registry>SourceCustomfields</registry>
<registry>SourceMetadata</registry>
<registry>SourceParameters</registry>
+
<registry>MVC</registry>
<registry>MVCParameters</registry>
<registry>Template</registry>
@@ -56,7 +56,7 @@
<fk name="catalog_type_id" source_id="id" source_model="CatalogTypes" required="1" />
</fks>
<custom_fields>
- <custom_field name="custom_fields" filter="char" null="1" default="" values=""/>
+ <custom_field name="custom_fields" filter="char" null="0" default="This is the default" values=""/>
</custom_fields>
<parameters>
<parameter name="section" filter="char" null="1" default=" "/>
Oops, something went wrong.

0 comments on commit 45c5f33

Please sign in to comment.