$name = $new_name; $disable_footprints = $new_disable_footprints; $disable_manufacturers = $new_disable_manufacturers; $disable_autodatasheets = $new_disable_autodatasheets; } else { $parent_id = 0; $name = ''; $disable_footprints = false; $disable_manufacturers = false; $disable_autodatasheets = false; } $html->set_variable('name', $name, 'string'); $html->set_variable('disable_footprints', $disable_footprints, 'boolean'); $html->set_variable('disable_manufacturers', $disable_manufacturers, 'boolean'); $html->set_variable('disable_autodatasheets', $disable_autodatasheets, 'boolean'); $category_list = $root_category->build_html_tree($selected_id, true, false); $html->set_variable('category_list', $category_list, 'string'); $parent_category_list = $root_category->build_html_tree($parent_id, true, true); $html->set_variable('parent_category_list', $parent_category_list, 'string'); } catch (Exception $e) { $messages[] = array('text' => nl2br($e->getMessage()), 'strong' => true, 'color' => 'red'); $fatal_error = true; } } /******************************************************************************** * * Generate HTML Output * *********************************************************************************/ $reload_link = $fatal_error ? 'edit_categories.php' : ''; // an empty string means that the...
} if (isset($searched_element) && get_class($searched_element) == 'Category') { $category_id = $searched_element->get_id(); } if (isset($searched_element) && get_class($searched_element) == 'Footprint') { $footprint_id = $searched_element->get_id(); } if (isset($searched_element) && get_class($searched_element) == 'Storelocation') { $storelocation_id = $searched_element->get_id(); } if (isset($searched_element) && get_class($searched_element) == 'Manufacturer') { $manufacturer_id = $searched_element->get_id(); } // dropdown lists -> generate lists $manufacturer_list = $root_manufacturer->build_html_tree($manufacturer_id, true, false); $category_list = $root_category->build_html_tree($category_id, true, false); $storelocation_list = $root_storelocation->build_html_tree($storelocation_id, true, false); $footprint_list = $root_footprint->build_html_tree($footprint_id, true, false); // the category ID is used for creating a new part (in *.tmpl file the latest DIV element) $html->set_variable('category_id', $category_id, 'integer'); // dropdown lists -> set html variables $html->set_variable('manufacturer_list', $manufacturer_list, 'string'); $html->set_variable('category_list', $category_list, 'string'); $html->set_variable('storelocation_list', $storelocation_list, 'string'); $html->set_variable('footprint_list', $footprint_list, 'string'); // global/category stuff $category = new Category($database, $current_user, $log, $category_id); $html->set_variable('disable_footprints', $config['footprints']['disable'] || $category->get_disable_footprints(true), 'boolean'); $html->set_variable('disable_manufacturers', $config['manufacturers']['disable'] || $category->get_disable_manufacturers(true), 'boolean'); $html->set_variable('max_upload_filesize', ini_get('upload_max_filesize'), 'string'); } catch (Exception $e) {