Esempio n. 1
0
 /**
  * add list to a Xoops\Form\OptionElement
  *
  * @param OptionElement $element      Form element to add options to
  * @param string        $subDirectory subdirectory (deprecated)
  *
  * @return void
  */
 public static function setOptionsArray(OptionElement $element, $subDirectory = '')
 {
     $xoops = \Xoops::getInstance();
     $subjects = static::getList($subDirectory);
     foreach (array_keys($subjects) as $name) {
         $element->addOption($name, '<img src="' . $xoops->url('images/subject/') . $name . '" alt="' . $name . '" />');
     }
 }
Esempio n. 2
0
 /**
  * add list to a Xoops\Form\OptionElement
  *
  * @param OptionElement $element
  *
  * @return void
  */
 public static function setOptionsArray(OptionElement $element)
 {
     $args = func_get_args();
     array_shift($args);
     if (empty($args)) {
         $element->addOptionArray(static::getList());
     } else {
         $element->addOptionArray(call_user_func_array('static::getList', $args));
     }
 }
Esempio n. 3
0
 /**
  * add list to a Xoops\Form\OptionElement
  *
  * @param OptionElement $element
  *
  * @return void
  */
 public static function setOptionsArray(OptionElement $element)
 {
     $element->addOptionArray(["" => "-"]);
     parent::setOptionsArray($element);
 }