> diff -w table_edit.inc.php.16 html/pukiowikio_edit/pkwk/plugin_default/table_edit.inc.php
2,30c2,15
< // PukiWiki - Yet another WikiWikiWeb clone.
< // Max pages allowed to be included at a time
<
< define('PLUGIN_TABLE_EDIT_MAX', 4);
< define('PLUGIN_TABLE_EDIT_FIELD_WIDTH', 100);
< define('PLUGIN_TABLE_EDIT_FORCE_TIME_UPDATE', false);
< define('PLUGIN_TABLE_EDIT_DEFAULT_SORT_STRING', ''); // semicolon(:) separated
<
< //define('PLUGIN_TABLE_EDIT_STRING_ADD',    'add');
< //define('PLUGIN_TABLE_EDIT_STRING_EDIT',   'edit');
< //define('PLUGIN_TABLE_EDIT_STRING_UPDATE', 'update');
< //define('PLUGIN_TABLE_EDIT_STRING_DELETE', 'delete');
< //define('PLUGIN_TABLE_EDIT_STRING_DELETE_CHECK', 'delete');
< //define('PLUGIN_TABLE_EDIT_STRING_COPY',   'copy');
<
<
< //define('PLUGIN_TABLE_EDIT_PLUGIN_NAME', 'read');
< define('PLUGIN_TABLE_EDIT_PLUGIN_NAME', 'table_edit');
<
< // ----
< define('PLUGIN_TABLE_EDIT_USAGE', '#include(): Usage: (a-page-name-you-want-to-edit)');
<
<
---
> /**
>  * PukiWiki - Yet another WikiWikiWeb clone.
>  * table_edit.inc.php
>  * @author qinf
>  * @version 1.16 modi ioio
>  * @license not clear
> */
> // Debug and modified (cell form) by ioio.
>
> define('PLUGIN_TABLE_EDIT_USAGE', '#table_edit(): Usage: (a-page-name-you-want-to-edit)');
>
> /**
>  * Class EditableTablePage
>  */
34a20,23
> /**
>  * function EditableTablePage()
>  * execute parent::Element()
>  */
38a28,30
> /**
>  * function add()
>  */
271a264
>
277d269
<     $global_cnt++;
281c273
<       $cnt = count($table->elements) + 1;
---
>       $cnt = (empty($table->elements) ? 0 : count($table->elements)) + 1;
283,284c275,276
<       if (strtolower($out[2]) == 'h' || strtolower($out[2]) == 'f') {
<         $new_table->elements[0][] = & new EditableTableEditCell(PLUGIN_TABLE_EDIT_STRING_ADD, get_script_uri()  . '?cmd=' . PLUGIN_TABLE_EDIT_PLUGIN_NAME . '&mode=edit&page=' . rawurlencode($vars['page']) . '&table=' . $table_number . '&row=-1&from=' . rawurlencode($from_page));
---
>       if (strtolower($line[2]) == 'h' || strtolower($line[2]) == 'f') {
>         $new_table->elements[0][] = & new EditableTableEditCell(PLUGIN_TABLE_EDIT_STRING_EDIT, get_script_uri() . '?cmd=' . PLUGIN_TABLE_EDIT_PLUGIN_NAME . '&mode=edit&page=' . rawurlencode($vars['page']) . '&table=' . $table_number . '&row=-1&from=' . rawurlencode($from_page));
297c289
<     $global_cnt++;
---
> //        $global_cnt++;
301c293,294
<       $cnt = count($table->elements) + 1;
---
> //    $cnt = count($table->elements) + 1;
>       $cnt = (empty($table->elements) ? 0 : count($table->elements)) + 1;
401c394
< global $script, $vars, $get, $post, $menubar, $_msg_include_restrict;
---
> global $vars, $menubar, $_msg_include_restrict;
404a398,399
> $script = get_script_uri();
>
439c434
< $get['page'] = $post['page'] = $vars['page'] = $page;
---
> $vars['page'] = $page;
450c445
< $get['page'] = $post['page'] = $vars['page'] = $root;
---
> $vars['page'] = $root;
461c456,457
< if ($row > count($table->elements) || $row < -1) return null;
---
> $elementnum = count($table->elements);
> if ($row > $elementnum || $row < -1) return null;
463c459
< if ($row == -1 || $vars['copy'] == 'on') {
---
> if ($row == -1 || (isset($vars['copy']) ? $vars['copy'] : '') == 'on') {
465a462,464
>      if (PLUGIN_TABLE_EDIT_TEXTAREAMODE) {  // Input cell data in a textaere.
>         $str = str_replace("\n", '&br;', $vars['cell_' . ($i+1)]);
>      } else {
466a466
>      }
469a470
>   $table->types[$elementnum] = '';
472a474,476
>      if (PLUGIN_TABLE_EDIT_TEXTAREAMODE) {  // Input cell data in a textaere.
>         $str = str_replace("\n", '&br;', $vars['cell_' . ($i+1)]);
>      } else {
473a478
>      }
494,495c499,502
< $body = '<form action="' . get_script_uri() . '?cmd=' . PLUGIN_TABLE_EDIT_PLUGIN_NAME . '&mode=post&from=' . rawurlencode($from_page) . '&table=' . $table_id . '&row=' . $row . '&page=' . rawurlencode($vars['page']) . '&digest=' . $digest . '" method="post">';
< $body .= $root;
---
> $body = 'Table = ' . $table_id . '<br/>';
> $body .= 'row = ' . $row . '<br/>';
> $body .= '<form action="' . get_script_uri() . '?cmd=' . PLUGIN_TABLE_EDIT_PLUGIN_NAME . '&mode=post&from=' . rawurlencode($from_page) . '&table=' . $table_id . '&row=' . $row . '&page=' . rawurlencode($vars['page']) . '&digest=' . $digest . '" method="post">';
> //ioio $body .= $root;
500c507
<   if (strtolower($table->types[$i]) == 'h' || strtolower($table->types[$i]) == 'f') {
---
>   if (isset($table->types) && (strtolower($table->types[$i]) == 'h' || strtolower($table->types[$i]) == 'f')) {
508c515,520
<   $body .= ($i+1) . ': ' . ($header? $header[$i]->cellString() : '') . '<br />';
---
>   $body .= ($i+1) . ': ' . (isset($header) ? $header[$i]->cellString() : '') . '<br />';
>   if (PLUGIN_TABLE_EDIT_TEXTAREAMODE) {   // Input cell data in a textaere.
>   $body .= ' &nbsp; &nbsp; <textarea COLS="' . PLUGIN_TABLE_EDIT_FIELD_WIDTH . '" ROWS="' . PLUGIN_TABLE_EDIT_FIELD_HEIGHT . '" name="cell_' . ($i+1) . '">';
>   $body .= htmlspecialchars(str_replace('&br;', "\n", empty($table->elements[$row][$i]->rawtext) ? '' : $table->elements[$row][$i]->rawtext));
>   $body .= '</textarea><br />';
>   } else {    // Input cell data in an input text field.
510,511c522,523
<   $body .= preg_match('/^[^"]+$/', $table->elements[$row][$i]->rawtext)?
<       '"' . $table->elements[$row][$i]->rawtext . '"' : "'" . $table->elements[$row][$i]->rawtext . "'";
---
>   $body .= htmlspecialchars(preg_match('/^[^"]+$/', $table->elements[$row][$i]->rawtext)?
>     '"' . $table->elements[$row][$i]->rawtext . '"' : "'" . $table->elements[$row][$i]->rawtext) . "'";
513a526
> }
516c529
<   $body .= '<br /> &nbsp; <input type="submit" value="' . PLUGIN_TABLE_EDIT_STRING_ADD . '">';
---
>   $body .= '<br /> &nbsp; <input type="submit" value="' . PLUGIN_TABLE_EDIT_STRING_ADD_BUTTON . '">';
524c537,538
<   $body .= ' &nbsp; <input type="checkbox" name="copy"> ' . PLUGIN_TABLE_EDIT_STRING_COPY . ' </input></form>';
---
>   $body .= ' &nbsp; <input type="checkbox" name="copy"> ' . PLUGIN_TABLE_EDIT_STRING_COPY . ' </input>';
>   $body .= '</form>';
556c570,571
< global $vars, $referer;
---
> global $vars, $referer, $trackback;
> global $_title_notfound, $_title_invalidiwn, $_msg_invalidiwn;
558c573
< $refer  = isset($vars['page'])   ? $vars['page']   : '';
---
> $page = $refer  = isset($vars['page'])   ? $vars['page']   : '';
562c577,578
< $page   = get_fullname(strip_bracket(array_shift($args)), $refer);
---
>
> $_title_add = '';
580c596
<   if ($mode=='delete' && $vars['delete'] != 'on')
---
>   if (($mode=='delete') && (!isset($vars['delete']) || ($vars['delete'] != 'on')))
590c606
<   $notimeupdate = $vars['noupdatetime'] == 'on' && ! PLUGIN_TABLE_EDIT_FORCE_TIME_UPDATE;
---
>   $notimeupdate = (isset($vars['noupdatetime']) ? $vars['noupdatetime'] : '') == 'on' && ! PLUGIN_TABLE_EDIT_FORCE_TIME_UPDATE;
593c609
<   header('Location: ' . $script . '?' . rawurlencode($from)); // HTTP
---
>   header('Location: ' . get_script_uri() . '?' . rawurlencode($from)); // HTTP
598a615
>     if(check_editable($page, false, false)) {
600a618,620
>     } else {
>        $body = '';
>     }
608a629
>     if (check_editable($page, FALSE, FALSE)) {
612c633,638
<     return array('msg'=>$_title_invalidwn,
---
>       $vars['http_status'] = '404';
>       header('HTTP/1.0 404 Not found');
>       return array('msg'=>$_title_notfound, 'body'=>' ');
>     }
>   } else {
>     return array('msg'=>$_title_invalidiwn,

トップ 編集凍結差分バックアップ添付複製名前変更リロード 新規一覧 単語検索 最終更新  ヘルプ  最終更新のRSS
Last-modified: 2010-09-12 (日) 22:37:38 (4153d)