mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-27 01:26:30 +00:00
make_table_with_key_is_id function added to replace and use for like filling the category array, I guess it will be used in the future for a lot of different things
--HG-- branch : quitta-gsoc-2013
This commit is contained in:
parent
ba69c5939e
commit
fca8eb1ced
2 changed files with 10 additions and 5 deletions
|
@ -16,4 +16,13 @@ class Gui_Elements{
|
|||
return $result;
|
||||
}
|
||||
|
||||
public static function make_table_with_key_is_id( $inputList, $funcArray, $idFunction){
|
||||
$result = Array();
|
||||
foreach($inputList as $element){
|
||||
foreach($funcArray as $function){
|
||||
$result[$element->$idFunction()] = $element->$function();
|
||||
}
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
}
|
|
@ -29,11 +29,7 @@ function createticket(){
|
|||
//create array of category id & names
|
||||
global $cfg;
|
||||
$catArray = Ticket_Category::getAllCategories($cfg['db']['lib']);
|
||||
$result['category'] = Array();
|
||||
foreach($catArray as $catObj){
|
||||
$result['category'][$catObj->getTCategoryId()] = $catObj->getName();
|
||||
}
|
||||
|
||||
$result['category'] = Gui_Elements::make_table_with_key_is_id($catArray, Array("getName"), "getTCategoryId" );
|
||||
return $result;
|
||||
|
||||
}else{
|
||||
|
|
Loading…
Reference in a new issue