Esempio n. 1
0
 /**
  * Render the value(s) of a cell
  *
  * @param Clansuite_Datagrid_Cell
  * @return string Return html-code
  */
 public function renderCell($oCell)
 {
     $image_alt = $value = $oCell->getValue();
     // build an image name for the alt-tag
     if (mb_strlen($value) > $this->nameWrapLength) {
         $image_alt = mb_substr($value, 0, $this->nameWrapLength - 5) . 'Image';
     }
     return $this->_replacePlaceholders($value, Clansuite_HTML::img($value, array('alt' => $image_alt)));
 }
Esempio n. 2
0
 /**
  * Render the value(s) of a cell
  *
  * @param Clansuite_Datagrid_Cell
  * @return string Return html-code
  */
 public function renderCell($oCell)
 {
     // assign values to internal var
     $values = $oCell->getValues();
     // set internal link
     $this->link = parent::getColumn()->getBaseURL();
     // validate
     if (false == isset($values['name'])) {
         throw new Clansuite_Exception(_('A link needs a name. Please define "name" in the ResultKeys'));
     } else {
         if (mb_strlen($values['name']) > $this->nameWrapLength) {
             $values['name'] = mb_substr($values['name'], 0, $this->nameWrapLength - 3) . '...';
         }
     }
     // render
     return $this->_replacePlaceholders($values, Clansuite_HTML::renderElement('a', $this->nameFormat, array('href' => Clansuite_Datagrid::appendUrl($this->linkFormat), 'id' => $this->linkId, 'title' => $this->linkTitle)));
 }