html_form_input('hidden', 'fileman[' . $i . ']', base64_encode($fileman[$i]));
            }
            html_table_row_begin();
            html_table_col_begin();
            html_form_textarea('edit_file_content', 35, 75, $content);
            html_table_col_end();
            html_table_col_begin('center');
            html_form_input('submit', 'edit_preview', lang('Preview %1', html_encode($fileman[$j], 1)));
            html_break(1);
            html_form_input('submit', 'edit_save', lang('Save %1', html_encode($fileman[$j], 1)));
            //			html_break (1);
            //			html_form_input ('submit', 'edit_save_all', lang('Save all'));
            html_table_col_end();
            html_table_row_end();
            html_break(2);
            html_form_end();
            html_table_end();
        }
    }
} elseif ($op == 'upload' && $path != '/' && $path != $GLOBALS['fakebase']) {
    for ($i = 0; $i != $show_upload_boxes; $i++) {
        if ($badchar = bad_chars($_FILES['upload_file']['name'][$i], True, True)) {
            echo $GLOBALS['phpgw']->common->error_list(array(html_encode(lang('File names cannot contain "%1"', $badchar), 1)));
            continue;
        }
        ###
        # Check to see if the file exists in the database, and get its info at the same time
        ###
        $ls_array = $GLOBALS['phpgw']->vfs->ls(array('string' => $path . '/' . $_FILES['upload_file']['name'][$i], 'relatives' => array(RELATIVE_NONE), 'checksubdirs' => False, 'nofiles' => True));
        $fileinfo = $ls_array[0];
        if ($fileinfo['name']) {
function do_git_action($action)
{
    global $commit_message, $gitpath;
    echo html_header_message_update($action . "ing...");
    $args = array($action);
    debug('git ' . implode(' ', $args));
    $h = start_command($gitpath, $args);
    list($stdout, $stderr) = get_all_data($h, array('stdout', 'stderr'));
    debug("stdout: {$stdout}");
    debug("stderr: {$stderr}");
    $exit = get_exit_code($h);
    debug($exit);
    clean_up($h);
    if ($exit === 0) {
        echo html_header_message_update($action . "ing... OK");
    } else {
        echo html_header_message_update($action . 'ing...: <span class="error">FAILED</a>', true);
        if (trim($stderr) != '') {
            error("{$stderr}");
        }
        echo html_form_end();
        exit;
    }
}
$be = new box('80%', $th_box_frame_color, $th_box_frame_width, $th_box_title_bgcolor, $th_box_title_font_color, $th_box_title_align, $th_box_body_bgcolor, $th_box_error_font_color, $th_box_body_align);
start_content();
if ($config_perm_admdoco != 'all' && (!isset($perm) || !$perm->have_perm($config_perm_admdoco))) {
    $be->box_full($t->translate('Error'), $t->translate('Access denied'));
} else {
    $db->query("SELECT * FROM doco WHERE language='{$la}'");
    $bx->box_begin();
    $bx->box_title($t->translate('Page Documentation Administration'));
    $bx->box_body_begin();
    $bx->box_columns_begin(2);
    $bx->box_column('left', '88%', '', $t->translate('Enter a new ' . 'documentation entry ' . 'for a page'));
    $bx->box_column('right', '12%', '', html_form_action('insdoco.php') . html_form_hidden('create', 1) . html_form_submit($t->translate('Insert'), 'Insert') . html_form_end());
    $bx->box_columns_end();
    $bx->box_body_end();
    $bx->box_end();
    while ($db->next_record()) {
        $bx->box_begin();
        $bx->box_title($t->translate('Page') . ': ' . $db->f('page') . ', ' . $t->translate('Header') . ': ' . $db->f('header'));
        $bx->box_body_begin();
        $bx->box_columns_begin(2);
        $bx->box_column('left', '76%', '', $db->f('doco'));
        $bx->box_column('right', '12%', '', html_form_action('insdoco.php') . html_form_hidden('modify', 1) . html_form_hidden('delete', 0) . html_form_hidden('docoid', $db->f('docoid')) . html_form_submit($t->translate('Change'), 'Change') . html_form_end());
        $bx->box_column('right', '12%', '', html_form_action('insdoco.php') . html_form_hidden('modify', 0) . html_form_hidden('delete', 1) . html_form_hidden('docoid', $db->f('docoid')) . html_form_submit($t->translate('Delete'), 'Delete') . html_form_end());
        $bx->box_columns_end();
        $bx->box_body_end();
        $bx->box_end();
    }
}
end_content();
require 'include/footer.inc';
@page_close();
Example #4
0
 if (isset($del_license)) {
     // License in database and we want to delete it
     if (!strcmp($del_license, 'warning')) {
         // You've got another chance before it's deleted ;-)
         // We inform the administrator how many
         // projects will be affected by this deletion
         $db->query("SELECT COUNT(*) FROM developing WHERE " . "license='{$license}'");
         $db->next_record();
         $number_of_projects = $db->f('COUNT(*)');
         $be->box_full($t->translate('Warning!'), $t->translate('If you press another time the ' . 'Delete-button you will alter') . ' ' . $number_of_projects . ' ' . $t->translate('projects that have ' . 'actually license') . ' ' . $license);
         $bx->box_begin();
         $bx->box_title($t->translate('Delete License'));
         $bx->box_body_begin();
         $bx->box_columns_begin(2);
         $bx->box_column('left', '76%', '', '<b>' . $t->translate('License') . '</b>: ' . $license);
         $bx->box_column('right', '12%', '', html_form_action('PHP_SELF') . html_form_hidden('license', $license) . html_form_hidden('del_license', 'too_late') . html_form_submit($t->translate('Delete')) . html_form_end());
         $bx->box_columns_end();
         $bx->box_body_end();
         $bx->box_end();
         $bx->box_body_end();
         $bx->box_end();
     } else {
         $db->query("DELETE from licenses WHERE license='{$license}'");
         $bx->box_full($t->translate('Administration'), $t->translate('Deletion succesfully completed.'));
     }
 } else {
     if (empty($new_license) && empty($new_url) && empty($del_license)) {
         // It's already in our database
         // but no rename and no deletion and no new url... ->error
         $be->box_full($t->translate('Error'), $t->translate('That license already exists!'));
     }
start_content();
if ($config_perm_admdoco != 'all' && (!isset($perm) || !$perm->have_perm($config_perm_admdoco))) {
    $be->box_full($t->translate('Error'), $t->translate('Access denied'));
} else {
    if (isset($delete)) {
        if ($delete == 1) {
            $query = "SELECT * FROM doco WHERE docoid='{$docoid}' " . "AND language='{$la}'";
            $db->query($query);
            $db->next_record();
            doco_show($db);
            $bx->box_begin();
            $bx->box_title($t->translate('Do you really want to delete ' . 'this Page Documentation entry?'));
            $bx->box_body_begin();
            $bx->box_columns_begin(2);
            $bx->box_column('left', '76%', '', $t->translate('There is no way for undeletion.'));
            $bx->box_column('right', '12%', '', html_form_action('PHP_SELF') . html_form_hidden('modify', 0) . html_form_hidden('delete', 2) . html_form_hidden('docoid', $db->f('docoid')) . html_form_submit($t->translate('Yes, Delete')) . html_form_end() . html_form_action('PHP_SELF') . html_form_hidden('modify', 1) . html_form_hidden('delete', 0) . html_form_hidden('docoid', $db->f('docoid')) . html_form_submit($t->translate('No, just modify')) . html_form_end());
            $bx->box_columns_end();
            $bx->box_body_end();
            $bx->box_end();
        }
        if ($delete == 2) {
            // We remove it from our DB
            $db->query("DELETE FROM doco WHERE docoid='{$docoid}' " . "AND language='{$la}'");
            if ($db->affected_rows() < 1) {
                $be->box_full($t->translate('Error'), $t->translate('Database Error'));
            } else {
                $bx->box_full($t->translate('Page Documentation ' . 'Administration'), $t->translate('The documentation for that ' . 'page has been deleted'));
            }
        }
    }
    if (isset($modify)) {