PHP Classes
elePHPant
Icontem

File: view.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Abbey Sparrow  >  Datalus  >  view.php  >  Download  
File: view.php
Role: Example script
Content type: text/plain
Description: script to view & edit objects
Class: Datalus
Build Web applications from XML definitions
Author: By
Last change:
Date: 8 years ago
Size: 1,883 bytes
 

Contents

Class file image Download
<?php
   
require("Datalus.php");
   
   
$renderer = new PageRenderer();
   
$xml = "";
    if(
$_REQUEST['type']){
        if(
$_REQUEST['id'] || $_REQUEST['edit']){
           
$wrangler = new ObjectWrangler($_REQUEST['type']);
            if(
$_REQUEST['id']){
                if(
$_REQUEST['edit'] && $wrangler->canEdit()){
                   
// editing existing object
                   
if(!$_REQUEST['submit']){
                       
$renderer->setEditable(true);
                       
$wrangler->setEditable(true);
                    }
                   
//echo("edit");
               
}else{
                   
// viewing existing object (loading handled in wrangler)
                    //echo("view");
               
}
            }else{
               
//echo("new");
               
if(!$_REQUEST['submit']){
                   
$renderer->setEditable(true);
                   
$wrangler->setEditable(true);
                }
               
//making new object
           
}
        }elseif(
$_REQUEST['list'] == "full"){
           
$wrangler = new BatchWrangler($_REQUEST['type'], getCatProp('default_order'));
        }else{
           
$wrangler = new BatchWrangler($_REQUEST['type'], getCatProp('default_order'));
           
$wrangler->setToSummary();
        }
        if(
$_REQUEST['axis']) $wrangler->setAxis($_REQUEST['axis']);
       
$xml = $wrangler->display();
    }else{
       
alert("Type required for viewing of objects, showing default listing.");
    }
   
$renderer->addMenuXML($catses->makeCatalystMenu()->XML(""));
   
$renderer->addMenuXML($catses->makeMenu("Navigation")->XML(""));
   
$renderer->wrapperStaticXML($catses->getGreeting());
   
$renderer->wrapperFooterXML($renderer->renderCopyright());
   
$renderer->wrapperJavascriptXML($catses->getVerifierJS());
   
$renderer->wrapperItemXML($xml);
    echo(
$renderer->render());
?>