Ejemplo n.º 1
0
            $parent_id = $selected_footprint->get_parent_id();
            $html->set_variable('id', $selected_footprint->get_id(), 'integer');
            $name = $selected_footprint->get_name();
            $filename = $selected_footprint->get_filename();
        } elseif ($action == 'add') {
            $parent_id = $new_parent_id;
            $name = $new_name;
            $filename = $new_filename;
        } else {
            $parent_id = 0;
            $name = '';
            $filename = '';
        }
        $html->set_variable('name', $name, 'string');
        $html->set_variable('filename', str_replace(BASE . '/', '', $filename), 'string');
        $footprint_list = $root_footprint->build_html_tree($selected_id, true, false);
        $html->set_variable('footprint_list', $footprint_list, 'string');
        $parent_footprint_list = $root_footprint->build_html_tree($parent_id, true, true);
        $html->set_variable('parent_footprint_list', $parent_footprint_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_footprints.php' : '';
// an empty string means that the...
Ejemplo n.º 2
0
         $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) {
     $messages[] = array('text' => nl2br($e->getMessage()), 'strong' => true, 'color' => 'red');
     $fatal_error = true;