Exemple #1
0
 public function actionGet($key = null)
 {
     $criteria = new CDbCriteria();
     if (!$key) {
         $criteria->compare('t.`visible`', 1);
     }
     if ($key) {
         $criteria->compare('t.`key`', $key);
     }
     $criteria->order = "sort";
     // not with('events') because i have a condition and order there
     if ($models = Team::model()->with('pages')->findAll($criteria)) {
         if (count($models) == 1) {
             $this->pageTitle = $models[0]->name . ' - ' . $this->pageTitle;
         } else {
             $this->pageTitle = 'Team vom ' . $this->pageTitle;
             ShortWidgets::addJsShorten(".text", 350);
         }
         $this->render('get', array('models' => $models));
     }
 }
 public function init()
 {
     ShortWidgets::addJsShorten(".ext-comment p", 150);
     parent::init();
 }
        ?>
)</a></li>
		<?php 
    }
    ?>
	</ul>
<?php 
}
?>

<div class="tab-content">
	<?php 
if ($commentable) {
    // TODO - this doesn't work with hidden elements - maybe is there some update trigger?
    // I reduced the pagesize so it is no big problem..
    ShortWidgets::addJsShorten(".ext-comment p", 60);
    ?>
	<div class="tab-pane text<?php 
    if (!$eventable || !$model->events) {
        ?>
 active<?php 
    }
    ?>
" id="comments">
		<?php 
    if (count($comments)) {
        ?>
		<br/>
		<?php 
        echo CHtml::link('<i class="glyphicon glyphicon-comment"></i> ins Gästebuch eintragen', array('/page/guestbook/list/', 'comment' => $model->key), array('rel' => 'nofollow'));
        ?>