Diese Array taucht nur auf, wenn $catid nicht leer ist.
Im PHP Code gibt es keine Ausgaben und es ist ausgeschlossen, dass dieses Array aus anderen Teilen kommen kann. Es muss sich hier irgendwo verstecken.
Das Problem ist wohl mal wieder, das ihr mit dem Code nicht allzuviel anfangen könnt, da ich ja auf eine ganze Funktionsreferenz zurückgreien kann. Aus diesem Grund habe ich die wichtigsten Funktionen auch angehängt. Ich sehe da kein Array.
PHP-Code:
/** ensure this file is being included by a parent file */
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
$sections = $params->get( 'sections', '' );
$okbutton = $params->get( 'okbutton', '1' );
$pretext = $params->get( 'pretext', '' );
$precatlist = $params->get( 'precatlist', '' );
$precontentlist = $params->get( 'precontentlist', '' );
$firstcatoption = $params->get( 'firstcatoption', '' );
$firstcontentoption = $params->get( 'firstcontentoption', '' );
$defaultItemid = intval( $params->get( 'defaultitemid', '' ) );
$catid = intval( mosGetParam( $_REQUEST, 'catid', '' ) );
$id = intval( mosGetParam( $_REQUEST, 'id', '' ) );
$option = mosGetParam( $_REQUEST, 'option', '' );
$task = mosGetParam( $_REQUEST, 'task', '' );
global $Itemid;
if($Itemid) {
$_Itemid = $Itemid;
} else {
$_Itemid = 0;
}
if($defaultItemid) {
$_Itemid = $defaultItemid;
}
global $database, $my;
$query = "SELECT c.id, c.name FROM jos_categories AS c"
."\n INNER JOIN jos_sections AS s ON s.id=c.section"
."\n WHERE c.access<=".$my->gid
. (!empty($sections) ? ' AND c.section IN ('.$sections.')' : '')
."\n AND c.published=1"
;
$database->setQuery( $query );
$cats = $database->loadObjectList();
$categories = array();
if (!empty($firstcatoption) || (count($row)<=1 && !$okbutton)) {
$categories[] = mosHTML::makeOption( '', $firstcatoption );
}
foreach ( $cats as $cat ) {
$categories[] = mosHTML::makeOption( $cat->id, $cat->name);
}
$cat_list = mosHTML::selectList( $categories, 'catid', 'class="inputbox" size="1" onChange="document.catForm.submit();"', 'value', 'text', $catid );
if(!empty($catid)) {
$query = "SELECT id, title FROM #__content"
."\n WHERE catid=".$catid
."\n AND access<=".$my->gid
."\n AND state=1"
. (!empty($sections) ? ' AND section IN ('.$sections.')' : '')
;
$database->setQuery( $query );
$content = $database->loadObjectList();
$contents = array();
if (!empty($firstcontentoption) || (count($content)<=1 && !$okbutton)) {
$contents[] = mosHTML::makeOption( '', $firstcontentoption );
}
foreach ( $content as $c ) {
$contents[] = mosHTML::makeOption( $c->id, $c->title );
}
$content_list = mosHTML::selectList( $contents, 'id', 'class="inputbox" size="1" onChange="document.contentForm.submit();"', 'value', 'text', $id );
}
?>
PHP-Code:
function makeOption( $value, $text='', $value_name='value', $text_name='text' ) {
$obj = new stdClass;
$obj->$value_name = $value;
$obj->$text_name = trim( $text ) ? $text : $value;
return $obj;
}
PHP-Code:
function selectList( &$arr, $tag_name, $tag_attribs, $key, $text, $selected=NULL, $idtag=false, $flag=false ) {
reset( $arr );
$id = $tag_name;
if ( $idtag ) {
$id = $idtag;
}
$html = '<select name="'. $tag_name .'" id="'. $id .'" '. $tag_attribs .'>';
for ($i=0, $n=count( $arr ); $i < $n; $i++ ) {
if( is_array( $arr[$i] ) ) {
$k = $arr[$i][$key];
$t = $arr[$i][$text];
$id = ( isset( $arr[$i]['id'] ) ? $arr[$i]['id'] : null );
} else {
$k = $arr[$i]->$key;
$t = $arr[$i]->$text;
$id = ( isset( $arr[$i]->id ) ? $arr[$i]->id : null );
}
//if no string after hypen - take hypen out
$splitText = explode( " - ", $t, 2 );
$t = $splitText[0];
if(isset($splitText[1])){ $t .= " - ". $splitText[1]; }
$extra = '';
//$extra .= $id ? ' id="' . $arr[$i]->id . '"' : '';
if (is_array( $selected )) {
foreach ($selected as $obj) {
$k2 = $obj->$key;
if ($k == $k2) {
$extra .= ' selected="selected"';
break;
}
}
} else {
$extra .= ( $k == $selected ? ' selected="selected"' : '' );
}
//if flag translate text
if($flag) $t = JText::_( $t );
$html .= '<option value="'. $k .'" '. $extra .'>' . $t . '</option>';
}
$html .= '</select>';
return $html;
}