示例#1
0
 public function request()
 {
     if ($this->buttonClicked('saveSmiley')) {
         $smileyData = $this->getRequestVar('smiley');
         if (!$smileyData['filename'] || !$smileyData['code']) {
             $this->view->addErrorMessage('SAVE_FAILED_SMILEY');
             return true;
         }
         $this->smiley = new \fpcm\model\files\smiley($smileyData['filename']);
         $this->smiley->setSmileycode($smileyData['code']);
         if (!$this->smiley->save()) {
             $this->view->addErrorMessage('SAVE_FAILED_SMILEY');
             return true;
         }
         $this->cache->cleanup();
         $this->redirect('smileys/list', array('added' => 1));
     }
     $this->view->addJsVars(array('fpcmNavigationActiveItemId' => 'submenu-itemnav-item-smileys'));
     return true;
 }
示例#2
0
 /**
  * Parst Smileys
  * @param \fpcm\model\files\smiley $smiley
  * @return string
  */
 private function parseSmileyFilePath(\fpcm\model\files\smiley $smiley)
 {
     return '<img src="' . $smiley->getSmileyUrl() . '" class="fpcm-pub-smiley" ' . $smiley->getWhstring() . ' alt="">';
 }