getRepeatable() 공개 메소드

Get the rendering of this field type for a repeatable (grid) display, e.g. in a view listing many item (typically a "browse" task)
부터: 2.0
public getRepeatable ( ) : string
리턴 string The field HTML
예제 #1
0
파일: Title.php 프로젝트: Joal01/fof
 /**
  * Get the rendering of this field type for a repeatable (grid) display,
  * e.g. in a view listing many item (typically a "browse" task)
  *
  * @since 2.0
  *
  * @return  string  The field HTML
  */
 public function getRepeatable()
 {
     // Initialise
     $slug_field = isset($this->element['slug_field']) ? (string) $this->element['slug_field'] : $this->item->getFieldAlias('slug');
     $slug_format = $this->element['slug_format'] ? (string) $this->element['slug_format'] : '(%s)';
     $slug_class = $this->element['slug_class'] ? (string) $this->element['slug_class'] : 'small';
     // Get the regular display
     $html = parent::getRepeatable();
     $slug = $this->item->{$slug_field};
     $html .= '<br />' . '<span class="' . $slug_class . '">';
     $html .= JText::sprintf($slug_format, $slug);
     $html .= '</span>';
     return $html;
 }
예제 #2
0
 /**
  * Get the rendering of this field type for a repeatable (grid) display,
  * e.g. in a view listing many item (typically a "browse" task)
  *
  * @since 2.0
  *
  * @return  string  The field HTML
  */
 public function getRepeatable()
 {
     static $oldUrl = null;
     $this->class = ' ';
     if (!empty($oldUrl)) {
         $this->element['url'] = $oldUrl;
     }
     if ($this->value == '_MAIN_' || $this->item->primary) {
         $this->class = 'label label-success';
         $this->value = \JText::_('COM_ARS_DLIDLABELS_LBL_DEFAULT');
         $oldUrl = (string) $this->element['url'];
         $this->element['url'] = '';
     }
     return parent::getRepeatable();
 }