Added new (clean) yii boilerplate
This commit is contained in:
16
framework/gii/views/common/code.php
Normal file
16
framework/gii/views/common/code.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
if($file->type==='php')
|
||||
{
|
||||
echo '<div class="content">';
|
||||
highlight_string($file->content);
|
||||
echo '</div>';
|
||||
}
|
||||
elseif(in_array($file->type,array('txt','js','css')))
|
||||
{
|
||||
echo '<div class="content">';
|
||||
echo nl2br($file->content);
|
||||
echo '</div>';
|
||||
}
|
||||
else
|
||||
echo '<div class="error">Preview is not available for this file type.</div>';
|
||||
?>
|
||||
9
framework/gii/views/common/diff.php
Normal file
9
framework/gii/views/common/diff.php
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php if($diff===false): ?>
|
||||
<div class="error">Diff is not supported for this file type.</div>
|
||||
<?php elseif(empty($diff)): ?>
|
||||
<div class="error">No changes.</div>
|
||||
<?php else: ?>
|
||||
<div class="content">
|
||||
<pre class="diff"><?php echo $diff; ?></pre>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
76
framework/gii/views/common/generator.php
Normal file
76
framework/gii/views/common/generator.php
Normal file
@@ -0,0 +1,76 @@
|
||||
<div class="row template sticky">
|
||||
<?php echo $this->labelEx($model,'template'); ?>
|
||||
<?php echo $this->dropDownList($model,'template',$templates); ?>
|
||||
<div class="tooltip">
|
||||
Please select which set of the templates should be used to generated the code.
|
||||
</div>
|
||||
<?php echo $this->error($model,'template'); ?>
|
||||
</div>
|
||||
|
||||
<div class="buttons">
|
||||
<?php echo CHtml::submitButton('Preview',array('name'=>'preview')); ?>
|
||||
|
||||
<?php if($model->status===CCodeModel::STATUS_PREVIEW && !$model->hasErrors()): ?>
|
||||
<?php echo CHtml::submitButton('Generate',array('name'=>'generate')); ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<?php if(!$model->hasErrors()): ?>
|
||||
<div class="feedback">
|
||||
<?php if($model->status===CCodeModel::STATUS_SUCCESS): ?>
|
||||
<div class="success">
|
||||
<?php echo $model->successMessage(); ?>
|
||||
</div>
|
||||
<?php elseif($model->status===CCodeModel::STATUS_ERROR): ?>
|
||||
<div class="error">
|
||||
<?php echo $model->errorMessage(); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if(isset($_POST['generate'])): ?>
|
||||
<pre class="results"><?php echo $model->renderResults(); ?></pre>
|
||||
<?php elseif(isset($_POST['preview'])): ?>
|
||||
<?php echo CHtml::hiddenField("answers"); ?>
|
||||
<table class="preview">
|
||||
<tr>
|
||||
<th class="file">Code File</th>
|
||||
<th class="confirm">
|
||||
<label for="check-all">Generate</label>
|
||||
<?php
|
||||
$count=0;
|
||||
foreach($model->files as $file)
|
||||
{
|
||||
if($file->operation!==CCodeFile::OP_SKIP)
|
||||
$count++;
|
||||
}
|
||||
if($count>1)
|
||||
echo '<input type="checkbox" name="checkAll" id="check-all" />';
|
||||
?>
|
||||
</th>
|
||||
</tr>
|
||||
<?php foreach($model->files as $i=>$file): ?>
|
||||
<tr class="<?php echo $file->operation; ?>">
|
||||
<td class="file">
|
||||
<?php echo CHtml::link(CHtml::encode($file->relativePath), array('code','id'=>$i), array('class'=>'view-code','rel'=>$file->path)); ?>
|
||||
<?php if($file->operation===CCodeFile::OP_OVERWRITE): ?>
|
||||
(<?php echo CHtml::link('diff', array('diff','id'=>$i), array('class'=>'view-code','rel'=>$file->path)); ?>)
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td class="confirm">
|
||||
<?php
|
||||
if($file->operation===CCodeFile::OP_SKIP)
|
||||
echo 'unchanged';
|
||||
else
|
||||
{
|
||||
$key=md5($file->path);
|
||||
echo CHtml::label($file->operation, "answers_{$key}")
|
||||
. ' ' . CHtml::checkBox("answers[$key]", $model->confirmed($file));
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
5
framework/gii/views/default/error.php
Normal file
5
framework/gii/views/default/error.php
Normal file
@@ -0,0 +1,5 @@
|
||||
<h1>Error <?php echo $code; ?></h1>
|
||||
|
||||
<div class="error">
|
||||
<?php echo CHtml::encode($message); ?>
|
||||
</div>
|
||||
11
framework/gii/views/default/index.php
Normal file
11
framework/gii/views/default/index.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<h1>Welcome to Yii Code Generator!</h1>
|
||||
|
||||
<p>
|
||||
You may use the following generators to quickly build up your Yii application:
|
||||
</p>
|
||||
<ul>
|
||||
<?php foreach($this->module->controllerMap as $name=>$config): ?>
|
||||
<li><?php echo CHtml::link(ucwords(CHtml::encode($name).' generator'),array($name.'/index'));?></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
|
||||
11
framework/gii/views/default/login.php
Normal file
11
framework/gii/views/default/login.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<div class="form login">
|
||||
<?php $form=$this->beginWidget('CActiveForm'); ?>
|
||||
<p>Please enter your password</p>
|
||||
|
||||
<?php echo $form->passwordField($model,'password'); ?>
|
||||
<?php echo $form->error($model,'password'); ?>
|
||||
|
||||
<?php echo CHtml::submitButton('Enter'); ?>
|
||||
|
||||
<?php $this->endWidget(); ?>
|
||||
</div><!-- form -->
|
||||
7
framework/gii/views/layouts/column1.php
Normal file
7
framework/gii/views/layouts/column1.php
Normal file
@@ -0,0 +1,7 @@
|
||||
<?php $this->beginContent('gii.views.layouts.main'); ?>
|
||||
<div class="container">
|
||||
<div id="content">
|
||||
<?php echo $content; ?>
|
||||
</div><!-- content -->
|
||||
</div>
|
||||
<?php $this->endContent(); ?>
|
||||
25
framework/gii/views/layouts/generator.php
Normal file
25
framework/gii/views/layouts/generator.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php $this->beginContent('gii.views.layouts.main'); ?>
|
||||
<div class="container">
|
||||
<div class="span-4">
|
||||
<div id="sidebar">
|
||||
<?php $this->beginWidget('zii.widgets.CPortlet', array(
|
||||
'title'=>'Generators',
|
||||
)); ?>
|
||||
<ul>
|
||||
<?php foreach($this->module->controllerMap as $name=>$config): ?>
|
||||
<li><?php echo CHtml::link(ucwords(CHtml::encode($name).' generator'),array($name.'/index'));?></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php $this->endWidget(); ?>
|
||||
</div><!-- sidebar -->
|
||||
</div>
|
||||
<div class="span-16">
|
||||
<div id="content">
|
||||
<?php echo $content; ?>
|
||||
</div><!-- content -->
|
||||
</div>
|
||||
<div class="span-4 last">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<?php $this->endContent(); ?>
|
||||
57
framework/gii/views/layouts/main.php
Normal file
57
framework/gii/views/layouts/main.php
Normal file
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
$cs=Yii::app()->clientScript;
|
||||
$cs->coreScriptPosition=CClientScript::POS_HEAD;
|
||||
$cs->scriptMap=array();
|
||||
$baseUrl=$this->module->assetsUrl;
|
||||
$cs->registerCoreScript('jquery');
|
||||
$cs->registerScriptFile($baseUrl.'/js/tooltip.js');
|
||||
$cs->registerScriptFile($baseUrl.'/js/fancybox/jquery.fancybox-1.3.1.pack.js');
|
||||
$cs->registerCssFile($baseUrl.'/js/fancybox/jquery.fancybox-1.3.1.css');
|
||||
?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="language" content="en" />
|
||||
|
||||
<!-- blueprint CSS framework -->
|
||||
<link rel="stylesheet" type="text/css" href="<?php echo $this->module->assetsUrl; ?>/css/screen.css" media="screen, projection" />
|
||||
<link rel="stylesheet" type="text/css" href="<?php echo $this->module->assetsUrl; ?>/css/print.css" media="print" />
|
||||
<!--[if lt IE 8]>
|
||||
<link rel="stylesheet" type="text/css" href="<?php echo $this->module->assetsUrl; ?>/css/ie.css" media="screen, projection" />
|
||||
<![endif]-->
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="<?php echo $this->module->assetsUrl; ?>/css/main.css" />
|
||||
|
||||
<title><?php echo CHtml::encode($this->pageTitle); ?></title>
|
||||
|
||||
<script type="text/javascript" src="<?php echo $this->module->assetsUrl; ?>/js/main.js"></script>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="container" id="page">
|
||||
<div id="header">
|
||||
<div class="top-menus">
|
||||
<?php echo CHtml::link('help','http://www.yiiframework.com/doc/guide/topics.gii'); ?> |
|
||||
<?php echo CHtml::link('webapp',Yii::app()->homeUrl); ?> |
|
||||
<a href="http://www.yiiframework.com">yii</a>
|
||||
<?php if(!Yii::app()->user->isGuest): ?>
|
||||
| <?php echo CHtml::link('logout',array('default/logout')); ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div id="logo"><?php echo CHtml::link(CHtml::image($this->module->assetsUrl.'/images/logo.png'),array('default/index')); ?></div>
|
||||
</div><!-- header -->
|
||||
|
||||
<?php echo $content; ?>
|
||||
|
||||
</div><!-- page -->
|
||||
|
||||
<div id="footer">
|
||||
<?php echo Yii::powered(); ?>
|
||||
<br/>A product of <a href="http://www.yiisoft.com">Yii Software LLC</a>.
|
||||
</div><!-- footer -->
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user