1 <?php
 2 
 3 /**
 4  * @package redaxo\structure
 5  */
 6 class rex_form_widget_linklist_element extends rex_form_element
 7 {
 8     private $category_id = 0;
 9 
10     // 1. Parameter nicht genutzt, muss aber hier stehen,
11     // wg einheitlicher Konstrukturparameter
12     public function __construct($tag = '', rex_form_base $table = null, array $attributes = [])
13     {
14         parent::__construct('', $table, $attributes);
15     }
16 
17     public function setCategoryId($category_id)
18     {
19         $this->category_id = $category_id;
20     }
21 
22     public function formatElement()
23     {
24         static $widget_counter = 1;
25 
26         $html = rex_var_linklist::getWidget($widget_counter, $this->getAttribute('name'), $this->getValue(), ['category' => $this->category_id]);
27 
28         ++$widget_counter;
29         return $html;
30     }
31 }
32