<?php
/**
 * appRain CMF
 *
 * LICENSE
 *
 * This source file is subject to the MIT license that is bundled
 * with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://www.opensource.org/licenses/mit-license.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@apprain.com so we can send you a copy immediately.
 *
 * @copyright  Copyright (c) 2010 appRain, Team. (http://www.apprain.com)
 * @license    http://www.opensource.org/licenses/mit-license.php MIT license
 *
 * HELP
 *
 * Official Website
 * http://www.apprain.com/
 *
 * Download Link
 * http://www.apprain.com/download
 *
 * Documents Link
 * http ://www.apprain.com/docs
 */
 ?>
 <?php App::Helper('Toolbar')->setTitle("MVC Manager")->setBtnBack()->Render(array('code'=>'mvc_manager_list_top')); ?>
 <?php $i=0; foreach( $mvcdata as $mvckey => $mvcval ):?>
            <h3 <?php if(!$i):?>class="first"<?php endif;?>
				><?php echo $mvckey; ?> (<?php echo $mvcval['model']['version']; ?>)</h3>
                    <?php
                        $Grid = App::Module('DataGrid')->clear()->setDisplay('FormListing');
                        $Grid->addRow("Model Name",$mvcval['model']['name']/* . " " . App::Load("Helper/Html")->linkTag( $this->baseurl("/developer/editor/" . base64_encode($mvcval['model']["path"]) . "/" . base64_encode(strtolower($mvcval['model']["name"]) . ".php")),"Edit")*/)
                             ->addRow("Model Version",$mvcval['model']['version'])
                             ->addRow("Model Table",($mvcval['model']['db_table']) ? $mvcval['model']['db_table'] : "<span style=\"color:#FF0000\">No Available</span>");

                        if( $mvcval['model']['insteller']['exists'] ):
                            $Grid->addRow("Installer","Yes");
                        else:
                            $Grid->addRow("Installer","<span style=\"color:#FF0000\">No Available</span>");
                        endif;
						/*
                        if($mvcval['controller']['exists']) :
                            $Grid->addRow("Controller Name",$mvcval['controller']['name']);
                        else:
                            $Grid->addRow("Controller Status","<span style=\"color:#FF0000\">No Available</span>");
                        endif;

                        if($mvcval['view']['exists']) :
                            $Grid->addRow("Total Views",count($mvcval['view']['files']));
                            $str = "";
                            foreach( $mvcval['view']['files'] as $val )
                            {
                                $str .= ($str!="" )  ? $this->get_tag("br","/") : $str;
                                $str .=  $val['file_name'];// . " ".  App::Load("Helper/Html")->linkTag( $this->baseurl("/developer/editor/" . base64_encode($val["path"]) . "/" . base64_encode($val["file_name"])),"Edit") . " " . App::Load("Helper/Html")->linkTag($val['url'],"View");
                            }
                            $Grid->addRow("Manage Views","{$str} ");
                        else:
                            $Grid->addRow("View Status","<span style=\"color:#FF0000\">No Available</span>");
                        endif;*/
                        $Grid->Render();
                        ?>
    <?php $i++; endforeach; ?>
    <?php App::Helper('Toolbar')->setBtnBack()->Render(array('code'=>'mvc_manager_list_bottom')); ?>