From 79c7eb50dd6e02757556265624080f810040c392 Mon Sep 17 00:00:00 2001 From: quincykwende Date: Fri, 12 Apr 2013 22:38:22 +0100 Subject: [PATCH] Keep track of all uncommitted files --- classes/associator.php | 249 -- classes/associator/checkboxes.php | 31 - classes/associator/radios.php | 31 - classes/builder/frontend.php | 312 +- classes/controller/accessdenied.php | 10 +- classes/controller/ajax.php | 180 +- classes/controller/associator.php | 2 +- classes/controller/auth.php | 177 +- classes/controller/authstatus.php | 17 +- classes/controller/builder.php | 317 +- classes/controller/cms.php | 38 +- classes/controller/csv.php | 289 +- classes/controller/csvimports.php | 43 +- classes/controller/customreel.php | 342 +- classes/controller/export.php | 259 +- classes/controller/file.php | 68 +- classes/controller/footer.php | 13 +- classes/controller/graph.php | 31 +- classes/controller/header.php | 13 +- classes/controller/headerfooter.php | 11 +- classes/controller/html.php | 16 - classes/controller/initializer.php | 12 +- classes/controller/keepalive.php | 20 +- classes/controller/language.php | 21 +- classes/controller/lattice.php | 160 - classes/controller/latticeviews.php | 109 +- classes/controller/layout.php | 76 - classes/controller/list.php | 215 +- classes/controller/navigation.php | 196 +- classes/controller/preview.php | 11 +- classes/controller/publicmenu.php | 67 +- classes/controller/registration.php | 4 +- classes/controller/rest.php | 6 + classes/controller/setup.php | 21 +- classes/controller/test.php | 16 +- classes/controller/usermanagement.php | 338 +- classes/controller/views.php | 10 +- classes/controller/xml.php | 6 + classes/frontend.php | 44 - classes/graph.php | 219 +- classes/graph/objectquery.php | 83 +- classes/initializer/cms.php | 15 +- classes/initializer/lattice.php | 29 +- classes/initializer/latticeauth.php | 57 - classes/lattice.php | 264 -- classes/lattice/cms.php | 260 +- classes/lattice/cmsinterface.php | 342 +- classes/lattice/controller/associator.php | 70 +- classes/lattice/initializer.php | 111 +- .../latticeauth/controller/registration.php | 122 - classes/latticecms.php | 368 -- classes/latticeui.php | 197 - classes/latticeurl.php | 9 - classes/latticeutil.php | 152 - classes/latticeview.php | 368 -- classes/model/association.php | 9 +- classes/model/content.php | 10 +- classes/model/file.php | 131 +- classes/model/initializedmodule.php | 11 +- classes/model/language.php | 18 +- classes/model/lattice.php | 10 +- classes/model/lattice/contentdriver.php | 43 +- classes/model/lattice/foreign.php | 82 +- classes/model/lattice/object.php | 312 +- classes/model/listcontainer.php | 93 +- classes/model/object.php | 3339 +++++++++-------- classes/model/objectelementrelationship.php | 5 +- classes/model/objectmap.php | 114 +- classes/model/objectrelationship.php | 14 +- classes/model/objects/tag.php | 9 +- classes/model/objects/user.php | 10 +- classes/model/objecttype.php | 352 +- classes/model/rosetta.php | 10 +- classes/model/tag.php | 8 +- classes/model/user.php | 24 +- classes/navigation.php | 61 - classes/response.php | 16 +- classes/session.php | 24 +- classes/utility/auth.php | 39 - classes/view/csv.php | 135 - classes/view/csvcontainer.php | 36 - config/auth.php | 2 +- config/cms-s.php | 4 - config/cms.php | 10 +- config/lattice.php | 6 +- config/lattice_cms.php | 12 +- config/latticeviews.php | 2 +- config/navigation.php | 8 +- config/registration.php | 4 +- config/usermanagement.php | 19 +- cookbook/moplib.htaccess | 48 - .../config/config.inc.php | 8 +- devtools/ruckusing-migrations/generate.php | 12 +- .../adapters/class.Ruckusing_MySQLAdapter.php | 190 +- .../class.Ruckusing_MySQLTableDefinition.php | 62 +- .../class.Ruckusing_FrameworkRunner.php | 40 +- .../task/class.Ruckusing_TaskManager.php | 16 +- .../classes/util/class.Ruckusing_Logger.php | 6 +- .../util/class.Ruckusing_MigratorUtil.php | 38 +- .../util/class.Ruckusing_NamingUtil.php | 16 +- .../lib/tasks/class.Ruckusing_DB_Migrate.php | 40 +- .../lib/tasks/class.Ruckusing_DB_Setup.php | 2 +- .../lib/tasks/class.Ruckusing_DB_Status.php | 2 +- .../lib/tasks/class.Ruckusing_DB_Version.php | 4 +- .../tests/test_helper.php | 8 +- .../tests/unit/BaseMigrationTest.php | 8 +- .../tests/unit/MigratorUtilTest.php | 4 +- .../tests/unit/MySQLAdapterTest.php | 12 +- .../tests/unit/MySQLTableDefinitionTest.php | 6 +- .../tests/unit/NamingUtilTest.php | 4 +- .../tests/unit/TaskManagerTest.php | 4 +- devtools/tests/classes/AssociatorTest.php | 2 +- .../classes/GraphObjectAuthRolesTest.php | 2 +- devtools/tests/classes/ModelObjectTest.php | 4 +- i18n/en.php | 1 + includes/mysqlfuncs.php | 2 +- init.php | 38 +- lattice/clusters.xml | 45 +- lattice/cmsModules.dtd | 17 - lattice/cmsModules.xml | 8 - lattice/objects.dtd | 8 +- views/LayoutAdmin.php | 5 +- views/auth/forgot.php | 2 +- views/auth/login.php | 2 +- views/default.php | 6 +- views/header_admin.php | 1 - views/initializationMessages.php | 21 - views/js/latticesettings.php | 4 +- views/languageControls.php | 2 +- views/lattice/associator.php | 72 +- views/lattice/associator/checkboxes.php | 20 +- views/lattice/associator/checkboxes/item.php | 6 +- views/lattice/associator/radios.php | 2 +- views/latticeInstalled.php | 8 - views/latticeNotInstalled.php | 8 - views/lattice_cms.php | 12 +- views/lattice_cms_nodetitle.php | 27 +- views/list.php | 14 +- views/list_item.php | 4 +- views/logged_in_as.php | 6 +- views/moveControls.php | 7 - views/navigation.php | 1 + views/navigationNode.php | 14 - views/navigationTier.php | 6 - views/pagination/paginationControls.php | 6 +- views/publicnav.php | 2 +- views/registration.php | 2 +- views/tierMethodsDrawer.php | 13 - views/ui/checkbox.php | 2 +- views/ui/date.php | 2 +- views/ui/dateRange.php | 2 +- views/ui/file.php | 24 +- views/ui/image.php | 18 +- views/ui/input.php | 2 +- views/ui/multiSelect.php | 12 - views/ui/password.php | 6 +- views/ui/pulldown.php | 2 +- views/ui/radioGroup.php | 10 - views/ui/tags.php | 2 +- views/ui/text.php | 10 +- views/ui/time.php | 2 +- views/usermanagement.php | 12 +- views/usermanagement_item.php | 19 +- views/usersList.php | 2 +- 164 files changed, 3135 insertions(+), 9351 deletions(-) delete mode 100644 classes/associator.php delete mode 100644 classes/associator/checkboxes.php delete mode 100644 classes/associator/radios.php delete mode 100644 classes/controller/html.php delete mode 100644 classes/controller/lattice.php delete mode 100644 classes/controller/layout.php delete mode 100644 classes/frontend.php delete mode 100644 classes/initializer/latticeauth.php delete mode 100755 classes/lattice.php delete mode 100644 classes/latticeauth/controller/registration.php delete mode 100755 classes/latticecms.php delete mode 100755 classes/latticeui.php delete mode 100644 classes/latticeurl.php delete mode 100755 classes/latticeutil.php delete mode 100644 classes/latticeview.php delete mode 100644 classes/navigation.php delete mode 100644 classes/utility/auth.php delete mode 100644 classes/view/csv.php delete mode 100644 classes/view/csvcontainer.php delete mode 100644 config/cms-s.php delete mode 100644 cookbook/moplib.htaccess delete mode 100755 lattice/cmsModules.dtd delete mode 100644 lattice/cmsModules.xml delete mode 100644 views/initializationMessages.php delete mode 100644 views/latticeInstalled.php delete mode 100644 views/latticeNotInstalled.php delete mode 100644 views/moveControls.php delete mode 100644 views/navigationNode.php delete mode 100644 views/navigationTier.php delete mode 100644 views/tierMethodsDrawer.php delete mode 100755 views/ui/multiSelect.php delete mode 100755 views/ui/radioGroup.php diff --git a/classes/associator.php b/classes/associator.php deleted file mode 100644 index a17d4d74..00000000 --- a/classes/associator.php +++ /dev/null @@ -1,249 +0,0 @@ -pool - public $numPages = 2; - - protected $label; - protected $poolLabel; - protected $pageLength; - //this is page size for paginator - //this doesn't matter anymore because we're paginating - private $maxPoolSize = 80; - private $pageNum = 1; - public static function getFiltersFromDomNode($node){ - $filtersNodeList = lattice::config('objects', 'filter', $node); - $filters = array(); - foreach($filtersNodeList as $filter){ - $setting = array(); - $setting['from'] = $filter->getAttribute('from'); - $setting['objectTypeName'] = $filter->getAttribute('objectTypeName'); - $setting['tagged'] = $filter->getAttribute('tagged'); - $setting['function'] = $filter->getAttribute('function'); - $filters[] = $setting; - } - return $filters; - - } - - - //TODO - public function setViewName($viewName){throw new Kohana_Exception('Not Implemented');} //to support multi-lattice single custom view - public function setAssociatorName($associatorName){throw new Kohana_Exception('Not Implemented');} //to support mutli-instance single lattice - - - - public function __construct($parentId, $lattice, $filters=NULL, $loadPool=NULL){ - $this->parentId = $parentId; - $this->parent = Graph::object($this->parentId); - $this->lattice = $lattice; - $this->filters = $filters; - $this->pageLength = Kohana::config('cms.associatorPageLength'); - - foreach($this->parent->getLatticeChildrenPaged($this->lattice) as $child){ - $this->associated[] = $child; - } - - if(is_array($loadPool)){ - $this->pool = $loadPool; - } - $logPool = array(); - - if (is_array($loadPool)){ - foreach ($loadPool as $l){ - $logPool[] = $l->id; - } - - } - // Kohana::$log->add( Kohana_Log::INFO, print_r($logPool,1) )->write(); - // Kohana::$log->add( Kohana_Log::INFO, print_r($filters,1) )->write(); - // Kohana::$log->add( Kohana_Log::INFO, print_r($lattice,1) )->write(); - - //load pool - if($filters){ - - $objects = Graph::object(); - - foreach($filters as $filter){ - - if(isset($filter['from']) && $filter['from']){ - $from = Graph::object($filter['from']); - ($filter['lattice']) ? $lattice = $filter['lattice'] : $lattice = 'lattice'; - $objects = $from->latticeChildrenQuery($lattice); - } - - if(isset($filter['tagged']) && $filter['tagged']){ - $objects->taggedFilter($filter['tagged']); - } - - if(isset($filter['objectTypeName']) && $filter['objectTypeName']){ - $t = ORM::Factory('objectType', $filter['objectTypeName']); - if(!$t->loaded()){ - Graph::configureObjectType($filter['objectTypeName']); - $t = ORM::Factory('objecttype', $filter['objectTypeName']); - if(!$t->loaded()){ - throw new Kohana_Exception($filter['objectTypeName'] .' Not Found'); - } - } - $objects->where('objecttype_id', '=', $t->id); - } - - if(isset($filter['match']) && $filter['match']){ - $matchFields = explode(',',$filter['matchFields']); - $wheres = array(); - foreach($matchFields as $matchField){ - $wheres[] = array($matchField, 'LIKE', '%'.$filter['match'].'%'); - } - $objects->contentFilter($wheres); - - } - - if(isset($filter['function']) && $filter['function']){ - $callback = explode('::', $filter['function']); - - $options = null; - $objects = call_user_func($callback, $objects, $parentId, $options); - } - - - $objects->where('objects.language_id', '=', Graph::defaultLanguage()); - $objects->publishedFilter(); - //just return an array of id's then load the pool object - $results = $objects->find_all()->as_array(NULL, 'id'); - //check our filtered objects are correct - //compact the array to remove redundant keys - $res = array(); - foreach ($results as $id) { - $object = Graph::object($id); - if(!$this->parent->checkLatticeRelationship($lattice, $object)){ - $res[$id] = $id; - } - } - $results = $res; - $this->numPages = ceil(count($results)/$this->pageLength); - //get slice the first page, then load the objects from their id's - $params = explode("/",$_SERVER["REQUEST_URI"]); - //print_r($params); - //@TODO this is a kludge. Oh well. - if (isset($params[7]) && $params[6]=="postingVideosAssociator"){ - //we're passing a page number - so slice the object ids - $results = array_slice($results,($params[7]-1)*16,16); - } else { - $results = array_slice($results,0,$this->pageLength); - } - - foreach($results as $id){ - $object = Graph::object($id); - $this->pool[$id] =$object; - } - } - - } else if(!is_array($loadPool)) { - - $objects = Graph::object() - ->where( 'id', '!=', $parentId ) - ->where( 'objects.language_id', '=', Graph::defaultLanguage() ) - ->publishedFilter() - ->limit( $this->maxPoolSize ) - ->find_all(); - $this->pool = $objects; - - } - - } - - public function setLabel($label){ - $this->label = $label; - } - public function setPageLength($pageLength){ - $this->pageLength = $pageLength; - } - - public function setPoolLabel($poolLabel){ - $this->poolLabel = $poolLabel; - } - - public function render($viewName = NULL){ - if($viewName && ($view = Kohana::find_file('views', 'lattice/associator/'.$viewName) )){ - $view = new View('lattice/associator/'.$viewName); - } else { - $view = new View('lattice/associator'); - } - - - $view->pool = $this->poolItemViews($viewName); - - $view->associated = array(); - foreach($this->associated as $associatedItem){ - $view->associated[] = $this->getItemView($associatedItem, $viewName); - } - - $view->parentId = $this->parentId; - $view->lattice = $this->lattice; - $view->label = $this->label; - $view->poolLabel = $this->poolLabel; - $view->pageLength = $this->pageLength; - $view->numPages = $this->numPages; - - - - /* - paginator vars- probably should be its own func - these are messy too - - */ - - $view->urlPrepend = "ajax/html"; - // echo strpos($original_uri,$action); - //pass our paginator params to the view -// $view->controllerName = $this->request->controller(); -// $view->action = $action; -// $view->params = $this->request->param(); -// $view->currentPage = $view->params["param4"]; - /* end paginator vars*/ - return $view->render(); - } - - public function renderPoolItems(){ - return( implode("\n",$this->poolItemViews($this->lattice) ) ); - } - - private function poolItemViews($viewName = NULL){ - $poolItemViews = array(); - foreach($this->pool as $poolItem){ - $poolItemViews[] = $this->getItemView($poolItem, $viewName); - } - return $poolItemViews; - } - - private function getItemView($item, $viewName){ - - if($viewName && $view = Kohana::find_file('views/lattice/associator/'.$viewName, $item->objecttype->objecttypename)){ - $view = new View('lattice/associator/'.$viewName.'/'.$item->objecttype->objecttypename); - } else if($viewName && $view = Kohana::find_file('views/lattice/associator/'.$viewName, 'item')){ - $view = new View('lattice/associator/'.$viewName.'/'.'item'); - } else if($view = Kohana::find_file('views/lattice/associator/', $item->objecttype->objecttypename)){ - $view = new View('lattice/associator/'.$item->objecttype->objecttypename); - } else { - $view = new View('lattice/associator/item'); - } - $view->object = $item; - - $view->selected = false; - - return $view; - - } - - - -} diff --git a/classes/associator/checkboxes.php b/classes/associator/checkboxes.php deleted file mode 100644 index d0a0770a..00000000 --- a/classes/associator/checkboxes.php +++ /dev/null @@ -1,31 +0,0 @@ - $view){ - $view->selected = true; - $poolViews[$key] = $view; - } - - array_walk($poolViews, array('Associator_Checkboxes', 'setUniqueElementId')); - - ksort($poolViews); - - return $poolViews; - } - - private static function titleIndex($view){ - return $view->object->title; - } - - private static function setUniqueElementId($view){ - $view->uniqueElementId = LatticeCms::uniqueElementId(); - } - -} diff --git a/classes/associator/radios.php b/classes/associator/radios.php deleted file mode 100644 index 91fb014d..00000000 --- a/classes/associator/radios.php +++ /dev/null @@ -1,31 +0,0 @@ - $view){ - $view->selected = true; - $poolViews[$key] = $view; - } - - array_walk($poolViews, array('Associator_Radios', 'setUniqueElementId')); - - ksort($poolViews); - - return $poolViews; - } - - private static function titleIndex($view){ - return $view->object->title; - } - - private static function setUniqueElementId($view){ - $view->uniqueElementId = LatticeCms::uniqueElementId(); - } - -} diff --git a/classes/builder/frontend.php b/classes/builder/frontend.php index 32b6869d..e93eb6e7 100755 --- a/classes/builder/frontend.php +++ b/classes/builder/frontend.php @@ -1,311 +1,3 @@ -basePath)){ - die($this->basePath.' must be writable'); - } - } - - public function index(){ - echo "Configuring Frontend\n"; - echo "Reading application/config/frontend.xml\n"; - - lattice::config('objects', '//objectTypes'); - - flush(); - ob_flush(); - flush(); - - $createdViews = array(); - // foreach(lattice::config('frontend', '//view') as $view ){ - // //this has removed the ability to build virtual views - foreach(lattice::config('objects', '//objectType') as $objectType){ - $view = lattice::config('frontend', '//view[@name="'.$objectType->getAttribute('name').'"]'); - if(count($view)){ - $view = $view->item(0); - } - if($view){ - $viewName = $view->getAttribute('name'); - } else { - $viewName = $objectType->getAttribute('name'); - } - - echo $viewName."\n"; - flush(); - ob_flush(); - flush(); - - ob_start(); - if(!$view || ($view && $view->getAttribute('loadPage')=='true')){ - echo "

\n\n"; - //this also implies that name is a objecttypename - foreach(lattice::config('objects', - sprintf('//objectType[@name="%s"]/elements/*', $viewName )) as $element){ - - switch($element->tagName){ - case 'list': - $this->makeListDataHtml($element, "\$content['main']"); - break; - case 'associator': - $this->makeAssociatorDataHtml($element, "\$content['main']"); - break; - default: - frontend::makeHtmlElement($element, "\$content['main']"); - break; - } - - } - - if($view && $view->getAttribute('loadPage')=='true'){ - - //Now the includeData - if($iDataNodes = lattice::config('frontend',"//view[@name=\"".$view->getAttribute('name')."\"]/includeData")){ - foreach($iDataNodes as $iDataConfig){ - $prefix = "\$content"; - $this->makeIncludeDataHtml($iDataConfig, $prefix, null); - } - } - - if($subviews = lattice::config('frontend',"//view[@name=\"".$view->getAttribute('name')."\"]/subview")){ - foreach($subviews as $subviewConfig){ - echo "\ngetAttribute('label').";?>\n"; - } - } - - } - - - - $html = ob_get_contents(); - ob_end_clean(); - $file = fopen($this->basePath.$viewName.'.php', 'w'); - fwrite($file, $html); - fclose($file); - - $createdViews[] = $viewName; - } - } - - echo 'Completed all basic object views' . "\n"; - flush(); - ob_flush(); - flush(); - - //and any virtual views - foreach(lattice::config('frontend', '//view') as $viewConfig){ - $viewName = $viewConfig->getAttribute('name'); - - if( in_array($viewName, $createdViews)){ - continue; - } - echo 'Virtual View: '.$viewName . "\n"; - flush(); - ob_flush(); - flush(); - - - touch($this->basePath.$viewName.'.php'); - - ob_start(); - //Now the includeData - - if($iDataNodes = lattice::config('frontend',"//view[@name=\"".$viewName."\"]/includeData")){ - foreach($iDataNodes as $iDataConfig){ - $prefix = "\$content"; - $this->makeIncludeDataHtml($iDataConfig, $prefix, null); - } - } - - if($subviews = lattice::config('frontend',"//view[@name=\"".$viewName."\"]/subview")){ - foreach($subviews as $subviewConfig){ - echo "\ngetAttribute('label').";?>\n"; - } - } - - - $html = ob_get_contents(); - ob_end_clean(); - $file = fopen($this->basePath.$viewName.'.php', 'w'); - fwrite($file, $html); - fclose($file); - } - - - - echo "Done\n"; - } - - public function makeListDataHtml($listDataConfig, $prefix, $indent = ''){ - $objectTypes = array(); - foreach (lattice::config('objects', 'addableObject', $listDataConfig) as $addable) { - $objectTypeName = $addable->getAttribute('objectTypeName'); - $objectTypes[$objectTypeName] = $objectTypeName; - } - - $this->makeMultiObjectTypeLoop($objectTypes, $listDataConfig->getAttribute('name'), $prefix, $indent); - - } - - //TODO: This doesn't currently support filter types that don't declare objecTypeNames or - //nor with multiple objectTypeNames per filter - public function makeAssociatorDataHtml($associatorDataConfig, $prefix, $indent = ''){ - $objectTypes = array(); - $filters = lattice::config('objects', 'filter', $associatorDataConfig); - foreach($filters as $filter){ - if($filter->getAttribute('objectTypeName')){ - $objectTypes[] = $filter->getAttribute('objectTypeName'); - } - } - - $this->makeMultiObjectTypeLoop($objectTypes, $associatorDataConfig->getAttribute('name'), $prefix, $indent); - } - - - public function makeIncludeDataHtml($iDataConfig, $prefix, $parentTemplate, $indent=''){ - $label = $iDataConfig->getAttribute('label'); - - - $objectTypes = array(); - //if slug defined, get objectType from slug - if($slug = $iDataConfig->getAttribute('slug')){ - $object = Graph::object($slug); - if(!$object->loaded()){ - //error out, - //object must be loaded from data.xml for this type of include conf - } - $objectTypes[] = $object->objecttype->objecttypename; - } - if(!count($objectTypes)){ - $objectTypes = $iDataConfig->getAttribute('objectTypeFilter'); - if($objectTypes!='all'){ - $objectTypes = explode(',', $objectTypes); - } else { - $objectTypes = array(); - } - } - - if(!count($objectTypes)){ - //no where for objectTypes - //assume that we'll have to make a good guess based off 'from' parent - $from=$iDataConfig->getAttribute('from'); - if($from=="parent"){ - - //get the info from addableObjects of the current - foreach(lattice::config('objects', sprintf('//objectType[@name="%s"]/addableObject', $parentTemplate)) as $addable){ - $objectTypeName = $addable->getAttribute('objectTypeName'); - $objectTypes[$objectTypeName] = $objectTypeName; - } - - //and we can also check all the existing data to see if it has any other objectTypes - $parentObjects = Graph::object()->objecttypeFilter($parentTemplate)->publishedFilter()->find_all(); - foreach($parentObjects as $parent){ - $children = $parent->getPublishedChildren(); - foreach($children as $child){ - $objectTypeName = $child->objecttype->objecttypename; - $objectTypes[$objectTypeName] = $objectTypeName; - } - } - } else { - //see if from is a slug - $objectTypesFromParent = $this->getChildrenObjectTypes(Graph::object($from)); - $objectTypes = array_merge($objectTypes, $objectTypesFromParent); - - - } - } - - // now $objectTypes contains all the needed objectTypes in the view - - - $this->makeMultiObjectTypeLoop($objectTypes, $label, $prefix, $indent, $iDataConfig); - } - - protected function makeMultiObjectTypeLoop($objectTypes, $label, $prefix, $indent='', $frontendNode=NULL ){ - echo $indent."

$label

\n\n"; - echo $indent."\n\n"; - } - - protected function getChildrenObjectTypes($object){ - $objectTypes = array(); - if ($object->loaded()) { - //find its addable objects - foreach (lattice::config('objects', sprintf('//objectType[@name="%s"]/addableObject', $object->objecttype->objecttypename)) as $addable) { - $objectTypeName = $addable->getAttribute('objectTypeName'); - $objectTypes[$objectTypeName] = $objectTypeName; - } - //and follow up with any existing data - $children = $object->getPublishedChildren(); - foreach ($children as $child) { - $objectTypeName = $child->objecttype->objecttypename; - $objectTypes[$objectTypeName] = $objectTypeName; - } - } - return $objectTypes; - - } -} +class Builder_Frontend extends Lattice_Builder_Frontend { } diff --git a/classes/controller/accessdenied.php b/classes/controller/accessdenied.php index 1ea248aa..0eaae993 100644 --- a/classes/controller/accessdenied.php +++ b/classes/controller/accessdenied.php @@ -1,12 +1,6 @@ -response->body($view->render()); - } } diff --git a/classes/controller/ajax.php b/classes/controller/ajax.php index 54d0568c..ed488068 100644 --- a/classes/controller/ajax.php +++ b/classes/controller/ajax.php @@ -1,180 +1,6 @@ getCode(); - $message = $e->getMessage(); - $file = $e->getFile(); - $line = $e->getLine(); - - // Get the exception backtrace - $trace = $e->getTrace(); - - ob_start(); - - // Include the exception HTML - if ($view_file = Kohana::find_file('views', Kohana_Exception::$error_view)) - { - include $view_file; - } - else - { - throw new Kohana_Exception('Error view file does not exist: views/:file', array( - ':file' => Kohana_Exception::$error_view, - )); - } - - // Display the contents of the output buffer - $message = ob_get_clean(); - return $message; - } - - public function action_data($uri) - { - //request to child, just data - $arguments = explode('/', $uri); - - try { - $subRequest = Request::Factory($uri); - $data = $subRequest->execute()->data(); - } catch (Exception $e) { - //return HTML from exception - - // Start an output buffer - - $ajaxResponse = array( - 'returnValue' => FALSE, - 'response' => $this->handleException($e), - 'arguments'=>$arguments - - ); - $this->response->headers('Content-Type', 'application/json'); - $this->response->body(json_encode($ajaxResponse)); - return; - } - $ajaxResponse = array( - 'returnValue' => TRUE, - 'response'=>$data, - 'arguments'=>$arguments - ); - $this->response->headers('Content-Type', 'application/json'); - $this->response->body(json_encode($ajaxResponse)); - $this->response->body(); - } - - public function action_html($uri) - { -// Kohana::$log->add(Log::INFO, 'Ajax html request begin'); - $arguments = explode('/', $uri); - - try { - $subRequest = Request::Factory($uri); - $html = $subRequest->execute()->body(); - } catch (Exception $e) { - //return HTML from exception - - $message = $e; - $ajaxResponse = array( - 'returnValue' => FALSE, - 'response' => $this->handleException($e), - 'arguments'=>$arguments - - ); - $this->response->headers('Content-Type', 'application/json'); - $this->response->body(json_encode($ajaxResponse)); - return; - } - - - $cssResources = array(); - foreach($this->resources['librarycss'] as $css){ - array_push($cssResources, $css); - } - foreach($this->resources['css'] as $css){ - array_push($cssResources, $css); - } - - $jsResources = array(); - foreach($this->resources['libraryjs'] as $js){ - array_push($jsResources, $js); - } - foreach($this->resources['js'] as $js){ - array_push($jsResources, $js); - } - - $ajaxResponse = array( - 'response'=>array( - 'html'=>$html, - 'js'=>$jsResources, - 'css'=>$cssResources - ), - 'returnValue' => TRUE, - 'arguments'=>$arguments - ); - $this->response->headers('Content-Type', 'application/json'); - $this->response->body(json_encode($ajaxResponse)); - } - - public function action_compound($uri) - { - $arguments = explode('/', $uri); - - try { - $subRequest = Request::Factory($uri); - $requestResponse = $subRequest->execute(); - } catch (Exception $e) { - //return HTML from exception - $message = $e; - $ajaxResponse = array( - 'returnValue' => FALSE, - 'response' => $this->handleException($e), - 'arguments'=>$arguments - ); - $this->response->headers('Content-Type', 'application/json'); - $this->response->body(json_encode($ajaxResponse)); - return; - } - - - $cssResources = array(); - foreach($this->resources['librarycss'] as $css){ - array_push($cssResources, $css); - } - foreach($this->resources['css'] as $css){ - array_push($cssResources, $css); - } - - $jsResources = array(); - foreach($this->resources['libraryjs'] as $js){ - array_push($jsResources, $js); - } - foreach($this->resources['js'] as $js){ - array_push($jsResources, $js); - } - - - $compoundResponse = array( - 'data' => $requestResponse->data(), - 'html' => $requestResponse->body(), - 'css' => $cssResources, - 'js' => $jsResources, - ); - $ajaxResponse = array( - 'returnValue' => TRUE, - 'response'=>$compoundResponse, - 'arguments'=>$arguments - ); - $this->response->headers('Content-Type', 'application/json'); - $this->response->body(json_encode($ajaxResponse)); - } - -} // End Welcome + +} // End Ajax diff --git a/classes/controller/associator.php b/classes/controller/associator.php index 682c2a41..974a990a 100644 --- a/classes/controller/associator.php +++ b/classes/controller/associator.php @@ -1,4 +1,4 @@ -action_login(); - } - - /* - * Currently not supporting public creation of users - public function action_create() - { - $this->view->title = 'Create User'; - - $form = new Forge('auth/create'); - $form->input('email')->label(TRUE)->rules('required|length[4,32]|valid_email'); - $form->input('username')->label(TRUE)->rules('required|length[4,32]'); - $form->password('password')->label(TRUE)->rules('required|length[5,40]'); - $form->submit('Create New User'); - - if ($form->validate()) - { - // Create new user - $user = ORM::factory('user'); - - if ( ! $user->username_exists($form->username->value)) - { - foreach ($form->as_array() as $key => $val) - { - // Set user data - $user->$key = $val; - } - - if ($user->save() AND $user->add(ORM::factory('role', 'login'))) - { - Auth::instance()->login($user, $form->password->value); - - // Redirect to the login object - Request::current()->redirect('auth/login'); - } - - } else { - } - } - - $this->view = new View('auth/create'); - $this->view->content = $form->render(); - } - */ - - public function action_login($redirect = null) - { - - - $error = null; - - /* - * Switch to validate library - $form->input('username')->label(TRUE)->rules('required|length[4,32]'); - $form->password('password')->label(TRUE)->rules('required|length[5,40]'); - */ - - $formValues = $_POST; - if (isset($formValues['submit']) ) - { - // Load the user - if (Auth::instance()->login($formValues['username'], $formValues['password'])) - { - // Login successful, redirect - //somewhere in here we can hang extra values for user roles - //just override auth.redirect or something - $authredirect = Kohana::config('auth.redirect'); - - if($formValues['redirect']){ - Request::current()->redirect(url::site($formValues['redirect'],Request::current()->protocol(),false)); - } else if($redirect = $authredirect){ - Request::current()->redirect(url::site($redirect,Request::current()->protocol(),false)); - } else { - Request::current()->redirect(url::site('auth/login',Request::current()->protocol(),false)); - } - return; - } - else - { - $error = 'Invalid username or password.'; - } - } - - if (isset($_GET["redirect"])){ - $redirect = $_GET["redirect"]; - } - - $view = new View('auth/login'); - - if($redirect == 'resetPasswordSuccess'){ - $view->message = I18n::get('resetPasswordSuccess'); - $redirect = null; - } else if($error){ - $view->message = $error; - } - $view->title = 'User Login'; - - if(!$redirect){ - if(isset($formValues['redirect'])){ - $redirect = $formValues['redirect']; - } - } - $view->redirect = $redirect; - $this->response->body($view->render()); - - } - - public function action_logout() - { - // Force a complete logout - Auth::instance()->logout(TRUE); - - // Redirect back to the login object - Request::current()->redirect(url::site('auth/login',Request::current()->protocol(),false)); - - } - - public function action_noaccess($controller = NULL){ - $this->message = 'You do not have access to the requested object'; - $this->login($controller); - } - - public function action_forgot(){ - if(isset($_POST['email'])){ - $user = ORM::Factory('user')->where('email', '=', $_POST['email'])->find(); - if($user->loaded() ){ - $password = Utility_Auth::randomPassword(); - $user->password = $password; - $user->save(); - $body = I18n::get('forgotPasswordEmailBody'); - $body = str_replace('___Lattice___username___Lattice___', $user->username, $body); - $body = str_replace('___Lattice___password___Lattice___', $password, $body); - - mail($user->email, I18n::get('forgotPasswordEmailSubject'), $body); - Request::current()->redirect('auth/login/resetPasswordSuccess'); - - } else { - $view = new View('auth/forgot'); - $view->message = I18n::get('resetPasswordFailed'); - - } - } else { - $view = new View('auth/forgot'); - } - $this->response->body($view); - } - - - -} // End Auth Controller +} // End Auth Controller diff --git a/classes/controller/authstatus.php b/classes/controller/authstatus.php index 42047a9e..56533c2f 100755 --- a/classes/controller/authstatus.php +++ b/classes/controller/authstatus.php @@ -1,19 +1,8 @@ -get_user()){ - $view->username = Auth::instance()->get_user()->username; - } - $this->response->body($view->render()); - } } diff --git a/classes/controller/builder.php b/classes/controller/builder.php index 73d56297..d2601c68 100755 --- a/classes/controller/builder.php +++ b/classes/controller/builder.php @@ -1,316 +1,5 @@ -rootNodeObjectType = Kohana::config('cms.graphRootNode'); - - } - - public function destroy($dir) { - $mydir = opendir($dir); - while(false !== ($file = readdir($mydir))) { - if($file != "." && $file != "..") { - // chmod($dir.$file, 0777); - if(is_dir($dir.$file)) { - chdir('.'); - destroy($dir.$file.'/'); - rmdir($dir.$file) or DIE("couldn't delete $dir$file
"); - } - else - unlink($dir.$file) or DIE("couldn't delete $dir$file
"); - } - } - closedir($mydir); - } - - public function action_initializeSite($xmlFile='data'){ - - $mtime = microtime(); - $mtime = explode(' ', $mtime); - $mtime = $mtime[1] + $mtime[0]; - $starttime = $mtime; - - - if(Kohana::config('lattice.live')){ - die('builder/initializeSite is disabled on sites marked live'); - } - - //clean out media dir - $this->destroy('application/media/'); - - $db = Database::instance(); - $db->query(Database::DELETE, 'delete from objects'); - $db->query(Database::UPDATE, 'alter table objects AUTO_INCREMENT = 1'); - $db->query(Database::DELETE, 'delete from contents'); - $db->query(Database::UPDATE, 'alter table contents AUTO_INCREMENT = 1'); - $db->query(Database::DELETE, 'delete from objecttypes'); - $db->query(Database::UPDATE, 'alter table objecttypes AUTO_INCREMENT = 1'); - $db->query(Database::DELETE, 'delete from objectmaps'); - $db->query(Database::UPDATE, 'alter table objectmaps AUTO_INCREMENT = 1'); - $db->query(Database::DELETE, 'delete from objectrelationships'); - $db->query(Database::UPDATE, 'alter table objectrelationships AUTO_INCREMENT = 1'); - $db->query(Database::DELETE, 'delete from objectelementrelationships'); - $db->query(Database::UPDATE, 'alter table objectelementrelationships AUTO_INCREMENT = 1'); - $db->query(Database::DELETE, 'delete from rosettas'); - $db->query(Database::UPDATE, 'alter table rosettas AUTO_INCREMENT = 1'); - $db->query(Database::DELETE, 'delete from tags'); - $db->query(Database::UPDATE, 'alter table tags AUTO_INCREMENT = 1'); - $db->query(Database::DELETE, 'delete from objects_tags'); - $db->query(Database::UPDATE, 'alter table objects_tags AUTO_INCREMENT = 1'); - $db->query(Database::DELETE, 'delete from tags_tagbuckets'); - $db->query(Database::UPDATE, 'alter table tags_tagbuckets AUTO_INCREMENT = 1'); - flush(); - ob_flush(); - - //immediately reinitialize the graph - Graph::configureObjectType($this->rootNodeObjectType, true); - Graph::addRootNode($this->rootNodeObjectType); - - if($xmlFile != 'data'){ - //then we are loading an export - $xmlFile = 'application/export/'.$xmlFile.'/'.$xmlFile.'.xml'; - } - echo "\nInserting Data\n"; - $this->insertData($xmlFile, NULL, lattice::config($xmlFile, 'nodes')->item(0) ); - - latticecms::regenerateImages(); - - $this->insertRelationships($xmlFile); - - //and run frontend - echo "\n Regenerating Frontend"; - $this->action_frontend(); - - - $memoryUseFollowingAction = memory_get_usage(true); - - $mtime = microtime(); - $mtime = explode(" ", $mtime); - $mtime = $mtime[1] + $mtime[0]; - $endtime = $mtime; - $totaltime = ($endtime - $starttime); - echo ' + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lattice/cmsModules.dtd b/lattice/cmsModules.dtd deleted file mode 100755 index a6f7a396..00000000 --- a/lattice/cmsModules.dtd +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - diff --git a/lattice/cmsModules.xml b/lattice/cmsModules.xml deleted file mode 100644 index dddb43c8..00000000 --- a/lattice/cmsModules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/lattice/objects.dtd b/lattice/objects.dtd index d5415179..5edb22bf 100755 --- a/lattice/objects.dtd +++ b/lattice/objects.dtd @@ -31,7 +31,7 @@ initialAccessRoles CDATA #IMPLIED > - + @@ -72,6 +72,11 @@ > + + + diff --git a/views/LayoutAdmin.php b/views/LayoutAdmin.php index db8ec4d5..10914be2 100644 --- a/views/LayoutAdmin.php +++ b/views/LayoutAdmin.php @@ -10,7 +10,10 @@
-execute()->body();?> +execute()->body(); +?> execute()->body();?>
diff --git a/views/auth/forgot.php b/views/auth/forgot.php index 19ec2b63..fbfc908e 100755 --- a/views/auth/forgot.php +++ b/views/auth/forgot.php @@ -2,7 +2,7 @@