} 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']) { if ($fileinfo['mime_type'] == 'Directory') {
function parse_table($text) { global $page; static $in_table = false; static $table_count = 0; $pre = ''; $post = ''; $csv_download = false; if (preg_match('/^\\*?(\\|\\|)+.*(\\|\\|)\\s*$/', $text)) { if (!$in_table) { $pre = html_table_start(); $in_table = true; $table_count++; if (preg_match('/^\\*(\\|\\|)+.*(\\|\\|)\\s*$/', $text)) { $csv_download = true; } } $text = preg_replace('/^\\*?((\\|\\|)+)(.*)\\|\\|\\s*$/e', "new_entity(array('raw',html_table_row_start().html_table_cell_start(strlen('\\1')/2)))." . "q1('\\3').new_entity(array('raw',html_table_cell_end().html_table_row_end()))", $text, -1); $text = preg_replace('/((\\|\\|)+)/e', "new_entity(array('raw',html_table_cell_end().html_table_cell_start(strlen('\\1')/2)))", $text, -1); } else { if ($in_table) { $in_table = false; $pre = html_table_end(); } } if ($pre != '') { $text = new_entity(array('raw', $pre)) . parse_newline($text); if ($csv_download) { $img = '<img align="top" src="images/csv.png" alt="Download as CSV" ' . 'title="Download as CSV" hspace="3" width="14" height="15" ' . 'border="0">'; $text = html_table_start() . html_table_row_start() . html_table_cell_start() . '<a href="' . tablecsvURL($page, $table_count) . '">' . $img . '<small>Download as CSV</small></a>' . html_table_cell_end() . html_table_row_end() . html_table_end() . $text; } } if ($post != '') { $text = $text . new_entity(array('raw', $post)); } return $text; }
function parse_table($text) { static $in_table = 0; $pre = ''; $post = ''; if (preg_match('/^(\\|\\|)+.*(\\|\\|)\\s*$/', $text)) { if (!$in_table) { $pre = html_table_start(); $in_table = 1; } $text = preg_replace('/^((\\|\\|)+)(.*)\\|\\|\\s*$/e', "new_entity(array('raw',html_table_row_start().html_table_cell_start(strlen('\\1')/2)))." . "q1('\\3').new_entity(array('raw',html_table_cell_end().html_table_row_end()))", $text, -1); $text = preg_replace('/((\\|\\|)+)/e', "new_entity(array('raw',html_table_cell_end().html_table_cell_start(strlen('\\1')/2)))", $text, -1); } else { if ($in_table) { $in_table = 0; $pre = html_table_end(); } } if ($pre != '') { $text = new_entity(array('raw', $pre)) . $text; } if ($post != '') { $text = $text . new_entity(array('raw', $post)); } return $text; }
function parse_table($text) { static $in_table = 0; $pre = ''; $post = ''; if (preg_match('/^(\\|\\|)+(\\{([^{}]+)\\})?.*(\\|\\|)\\s*$/', $text, $args)) { if (!$in_table) { $pre = html_table_start($args[3]); $in_table = 1; } $text = preg_replace('/\\|\\s+\\|/e', "q1('|').new_entity(array('raw',' ')).q1('|')", $text); $text = preg_replace('/^((\\|\\|+)(\\{([^{}]+)\\})?)(.*)\\|\\|\\s*$/e', "new_entity(array('raw',html_table_row_start('\\4').\r\n html_table_cell_start(strlen('\\2')/2, '\\4')))." . "q1('\\5').new_entity(array('raw',html_table_cell_end().html_table_row_end()))", $text, -1); $text = preg_replace('/((\\|\\|+)(\\{([^{}]+)\\})?)/e', "new_entity(array('raw',html_table_cell_end().html_table_cell_start(strlen('\\2')/2, '\\4')))", $text, -1); } else { if ($in_table) { $in_table = 0; $pre = html_table_end(); } } if ($pre != '') { $text = new_entity(array('raw', $pre)) . $text; } if ($post != '') { $text = $text . new_entity(array('raw', $post)); } return $text; }