Advertisement
Guest User

Untitled

a guest
Feb 29th, 2012
265
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.98 KB | None | 0 0
  1. <?php if (Yii::app()->user->isGuest) {
  2. ?><div class="ext-comment-not-loggedin">
  3.     Sorry, you have to login to leave a comment.
  4. </div><?php } else { ?>
  5. <div id="ext-comment-form-<?php echo $comment->isNewRecord ? 'new' : 'edit-'.$comment->id; ?>" class="form">
  6.  
  7. <?php $form = $this->beginWidget('CActiveForm', array(
  8.     'id'=>'ext-comment-form',
  9.     'action'=>array('/comment/comment/create'),
  10.     'enableAjaxValidation'=>false
  11. )); ?>
  12.  
  13.     <?php /** @var CActiveForm $form */
  14.     echo $form->errorSummary($comment); ?>
  15.  
  16.     <div class="row">
  17.         <?php echo $form->labelEx($comment,'message'); ?>
  18.         <?php echo $form->error($comment,'message'); ?>
  19.         <?php // this works -> echo $form->textArea($comment,'message'); ?>
  20.         <?php //this widget works at other places but not here
  21. $this->widget('application.extensions.editme.ExtEditMe', array(
  22.     'model'=>$comment,
  23.     'height'=>'300px',
  24.     'width'=>'100%',
  25.     'attribute'=>'message',
  26.     'filebrowserImageBrowseUrl'=>  Yii::app()->baseUrl.'/kcfinder/browse.php?type=images&cms=yii',
  27.     'filebrowserImageBrowseLinkUrl'=>Yii::app()->baseUrl.'/kcfinder/browse.php?type=images&cms=yii',
  28.     'filebrowserImageUploadUrl'=>Yii::app()->baseUrl.'/kcfinder/upload.php?type=images&cms=yii',
  29. )); ?>
  30.     </div>
  31.  
  32.     <div class="row buttons">
  33.         <?php if ($comment->isNewRecord) {
  34.        
  35.  
  36.             echo $form->hiddenField($comment, 'type');
  37.             echo $form->hiddenField($comment, 'key');
  38.  
  39.             /* echo CHtml::hiddenField('returnUrl', $this->createUrl(''));}
  40.             echo CHtml::submitButton('Save'); */
  41.             echo CHtml::ajaxSubmitButton('Submit',
  42.                 array('/comment/comment/create'),
  43.                 array(
  44.                     'replace'=>'#ext-comment-form-new',
  45.                     'error'=>"function(){
  46.                        $('#Comment_message').css('border-color', 'red');
  47.                        $('#Comment_message').css('background-color', '#fcc');
  48.                    }"
  49.                 ),
  50.                 array('id'=>'ext-comment-submit' . (isset($ajaxId) ? $ajaxId : ''))
  51.             );
  52.         } else {
  53.             echo CHtml::ajaxSubmitButton('Update',
  54.                 array('/comment/comment/update', 'id'=>$comment->id),
  55.                 array(
  56.                     'replace'=>'#ext-comment-form-edit-'.$comment->id,
  57.                     'error'=>"function(){
  58.                         $('#Comment_message').css('border-color', 'red');
  59.                         $('#Comment_message').css('background-color', '#fcc');
  60.                     }"
  61.                 ),
  62.                 array('id'=>'ext-comment-submit' . (isset($ajaxId) ? $ajaxId : ''))
  63.             );
  64.         }
  65.         ?>
  66.     </div>
  67.  
  68. <?php $this->endWidget() ?>
  69.  
  70. </div><!-- form -->
  71. <?php } ?>
  72.  
  73. <?php /* $this->widget('application.extensions.editme.ExtEditMe', array(
  74.     'model'=>$comment,
  75.     'height'=>'300px',
  76.     'width'=>'100%',
  77.     'attribute'=>'message',
  78.     'filebrowserImageBrowseUrl'=>  Yii::app()->baseUrl.'/kcfinder/browse.php?type=images&cms=yii',
  79.     'filebrowserImageBrowseLinkUrl'=>Yii::app()->baseUrl.'/kcfinder/browse.php?type=images&cms=yii',
  80.     'filebrowserImageUploadUrl'=>Yii::app()->baseUrl.'/kcfinder/upload.php?type=images&cms=yii',
  81. )); */?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement