protected function show_available()
{
// Get list of styles
$styles = $this->find_available(true);
// Show styles
if (empty($styles)) {
trigger_error($this->user->lang['NO_UNINSTALLED_STYLE'] . adm_back_link($this->u_base_action), E_USER_NOTICE);
}
usort($styles, array($this, 'sort_styles'));
$this->styles_list_cols = 3;
$this->template->assign_vars(array('STYLES_LIST_COLS' => $this->styles_list_cols, 'STYLES_LIST_HIDE_COUNT' => true));
// Show styles
foreach ($styles as &$style) {
// Check if style has a parent style in styles list
$has_parent = false;
if ($style['_inherit_name'] != '') {
foreach ($styles as $parent_style) {
if ($parent_style['style_name'] == $style['_inherit_name'] && empty($parent_style['_shown'])) {
// Show parent style first
$has_parent = true;
}
}
}
if (!$has_parent) {
$this->list_style($style, 0);
$this->show_available_child_styles($styles, $style['style_name'], 1);
}
}
// Show styles that do not have parent style in styles list
foreach ($styles as $style) {
if (empty($style['_shown'])) {
$this->list_style($style, 0);
}
}
// Add button
if (isset($this->style_counters) && $this->style_counters['caninstall'] > 0) {
$this->template->assign_block_vars('extra_actions', array('ACTION_NAME' => 'install', 'L_ACTION' => $this->user->lang['INSTALL_STYLES']));
}
}