Location: PHPKode > projects > Entier Studio > entierstudio/studio/handlers/ctrl.DeploymentComponent.php
<?php
/**
 * Entier Studio
 *
 * LICENSE
 *
 *	Copyright 2006 Entier Studio team.
 *
 *	Licensed under the Apache License, Version 2.0 (the "License");
 *	you may not use this file except in compliance with the License.
 *	You may obtain a copy of the License at
 *		http://www.apache.org/licenses/LICENSE-2.0
 *
 *	Unless required by applicable law or agreed to in writing, software
 *	distributed under the License is distributed on an "AS IS" BASIS,
 *	WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *	See the License for the specific language governing permissions and
 *	limitations under the License.
 *
 * @package    entier.studio
 * @copyright  Copyright (c) 2006 Entier Studio team. All rights reserved.
 * @version	   $Id: ctrl.DeploymentComponent.php 81 2008-01-17 23:08:21Z yannromefort $
 */
//-------------------------------------------------------------------------
// Safe mode
if (!defined('__ENTIER_FRONT_CONTROLLER__')) die(403);
//
//-------------------------------------------------------------------------
//	View Handler
//
@include_once (COMPONENTS_VIEW . "view.ObjectoryComponentExporter.php");
//
$componentView = new ObjectoryComponentExporter();
//
//	Mode Handler
//
$viewMode = NULLVIEW;
$failMode = NULLVIEW;
$viewHTML = "";
$failHTML = "";
$formMark = "";
//
switch ($__mode) {
    case "form":
        //
        $viewMode = FORMVIEW;
        $viewHTML = "$__ctrl-$__view.html";
        //
        $componentView->set_field_value("OBJELEMPKID", $userRequest->Parameter("pkid"));
        $componentView->set_field_value("OBJCOMPPKID", $userRequest->Parameter("bind"));
        $componentView->set_field_value("OBJETYPPKID", $userRequest->Parameter("type"));
        //
        
    break;
    case "view":
        //
        $componentView->set_field_value("OBJCOMPPKID", $userRequest->Parameter("pkid"));
        $componentView->set_field_value("OBJCTYPPKID", $userRequest->Parameter("type"));
        //
        switch ($__view) {
            case "view":
                //
                $viewMode = ITEMVIEW;
                $viewHTML = "$__ctrl-$__view.html";
                //
                
            break;
            case "frame":
                //
                $viewMode = FRAMEVIEW;
                $viewHTML = "$__ctrl-$__view.html";
                //
                
            break;
            case "code":
                //
                $viewMode = CODEVIEW;
                //
                $componentView->set_field_value("OBJCRELPKID", $userRequest->Parameter("pkid"));
                //
                
            break;
            case "proc":
                //
                $viewMode = PROCVIEW;
                $viewHTML = "$__ctrl-$__view.html";
                //
                $componentView->set_field_value("OBJRESOPKID", $userRequest->Parameter("host"));
                //
                
            break;
        }
        //
        
    break;
    case "list":
        //
        $viewMode = LISTVIEW;
        $viewHTML = "$__ctrl-$__view.html";
        $formMark = "list";
        //
        $componentView->set_field_value("OBJCOMPPKID", $userRequest->Parameter("pkid"));
        //
        
    break;
    case "grid":
        //
        $viewMode = GRIDVIEW;
        $viewHTML = "$__ctrl-$__view.html";
        $formMark = "list";
        //
        $componentView->set_field_value("OBJRRELMILE", $userRequest->Parameter("fkid"));
        //
        
    break;
    case "tree":
        //
        $viewMode = TREEVIEW;
        $viewHTML = "$__ctrl-$__view.html";
        $formMark = array(
            "tree",
            "list"
        );
        //
        $componentView->set_field_value("OBJCOMPPKID", $userRequest->Parameter("pkid"));
        $componentView->set_field_value("OBJCTYPPKID", $userRequest->Parameter("type"));
        //
        
    break;
}
//
//-------------------------------------------------------------------------
//	Display View
//
if ($componentView->renderView($database, $template, $viewHTML, $formMark, $viewMode) == false) {
    if ($componentView->get_error_count() > 0) {
        //
        $viewMode = FAILVIEW;
        $viewHTML = "action.errors.html";
        //
        @include_once (FRAMEWORK_VIEW . "view.ExceptionView.php");
        //
        $exceptionView = new ExceptionView($componentView->errorSet());
        $exceptionView->renderView($viewHTML, $formMark, $viewMode);
    }
}
//
//-------------------------------------------------------------------------
?>
Return current item: Entier Studio