/**
  * Renders the parsed text.
  *
  * @param string $text The text to be parsed.
  * @return string The parsed text.
  */
 public function getParsedText($text)
 {
     if ($this->smileys === NULL) {
         $this->smileys = $this->smileyRepository->findAll();
     }
     foreach ($this->smileys as $smiley) {
         $text = str_replace($smiley->getSmileyShortcut(), $this->getSmileyIcon($smiley), $text);
     }
     return $text;
 }
예제 #2
0
 /**
  * @return array
  */
 public function getItems()
 {
     if ($this->smileys === NULL) {
         $this->smileys = $this->smileyRepository->findAll();
     }
     if (count($this->smileys) === 0) {
         return FALSE;
     }
     $result = array();
     foreach ($this->smileys as $smiley) {
         $result[] = $smiley->exportForMarkItUp();
     }
     return array(array('name' => $this->settings['title'], 'className' => $this->settings['iconClassName'], 'replaceWith' => $this->smileys[0]->getSmileyShortcut(), 'dropMenu' => $result));
 }