function _range_panel(&$app, $c)
{
    global $lang;
    $p =& $app->ui;
    $def =& $app->db->def;
    $m = array('marker_field' => 'marker');
    $p->paragraph();
    # Link to creator of new record.
    $p->v->cursor->set_key('');
    $p->open_row();
    $e = new event('tk_range_edit_select', $m);
    $e->set_next($app->event());
    $p->submit_button('select range', $e);
    $sel = tk_range_edit_all_selected($app, 'marker');
    if ($sel == 0 || $sel == 2) {
        $e = new event('tk_range_edit_select', $m);
        $e->set_next($app->event());
        $p->submit_button('select all', $e);
    }
    if ($sel == 1 || $sel == 2) {
        $e = new event('tk_range_edit_unselect', $m);
        $e->set_next($app->event());
        $p->submit_button('select all', $e);
    }
    $e_delete = new event('record_delete');
    $e_delete->set_next($app->event());
    $e = new event('tk_range_edit_call', array('view' => $e_delete, 'argname' => 'id', 'marker_field' => 'marker'));
    generic_create($app, $c);
    if ($c->have_submit_button) {
        $p->cmd_update();
    }
    $p->close_row();
    $p->paragraph();
}
 function _make_cmd($cmd, $label, $handler, $args)
 {
     global $lang;
     if (!$label) {
         $label = $lang["cmd {$cmd}"];
     }
     $this->open_row_and_cell();
     $e = new event(($this->no_update || $cmd == 'delete' ? 'record' : 'form') . "_{$cmd}");
     $e->set_next($this->make_event($handler, $args));
     $this->submit_button($label, $e);
     $this->close_cell_and_row();
 }
Example #3
0
function _show_object_class(&$documents, &$images, &$user_defined, &$configuration, &$cache, &$app, $table, $id, $only_local, $id_class, $class, $descr)
{
    $p =& $app->ui;
    $common_args = array('class' => $class, 'table' => $table, 'id' => $id, 'otable' => $table, 'oid' => $id);
    $e_edit_data = new event('edit_data', $common_args);
    $e_edit_data->set_caller($app->event());
    $descr = preg_replace('/ /', ' ', $descr);
    if (!isset($cache[$id_class])) {
        # && ((!$only_local) || ($only_local && substr ($class, 0, 2) == 'u_'))) {
        $e = new event('assoc_object', $common_args);
        $e->set_next($e_edit_data);
        $tmp = '[' . $p->_looselink("<FONT COLOR=\"BLACK\">{$descr}</FONT>", $e) . "]\n";
    } else {
        $tmp = _show_existing_object_class($images, $cache, $app, $table, $id, $only_local, $id_class, $class, $descr, $e_edit_data);
    }
    switch (substr($class, 0, 2)) {
        case 'l_':
            $documents .= $tmp;
            break;
        case 'd_':
            $configuration .= $tmp;
            break;
        default:
            $user_defined .= $tmp;
    }
}