Example #1
0
    // admin
    $root_category = new Category($database, $current_user, $log, 0);
    $root_device = new Device($database, $current_user, $log, 0);
} catch (Exception $e) {
    $messages[] = array('text' => nl2br($e->getMessage()), 'strong' => true, 'color' => 'red');
    $fatal_error = true;
}
/********************************************************************************
 *
 *   Build Navigation Trees
 *
 *********************************************************************************/
$html->use_javascript(array('dtree', 'toggle'));
if (!$fatal_error) {
    try {
        $javascript = $root_category->build_javascript_tree('cat_navtree', 'show_category_parts.php', 'cid', 'content_frame');
        $html->set_variable('categories_navtree', $javascript);
        $javascript = $root_device->build_javascript_tree('cat_devtree', 'show_device_parts.php', 'device_id', 'content_frame', true, true, 'Übersicht', false, true);
        $html->set_variable('devices_navtree', $javascript);
    } catch (Exception $e) {
        $messages[] = array('text' => 'Die Navigationsmenüs konnten nicht erfolgreich erstellt werden!', 'strong' => true, 'color' => 'red');
        $messages[] = array('text' => 'Fehlermeldung: ' . nl2br($e->getMessage()), 'color' => 'red');
    }
}
/********************************************************************************
 *
 *   Set the rest of the HTML variables
 *
 *********************************************************************************/
$html->set_variable('disable_footprints', $config['footprints']['disable'], 'boolean');
$html->set_variable('disable_manufacturers', $config['manufacturers']['disable'], 'boolean');