function generateListItems(&$pHash, $pOptions, $pLocate) { $ret = ''; foreach (array_keys($pHash) as $conId) { $class = !empty($pOptions['radio_checkbox']) ? 'checkbox' : ''; $ret .= '<li id="fisheyegallery' . $pHash[$conId]['content']['gallery_id'] . '" gallery_id="' . $pHash[$conId]['content']['gallery_id'] . '" '; if (!empty($pOptions['item_attributes'])) { foreach ($pOptions['item_attributes'] as $key => $value) { if ($key == 'class') { $class .= ' ' . $value; } else { $ret .= " {$key}=\"{$value}\" "; } } } $ret .= ' class="' . $class . '"><label>'; if ($pLocate || $pHash[$conId]['content']['content_id'] != $this->mContentId) { if (!empty($pOptions['radio_checkbox'])) { $ret .= '<input type="checkbox" name="gallery_additions[]" value="' . $pHash[$conId]['content']['gallery_id'] . '" '; if (!empty($pHash[$conId]['content']['in_gallery']) || $pHash[$conId]['content']['content_id'] == $this->mContentId) { $ret .= ' checked="checked" '; } $ret .= '/>'; } } if ($pHash[$conId]['content']['content_id'] == $this->mContentId or isset($pHash[$conId]['content']['in_gallery']) and $pHash[$conId]['content']['in_gallery']) { $ret .= '<span class="active">' . htmlspecialchars($pHash[$conId]['content']['title']) . '</span>'; } else { $ret .= htmlspecialchars($pHash[$conId]['content']['title']); } $ret .= '</label></li>'; if (!empty($pHash[$conId]['children'])) { $ret .= '<li><ul>' . FisheyeGallery::generateListItems($pHash[$conId]['children'], $pOptions, $pLocate) . '</ul></li>'; } } return $ret; }