예제 #1
0
파일: Termin.php 프로젝트: balrok/aiajaya
 public function getUntertitel($export = false, $links = true, $htmlentities = true)
 {
     $text = str_replace('--', '<br/>', CHtml::encode($this->untertitel));
     if (Yii::app()->getModule('event')->team) {
         if (!self::$teamModels) {
             self::$teamModels = Team::model()->findAll();
         }
         foreach (self::$teamModels as $model) {
             $alias = array($model->name);
             if ($htmlentities) {
                 $alias[] = htmlentities($model->name);
             } else {
                 $alias[] = $model->name;
             }
             if ($model->name == 'Milam M. Horn') {
                 $alias[] = 'Milam Horn';
                 $alias[] = 'Milam';
             }
             if ($model->name == 'Katarina Heidenreich') {
                 $alias[] = 'Katarina';
                 $alias[] = 'K.Heidenreich';
             }
             foreach ($alias as $name) {
                 if (strpos($text, $name) !== false) {
                     $this->teamLinks[] = $model->key;
                     if ($links) {
                         if ($export) {
                             $text = str_replace($name, CHtml::link(substr($name, 0, 1), Yii::app()->controller->createAbsoluteUrl('//page/team/get', array('key' => $model->key)), array('style' => '#placeholderpersonstyle#', 'title' => 'Teamseite')) . substr($name, 1), $text);
                         } else {
                             $text = str_replace($name, CHtml::link('<i class="glyphicon glyphicon-user"></i>', array('/page/team/get', 'key' => $model->key), array('rel' => 'nofollow')) . " " . $name, $text);
                         }
                     }
                     break;
                 }
             }
         }
     }
     return $text;
 }