Exemplo n.º 1
0
 /**
  * Display the value of this relation.
  *
  * @param array $record
  * @param string $mode
  *
  * @return string piece of html code
  */
 public function display($record, $mode)
 {
     $record[$this->fieldName()] = $record[$this->fieldName()]['selected'];
     return parent::display($record, $mode);
 }
Exemplo n.º 2
0
 /**
  * Get the HTML label of the attribute.
  *
  * The difference with the label() method is that the label method always
  * returns the HTML label, while the getLabel() method is 'smart', by
  * taking the self::AF_NOLABEL and self::AF_BLANKLABEL flags into account.
  *
  * @param array $record The record holding the value for this attribute.
  * @param string $mode The mode ("add", "edit" or "view")
  *
  * @return string The HTML compatible label for this attribute, or an
  *                empty string if the label should be blank, or NULL if no
  *                label at all should be displayed.
  */
 public function getLabel($record = [], $mode = '')
 {
     $additional = '';
     if ($this->hasPositionAttribute()) {
         if (is_null($this->m_positionAttributeHtmlModifier)) {
             $additional = ' <img src="' . Config::getGlobal('assets_url') . 'images/up-down.gif"
       width="10" height="10" 
       alt="Sortable Ordering" 
       title="Sortable Ordering" />';
         } else {
             $additional = $this->m_positionAttributeHtmlModifier;
         }
     }
     return parent::getLabel($record, $mode) . $additional;
 }