Exemplo n.º 1
0
 function getOneLevelOfCategoriesAjax()
 {
     global $gorumroll, $lll;
     list($allowAd, $recursive) = G::getAttr($gorumroll->rollid, "appcategory", "allowAd", "recursive");
     $fields = $this->getOneLevelOfCategories($gorumroll->rollid);
     if (count($fields)) {
         $values = array_map(create_function('$v', 'return $v->id;'), $fields);
         $labels = array_map(create_function('$v', 'return htmlspecialchars($v->getAttr("name"));'), $fields);
         $rels = array_map(create_function('$v', 'return $v->allowAd;'), $fields);
         array_unshift($values, 0);
         array_unshift($labels, $lll["selectCategory"]);
         array_unshift($rels, intval($allowAd || $recursive));
         $fields = GenerWidget::generSelectOptions($labels, $values, 0, '', $rels);
     } else {
         $fields = "";
     }
     echo "{ allowAd: " . intval($allowAd || $recursive) . ", fields: '" . str_replace("\n", "", addcslashes($fields, "'")) . "' }";
     die;
 }
Exemplo n.º 2
0
 function getValuesForRulesAjax()
 {
     global $gorumroll, $lll;
     $this->getValuesForRules($gorumroll->rollid, $labels, $values);
     echo GenerWidget::generSelectOptions($labels, $values);
     die;
 }
Exemplo n.º 3
0
 function generSelectField($name, &$labels, &$values, $id = "", $selected = 0, $size = 0, $width = 0, $showRelation = "", $extra = "")
 {
     $s = "\n<select name='{$name}'";
     if ($id) {
         $s .= " id='{$id}'";
     }
     if ($size > 0) {
         $s .= " size='{$size}'";
     }
     if ($width > 0) {
         $s .= " width='{$width}' style='width:{$width}px;'";
     }
     if ($extra != "") {
         $s .= " {$extra}";
     }
     $s .= ">\n";
     $s .= GenerWidget::generSelectOptions($labels, $values, $selected, $showRelation);
     $s .= "</select>\n";
     return $s;
 }