public function showEpisode($episodeId)
    {
        if (! $episodeId) {
            return null;
        }
        $episode = $this->loader->getAgenda()->getEpisodeOfCare($episodeId);

        if (! $episode->exists) {
            return $episodeId;
        }

        $episodeItem = $this->menu->findAllowedController('care-episode', 'show');
        if ($episodeItem) {
            $href = $episodeItem->toHRefAttribute(['gec_episode_of_care_id' => $episodeId]);
        } else {
            $href = false;
        }

        if (! $href) {
            return $episode->getDisplayString();
        }

        $onclick = new \MUtil_Html_OnClickArrayAttribute();
        $onclick->addCancelBubble(true);
        return \MUtil_Html::create('a', $href, $episode->getDisplayString(), $onclick);
    }
public function showEpisode($episodeId)
    {
        if (! $episodeId) {
            return null;
        }
        $episode = $this->loader->getAgenda()->getEpisodeOfCare($episodeId);

        if (! $episode->exists) {
            return $episodeId;
        }

        $episodeItem = $this->menu->findAllowedController('care-episode', 'show');
        if ($episodeItem) {
            $href = $episodeItem->toHRefAttribute(['gec_episode_of_care_id' => $episodeId]);
        } else {
            $href = false;
        }

        if (! $href) {
            return $episode->getDisplayString();
        }

        $onclick = new \MUtil_Html_OnClickArrayAttribute();
        $onclick->addCancelBubble(true);
        return \MUtil_Html::create('a', $href, $episode->getDisplayString(), $onclick);
    }
public function showEpisode ( $ episodeId ) { if ( ! $ episodeId ) { return null ; } $ episode = $ this -> loader -> getAgenda ( ) -> getEpisodeOfCare ( $ episodeId ) ; if ( ! $ episode -> exists ) { return $ episodeId ; } $ episodeItem = $ this -> menu -> findAllowedController ( 'care-episode' , 'show' ) ; if ( $ episodeItem ) { $ href = $ episodeItem -> toHRefAttribute ( [ 'gec_episode_of_care_id' => $ episodeId ] ) ; } else { $ href = false ; } if ( ! $ href ) { return $ episode -> getDisplayString ( ) ; } $ onclick = new \ MUtil_Html_OnClickArrayAttribute ( ) ; $ onclick -> addCancelBubble ( true ) ; return \ MUtil_Html :: create ( 'a' , $ href , $ episode -> getDisplayString ( ) , $ onclick ) ; }
Display the episode
@param int $episodeId
@return string
Display the episode