/**
  * Returns the title of the module
  *
  * @return string
  */
 public function getTitle()
 {
     $title = 'OntoWiki';
     if (!$this->_owApp->user instanceof Erfurt_Auth_Identity) {
         return $title;
     }
     if ($this->_owApp->user->isOpenId() || $this->_owApp->user->isWebId()) {
         if ($this->_owApp->user->getLabel() !== '') {
             $userName = $this->_owApp->user->getLabel();
             $userName = OntoWiki_Utils::shorten($userName, 25);
         } else {
             $userName = OntoWiki_Utils::getUriLocalPart($this->_owApp->user->getUri());
             $userName = OntoWiki_Utils::shorten($userName, 25);
         }
     } else {
         if ($this->_owApp->user->getUsername() !== '') {
             $userName = $this->_owApp->user->getUsername();
             $userName = OntoWiki_Utils::shorten($userName, 25);
         } else {
             $userName = OntoWiki_Utils::getUriLocalPart($this->_owApp->user->getUri());
             $userName = OntoWiki_Utils::shorten($userName, 25);
         }
     }
     if (isset($userName) && $userName !== 'Anonymous') {
         $title .= ' (' . $userName . ')';
     }
     return $title;
 }
Esempio n. 2
0
 public function onDisplayLiteralPropertyValue($event)
 {
     if (array_key_exists($event->property, $this->_properties) && Erfurt_Uri::check($event->value)) {
         return '<a href="' . $event->value . '">' . OntoWiki_Utils::shorten($event->value, 60) . '</a>';
     }
 }