function build_cats_tree_select($tree, $ident = 0, $selected = 0) { if (is_array($tree)) { $tree_select = ""; foreach ($tree as $item) { $tree_select .= "<option value='" . $item['ctg_cat_id'] . "'" . ($selected == $item['ctg_cat_id'] ? " selected='selected'" : "") . ">" . make_ident($ident) . " " . $item['ctg_cat_title'] . "</option>"; if (isset($item['childs'])) { $tree_select .= build_cats_tree_select($item['childs'], $ident + 1, $selected); } } } else { return null; } return $tree_select; }
} echo "<tr>"; echo "<td class='tbl' width='250'>" . $locale['ctg10'] . "</td>"; echo "<td class='tbl'><input type='text' class='textbox' style='width:250px;' name='title' value='" . $title . "' /></td>"; echo "</tr><tr>"; echo "<td class='tbl' width='250'>" . $locale['ctg33'] . "</td>"; echo "<td class='tbl'><input type='text' class='textbox' style='width:250px;' name='cost' value='" . $cost . "' /></td>"; echo "</tr><tr>"; echo "<td class='tbl' width='250'>" . $locale['ctg11a'] . "</td>"; echo "<td class='tbl'><textarea class='textbox' style='width:250px;' name='short_desc'>" . $short_desc . "</textarea></td>"; echo "</tr><tr>"; echo "<td class='tbl' width='250'>" . $locale['ctg11'] . "</td>"; echo "<td class='tbl'><textarea class='textbox' style='width:250px;' name='desc'>" . $desc . "</textarea></td>"; echo "</tr><tr>"; echo "<td class='tbl'>" . $locale['ctg12'] . "</td>"; echo "<td class='tbl'><select name='cat_id' class='textbox'><option value='0'>" . $locale['ctg19'] . "</option>" . build_cats_tree_select(build_cats_tree_array($cats), 0, $cat_id) . "</select></td>"; echo "</tr><tr valign='top'>"; echo "<td class='tbl'>" . $locale['ctg38'] . "</td>"; echo "<td class='tbl'>"; echo "<div id='files-uploaded'>"; if ($images && !empty($images)) { foreach ($images as $image) { echo "<div class='uimage uimage-" . $image['ctg_image_id'] . "'><input type='radio' name='cover' value='" . $image['ctg_image_id'] . "'" . ($image['ctg_image_id'] == $cover_image ? " checked='checked'" : "") . " /><img src='" . AL_CATALOG_DIR . "uploads/" . $image['ctg_image_thumb'] . "' height='50' /><a href='#' data-image-id='" . $image['ctg_image_id'] . "' class='delete-image'>" . $locale['ctg8'] . "</a><input type='hidden' name='images-uploaded[]' value='" . $image['ctg_image_id'] . "' />\n <input type='checkbox' name='images-hidden[]' value='" . $image['ctg_image_id'] . "'" . ($image['ctg_image_show'] == 0 ? " checked" : "") . " /> " . $locale['ctg49'] . "\n <pre>[CATALOG_IMAGE_" . $image['ctg_image_id'] . "]</pre>\n </div>"; } } echo "</div>"; echo "<div id='files-container'><div id='filelist'></div><br /><a href='#' id='ctg-upload-image'>" . $locale['ctg40'] . "</a></div>"; echo "</td>"; echo "</tr><tr>"; echo "<td class='tbl'>" . $locale['ctg39'] . "</td>"; echo "<td class='tbl' id='tabs-container'>";