function edit($id) { global $my, $mainframe, $database, $option, $priTask, $subTask; global $WBG_CONFIG, $wbGalleryDB_cat; // Load Row $row = new wbGalleryDB_img($database); $row->load($id); // Build Select Lists $lists = array(); $catTree = $wbGalleryDB_cat->getCategoryTree(); $tList = array(mosHTML::makeOption('0', 'Select Category...', 'id', 'name')); $tList = array_merge($tList, $catTree); $lists['cat_id'] = mosHTML::selectList($tList, 'cat_id', '', 'id', 'name', $row->cat_id); // Catchup... if (!$row->width || !$row->height) { $path = $mainframe->getCfg('absolute_path') . $WBG_CONFIG->path_original . $row->file; if (file_exists($path)) { $row->size = filesize($path); $imgInfo = getimagesize($path); $row->width = $imgInfo[0]; $row->height = $imgInfo[1]; $row->store(); } } wbGallery_img_html::edit($row, $lists); }