diff options
Diffstat (limited to 'protected/modules/cms/views/sitecontent')
| -rw-r--r-- | protected/modules/cms/views/sitecontent/_form.php | 105 | ||||
| -rw-r--r-- | protected/modules/cms/views/sitecontent/_search.php | 49 | ||||
| -rw-r--r-- | protected/modules/cms/views/sitecontent/_short.php | 34 | ||||
| -rw-r--r-- | protected/modules/cms/views/sitecontent/_view.php | 34 | ||||
| -rw-r--r-- | protected/modules/cms/views/sitecontent/admin.php | 71 | ||||
| -rw-r--r-- | protected/modules/cms/views/sitecontent/create.php | 21 | ||||
| -rw-r--r-- | protected/modules/cms/views/sitecontent/draw.php | 4 | ||||
| -rw-r--r-- | protected/modules/cms/views/sitecontent/index.php | 25 | ||||
| -rw-r--r-- | protected/modules/cms/views/sitecontent/results.php | 19 | ||||
| -rw-r--r-- | protected/modules/cms/views/sitecontent/update.php | 18 | ||||
| -rw-r--r-- | protected/modules/cms/views/sitecontent/view.php | 47 |
11 files changed, 427 insertions, 0 deletions
diff --git a/protected/modules/cms/views/sitecontent/_form.php b/protected/modules/cms/views/sitecontent/_form.php new file mode 100644 index 0000000..6c8d056 --- /dev/null +++ b/protected/modules/cms/views/sitecontent/_form.php @@ -0,0 +1,105 @@ +<?php +if(Yii::app()->getModule('cms')->rtepath != false) +Yii::app()->clientScript-> registerScriptFile(Yii::app()->getModule('cms')->rtepath, CClientScript::POS_HEAD); +if(Yii::app()->getModule('cms')->rteadapter != false) +Yii::app()->clientScript-> registerScriptFile(Yii::app()->getModule('cms')->rteadapter, CClientScript::POS_HEAD); + +?> + +<div class="form"> + +<?php $form=$this->beginWidget('CActiveForm', array( + 'id'=>'sitecontent-form', + 'enableAjaxValidation'=>true, + )); ?> + +<?php echo $form->errorSummary($model); ?> + +<div class="row"> +<?php echo $form->labelEx($model,'parent'); ?> +<?php echo CHtml::activeDropDownList($model, + 'parent', + CHtml::listData(Sitecontent::model()->findAll(), + 'id', + 'title'), + array( + 'empty' => array( + '0' => ' - '))); ?> +<?php echo $form->error($model,'header'); ?> +</div> + +<div class="row" style="float:right;"> +<?php echo $form->labelEx($model,'position'); ?> +<?php for($i = 0; $i < 10; $i++) $position[] = $i; ?> +<?php echo CHtml::dropDownList('Sitecontent[position]', + $model->position, + $position); ?> +<?php echo $form->error($model,'position'); ?> +</div> + +<div class="row"> +<?php echo $form->labelEx($model,'id'); ?> +<?php echo $form->textField($model,'id',array('size'=>5,'maxlength'=>11)); ?> +<?php echo $form->error($model,'id'); ?> +</div> + + +<div class="row"> +<?php echo $form->labelEx($model,'title'); ?> +<?php echo $form->textField($model,'title',array('size'=>60,'maxlength'=>255)); ?> +<?php echo $form->error($model,'title'); ?> +</div> + +<div class="row"> +<?php echo $form->labelEx($model,'keywords'); ?> +<?php echo $form->textField($model,'keywords',array('size'=>60,'maxlength'=>255)); ?> +<?php echo $form->error($model,'keywords'); ?> +</div> + +<div class="row"> +<?php echo $form->labelEx($model,'description'); ?> +<?php echo $form->textField($model,'description',array('size'=>60,'maxlength'=>255)); ?> +<?php echo $form->error($model,'description'); ?> +</div> + +<div class="row"> +<?php echo $form->labelEx($model,'title_browser'); ?> +<?php echo $form->textField($model,'title_browser',array('size'=>60,'maxlength'=>80)); ?> +<?php echo $form->error($model,'title_browser'); ?> +</div> + +<div class="row"> +<?php echo $form->labelEx($model,'title_url'); ?> +<?php echo $form->textField($model,'title_url',array('size'=>60,'maxlength'=>80)); ?> +<?php echo $form->error($model,'title_url'); ?> +</div> + +<div class="row"> +<?php echo $form->labelEx($model,'language'); ?> +<?php echo $form->dropDownList($model,'language',Yii::app()->controller->module->languages); ?> +<?php echo $form->error($model,'language'); ?> +</div> + + +<div class="row"> +<?php echo $form->labelEx($model,'content'); ?> +<?php $this->widget('application.extensions.extckeditor.ExtCKEditor', array( +'model'=>$model, +'attribute'=>'content', // model atribute +'language'=>'DE', /* default lang, If not declared the language of the project will be used in case of using multiple languages */ +'editorTemplate'=>'full', // Toolbar settings (full, basic, advanced) +)); ?> +<?php //echo $form->textArea($model,'content',array('rows'=>6, 'cols'=>50)); ?> +<?php //Yii::app()->clientScript->registerScript("ckeditor", "$('#Sitecontent_content').ckeditor();"); ?> +<?php echo $form->error($model,'content'); ?> +</div> + +<div class="row buttons"> +<?php echo CHtml::submitButton($model->isNewRecord + ? Yii::t('CmsModule.cms', 'Create sitecontent') + : Yii::t('CmsModule.cms', 'Save sitecontent')); ?> +</div> + +<?php $this->endWidget(); ?> + +</div><!-- form --> diff --git a/protected/modules/cms/views/sitecontent/_search.php b/protected/modules/cms/views/sitecontent/_search.php new file mode 100644 index 0000000..e67934a --- /dev/null +++ b/protected/modules/cms/views/sitecontent/_search.php @@ -0,0 +1,49 @@ +<div class="wide form"> + +<?php $form=$this->beginWidget('CActiveForm', array( + 'action'=>Yii::app()->createUrl($this->route), + 'method'=>'get', +)); ?> + + <div class="row"> + <?php echo $form->label($model,'id'); ?> + <?php echo $form->textField($model,'id'); ?> + </div> + + <div class="row"> + <?php echo $form->label($model,'position'); ?> + <?php echo $form->textField($model,'position'); ?> + </div> + + <div class="row"> + <?php echo $form->label($model,'title'); ?> + <?php echo $form->textField($model,'title',array('size'=>60,'maxlength'=>255)); ?> + </div> + + <div class="row"> + <?php echo $form->label($model,'content'); ?> + <?php echo $form->textArea($model,'content',array('rows'=>6, 'cols'=>50)); ?> + </div> + + <div class="row"> + <?php echo $form->label($model,'authorid'); ?> + <?php echo $form->textField($model,'authorid'); ?> + </div> + + <div class="row"> + <?php echo $form->label($model,'createtime'); ?> + <?php echo $form->textField($model,'createtime'); ?> + </div> + + <div class="row"> + <?php echo $form->label($model,'updatetime'); ?> + <?php echo $form->textField($model,'updatetime'); ?> + </div> + + <div class="row buttons"> + <?php echo CHtml::submitButton(Yii::t('App','Search')); ?> + </div> + +<?php $this->endWidget(); ?> + +</div><!-- search-form --> diff --git a/protected/modules/cms/views/sitecontent/_short.php b/protected/modules/cms/views/sitecontent/_short.php new file mode 100644 index 0000000..0352c04 --- /dev/null +++ b/protected/modules/cms/views/sitecontent/_short.php @@ -0,0 +1,34 @@ +<div class="view"> + + <b><?php echo CHtml::encode($data->getAttributeLabel('id')); ?>:</b> + <?php echo CHtml::link(CHtml::encode($data->id), array('view', 'id'=>$data->id)); ?> + <br /> + + <b><?php echo CHtml::encode($data->getAttributeLabel('position')); ?>:</b> + <?php echo CHtml::encode($data->position); ?> + <br /> + + <b><?php echo CHtml::encode($data->getAttributeLabel('title')); ?>:</b> + <?php echo CHtml::encode($data->title); ?> + <br /> + + <b><?php echo CHtml::encode($data->getAttributeLabel('content')); ?>:</b> + <?php echo CHtml::encode($data->content); ?> + <br /> + + <b><?php echo CHtml::encode($data->getAttributeLabel('authorid')); ?>:</b> + <?php echo CHtml::encode($data->authorid); ?> + <br /> + + <b><?php echo CHtml::encode($data->getAttributeLabel('createtime')); ?>:</b> + <?php echo CHtml::encode($data->createtime); ?> + <br /> + + <?php /* + <b><?php echo CHtml::encode($data->getAttributeLabel('updatetime')); ?>:</b> + <?php echo CHtml::encode($data->updatetime); ?> + <br /> + + */ ?> + +</div> diff --git a/protected/modules/cms/views/sitecontent/_view.php b/protected/modules/cms/views/sitecontent/_view.php new file mode 100644 index 0000000..0352c04 --- /dev/null +++ b/protected/modules/cms/views/sitecontent/_view.php @@ -0,0 +1,34 @@ +<div class="view"> + + <b><?php echo CHtml::encode($data->getAttributeLabel('id')); ?>:</b> + <?php echo CHtml::link(CHtml::encode($data->id), array('view', 'id'=>$data->id)); ?> + <br /> + + <b><?php echo CHtml::encode($data->getAttributeLabel('position')); ?>:</b> + <?php echo CHtml::encode($data->position); ?> + <br /> + + <b><?php echo CHtml::encode($data->getAttributeLabel('title')); ?>:</b> + <?php echo CHtml::encode($data->title); ?> + <br /> + + <b><?php echo CHtml::encode($data->getAttributeLabel('content')); ?>:</b> + <?php echo CHtml::encode($data->content); ?> + <br /> + + <b><?php echo CHtml::encode($data->getAttributeLabel('authorid')); ?>:</b> + <?php echo CHtml::encode($data->authorid); ?> + <br /> + + <b><?php echo CHtml::encode($data->getAttributeLabel('createtime')); ?>:</b> + <?php echo CHtml::encode($data->createtime); ?> + <br /> + + <?php /* + <b><?php echo CHtml::encode($data->getAttributeLabel('updatetime')); ?>:</b> + <?php echo CHtml::encode($data->updatetime); ?> + <br /> + + */ ?> + +</div> diff --git a/protected/modules/cms/views/sitecontent/admin.php b/protected/modules/cms/views/sitecontent/admin.php new file mode 100644 index 0000000..4a5ab8c --- /dev/null +++ b/protected/modules/cms/views/sitecontent/admin.php @@ -0,0 +1,71 @@ +<?php +$this->breadcrumbs=array( + Cms::t('Sitecontent')=>array('index'), + Cms::t('Manage'), +); + +$this->menu=array( + array( + 'label'=>Cms::t('Manage Sitecontent'), + 'url'=>array('sitecontent/admin') + ), + array( + 'label'=>Cms::t('Create new Sitecontent'), + 'url'=>array('create')), + ); + +Yii::app()->clientScript->registerScript('search', " +$('.search-button').click(function(){ + $('.search-form').toggle(); + return false; +}); +$('.search-form form').submit(function(){ + $.fn.yiiGridView.update('sitecontent-grid', { + data: $(this).serialize() + }); + return false; +}); +"); +?> + +<h2><?php echo Yii::t('CmsModule.cms', 'Manage Sitecontent'); ?></h2> + +<?php echo CHtml::link(Yii::t('App','Advanced Search'),'#',array('class'=>'search-button')); ?> +<div class="search-form" style="display:none"> +<?php $this->renderPartial('_search',array( + 'model'=>$model, +)); ?> +</div><!-- search-form --> + +<?php +$this->widget('zii.widgets.grid.CGridView', array( + 'id'=>'sitecontent-grid', + 'dataProvider'=>$model->search(), + 'filter'=>$model, + 'columns'=>array( + 'id', + array( + 'name' => 'language', + 'filter' => Yii::app()->controller->module->languages, + ), + 'title', + 'keywords', + 'description', + array( + 'name'=>'createtime', + 'value'=>'date(Yii::app()->controller->module->dateformat, $data->createtime)', + 'filter' => false, + ), + array( + 'name'=>'updatetime', + 'value'=>'date(Yii::app()->controller->module->dateformat, $data->updatetime)', + 'filter' => false, + ), + 'position', + array( + 'class'=>'CButtonColumn', + ), + ), + )); ?> + +<?php echo CHtml::link('New sitecontent', array('//cms/sitecontent/create')); ?> diff --git a/protected/modules/cms/views/sitecontent/create.php b/protected/modules/cms/views/sitecontent/create.php new file mode 100644 index 0000000..88ff27e --- /dev/null +++ b/protected/modules/cms/views/sitecontent/create.php @@ -0,0 +1,21 @@ +<?php +$this->breadcrumbs=array( + Yii::t('CmsModule.cms', 'Sitecontent')=>array('admin'), + Yii::t('CmsModule.cms', 'Create'), +); + +$this->menu=array( + array( + 'label'=>Yii::t('CmsModule.cms', 'Manage Menustructure'), + 'url'=>array('menustructure/admin') + ), + array( + 'label'=>Yii::t('CmsModule.cms', 'Manage Sitecontent'), + 'url'=>array('sitecontent/admin') + ), +); +?> + +<h2><?php echo Yii::t('CmsModule.cms', 'Create new Sitecontent'); ?></h2> + +<?php echo $this->renderPartial('_form', array('model'=>$model)); ?> diff --git a/protected/modules/cms/views/sitecontent/draw.php b/protected/modules/cms/views/sitecontent/draw.php new file mode 100644 index 0000000..9c34a12 --- /dev/null +++ b/protected/modules/cms/views/sitecontent/draw.php @@ -0,0 +1,4 @@ +<h2><?php echo $sitecontent->title?></h2> +<?php //echo CHtml::encode($sitecontent->content); +echo $sitecontent->content; +?> diff --git a/protected/modules/cms/views/sitecontent/index.php b/protected/modules/cms/views/sitecontent/index.php new file mode 100644 index 0000000..0d1f003 --- /dev/null +++ b/protected/modules/cms/views/sitecontent/index.php @@ -0,0 +1,25 @@ +<?php +$this->breadcrumbs=array( + 'Sitecontents', +); + +$this->menu=array( + array( + 'label'=>Yii::t('CmsModule.cms', 'Manage Menustructure'), + 'url'=>array('menustructure/admin') + ), + array( + 'label'=>Yii::t('CmsModule.cms', 'Manage Sitecontent'), + 'url'=>array('sitecontent/admin') + ), + array('label'=>Yii::t('App', 'Create').' Sitecontent', 'url'=>array('create')), + array('label'=>Yii::t('App', 'Manage').' Sitecontent', 'url'=>array('admin')), +); +?> + +<h2>Sitecontents</h2> + +<?php $this->widget('zii.widgets.CListView', array( + 'dataProvider'=>$dataProvider, + 'itemView'=>'_view', +)); ?> diff --git a/protected/modules/cms/views/sitecontent/results.php b/protected/modules/cms/views/sitecontent/results.php new file mode 100644 index 0000000..ed55117 --- /dev/null +++ b/protected/modules/cms/views/sitecontent/results.php @@ -0,0 +1,19 @@ +<?php +$this->breadcrumbs = array(Yii::t('CmsModule.cms', 'Search results')); + +if($results != array()) { + printf('<h2>%s %s</h2>', + count($results), + Yii::t('CmsModule.cms', 'Results:')); + + echo '<ul>'; + foreach($results as $result) { + printf('<li>%s</li>', + CHtml::link($result->title, array( + '//cms/sitecontent/view', 'id' => $result->id, 'highlight' => $search))); + } + echo '</ul>'; +} else { + echo Yii::t('CmsModule.cms', 'No results found'); +} +?> diff --git a/protected/modules/cms/views/sitecontent/update.php b/protected/modules/cms/views/sitecontent/update.php new file mode 100644 index 0000000..5ed7e8d --- /dev/null +++ b/protected/modules/cms/views/sitecontent/update.php @@ -0,0 +1,18 @@ +<?php +$this->breadcrumbs=array( + Yii::t('CmsModule.cms', 'Sitecontent')=>array('admin'), + $model->id=>array('view','id'=>$model->id), + Yii::t('CmsModule.cms', 'Update'), +); + +$this->menu=array( + array( + 'label'=>Yii::t('CmsModule.cms', 'Manage Sitecontent'), + 'url'=>array('sitecontent/admin') + ), +); +?> + +<h2><?php echo Yii::t('CmsModule.cms', 'Update');?> <?php echo $model->title; ?></h2> + +<?php echo $this->renderPartial('_form', array('model'=>$model)); ?> diff --git a/protected/modules/cms/views/sitecontent/view.php b/protected/modules/cms/views/sitecontent/view.php new file mode 100644 index 0000000..c75f610 --- /dev/null +++ b/protected/modules/cms/views/sitecontent/view.php @@ -0,0 +1,47 @@ +<?php +if(isset($sc)) + $this->pageTitle = $sc->title . ' - ' . Yii::app()->name; +if(isset($menu)) + $this->pageTitle = $menu->title. ' - ' . Yii::app()->name; + +if(Yii::app()->user->id == 1) // is admin +{ + if(is_object($sitecontent)) + { + $this->renderPartial('draw', array('sitecontent' => $sitecontent)); + echo "<br />"; + echo CHtml::link(Yii::t('CmsModule.cms', 'Edit this sitecontent'), + array('/cms/sitecontent/update', 'id' => $sitecontent->id)); + } + else if ($sitecontent == array()) + { + echo CHtml::link(Yii::t('CmsModule.cms', 'Create new sitecontent here'), + array('/cms/sitecontent/create', 'position' => $menu->id)); + + } else if (is_array($sitecontent)) + { + foreach($sitecontent as $sc) + { + $this->renderPartial('draw', array('sitecontent' => $sc)); + echo "<br />"; + echo CHtml::link(Yii::t('CmsModule.cms', 'Edit this sitecontent'), + array('/cms/sitecontent/update', 'id' => $sc->id)); + } + } +} +else +{ + if(!is_null($sitecontent)) + if(is_object($sitecontent)) + $this->renderPartial('draw', array('sitecontent' => $sitecontent)); + else + foreach($sitecontent as $sc) + { + $this->renderPartial('draw', array('sitecontent' => $sc)); + } + +} + +if(isset($menu)) + $this->breadcrumbs = array($menu->title); + |
