예제 #1
0
 /**
  * Returns a displayable string for this value.
  *
  * @param array $record The record to display
  * @param string $mode The display mode ("view" for viewpages, or "list"
  *                       for displaying in recordlists, "edit" for
  *                       displaying in editscreens, "add" for displaying in
  *                       add screens. "csv" for csv files. Applications can
  *                       use additional modes.
  *
  * @return string
  */
 public function display($record, $mode)
 {
     if ($mode == 'csv') {
         return parent::display($record, $mode);
     }
     if (isset($record[$this->fieldName()]) && $record[$this->fieldName()] != '') {
         return '<a href="mailto:' . $record[$this->fieldName()] . '">' . $record[$this->fieldName()] . '</a>';
     }
     return '';
 }
예제 #2
0
 function display($record = "", $mode = '')
 {
     if ($this->getSearchType() == "number") {
         $attr = new NumberAttribute($this->fieldName());
         return $attr->display($record, $mode);
     } else {
         if ($this->getSearchType() == "date") {
             $attr = new DateAttribute($this->fieldName());
             $record[$this->fieldName()] = $attr->db2value($record);
             return $attr->display($record, $mode);
         }
     }
     return parent::display($record, $mode);
 }
예제 #3
0
 /**
  * Returns a displayable string for this value, to be used in HTML pages.
  *
  * @param array $record The record that holds the value for this attribute
  * @param string $mode The display mode.
  *
  * @return string HTML String
  */
 public function display($record, $mode)
 {
     if ($this->m_ownerInstance->m_partial == 'attribute.' . $this->fieldName() . '.refresh') {
         $record[$this->fieldName()] = $this->load($this->m_ownerInstance->getDb(), $record, $mode);
     }
     return parent::display($record, $mode);
 }