예제 #1
0
 protected function _getEmoticonImg($emoticonCode, $height = null)
 {
     $emoticon = CM_Emoticon::findByCode($emoticonCode);
     if (!$emoticon) {
         throw new CM_Exception_Invalid('Cannot find emoticon for code `' . $emoticonCode . '`.');
     }
     $urlCdn = $this->_mockSite->getUrlCdn();
     $siteType = $this->_mockSite->getId();
     $deployVersion = CM_App::getInstance()->getDeployVersion();
     $heightAttribute = $height ? ' height="' . $height . '"' : '';
     return '<img src="' . $urlCdn . '/layout/' . $siteType . '/' . $deployVersion . '/img/emoticon/' . $emoticon->getFileName() . '" class="emoticon emoticon-' . $emoticon->getName() . '" title="' . $emoticon->getDefaultCode() . '"' . $heightAttribute . ' />';
 }
예제 #2
0
파일: All.php 프로젝트: cargomedia/cm
 public function __construct()
 {
     $source = new CM_PagingSource_Array(CM_Emoticon::getEmoticonData());
     parent::__construct($source);
 }
예제 #3
0
 public function testIsMail()
 {
     $emoticon = CM_Emoticon::findByCode(':-)');
     $siteDefault = CM_Site_Abstract::factory();
     $this->_assertSame('<span class="usertext oneline">foo <img src="http://cdn.default.dev/layout/' . $siteDefault->getId() . '/' . CM_App::getInstance()->getDeployVersion() . '/img/emoticon/smiley.png" class="emoticon emoticon-' . $emoticon->getName() . '" title=":smiley:" height="16" /></span>', array('text' => 'foo :-)', 'mode' => 'oneline', 'isMail' => true));
 }
예제 #4
0
 public function testFilesystemScanning()
 {
     $emoticon1 = new CM_Emoticon('smiley');
     $emoticon2 = CM_Emoticon::findByCode(':)');
     $this->assertEquals($emoticon1, $emoticon2);
 }