Permalink
Browse files

Operation Dog Food, Phase 3: Major refactoring. Lots working. Lots st…

…ill not working :)
  • Loading branch information...
1 parent 63aa1f8 commit 0b647dfff6eff958a3e33a99b38fef9d09ef4148 @cz cz committed Dec 17, 2010
Showing with 1,757 additions and 1,644 deletions.
  1. +3 −31 index.php
  2. +25 −25 symphony/assets/navigation.xml
  3. +1 −1 symphony/assets/scripts/drawer.js
  4. 0 symphony/assets/styles/{default.css → admin.css}
  5. +66 −18 ...ony/content/framework/{data-sources/data-sources.driver.php → datasources/datasources.driver.php}
  6. +1 −1 symphony/content/framework/{data-sources/data-sources.xsl → datasources/datasources.xsl}
  7. +73 −26 symphony/content/framework/events/events.driver.php
  8. +1 −1 symphony/content/framework/events/events.xsl
  9. +87 −38 symphony/content/framework/sections/sections.driver.php
  10. +1 −1 symphony/content/framework/sections/sections.xsl
  11. +50 −4 symphony/content/framework/utilities/utilities.driver.php
  12. +1 −1 symphony/content/framework/utilities/utilities.xsl
  13. +47 −2 symphony/content/framework/views/views.driver.php
  14. +2 −2 symphony/content/framework/views/views.xsl
  15. +64 −13 symphony/content/{content.publish.php → publish/publish.driver.php}
  16. +11 −0 symphony/content/publish/publish.xsl
  17. +126 −78 symphony/content/system/extensions/extensions.driver.php
  18. +75 −27 symphony/content/system/settings/settings.driver.php
  19. +49 −0 symphony/content/users/roles/roles.driver.php
  20. +11 −0 symphony/content/users/roles/roles.xsl
  21. +51 −3 symphony/content/users/users.driver.php
  22. +1 −1 symphony/content/users/users.xsl
  23. +0 −283 symphony/lib/class.administration.php
  24. +0 −517 symphony/lib/class.administrationpage.php
  25. +499 −31 symphony/lib/class.administrationview.php
  26. +88 −0 symphony/lib/class.context.php
  27. +126 −0 symphony/lib/class.controller.php
  28. +0 −244 symphony/lib/class.frontend.php
  29. +109 −48 symphony/lib/class.frontendview.php
  30. +0 −210 symphony/lib/class.renderer.php
  31. +21 −21 symphony/lib/class.section.php
  32. +140 −8 symphony/lib/class.view.php
  33. +6 −2 symphony/lib/class.xslproc.php
  34. +22 −7 symphony/templates/interface/layout.xsl
View
@@ -4,39 +4,11 @@
define('DOMAIN', rtrim(rtrim($_SERVER['HTTP_HOST'], '\\/') . dirname($_SERVER['PHP_SELF']), '\\/'));
require(DOCROOT . '/symphony/bundle.php');
+ require(LIB . '/class.controller.php');
- function renderer($handle){
- $path = NULL;
-
- if(file_exists(realpath($handle))){
- $path = realpath($handle);
-
- // Ensure the renderer is child of DOCROOT. Closes potential
- // security hole
- if(substr($path, 0, strlen(DOCROOT)) != DOCROOT){
- $path = NULL;
- }
- }
-
- elseif(file_exists(LIB . "/class.{$handle}.php")){
- $path = LIB . "/class.{$handle}.php";
- }
-
- if(is_null($path)){
- throw new Exception('Invalid Symphony renderer handle specified.');
- }
-
- $classname = require_once($path);
- return call_user_func("{$classname}::instance");
- }
-
- $handle = (isset($_GET['symphony-renderer'])
- ? $_GET['symphony-renderer']
- : 'frontend');
-
- $output = renderer($handle)->display(getCurrentPage());
+ $output = Controller::instance()->renderView();
header(sprintf('Content-Length: %d', strlen($output)));
echo $output;
- exit();
+ exit();
@@ -4,36 +4,36 @@
</group>
<group name="Framework" index="200" type="links">
<children>
- <item link="/blueprints/views/" name="Views" />
- <item link="/blueprints/views/new/" name="Views New" visible="no" />
- <item link="/blueprints/views/edit/" name="Views Edit" visible="no" />
-
- <item link="/blueprints/sections/" name="Sections" />
- <item link="/blueprints/sections/new/" name="Section New" visible="no" />
- <item link="/blueprints/sections/edit/" name="Section Edit" visible="no" />
-
- <item link="/blueprints/datasources/" name="Data Sources" />
- <item link="/blueprints/datasources/new/" name="Data Sources New" visible="no" />
- <item link="/blueprints/datasources/edit/" name="Data Sources Edit" visible="no" />
- <item link="/blueprints/datasources/info/" name="Data Sources Info" visible="no" />
-
- <item link="/blueprints/events/" name="Events" />
- <item link="/blueprints/events/new/" name="Event New" visible="no" />
- <item link="/blueprints/events/edit/" name="Event Edit" visible="no" />
- <item link="/blueprints/events/info/" name="Event Info" visible="no" />
-
- <item link="/blueprints/utilities/" name="XSLT Utilities" />
- <item link="/blueprints/utilities/new/" name="Utility New" visible="no" />
- <item link="/blueprints/utilities/edit/" name="Utility Edit" visible="no" />
+ <item link="/framework/views/" name="Views" />
+ <item link="/framework/views/new/" name="Views New" visible="no" />
+ <item link="/framework/views/edit/" name="Views Edit" visible="no" />
+
+ <item link="/framework/sections/" name="Sections" />
+ <item link="/framework/sections/new/" name="Section New" visible="no" />
+ <item link="/framework/sections/edit/" name="Section Edit" visible="no" />
+
+ <item link="/framework/datasources/" name="Data Sources" />
+ <item link="/framework/datasources/new/" name="Data Sources New" visible="no" />
+ <item link="/framework/datasources/edit/" name="Data Sources Edit" visible="no" />
+ <item link="/framework/datasources/info/" name="Data Sources Info" visible="no" />
+
+ <item link="/framework/events/" name="Events" />
+ <item link="/framework/events/new/" name="Event New" visible="no" />
+ <item link="/framework/events/edit/" name="Event Edit" visible="no" />
+ <item link="/framework/events/info/" name="Event Info" visible="no" />
+
+ <item link="/framework/utilities/" name="XSLT Utilities" />
+ <item link="/framework/utilities/new/" name="Utility New" visible="no" />
+ <item link="/framework/utilities/edit/" name="Utility Edit" visible="no" />
</children>
</group>
<group name="Users" index="300" type="links">
<children>
- <item link="/system/users/" name="Accounts" />
- <item link="/system/users/roles/" name="Roles" />
- <item link="/system/users/edit/" name="User Edit" visible="no" />
- <item link="/system/users/new/" name="User New" visible="no" />
+ <item link="/users/" name="Accounts" />
+ <item link="/users/roles/" name="Roles" />
+ <item link="/users/edit/" name="User Edit" visible="no" />
+ <item link="/users/new/" name="User New" visible="no" />
</children>
</group>
@@ -62,4 +62,4 @@ jQuery(document).ready(function($) {
});
});
-});
+});
@@ -1,5 +1,54 @@
<?php
+ /**
+ * DatasourcesDriver class...
+ */
+
+ Class DatasourcesDriver {
+
+ public $url;
+ public $view;
+
+ public function __construct() {
+ $this->view = Controller::instance()->View;
+ $this->url = Controller::instance()->url;
+
+ $this->setTitle();
+ }
+
+ public function setTitle() {
+ $this->view->title = __('Data Sources');
+ }
+
+ public function registerActions() {
+
+ $actions = array(
+ array(
+ 'name' => __('Create New'),
+ 'type' => 'new',
+ 'callback' => $url . '/new'
+ ),
+ array(
+ 'name' => __('Filter'),
+ 'type' => 'tool'
+ )
+ );
+
+ foreach($actions as $action) {
+ $this->view->registerAction($action);
+ }
+ }
+
+ public function registerDrawer() {
+ // Do stuff
+ }
+
+ public function buildDataXML($data) {
+
+ }
+ }
+
+ /*
require_once(LIB . '/class.administrationpage.php');
//require_once(LIB . '/class.datasourcemanager.php');
//require_once(LIB . '/class.sectionmanager.php');
@@ -27,14 +76,14 @@ public function __construct(){
$this->editing = $this->failed = false;
$this->datasource = $this->handle = $this->status = $this->type = NULL;
$this->types = array();
-
+
foreach (new ExtensionIterator(ExtensionIterator::FLAG_TYPE, array('Data Source')) as $extension) {
$path = Extension::getPathFromClass(get_class($extension));
$handle = Extension::getHandleFromPath($path);
-
+
if (Extension::status($handle) != Extension::STATUS_ENABLED) continue;
if (!method_exists($extension, 'getDataSourceTypes')) continue;
-
+
foreach ($extension->getDataSourceTypes() as $type) {
$this->types[$type->class] = $type;
}
@@ -51,7 +100,7 @@ public function __construct(){
}
public function __viewIndex() {
-
+
// This is the 'correct' way to append a string containing an entity
$title = $this->createElement('title');
$title->appendChild($this->createTextNode(__('Symphony') . ' '));
@@ -151,11 +200,11 @@ public function __viewIndex() {
if (is_null($ds->getType())) {
$col_type = Widget::TableData(__('Unknown'), array('class' => 'inactive'));
}
-
+
else{
$col_type = Widget::TableData($this->types[$ds->getType()]->name);
}
-
+
$dsTableBody[] = Widget::TableRow(array(
$col_name, $col_source, $col_type, $col_views
));
@@ -202,12 +251,12 @@ protected function __prepareForm() {
if (is_null($this->type)){
$this->type = Symphony::Configuration()->core()->{'default-datasource-type'};
}
-
+
// Should the default type or the selected type no longer be valid, choose the first available one instead
if(!in_array($this->type, array_keys($this->types))){
$this->type = current(array_keys($this->types));
}
-
+
foreach ($this->types as $type) {
if ($type->class != $this->type) continue;
@@ -217,7 +266,7 @@ protected function __prepareForm() {
? $_POST['fields']
: NULL
);
-
+
break;
}
}
@@ -274,7 +323,7 @@ protected function __actionForm() {
);
}
}
-
+
protected function __viewForm() {
// Show page alert:
@@ -341,18 +390,18 @@ protected function __viewForm() {
else{
$header = $this->xpath('//h2')->item(0);
$options = array();
-
+
foreach ($this->types as $type) {
$options[] = array($type->class, ($this->type == $type->class), $type->name);
}
-
+
usort($options, 'General::optionsSort');
$select = Widget::Select('type', $options);
-
+
$header->prependChild($select);
$header->prependChild(new DOMText(__('New')));
}
-
+
if($this->datasource instanceof Datasource){
$this->datasource->view($this->Form, $this->errors);
}
@@ -467,7 +516,7 @@ public function __viewInfo(){
$dl->appendChild($dd);
}
$fieldset->appendChild($dl);
- */
+ *
}
@@ -586,7 +635,7 @@ protected function __actionDelete(array $datasources, $redirect=NULL) {
Symphony::Database()->update($page, 'tbl_pages', "`id` = '".$page['id']."'");
}
- }*/
+ }*
}
if($success) redirect($redirect);
@@ -605,5 +654,4 @@ public function __actionIndex() {
}
- }
-
+ }*/
@@ -4,7 +4,7 @@ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href="layout.xsl"/>
-<xsl:template match="/" mode="view">
+<xsl:template match="root" mode="view">
<xsl:copy-of select="."/>
</xsl:template>
Oops, something went wrong.

0 comments on commit 0b647df

Please sign in to comment.