diff options
| author | Patrick Seeger <pseeger@ccwn.org> | 2012-04-30 16:59:07 +0200 |
|---|---|---|
| committer | Patrick Seeger <pseeger@ccwn.org> | 2012-04-30 16:59:07 +0200 |
| commit | 10b3e68c049cc0830584e535b9273ec1c7745450 (patch) | |
| tree | 59d9eb85033dbc02b33eb7a92c252d87bd835ba0 /protected/modules/cms | |
| parent | 2a8b46329775b8503519d432a52dba13e8547d8e (diff) | |
cms fixes + suche
Diffstat (limited to 'protected/modules/cms')
| -rw-r--r-- | protected/modules/cms/components/views/search.php | 2 | ||||
| -rw-r--r-- | protected/modules/cms/controllers/SitecontentController.php | 5 | ||||
| -rw-r--r-- | protected/modules/cms/messages/de/cms.php | 2 | ||||
| -rw-r--r-- | protected/modules/cms/models/Cms.php | 3 | ||||
| -rw-r--r-- | protected/modules/cms/models/Sitecontent.php | 4 | ||||
| -rw-r--r-- | protected/modules/cms/views/sitecontent/_form.php | 10 | ||||
| -rw-r--r-- | protected/modules/cms/views/sitecontent/draw.php | 5 |
7 files changed, 21 insertions, 10 deletions
diff --git a/protected/modules/cms/components/views/search.php b/protected/modules/cms/components/views/search.php index 76e1f4f..bc2fa2e 100644 --- a/protected/modules/cms/components/views/search.php +++ b/protected/modules/cms/components/views/search.php @@ -1,5 +1,5 @@ <?php -echo CHtml::beginForm(array('//cms/sitecontent/search')); +echo CHtml::beginForm(array('/cms/sitecontent/search')); echo CHtml::textField('search', '', array('size' => 10)); echo CHtml::submitButton('Suche'); echo CHtml::endForm(); diff --git a/protected/modules/cms/controllers/SitecontentController.php b/protected/modules/cms/controllers/SitecontentController.php index 0d1a23f..0e9e25b 100644 --- a/protected/modules/cms/controllers/SitecontentController.php +++ b/protected/modules/cms/controllers/SitecontentController.php @@ -14,8 +14,9 @@ class SitecontentController extends Controller public function actionSearch() { - $results = Sitecontent::model()->findAll( - 'content like "%'.trim($_POST['search']).'%"'); + $q = new CDbCriteria(); + $q->addSearchCondition('content',$_POST['search']); + $results = Sitecontent::model()->findAll($q); $this->render('results', array( 'results' => $results, diff --git a/protected/modules/cms/messages/de/cms.php b/protected/modules/cms/messages/de/cms.php index 474431b..ea84286 100644 --- a/protected/modules/cms/messages/de/cms.php +++ b/protected/modules/cms/messages/de/cms.php @@ -40,7 +40,7 @@ return array( 'Create' => 'Erstellen', 'Save' => 'Speichern', 'Update' => 'Bearbeite', - '' => '', + 'Language' => 'Sprache', '' => '', '' => '', '' => '', diff --git a/protected/modules/cms/models/Cms.php b/protected/modules/cms/models/Cms.php index 691ca0c..885e589 100644 --- a/protected/modules/cms/models/Cms.php +++ b/protected/modules/cms/models/Cms.php @@ -62,9 +62,10 @@ class Cms { $sitecontent = Sitecontent::model()->findByAttributes(array('id'=> $id)); $childs = $sitecontent->childs; if($childs) { + $tmp=array(); foreach($sitecontent->childs as $child) { Yii::trace("Lala","Debug"); - $tmp = array(array('label'=>$child->title, 'url'=>array('/cms/sitecontent/view', 'page'=>$child->title_url))); + $tmp = array_merge($tmp,array(array('label'=>$child->title, 'url'=>array('/cms/sitecontent/view', 'page'=>$child->title_url)))); } } return $tmp; diff --git a/protected/modules/cms/models/Sitecontent.php b/protected/modules/cms/models/Sitecontent.php index a15029f..6d8def2 100644 --- a/protected/modules/cms/models/Sitecontent.php +++ b/protected/modules/cms/models/Sitecontent.php @@ -27,11 +27,11 @@ class Sitecontent extends CActiveRecord public function rules() { return array( - array('id, position, title, language', 'required'), + array('position, title, language', 'required'), array('parent, position, createtime, updatetime', 'numerical', 'integerOnly'=>true), array('title, keywords, description', 'length', 'max'=>255), array('content, title_url, title_browser', 'safe'), - array('id, position, title, keywords, description, content, authorid, createtime, updatetime, language', 'safe', 'on'=>'search'), + array('title, keywords, description, content, language', 'safe', 'on'=>'search'), ); } diff --git a/protected/modules/cms/views/sitecontent/_form.php b/protected/modules/cms/views/sitecontent/_form.php index fc240cd..6c8d056 100644 --- a/protected/modules/cms/views/sitecontent/_form.php +++ b/protected/modules/cms/views/sitecontent/_form.php @@ -83,8 +83,14 @@ Yii::app()->clientScript-> registerScriptFile(Yii::app()->getModule('cms')->rtea <div class="row"> <?php echo $form->labelEx($model,'content'); ?> -<?php echo $form->textArea($model,'content',array('rows'=>6, 'cols'=>50)); ?> -<?php Yii::app()->clientScript->registerScript("ckeditor", "$('#Sitecontent_content').ckeditor();"); ?> +<?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> diff --git a/protected/modules/cms/views/sitecontent/draw.php b/protected/modules/cms/views/sitecontent/draw.php index 7bcb6f6..9c34a12 100644 --- a/protected/modules/cms/views/sitecontent/draw.php +++ b/protected/modules/cms/views/sitecontent/draw.php @@ -1 +1,4 @@ -<?php echo CHtml::encode($sitecontent->content); ?> +<h2><?php echo $sitecontent->title?></h2> +<?php //echo CHtml::encode($sitecontent->content); +echo $sitecontent->content; +?> |
