Skip to content

Commit b0002ce

Browse files
committed
inherit Wiki type from LongText to reduce code duplication
1 parent ef7146c commit b0002ce

File tree

1 file changed

+1
-44
lines changed

1 file changed

+1
-44
lines changed

types/Wiki.php

Lines changed: 1 addition & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,7 @@
33

44
use dokuwiki\plugin\struct\meta\QueryBuilderWhere;
55

6-
class Wiki extends AbstractBaseType {
7-
use TraitFilterPrefix;
8-
9-
protected $config = array(
10-
'prefix' => '',
11-
'postfix' => '',
12-
'rows' => '5',
13-
'cols' => '50'
14-
);
6+
class Wiki extends LongText {
157

168
/**
179
* @param int|string $value
@@ -25,39 +17,4 @@ public function renderValue($value, \Doku_Renderer $R, $mode) {
2517
$R->doc .= $doc; // FIXME this probably does not work for all renderers
2618
return true;
2719
}
28-
29-
/**
30-
* Clean line endings
31-
*
32-
* @param int|string $rawvalue
33-
* @return int|string
34-
*/
35-
public function validate($rawvalue) {
36-
$rawvalue = rtrim($rawvalue);
37-
$rawvalue = cleanText($rawvalue);
38-
return $rawvalue;
39-
}
40-
41-
/**
42-
* Use a text area for input
43-
*
44-
* @param string $name
45-
* @param string $rawvalue
46-
* @param string $htmlID
47-
*
48-
* @return string
49-
*/
50-
public function valueEditor($name, $rawvalue, $htmlID) {
51-
$rawvalue = formText($rawvalue);
52-
$params = array(
53-
'name' => $name,
54-
'class' => 'struct_'.strtolower($this->getClass()),
55-
'id' => $htmlID,
56-
'rows' => $this->config['rows'],
57-
'cols' => $this->config['cols']
58-
);
59-
$attributes = buildAttributes($params, true);
60-
61-
return "<textarea $attributes>$rawvalue</textarea>";
62-
}
6320
}

0 commit comments

Comments
 (0)