diff options
Diffstat (limited to 'protected')
24 files changed, 1472 insertions, 3 deletions
diff --git a/protected/config/main.php b/protected/config/main.php index 7207120..32a7021 100644 --- a/protected/config/main.php +++ b/protected/config/main.php @@ -16,6 +16,7 @@ return array( 'import'=>array( 'application.models.*', 'application.components.*', + 'application.extensions.ddeditor.*', ), 'modules'=>array( @@ -51,15 +52,16 @@ return array( 'connectionString' => 'sqlite:'.dirname(__FILE__).'/../data/testdrive.db', ), // uncomment the following to use a MySQL database - /* + 'db'=>array( - 'connectionString' => 'mysql:host=localhost;dbname=testdrive', + 'connectionString' => 'mysql:host=localhost;dbname=astaf', 'emulatePrepare' => true, 'username' => 'root', 'password' => '', 'charset' => 'utf8', + 'tablePrefix' => 'tbl_' ), - */ + 'errorHandler'=>array( // use 'site/error' action to display errors 'errorAction'=>'site/error', diff --git a/protected/controllers/CmsPageController.php b/protected/controllers/CmsPageController.php new file mode 100644 index 0000000..362f991 --- /dev/null +++ b/protected/controllers/CmsPageController.php @@ -0,0 +1,176 @@ +<?php + +class CmsPageController extends Controller +{ + /** + * @var string the default layout for the views. Defaults to '//layouts/column2', meaning + * using two-column layout. See 'protected/views/layouts/column2.php'. + */ + public $layout='//layouts/column2'; + + /** + * @return array action filters + */ + public function filters() + { + return array( + 'accessControl', // perform access control for CRUD operations + ); + } + + /** + * Specifies the access control rules. + * This method is used by the 'accessControl' filter. + * @return array access control rules + */ + public function accessRules() + { + return array( + array('allow', // allow all users to perform 'index' and 'view' actions + 'actions'=>array('index','view'), + 'users'=>array('*'), + ), + array('allow', // allow authenticated user to perform 'create' and 'update' actions + 'actions'=>array('create','update'), + 'users'=>array('@'), + ), + array('allow', // allow admin user to perform 'admin' and 'delete' actions + 'actions'=>array('admin','delete'), + 'users'=>array('admin'), + ), + array('deny', // deny all users + 'users'=>array('*'), + ), + ); + } + + /** + * Displays a particular model. + * @param integer $id the ID of the model to be displayed + */ + public function actionView($id) + { + $this->render('view',array( + 'model'=>$this->loadModel($id), + )); + } + + /** + * Creates a new model. + * If creation is successful, the browser will be redirected to the 'view' page. + */ + public function actionCreate() + { + $model=new CmsPage; + + // Uncomment the following line if AJAX validation is needed + // $this->performAjaxValidation($model); + + if(isset($_POST['CmsPage'])) + { + $model->attributes=$_POST['CmsPage']; + if($model->save()) + $this->redirect(array('view','id'=>$model->id)); + } + + $this->render('create',array( + 'model'=>$model, + )); + } + + /** + * Updates a particular model. + * If update is successful, the browser will be redirected to the 'view' page. + * @param integer $id the ID of the model to be updated + */ + public function actionUpdate($id) + { + $model=$this->loadModel($id); + + // Uncomment the following line if AJAX validation is needed + // $this->performAjaxValidation($model); + + if(isset($_POST['CmsPage'])) + { + $model->attributes=$_POST['CmsPage']; + if($model->save()) + $this->redirect(array('view','id'=>$model->id)); + } + + $this->render('update',array( + 'model'=>$model, + )); + } + + /** + * Deletes a particular model. + * If deletion is successful, the browser will be redirected to the 'admin' page. + * @param integer $id the ID of the model to be deleted + */ + public function actionDelete($id) + { + if(Yii::app()->request->isPostRequest) + { + // we only allow deletion via POST request + $this->loadModel($id)->delete(); + + // if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser + if(!isset($_GET['ajax'])) + $this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin')); + } + else + throw new CHttpException(400,'Invalid request. Please do not repeat this request again.'); + } + + /** + * Lists all models. + */ + public function actionIndex() + { + $dataProvider=new CActiveDataProvider('CmsPage'); + $this->render('index',array( + 'dataProvider'=>$dataProvider, + )); + } + + /** + * Manages all models. + */ + public function actionAdmin() + { + $model=new CmsPage('search'); + $model->unsetAttributes(); // clear any default values + if(isset($_GET['CmsPage'])) + $model->attributes=$_GET['CmsPage']; + + $this->render('admin',array( + 'model'=>$model, + )); + } + + /** + * Returns the data model based on the primary key given in the GET variable. + * If the data model is not found, an HTTP exception will be raised. + * @param integer the ID of the model to be loaded + */ + public function loadModel($id) + { + $model=CmsPage::model()->findByPk($id,"status=".CmsPage::STATUS_PUBLISHED); + if($model===null) + throw new CHttpException(404,'The requested page does not exist.'); + return $model; + } + + /** + * Performs the AJAX validation. + * @param CModel the model to be validated + */ + protected function performAjaxValidation($model) + { + if(isset($_POST['ajax']) && $_POST['ajax']==='cms-page-form') + { + echo CActiveForm::validate($model); + Yii::app()->end(); + } + } +} diff --git a/protected/extensions/ddeditor/DDEditor.php b/protected/extensions/ddeditor/DDEditor.php new file mode 100644 index 0000000..798ef90 --- /dev/null +++ b/protected/extensions/ddeditor/DDEditor.php @@ -0,0 +1,228 @@ +<?php +/** + * DDEditor Class File + * + * @author Joachim Werner <joachim.werner@diggin-data.de> + * @link http://www.diggin-data.de + */ + +/** + * DDEditor creates a textarea editor for Markdown syntax + * The editor has some buttons to replace selected text in a textarea + * with common Mardown syntax + * + * @author Joachim Werner <joachim.werner@diggin-data.de> + * @version 0.4 + */ +class DDEditor extends CWidget +{ + // {{{ Members + /** + * model - The model upon which the activeTextarea control is based on + * + * @var mixed + * @access public + */ + public $model; + /** + * The attribute name for which the activeTextarea control shall be created + * @var mixed + * @access public + */ + public $attribute; + /** + * Array of additional HTML options for the textarea control + * + * @var array + * @access public + */ + public $htmlOptions=array(); + public $additionalSnippets = array(); + /** + * Request which returns via AJAX the rendered preview for the Markdown text + * + * @var mixed + * @access public + */ + public $previewRequest; + /** + * The ID of the activeTextarea + * + * @var mixed + * @access private + */ + private $editorId; + // }}} + // {{{ run + /** + * Runs the widget + * + * @access public + * @return void + */ + public function run() + { + $this->registerClientScripts(); + echo $this->createMarkup(); + } // }}} + // {{{ createMarkup + /** + * Creates the widget's markup + * + * @access public + * @return void + */ + public function createMarkup() + { + if(!isset($this->htmlOptions['rows'])) { + $attribute = $this->attribute; + $text = $this->model->$attribute; + if (strpos($text, "\n") === FALSE) { + //MAC?! + $text = str_replace( "\r", "\n", $text ); + } else { + //Windows has \r\n + $text = str_replace( "\r", '', $text ); + } + $this->htmlOptions['rows'] = count(explode("\n", $text)); + } + $this->render( + 'editor', + array( + 'model'=>$this->model, + 'attribute'=>$this->attribute, + 'htmlOptions'=>$this->htmlOptions, + 'editorId' => $this->editorId, + 'additionalSnippets'=>$this->additionalSnippets, + ) + ); + } // }}} + // {{{ registerClientScripts + /** + * Registers the clientside widget files (css & js) + */ + private function registerClientScripts() { + // Get the resources path + $resources = dirname(__FILE__).'/resources'; + + $cs = Yii::app()->clientScript; + // publish the files + $baseUrl = Yii::app()->assetManager->publish($resources); + + // register the files + + // Stylesheet + if(is_file($resources.'/styles.css')) { + $cs->registerCssFile($baseUrl.'/styles.css'); + } + if(is_file($resources.'/editor.js')) { + $cs->registerScriptFile($baseUrl.'/editor.js'); + } + self::resolveNameID($this->model,$this->attribute,$this->htmlOptions); + $this->editorId = $this->htmlOptions['id']; + $c=1; + // Create preview request URL + $url = Yii::app()->urlManager->createUrl($this->previewRequest,array('attribute'=>$this->attribute)); + + $scriptId = uniqid('ed_').'_'; + // Bold + $cs->registerScript($scriptId.$c++,"jQuery('#".$this->editorId."-editor-bold').click(function(){insertTags('".$this->editorId."','**','**','bold ')});"); + // Italic + $cs->registerScript($scriptId.$c++,"jQuery('#".$this->editorId."-editor-italic').click(function(){insertTags('".$this->editorId."','_','_','italic ')});"); + // Headings + $cs->registerScript($scriptId.$c++,"jQuery('#".$this->editorId."-editor-h').change(function(){insertTags('".$this->editorId."',padText('#',this.value)+' ',' '+padText('#',this.value),'Heading '+this.value)});"); + // Link + $cs->registerScript($scriptId.$c++,"jQuery('#".$this->editorId."-editor-link').click(function(){insertTags('".$this->editorId."','[','](http://...)','Link Description')});"); + // Image + // $cs->registerScript($scriptId.$c++,"jQuery('#".$this->editorId."-editor-img').click(function(){insertTags('".$this->editorId."','','Image URL')});"); + // Image 2 + $cs->registerScript($scriptId.$c++,"jQuery('#".$this->editorId."-editor-img2').change(function(){insertTags('".$this->editorId."',this.value+'[Heading/Alt Text](',' \"Title\")','path/to/image.jpg')});"); + // List Item + $cs->registerScript($scriptId.$c++,"jQuery('#".$this->editorId."-editor-li').click(function(){insertTags('".$this->editorId."','* ','','List Item ')});"); + // HR + $cs->registerScript($scriptId.$c++,"jQuery('#".$this->editorId."-editor-hr').click(function(){insertTags('".$this->editorId."','****bslashN','','')});"); + // Table + $cs->registerScript($scriptId.$c++,"jQuery('#".$this->editorId."-editor-table').click(function(){insertTags('".$this->editorId."','| Header | Header |bslashN| ------ | ------ | bslashN| ',' | Cell |bslashN','Cell')});"); + // Code + $cs->registerScript($scriptId.$c++,"jQuery('#".$this->editorId."-editor-code').click(function(){insertTags('".$this->editorId."','`','`','sample code')});"); + // Code2 + $cs->registerScript($scriptId.$c++,"jQuery('#".$this->editorId."-editor-code2').click(function(){if(this.value=='') return;insertTags('".$this->editorId."','~~~~bslashN['+this.value+']bslashN','bslashN~~~~bslashN','// Sample Ccode')});"); + // Add Lines + $cs->registerScript($scriptId.$c++,"jQuery('#".$this->editorId."-editor-addlines').click(function(){jQuery('#".$this->editorId."').attr('rows',jQuery('#".$this->editorId."').attr('rows')+5);});"); + // Remove Lines + $cs->registerScript($scriptId.$c++,"jQuery('#".$this->editorId."-editor-remlines').click(function(){jQuery('#".$this->editorId."').attr('rows',jQuery('#".$this->editorId."').attr('rows')-5);});"); + // Preview + $cs->registerScript($scriptId.$c++,"jQuery('#".$this->editorId."-editor-preview').click(function(){jQuery('#".$this->editorId."').toggle();jQuery('#".$this->editorId."-preview').toggle();jQuery.ajax({type:'POST',url: '".$url."',data: jQuery(':parent form').serialize(),success:function(data){jQuery('#".$this->editorId."-preview').html(data);}});});"); + // Additional Snippets + if(sizeof($this->additionalSnippets)>0) { + $n=0; + foreach($this->additionalSnippets as $name=>$additionalSnippet) { + $ddId = $this->editorId."-editor-addS-".$n; + $cs->registerScript($scriptId.$c++,"jQuery('#".$ddId."').change(function(){insertTags('".$this->editorId."','','',this.value);this.selectedIndex=0;});"); + $n++; + } + } + } // }}} + // {{{ resolveNameID + /** + * Generates input name and ID for a model attribute. + * This method will update the HTML options by setting appropriate 'name' and 'id' attributes. + * This method may also modify the attribute name if the name + * contains square brackets (mainly used in tabular input). + * @param CModel the data model + * @param string the attribute + * @param array the HTML options + */ + public static function resolveNameID($model,&$attribute,&$htmlOptions) + { + if(!isset($htmlOptions['name'])) + $htmlOptions['name']=self::resolveName($model,$attribute); + if(!isset($htmlOptions['id'])) + $htmlOptions['id']=self::getIdByName($htmlOptions['name']); + else if($htmlOptions['id']===false) + unset($htmlOptions['id']); + } // }}} + // {{{ getIdByName + /** + * Generates a valid HTML ID based the name. + * @return string the ID generated based on name. + */ + public static function getIdByName($name) + { + return str_replace(array('[]', '][', '[', ']'), array('', '_', '_', ''), $name); + } // }}} + // {{{ resolveName + /** + * Generates input name for a model attribute. + * Note, the attribute name may be modified after calling this method if the name + * contains square brackets (mainly used in tabular input) before the real attribute name. + * @param CModel the data model + * @param string the attribute + * @return string the input name + * @since 1.0.2 + */ + public static function resolveName($model,&$attribute) + { + if(($pos=strpos($attribute,'['))!==false) + { + if($pos!==0) // e.g. name[a][b] + return get_class($model).'['.substr($attribute,0,$pos).']'.substr($attribute,$pos); + if(($pos=strrpos($attribute,']'))!==false && $pos!==strlen($attribute)-1) // e.g. [a][b]name + { + $sub=substr($attribute,0,$pos+1); + $attribute=substr($attribute,$pos+1); + return get_class($model).$sub.'['.$attribute.']'; + } + if(preg_match('/\](\w+\[.*)$/',$attribute,$matches)) + { + $name=get_class($model).'['.str_replace(']','][',trim(strtr($attribute,array(']['=>']','['=>']')),']')).']'; + $attribute=$matches[1]; + return $name; + } + } + else + return get_class($model).'['.$attribute.']'; + } // }}} +} + +/* vim: set ai sw=4 sts=4 et fdm=marker fdc=4: */ diff --git a/protected/extensions/ddeditor/README b/protected/extensions/ddeditor/README new file mode 100644 index 0000000..0d5e252 --- /dev/null +++ b/protected/extensions/ddeditor/README @@ -0,0 +1,108 @@ +# DDEditor Yii Extension + +This extension contains a widget to render an activeTextarea to enter Markdown text. + +The rendered widget contains some buttons to add markdown tags for + +* Bold, italic text +* Links +* Images +* Code +* Table structure. + +It is also capable of displaying dropdown lists with _additional text snippets_ for insertion. + + +### Requirements +* Yii 1.1.3 or above + +### Installation +* Extract the release file under `protected/extensions` + +### Usage + +#### Include New Extension + +In your `config/main.php` file, add + + // autoloading model and component classes + 'import'=>array( + ... + 'application.extensions.ddeditor.*', + ... + ), + +#### Create the controll in a form view: + +In e.g. `views/post/_form.php`, include the following code: + + <?php $this->widget( + 'application.extensions.ddeditor.DDEditor', + array( + 'model'=>$model, + 'attribute'=>'content', + 'htmlOptions'=>array('rows'=>10, 'cols'=>70), + 'previewRequest'=>'post/preview')); ?> + +If you want to display an **extra dropdown list** with **snippets**, you may add the +_additionalSnippets_ parameter: + + <?php $mySnippets = array( + 'Users' => array( + 'id1' => 'John', + 'id2' => 'Paul', + ), + 'Phrases' => array( + 'Text Foo' => 'foo', + 'Text Bar' => 'bar' + ) + ); ?> + + <?php $this->widget( + 'application.extensions.ddeditor.DDEditor', + array( + 'model'=>$model, + 'attribute'=>'content', + 'htmlOptions'=>array('rows'=>10, 'cols'=>70), + 'previewRequest'=>'post/preview', + 'additionalSnippets'=>array('My Snippets'=>$mySnippets), + ); ?> + + +#### Add a Controller Preview Action + +In order to receive a rendered preview of the textarea Markdown, add an action method to a controller: + + public function actionPreview() + { + $parser=new CMarkdownParser; + echo $parser->safeTransform($_POST['Post'][$_GET['attribute']]); + } + + +### Resources + +* [Demo](http://www.diggin-data.de/ddeditor) +* [Discussion](http://www.yiiframework.com/forum/index.php?/topic/11384-new-extension-markdown-editor) + + +### Changes + +#### March 29, 2010 +* **V0.4** + * Added code sample for using _additionalSnippets_ in README + * Added reset of _additional snippets_ dropdown list after selection + +#### March 28, 2010 +* **V0.3** + * Fixed _Depreciated: split_ warning + * Added _additionalSnippets_ member + * Added _Code Highlighter_ dropdown list + +#### August 31, 2010 +* **V0.2** + * Fixed setting `$previewReaquest` + * Fixed setting client script id's for using multiple editors in one form + +#### August 30, 2010 +* **V0.1** Initial release. diff --git a/protected/extensions/ddeditor/messages/de/ddeditor.php b/protected/extensions/ddeditor/messages/de/ddeditor.php new file mode 100644 index 0000000..390b819 --- /dev/null +++ b/protected/extensions/ddeditor/messages/de/ddeditor.php @@ -0,0 +1,33 @@ +<?php +/** + * Message translations. + * + * This file is automatically generated by 'yiic message' command. + * It contains the localizable messages extracted from source code. + * You may modify this file by translating the extracted messages. + * + * Each array element represents the translation (value) of a message (key). + * If the value is empty, the message is considered as not translated. + * Messages that no longer need translation will have their translations + * enclosed between a pair of '@@' marks. + * + * Message string can be used with plural forms format. Check i18n section + * of the guide for details. + * + * NOTE, this file must be saved in UTF-8 encoding. + * + * @version $Id: $ + */ +return array ( + 'Code' => 'Code', + 'Highslide' => 'Highslide', + 'IMG' => 'BILD', + 'Inline' => 'Im Fließtext', + 'B' => 'F', + 'H' => 'Ü', + 'HR' => 'HR', + 'I' => 'K', + 'Loading Preview...' => 'Lade Vorschau...', + 'Preview' => 'Vorschau', + 'Table' => 'Tabelle', +); diff --git a/protected/extensions/ddeditor/messages/en/ddeditor.php b/protected/extensions/ddeditor/messages/en/ddeditor.php new file mode 100644 index 0000000..df2b3b0 --- /dev/null +++ b/protected/extensions/ddeditor/messages/en/ddeditor.php @@ -0,0 +1,26 @@ +<?php +/** + * Message translations. + * + * This file is automatically generated by 'yiic message' command. + * It contains the localizable messages extracted from source code. + * You may modify this file by translating the extracted messages. + * + * Each array element represents the translation (value) of a message (key). + * If the value is empty, the message is considered as not translated. + * Messages that no longer need translation will have their translations + * enclosed between a pair of '@@' marks. + * + * NOTE, this file must be saved in UTF-8 encoding. + * + * @version $Id: $ + */ +return array ( + 'B' => '', + 'H' => '', + 'HR' => '', + 'I' => '', + 'Loading Preview...' => '', + 'Preview' => '', + 'Table' => '', +); diff --git a/protected/extensions/ddeditor/messages/en/ddeditor.php.merged b/protected/extensions/ddeditor/messages/en/ddeditor.php.merged new file mode 100644 index 0000000..15f12bb --- /dev/null +++ b/protected/extensions/ddeditor/messages/en/ddeditor.php.merged @@ -0,0 +1,33 @@ +<?php +/** + * Message translations. + * + * This file is automatically generated by 'yiic message' command. + * It contains the localizable messages extracted from source code. + * You may modify this file by translating the extracted messages. + * + * Each array element represents the translation (value) of a message (key). + * If the value is empty, the message is considered as not translated. + * Messages that no longer need translation will have their translations + * enclosed between a pair of '@@' marks. + * + * Message string can be used with plural forms format. Check i18n section + * of the guide for details. + * + * NOTE, this file must be saved in UTF-8 encoding. + * + * @version $Id: $ + */ +return array ( + 'B' => '', + 'Code' => '', + 'H' => '', + 'HR' => '', + 'Highslide' => '', + 'I' => '', + 'IMG' => '', + 'Inline' => '', + 'Loading Preview...' => '', + 'Preview' => '', + 'Table' => '', +); diff --git a/protected/extensions/ddeditor/messages/messages.php b/protected/extensions/ddeditor/messages/messages.php new file mode 100644 index 0000000..3de8acf --- /dev/null +++ b/protected/extensions/ddeditor/messages/messages.php @@ -0,0 +1,17 @@ +<?php +// This is hopefully a config array for the messages +return array( + 'sourcePath' => dirname(__FILE__) . DIRECTORY_SEPARATOR . '..', //root dir of all source + 'messagePath' => dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'messages', //root dir of message translations + 'languages' => array('de','en'), //array of lang codes to translate to, e.g. es_mx + 'fileTypes' => array('php','js',), //array of extensions no dot all others excluded + 'exclude' => array( //list of paths or files to exclude + '.svn', + 'yiic', + 'yiic.php', + '/gii', + '/messages', + ), + //'translator' => 'Yii:t', //this is the default but lets be complete +); +?> diff --git a/protected/extensions/ddeditor/resources/editor.js b/protected/extensions/ddeditor/resources/editor.js new file mode 100644 index 0000000..7317d3b --- /dev/null +++ b/protected/extensions/ddeditor/resources/editor.js @@ -0,0 +1,140 @@ +/** + * Some browser detection + */ +var clientPC = navigator.userAgent.toLowerCase(); // Get client info +var is_gecko = ((clientPC.indexOf('gecko')!=-1) && (clientPC.indexOf('spoofer')==-1) + && (clientPC.indexOf('khtml') == -1) && (clientPC.indexOf('netscape/7.0')==-1)); +var is_safari = ((clientPC.indexOf('AppleWebKit')!=-1) && (clientPC.indexOf('spoofer')==-1)); +var is_khtml = (navigator.vendor == 'KDE' || ( document.childNodes && !document.all && !navigator.taintEnabled )); +if (clientPC.indexOf('opera')!=-1) { + var is_opera = true; + var is_opera_preseven = (window.opera && !document.childNodes); + var is_opera_seven = (window.opera && document.childNodes); +} + +//{{{ insertTags +/** + * apply tagOpen/tagClose to selection in textarea, use sampleText instead + * of selection if there is none copied and adapted from phpBB + * + * @author phpBB development team + * @author MediaWiki development team + * @author Andreas Gohr <andi@splitbrain.org> + * @author Jim Raynor <jim_raynor@web.de> + */ +function insertTags(elID, tagOpen, tagClose, sampleText) { + tagOpen = tagOpen.replace(/bslashN/g,'\n'); + tagClose = tagClose.replace(/bslashN/g,'\n'); + var txtarea = document.getElementById(elID); + // IE + if(document.selection && !is_gecko) { + var theSelection = document.selection.createRange().text; + var replaced = true; + if(!theSelection){ + replaced = false; + theSelection=sampleText; + } + txtarea.focus(); + + // This has change + text = theSelection; + if(theSelection.charAt(theSelection.length - 1) == " "){// exclude ending space char, if any + theSelection = theSelection.substring(0, theSelection.length - 1); + r = document.selection.createRange(); + r.text = tagOpen + theSelection + tagClose + " "; + } else { + r = document.selection.createRange(); + r.text = tagOpen + theSelection + tagClose; + } + if(!replaced){ + r.moveStart('character',-text.length-tagClose.length); + r.moveEnd('character',-tagClose.length); + } + r.select(); + // Mozilla + } else if(txtarea.selectionStart || txtarea.selectionStart == '0') { + var replaced = false; + var startPos = txtarea.selectionStart; + var endPos = txtarea.selectionEnd; + if(endPos - startPos) replaced = true; + var scrollTop=txtarea.scrollTop; + var myText = (txtarea.value).substring(startPos, endPos); + if(!myText) { myText=sampleText;} + if(myText.charAt(myText.length - 1) == " "){ // exclude ending space char, if any + subst = tagOpen + myText.substring(0, (myText.length - 1)) + tagClose + " "; + } else { + subst = tagOpen + myText + tagClose; + } + txtarea.value = txtarea.value.substring(0, startPos) + subst + + txtarea.value.substring(endPos, txtarea.value.length); + txtarea.focus(); + + //set new selection + if(replaced){ + var cPos=startPos+(tagOpen.length+myText.length+tagClose.length); + txtarea.selectionStart=cPos; + txtarea.selectionEnd=cPos; + }else{ + txtarea.selectionStart=startPos+tagOpen.length; + txtarea.selectionEnd=startPos+tagOpen.length+myText.length; + } + txtarea.scrollTop=scrollTop; + // All others + } else { + var copy_alertText=alertText; + var re1=new RegExp("\\$1","g"); + var re2=new RegExp("\\$2","g"); + copy_alertText=copy_alertText.replace(re1,sampleText); + copy_alertText=copy_alertText.replace(re2,tagOpen+sampleText+tagClose); + var text; + if (sampleText) { + text=prompt(copy_alertText); + } else { + text=""; + } + if(!text) { text=sampleText;} + text=tagOpen+text+tagClose; + //append to the end + txtarea.value += "\n"+text; + + // in Safari this causes scrolling + if(!is_safari) { + txtarea.focus(); + } + + } + // reposition cursor if possible + if (txtarea.createTextRange) txtarea.caretPos = document.selection.createRange().duplicate(); + + return false; +} +// }}} + +// {{{ moreRows +/** + * Adds 2 more rows to a textarea + */ +function moreRows(textareaId) +{ + document.getElementById(textareaId).rows = document.getElementById(textareaId).rows + 2; +} // }}} + +// {{{ lessRows +/** + * Reduces a textarea by 2 rows + */ +function lessRows(textareaId) +{ + if( document.getElementById(textareaId).rows>2 ) + document.getElementById(textareaId).rows = document.getElementById(textareaId).rows - 2; +}// }}} + +// {{{ padText +function padText(text, length) +{ + var result=""; + for(i=0; i<length; i++) + result = result + text; + return result; +} +// }}} diff --git a/protected/extensions/ddeditor/resources/styles.css b/protected/extensions/ddeditor/resources/styles.css new file mode 100644 index 0000000..0568bd3 --- /dev/null +++ b/protected/extensions/ddeditor/resources/styles.css @@ -0,0 +1,15 @@ +.ddeditor .preview +{ + display: none; + border: 1px solid #aaa; + padding: 3px; +} +.ddeditor BUTTON,SELECT +{ + font-size: 9pt; +} +.ddeditor BUTTON +{ + border: 1px solid blue; + background-color: #eee; +} diff --git a/protected/extensions/ddeditor/views/editor.php b/protected/extensions/ddeditor/views/editor.php new file mode 100644 index 0000000..e8ab7be --- /dev/null +++ b/protected/extensions/ddeditor/views/editor.php @@ -0,0 +1,63 @@ +<div class="ddeditor"> +<button + type="button" + id="<?php echo $editorId ?>-editor-bold"><b><?php echo Yii::t('ddeditor','B'); ?></b></button> +<button + type="button" + id="<?php echo $editorId ?>-editor-italic"><i><?php echo Yii::t('ddeditor','I'); ?></i></button> +<select id="<?php echo $editorId ?>-editor-h"> + <option value=""><?php echo Yii::t('ddeditor','H'); ?></option> + <?php for($i=1; $i<=5; $i++ ) : ?> + <option value="<?php echo $i ?>"><?php echo Yii::t('ddeditor','H'); ?><?php echo $i ?></option> + <?php endfor; ?> +</select> +<button + type="button" + id="<?php echo $editorId ?>-editor-link">URL</button> +<!-- +<button + type="button" + id="<?php echo $editorId ?>-editor-img">IMG</button> +--> +<select id="<?php echo $editorId ?>-editor-img2"> + <option value=""><?php echo Yii::t('ddeditor','IMG'); ?></option> + <option value="!"><?php echo Yii::t('ddeditor','Inline'); ?></option> + <option value="*"><?php echo Yii::t('ddeditor','Highslide'); ?></option> +</select> +<button + type="button" + id="<?php echo $editorId ?>-editor-li">•</button> +<button + type="button" + id="<?php echo $editorId ?>-editor-hr"><?php echo Yii::t('ddeditor','HR'); ?></button> +<button + type="button" + id="<?php echo $editorId ?>-editor-code">Code</button> +<select id="<?php echo $editorId ?>-editor-code2"> + <option value=""><?php echo Yii::t('ddeditor','Code'); ?></option> + <?php foreach(explode(", ","ABAP, CPP, CSS, DIFF, DTD, HTML, JAVA, JAVASCRIPT, MYSQL, PERL, PHP, PYTHON, RUBY, SQL, XML") as $language) : ?> + <option value="<?php echo strtolower($language) ?>"><?php echo $language; ?></option> + <?php endforeach; ?> +</select> +<button + type="button" + id="<?php echo $editorId ?>-editor-table"><?php echo Yii::t('ddeditor','Table'); ?></button> +<button + type="button" + id="<?php echo $editorId; ?>-editor-addlines">+</button> +<button + type="button" + id="<?php echo $editorId; ?>-editor-remlines">-</button> +<button + type="button" + id="<?php echo $editorId; ?>-editor-preview"><?php echo Yii::t('ddeditor','Preview'); ?></button> +<br/> +<?php if(sizeof($additionalSnippets)>0) : ?> +<?php $n=0; foreach($additionalSnippets as $name=>$additionalSnippet) : $additionalSnippet = array_merge(array($name),$additionalSnippet); ?> +<?php echo CHtml::dropDownList($editorId.'-editor-addS-'.$n,'',$additionalSnippet); ?> +<?php $n++; endforeach; ?> +<br/> +<?php endif; ?> +<?php echo CHtml::activeTextArea($model,$attribute,$htmlOptions); ?> +<div id="<?php echo $editorId; ?>-preview" class="preview"><?php echo Yii::t('ddeditor','Loading Preview...'); ?></div> +</div> diff --git a/protected/models/CmsPage.php b/protected/models/CmsPage.php new file mode 100644 index 0000000..92acf23 --- /dev/null +++ b/protected/models/CmsPage.php @@ -0,0 +1,133 @@ +<?php + +/** + * This is the model class for table "{{cms_page}}". + * + * The followings are the available columns in table '{{cms_page}}': + * @property integer $id + * @property string $content + * @property string $title + * @property string $create_time + * @property string $update_time + * @property integer $status + * @property string $slug + */ +class CmsPage extends CActiveRecord +{ + + + const STATUS_PUBLISHED=1; + const STATUS_DRAFT=2; + const STATUS_DELETED=3; + /** + * Returns the static model of the specified AR class. + * @param string $className active record class name. + * @return CmsPage the static model class + */ + public static function model($className=__CLASS__) + { + return parent::model($className); + } + + /** + * @return string the associated database table name + */ + public function tableName() + { + return '{{cms_page}}'; + } + + /** + * @return array validation rules for model attributes. + */ + public function rules() + { + // NOTE: you should only define rules for those attributes that + // will receive user inputs. + return array( + array('content, title, status, slug', 'required'), + array('status', 'numerical', 'integerOnly'=>true), + array('status', 'in', 'range'=>array(1,2,3)), + array('title, slug', 'length', 'max'=>255), + // The following rule is used by search(). + // Please remove those attributes that should not be searched. + array('id, content, title, create_time, update_time, status, slug', 'safe', 'on'=>'search'), + //array('title, status', 'safe', 'on'=>'search'), + ); + } + + /** + * @return array relational rules. + */ + public function relations() + { + // NOTE: you may need to adjust the relation name and the related + // class name for the relations automatically generated below. + return array( + ); + } + + /** + * @return array customized attribute labels (name=>label) + */ + public function attributeLabels() + { + return array( + 'id' => 'ID', + 'content' => 'Content', + 'title' => 'Title', + 'create_time' => 'Create Time', + 'update_time' => 'Update Time', + 'status' => 'Status', + 'slug' => 'Slug', + ); + } + + /** + * Retrieves a list of models based on the current search/filter conditions. + * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions. + */ + public function search() + { + // Warning: Please modify the following code to remove attributes that + // should not be searched. + + $criteria=new CDbCriteria; + + $criteria->compare('id',$this->id); + $criteria->compare('content',$this->content,true); + $criteria->compare('title',$this->title,true); + $criteria->compare('create_time',$this->create_time,true); + $criteria->compare('update_time',$this->update_time,true); + $criteria->compare('status',$this->status); + $criteria->compare('slug',$this->slug,true); + + return new CActiveDataProvider($this, array( + 'criteria'=>$criteria, + )); + } + + public function getUrl() + { + return Yii::app()->createUrl('cms', array( + 'slug'=>$this->slug, + )); + } + + protected function beforeSave() + { + if(parent::beforeSave()) + { + if($this->isNewRecord) + { + $this->create_time=$this->update_time=new CDbExpression('NOW()'); + //$this->author_id=Yii::app()->user->id; + } + else + $this->update_time=new CDbExpression('NOW()'); + return true; + } + else + return false; + } +}
\ No newline at end of file diff --git a/protected/runtime/HTML/4.4.0,7dbdc3d58ab57a278defc6669c7aa098,1.ser b/protected/runtime/HTML/4.4.0,7dbdc3d58ab57a278defc6669c7aa098,1.ser Binary files differnew file mode 100644 index 0000000..d5dc58e --- /dev/null +++ b/protected/runtime/HTML/4.4.0,7dbdc3d58ab57a278defc6669c7aa098,1.ser diff --git a/protected/runtime/application.log b/protected/runtime/application.log new file mode 100644 index 0000000..03f7301 --- /dev/null +++ b/protected/runtime/application.log @@ -0,0 +1,204 @@ +2012/04/15 14:23:30 [error] [exception.CException] exception 'CException' with message 'Property "CDbConnection.tablePfrefix" is not defined.' in D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\base\CComponent.php:174 +Stack trace: +#0 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\YiiBase.php(222): CComponent->__set('tablePfrefix', 'tbl_') +#1 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\base\CModule.php(387): YiiBase::createComponent(Array) +#2 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\base\CModule.php(104): CModule->getComponent('db') +#3 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\gii\generators\model\ModelCode.php(54): CModule->__get('db') +#4 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CFormModel.php(40): ModelCode->init() +#5 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\gii\CCodeGenerator.php(152): CFormModel->__construct() +#6 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\gii\CCodeGenerator.php(64): CCodeGenerator->prepare() +#7 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\actions\CInlineAction.php(50): CCodeGenerator->actionIndex() +#8 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CController.php(309): CInlineAction->runWithParams(Array) +#9 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CController.php(287): CController->runAction(Object(CInlineAction)) +#10 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CController.php(266): CController->runActionWithFilters(Object(CInlineAction), Array) +#11 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CWebApplication.php(276): CController->run('') +#12 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CWebApplication.php(135): CWebApplication->runController('gii/model') +#13 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\base\CApplication.php(162): CWebApplication->processRequest() +#14 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\www.astaf.de\index.php(13): CApplication->run() +#15 {main} +REQUEST_URI=/index.php?r=gii/model +HTTP_REFERER=http://localhost/index.php?r=gii +--- +2012/04/15 16:20:28 [warning] [application] Failed to set unsafe attribute "create_time" of "CmsPage". +in D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\www.astaf.de\protected\controllers\CmsPageController.php (71) +in D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\www.astaf.de\index.php (13) +2012/04/15 16:20:28 [warning] [application] Failed to set unsafe attribute "updatetime" of "CmsPage". +in D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\www.astaf.de\protected\controllers\CmsPageController.php (71) +in D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\www.astaf.de\index.php (13) +2012/04/15 17:11:31 [error] [exception.CException] exception 'CException' with message 'Property "CmsPage.updatetime" is not defined.' in D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\base\CComponent.php:174 +Stack trace: +#0 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\db\ar\CActiveRecord.php(160): CComponent->__set('updatetime', 1334502691) +#1 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\www.astaf.de\protected\models\CmsPage.php(122): CActiveRecord->__set('updatetime', 1334502691) +#2 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\db\ar\CActiveRecord.php(1056): CmsPage->beforeSave() +#3 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\db\ar\CActiveRecord.php(787): CActiveRecord->update(NULL) +#4 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\www.astaf.de\protected\controllers\CmsPageController.php(96): CActiveRecord->save() +#5 [internal function]: CmsPageController->actionUpdate('1') +#6 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\actions\CAction.php(107): ReflectionMethod->invokeArgs(Object(CmsPageController), Array) +#7 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\actions\CInlineAction.php(48): CAction->runWithParamsInternal(Object(CmsPageController), Object(ReflectionMethod), Array) +#8 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CController.php(309): CInlineAction->runWithParams(Array) +#9 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\filters\CFilterChain.php(134): CController->runAction(Object(CInlineAction)) +#10 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\filters\CFilter.php(41): CFilterChain->run() +#11 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CController.php(1146): CFilter->filter(Object(CFilterChain)) +#12 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\filters\CInlineFilter.php(59): CController->filterAccessControl(Object(CFilterChain)) +#13 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\filters\CFilterChain.php(131): CInlineFilter->filter(Object(CFilterChain)) +#14 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CController.php(292): CFilterChain->run() +#15 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CController.php(266): CController->runActionWithFilters(Object(CInlineAction), Array) +#16 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CWebApplication.php(276): CController->run('update') +#17 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CWebApplication.php(135): CWebApplication->runController('cmsPage/update') +#18 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\base\CApplication.php(162): CWebApplication->processRequest() +#19 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\www.astaf.de\index.php(13): CApplication->run() +#20 {main} +REQUEST_URI=/index.php?r=cmsPage/update&id=1 +HTTP_REFERER=http://localhost/index.php?r=cmsPage/update&id=1 +--- +2012/04/15 17:26:25 [error] [php] Object of class DateTime could not be converted to string (D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\db\schema\CDbColumnSchema.php:141) +Stack trace: +#0 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\db\ar\CActiveRecord.php(787): CmsPage->insert() +#1 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\www.astaf.de\protected\controllers\CmsPageController.php(72): CmsPage->save() +#2 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\actions\CInlineAction.php(50): CmsPageController->actionCreate() +#3 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CController.php(309): CInlineAction->runWithParams() +#4 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\filters\CFilterChain.php(134): CmsPageController->runAction() +#5 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\filters\CFilter.php(41): CFilterChain->run() +#6 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CController.php(1146): CAccessControlFilter->filter() +#7 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\filters\CInlineFilter.php(59): CmsPageController->filterAccessControl() +#8 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\filters\CFilterChain.php(131): CInlineFilter->filter() +#9 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CController.php(292): CFilterChain->run() +#10 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CController.php(266): CmsPageController->runActionWithFilters() +#11 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CWebApplication.php(276): CmsPageController->run() +#12 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CWebApplication.php(135): CWebApplication->runController() +#13 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\base\CApplication.php(162): CWebApplication->processRequest() +#14 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\www.astaf.de\index.php(13): CWebApplication->run() +REQUEST_URI=/index.php?r=cmsPage/create +in D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\www.astaf.de\protected\controllers\CmsPageController.php (72) +in D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\www.astaf.de\index.php (13) +2012/04/15 17:54:06 [error] [exception.CHttpException.404] exception 'CHttpException' with message 'The requested page does not exist.' in D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\www.astaf.de\protected\controllers\CmsPageController.php:160 +Stack trace: +#0 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\www.astaf.de\protected\controllers\CmsPageController.php(54): CmsPageController->loadModel('9') +#1 [internal function]: CmsPageController->actionView('9') +#2 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\actions\CAction.php(107): ReflectionMethod->invokeArgs(Object(CmsPageController), Array) +#3 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\actions\CInlineAction.php(48): CAction->runWithParamsInternal(Object(CmsPageController), Object(ReflectionMethod), Array) +#4 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CController.php(309): CInlineAction->runWithParams(Array) +#5 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\filters\CFilterChain.php(134): CController->runAction(Object(CInlineAction)) +#6 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\filters\CFilter.php(41): CFilterChain->run() +#7 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CController.php(1146): CFilter->filter(Object(CFilterChain)) +#8 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\filters\CInlineFilter.php(59): CController->filterAccessControl(Object(CFilterChain)) +#9 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\filters\CFilterChain.php(131): CInlineFilter->filter(Object(CFilterChain)) +#10 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CController.php(292): CFilterChain->run() +#11 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CController.php(266): CController->runActionWithFilters(Object(CInlineAction), Array) +#12 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CWebApplication.php(276): CController->run('view') +#13 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CWebApplication.php(135): CWebApplication->runController('cmsPage/view') +#14 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\base\CApplication.php(162): CWebApplication->processRequest() +#15 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\www.astaf.de\index.php(13): CApplication->run() +#16 {main} +REQUEST_URI=/index.php?r=cmsPage/view&id=9 +HTTP_REFERER=http://localhost/index.php?r=cmsPage/create +--- +2012/04/15 17:54:18 [error] [exception.CHttpException.404] exception 'CHttpException' with message 'The requested page does not exist.' in D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\www.astaf.de\protected\controllers\CmsPageController.php:160 +Stack trace: +#0 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\www.astaf.de\protected\controllers\CmsPageController.php(54): CmsPageController->loadModel('9') +#1 [internal function]: CmsPageController->actionView('9') +#2 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\actions\CAction.php(107): ReflectionMethod->invokeArgs(Object(CmsPageController), Array) +#3 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\actions\CInlineAction.php(48): CAction->runWithParamsInternal(Object(CmsPageController), Object(ReflectionMethod), Array) +#4 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CController.php(309): CInlineAction->runWithParams(Array) +#5 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\filters\CFilterChain.php(134): CController->runAction(Object(CInlineAction)) +#6 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\filters\CFilter.php(41): CFilterChain->run() +#7 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CController.php(1146): CFilter->filter(Object(CFilterChain)) +#8 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\filters\CInlineFilter.php(59): CController->filterAccessControl(Object(CFilterChain)) +#9 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\filters\CFilterChain.php(131): CInlineFilter->filter(Object(CFilterChain)) +#10 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CController.php(292): CFilterChain->run() +#11 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CController.php(266): CController->runActionWithFilters(Object(CInlineAction), Array) +#12 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CWebApplication.php(276): CController->run('view') +#13 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CWebApplication.php(135): CWebApplication->runController('cmsPage/view') +#14 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\base\CApplication.php(162): CWebApplication->processRequest() +#15 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\www.astaf.de\index.php(13): CApplication->run() +#16 {main} +REQUEST_URI=/index.php?r=cmsPage/view&id=9 +HTTP_REFERER=http://localhost/index.php?r=cmsPage/create +--- +2012/04/15 17:54:38 [error] [exception.CHttpException.400] exception 'CHttpException' with message 'Your request is invalid.' in D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CController.php:337 +Stack trace: +#0 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CController.php(310): CController->invalidActionParams(Object(CInlineAction)) +#1 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\filters\CFilterChain.php(134): CController->runAction(Object(CInlineAction)) +#2 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\filters\CFilter.php(41): CFilterChain->run() +#3 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CController.php(1146): CFilter->filter(Object(CFilterChain)) +#4 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\filters\CInlineFilter.php(59): CController->filterAccessControl(Object(CFilterChain)) +#5 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\filters\CFilterChain.php(131): CInlineFilter->filter(Object(CFilterChain)) +#6 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CController.php(292): CFilterChain->run() +#7 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CController.php(266): CController->runActionWithFilters(Object(CInlineAction), Array) +#8 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CWebApplication.php(276): CController->run('view') +#9 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CWebApplication.php(135): CWebApplication->runController('cmsPage/view') +#10 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\base\CApplication.php(162): CWebApplication->processRequest() +#11 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\www.astaf.de\index.php(13): CApplication->run() +#12 {main} +REQUEST_URI=/index.php?r=cmsPage/view&slug=Slug +--- +2012/04/15 18:08:47 [error] [exception.CHttpException.400] exception 'CHttpException' with message 'Your request is invalid.' in D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CController.php:337 +Stack trace: +#0 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CController.php(310): CController->invalidActionParams(Object(CInlineAction)) +#1 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\filters\CFilterChain.php(134): CController->runAction(Object(CInlineAction)) +#2 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\filters\CFilter.php(41): CFilterChain->run() +#3 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CController.php(1146): CFilter->filter(Object(CFilterChain)) +#4 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\filters\CInlineFilter.php(59): CController->filterAccessControl(Object(CFilterChain)) +#5 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\filters\CFilterChain.php(131): CInlineFilter->filter(Object(CFilterChain)) +#6 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CController.php(292): CFilterChain->run() +#7 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CController.php(266): CController->runActionWithFilters(Object(CInlineAction), Array) +#8 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CWebApplication.php(276): CController->run('view') +#9 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CWebApplication.php(135): CWebApplication->runController('cmsPage/view') +#10 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\base\CApplication.php(162): CWebApplication->processRequest() +#11 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\www.astaf.de\index.php(13): CApplication->run() +#12 {main} +REQUEST_URI=/index.php?r=cmsPage/view&slug=Slug +--- +2012/04/15 18:08:54 [error] [exception.CException] exception 'CException' with message 'Property "CmsPageController.content" is not defined.' in D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\base\CComponent.php:131 +Stack trace: +#0 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\www.astaf.de\protected\views\cmsPage\view.php(21): CComponent->__get('content') +#1 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CBaseController.php(127): require('D:\Priv\CCWN\As...') +#2 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CBaseController.php(96): CBaseController->renderInternal('D:\Priv\CCWN\As...', Array, true) +#3 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CController.php(870): CBaseController->renderFile('D:\Priv\CCWN\As...', Array, true) +#4 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CController.php(783): CController->renderPartial('view', Array, true) +#5 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\www.astaf.de\protected\controllers\CmsPageController.php(55): CController->render('view', Array) +#6 [internal function]: CmsPageController->actionView('1') +#7 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\actions\CAction.php(107): ReflectionMethod->invokeArgs(Object(CmsPageController), Array) +#8 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\actions\CInlineAction.php(48): CAction->runWithParamsInternal(Object(CmsPageController), Object(ReflectionMethod), Array) +#9 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CController.php(309): CInlineAction->runWithParams(Array) +#10 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\filters\CFilterChain.php(134): CController->runAction(Object(CInlineAction)) +#11 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\filters\CFilter.php(41): CFilterChain->run() +#12 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CController.php(1146): CFilter->filter(Object(CFilterChain)) +#13 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\filters\CInlineFilter.php(59): CController->filterAccessControl(Object(CFilterChain)) +#14 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\filters\CFilterChain.php(131): CInlineFilter->filter(Object(CFilterChain)) +#15 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CController.php(292): CFilterChain->run() +#16 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CController.php(266): CController->runActionWithFilters(Object(CInlineAction), Array) +#17 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CWebApplication.php(276): CController->run('view') +#18 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CWebApplication.php(135): CWebApplication->runController('cmsPage/view') +#19 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\base\CApplication.php(162): CWebApplication->processRequest() +#20 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\www.astaf.de\index.php(13): CApplication->run() +#21 {main} +REQUEST_URI=/index.php?r=cmsPage/view&id=1 +--- +2012/04/15 18:10:36 [error] [exception.CException] exception 'CException' with message 'Property "CmsPage.update" is not defined.' in D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\base\CComponent.php:131 +Stack trace: +#0 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\db\ar\CActiveRecord.php(144): CComponent->__get('update') +#1 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\www.astaf.de\protected\views\cmsPage\view.php(38): CActiveRecord->__get('update') +#2 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CBaseController.php(127): require('D:\Priv\CCWN\As...') +#3 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CBaseController.php(96): CBaseController->renderInternal('D:\Priv\CCWN\As...', Array, true) +#4 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CController.php(870): CBaseController->renderFile('D:\Priv\CCWN\As...', Array, true) +#5 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CController.php(783): CController->renderPartial('view', Array, true) +#6 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\www.astaf.de\protected\controllers\CmsPageController.php(55): CController->render('view', Array) +#7 [internal function]: CmsPageController->actionView('1') +#8 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\actions\CAction.php(107): ReflectionMethod->invokeArgs(Object(CmsPageController), Array) +#9 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\actions\CInlineAction.php(48): CAction->runWithParamsInternal(Object(CmsPageController), Object(ReflectionMethod), Array) +#10 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CController.php(309): CInlineAction->runWithParams(Array) +#11 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\filters\CFilterChain.php(134): CController->runAction(Object(CInlineAction)) +#12 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\filters\CFilter.php(41): CFilterChain->run() +#13 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CController.php(1146): CFilter->filter(Object(CFilterChain)) +#14 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\filters\CInlineFilter.php(59): CController->filterAccessControl(Object(CFilterChain)) +#15 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\filters\CFilterChain.php(131): CInlineFilter->filter(Object(CFilterChain)) +#16 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CController.php(292): CFilterChain->run() +#17 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CController.php(266): CController->runActionWithFilters(Object(CInlineAction), Array) +#18 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CWebApplication.php(276): CController->run('view') +#19 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\web\CWebApplication.php(135): CWebApplication->runController('cmsPage/view') +#20 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\yii-framework\framework\base\CApplication.php(162): CWebApplication->processRequest() +#21 D:\Priv\CCWN\Astaf_2012\DevEnv\workspace\www.astaf.de\index.php(13): CApplication->run() +#22 {main} +REQUEST_URI=/index.php?r=cmsPage/view&id=1 +--- diff --git a/protected/runtime/gii-1.1.10/CrudCode.php b/protected/runtime/gii-1.1.10/CrudCode.php new file mode 100644 index 0000000..20e6de0 --- /dev/null +++ b/protected/runtime/gii-1.1.10/CrudCode.php @@ -0,0 +1,5 @@ +<?php +return array ( + 'template' => 'default', + 'baseControllerClass' => 'Controller', +); diff --git a/protected/runtime/gii-1.1.10/ModelCode.php b/protected/runtime/gii-1.1.10/ModelCode.php new file mode 100644 index 0000000..5e9791a --- /dev/null +++ b/protected/runtime/gii-1.1.10/ModelCode.php @@ -0,0 +1,8 @@ +<?php +return array ( + 'template' => 'default', + 'tablePrefix' => 'tbl_', + 'modelPath' => 'application.models', + 'baseClass' => 'CActiveRecord', + 'buildRelations' => '1', +); diff --git a/protected/views/cmsPage/_form.php b/protected/views/cmsPage/_form.php new file mode 100644 index 0000000..4b29cd3 --- /dev/null +++ b/protected/views/cmsPage/_form.php @@ -0,0 +1,50 @@ +<div class="form"> + +<?php $form=$this->beginWidget('CActiveForm', array( + 'id'=>'cms-page-form', + 'enableAjaxValidation'=>false, +)); ?> + + <p class="note">Fields with <span class="required">*</span> are required.</p> + + <?php echo $form->errorSummary($model); ?> + + <div class="row"> + + <?php echo $form->labelEx($model,'content'); ?> + <?php $this->widget( + 'application.extensions.ddeditor.DDEditor', + array( + 'model'=>$model, + 'attribute'=>'content', + 'htmlOptions'=>array('rows'=>10, 'cols'=>70), + 'previewRequest'=>'cmsPage/preview')); ?> + <?php echo $form->error($model,'content'); ?> + </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,'status'); ?> + <?php echo $form->textField($model,'status'); ?> + <?php echo $form->error($model,'status'); ?> + </div> + + <div class="row"> + <?php echo $form->labelEx($model,'slug'); ?> + <?php echo $form->textField($model,'slug',array('size'=>60,'maxlength'=>255)); ?> + <?php echo $form->error($model,'slug'); ?> + </div> + + <div class="row buttons"> + <?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?> + </div> + +<?php $this->endWidget(); ?> + +</div><!-- form -->
\ No newline at end of file diff --git a/protected/views/cmsPage/_search.php b/protected/views/cmsPage/_search.php new file mode 100644 index 0000000..abab43c --- /dev/null +++ b/protected/views/cmsPage/_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,'content'); ?> + <?php echo $form->textArea($model,'content',array('rows'=>6, 'cols'=>50)); ?> + </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,'create_time'); ?> + <?php echo $form->textField($model,'create_time'); ?> + </div> + + <div class="row"> + <?php echo $form->label($model,'update_time'); ?> + <?php echo $form->textField($model,'update_time'); ?> + </div> + + <div class="row"> + <?php echo $form->label($model,'status'); ?> + <?php echo $form->textField($model,'status'); ?> + </div> + + <div class="row"> + <?php echo $form->label($model,'slug'); ?> + <?php echo $form->textField($model,'slug',array('size'=>60,'maxlength'=>255)); ?> + </div> + + <div class="row buttons"> + <?php echo CHtml::submitButton('Search'); ?> + </div> + +<?php $this->endWidget(); ?> + +</div><!-- search-form -->
\ No newline at end of file diff --git a/protected/views/cmsPage/_view.php b/protected/views/cmsPage/_view.php new file mode 100644 index 0000000..fd490a3 --- /dev/null +++ b/protected/views/cmsPage/_view.php @@ -0,0 +1,32 @@ +<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('content')); ?>:</b> + <?php echo CHtml::encode($data->content); ?> + <br /> + + <b><?php echo CHtml::encode($data->getAttributeLabel('title')); ?>:</b> + <?php echo CHtml::encode($data->title); ?> + <br /> + + <b><?php echo CHtml::encode($data->getAttributeLabel('create_time')); ?>:</b> + <?php echo CHtml::encode($data->create_time); ?> + <br /> + + <b><?php echo CHtml::encode($data->getAttributeLabel('update_time')); ?>:</b> + <?php echo CHtml::encode($data->update_time); ?> + <br /> + + <b><?php echo CHtml::encode($data->getAttributeLabel('status')); ?>:</b> + <?php echo CHtml::encode($data->status); ?> + <br /> + + <b><?php echo CHtml::encode($data->getAttributeLabel('slug')); ?>:</b> + <?php echo CHtml::encode($data->slug); ?> + <br /> + + +</div>
\ No newline at end of file diff --git a/protected/views/cmsPage/admin.php b/protected/views/cmsPage/admin.php new file mode 100644 index 0000000..88ede5c --- /dev/null +++ b/protected/views/cmsPage/admin.php @@ -0,0 +1,58 @@ +<?php +$this->breadcrumbs=array( + 'Cms Pages'=>array('index'), + 'Manage', +); + +$this->menu=array( + array('label'=>'List CmsPage', 'url'=>array('index')), + array('label'=>'Create CmsPage', '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('cms-page-grid', { + data: $(this).serialize() + }); + return false; +}); +"); +?> + +<h1>Manage Cms Pages</h1> + +<p> +You may optionally enter a comparison operator (<b><</b>, <b><=</b>, <b>></b>, <b>>=</b>, <b><></b> +or <b>=</b>) at the beginning of each of your search values to specify how the comparison should be done. +</p> + +<?php echo CHtml::link('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'=>'cms-page-grid', + 'dataProvider'=>$model->search(), + 'filter'=>$model, + 'columns'=>array( + 'id', + 'content', + 'title', + 'create_time', + 'update_time', + 'status', + /* + 'slug', + */ + array( + 'class'=>'CButtonColumn', + ), + ), +)); ?> diff --git a/protected/views/cmsPage/create.php b/protected/views/cmsPage/create.php new file mode 100644 index 0000000..a193bdc --- /dev/null +++ b/protected/views/cmsPage/create.php @@ -0,0 +1,15 @@ +<?php +$this->breadcrumbs=array( + 'Cms Pages'=>array('index'), + 'Create', +); + +$this->menu=array( + array('label'=>'List CmsPage', 'url'=>array('index')), + array('label'=>'Manage CmsPage', 'url'=>array('admin')), +); +?> + +<h1>Create CmsPage</h1> + +<?php echo $this->renderPartial('_form', array('model'=>$model)); ?>
\ No newline at end of file diff --git a/protected/views/cmsPage/index.php b/protected/views/cmsPage/index.php new file mode 100644 index 0000000..2b9d12d --- /dev/null +++ b/protected/views/cmsPage/index.php @@ -0,0 +1,17 @@ +<?php +$this->breadcrumbs=array( + 'Cms Pages', +); + +$this->menu=array( + array('label'=>'Create CmsPage', 'url'=>array('create')), + array('label'=>'Manage CmsPage', 'url'=>array('admin')), +); +?> + +<h1>Cms Pages</h1> + +<?php $this->widget('zii.widgets.CListView', array( + 'dataProvider'=>$dataProvider, + 'itemView'=>'_view', +)); ?> diff --git a/protected/views/cmsPage/update.php b/protected/views/cmsPage/update.php new file mode 100644 index 0000000..e4aa403 --- /dev/null +++ b/protected/views/cmsPage/update.php @@ -0,0 +1,18 @@ +<?php +$this->breadcrumbs=array( + 'Cms Pages'=>array('index'), + $model->title=>array('view','id'=>$model->id), + 'Update', +); + +$this->menu=array( + array('label'=>'List CmsPage', 'url'=>array('index')), + array('label'=>'Create CmsPage', 'url'=>array('create')), + array('label'=>'View CmsPage', 'url'=>array('view', 'id'=>$model->id)), + array('label'=>'Manage CmsPage', 'url'=>array('admin')), +); +?> + +<h1>Update CmsPage <?php echo $model->id; ?></h1> + +<?php echo $this->renderPartial('_form', array('model'=>$model)); ?>
\ No newline at end of file diff --git a/protected/views/cmsPage/view.php b/protected/views/cmsPage/view.php new file mode 100644 index 0000000..b05fd2e --- /dev/null +++ b/protected/views/cmsPage/view.php @@ -0,0 +1,39 @@ +<?php +$this->breadcrumbs=array( + 'Cms Pages'=>array('index'), + $model->title, +); + +$this->menu=array( + array('label'=>'List CmsPage', 'url'=>array('index')), + array('label'=>'Create CmsPage', 'url'=>array('create')), + array('label'=>'Update CmsPage', 'url'=>array('update', 'id'=>$model->id)), + array('label'=>'Delete CmsPage', 'url'=>'#', 'linkOptions'=>array('submit'=>array('delete','id'=>$model->id),'confirm'=>'Are you sure you want to delete this item?')), + array('label'=>'Manage CmsPage', 'url'=>array('admin')), +); +?> + +<h1><?php echo $model->title; ?></h1> + +<div> +<?php + $parser=new CMarkdownParser; + echo $parser->safeTransform($model->content); + +?> +</div> + +<?php $this->widget('zii.widgets.CDetailView', array( + 'data'=>$model, + 'attributes'=>array( + 'id', + 'content', + 'title', + 'create_time', + 'update_time', + 'status', + 'slug', + ), +)); ?> + +<div>Diese Seite wurde am <?php echo $model->update_time ?> zuletzt aktualisiert.</div>
\ No newline at end of file |
