@@ -30,7 +30,7 @@ |
||
| 30 | 30 | */ |
| 31 | 31 | final public function __construct( Document$document ) |
| 32 | 32 | { |
| 33 | - $this->document= $document; |
|
| 33 | + $this->document=$document; |
|
| 34 | 34 | |
| 35 | 35 | $this->construct(); |
| 36 | 36 | } |
@@ -48,7 +48,9 @@ |
||
| 48 | 48 | /** |
| 49 | 49 | * Real constructor to be rewrite. |
| 50 | 50 | */ |
| 51 | - protected function construct(){} |
|
| 51 | + protected function construct() |
|
| 52 | + { |
|
| 53 | +} |
|
| 52 | 54 | |
| 53 | 55 | /** |
| 54 | 56 | * Parsing line. |
@@ -168,66 +168,66 @@ discard block |
||
| 168 | 168 | ], |
| 169 | 169 | ], |
| 170 | 170 | 'tag_nodes'=> [ |
| 171 | - 'SVG1.1'=> $svgTags= [ |
|
| 171 | + 'SVG1.1'=> $svgTags=[ |
|
| 172 | 172 | 'svg'=> [ |
| 173 | 173 | 'out'=> [ |
| 174 | - 'default_attributes'=> ['xmlns'=> 'http://www.w3.org/2000/svg','version'=> '1.1',], |
|
| 175 | - 'params'=> ['viewBox',], |
|
| 174 | + 'default_attributes'=> [ 'xmlns'=> 'http://www.w3.org/2000/svg', 'version'=> '1.1', ], |
|
| 175 | + 'params'=> [ 'viewBox', ], |
|
| 176 | 176 | 'scope'=> 'svg', |
| 177 | 177 | ], |
| 178 | 178 | 'in'=> [ |
| 179 | 179 | 'svg'=> [ |
| 180 | - 'params'=> ['x','y','width','height',], |
|
| 180 | + 'params'=> [ 'x', 'y', 'width', 'height', ], |
|
| 181 | 181 | ], |
| 182 | 182 | ], |
| 183 | 183 | ], |
| 184 | - '*'=> [], |
|
| 184 | + '*'=> [ ], |
|
| 185 | 185 | 'polygon'=> [ |
| 186 | - 'params'=> ['points',], |
|
| 187 | - 'only_in'=> ['svg',], |
|
| 186 | + 'params'=> [ 'points', ], |
|
| 187 | + 'only_in'=> [ 'svg', ], |
|
| 188 | 188 | ], |
| 189 | 189 | 'polyline'=> [ |
| 190 | - 'params'=> ['points',], |
|
| 191 | - 'only_in'=> ['svg',], |
|
| 190 | + 'params'=> [ 'points', ], |
|
| 191 | + 'only_in'=> [ 'svg', ], |
|
| 192 | 192 | ], |
| 193 | 193 | 'path'=> [ |
| 194 | - 'params'=> ['d',], |
|
| 195 | - 'only_in'=> ['svg',], |
|
| 194 | + 'params'=> [ 'd', ], |
|
| 195 | + 'only_in'=> [ 'svg', ], |
|
| 196 | 196 | ], |
| 197 | 197 | 'line'=> [ |
| 198 | - 'params'=> ['x1','y1','x2','y2',], |
|
| 199 | - 'only_in'=> ['svg',], |
|
| 198 | + 'params'=> [ 'x1', 'y1', 'x2', 'y2', ], |
|
| 199 | + 'only_in'=> [ 'svg', ], |
|
| 200 | 200 | ], |
| 201 | 201 | 'rect'=> [ |
| 202 | - 'params'=> ['x','y','width','height',], |
|
| 203 | - 'only_in'=> ['svg',], |
|
| 202 | + 'params'=> [ 'x', 'y', 'width', 'height', ], |
|
| 203 | + 'only_in'=> [ 'svg', ], |
|
| 204 | 204 | ], |
| 205 | 205 | 'circle'=> [ |
| 206 | - 'params'=> ['cx','cy','r',], |
|
| 207 | - 'only_in'=> ['svg',], |
|
| 206 | + 'params'=> [ 'cx', 'cy', 'r', ], |
|
| 207 | + 'only_in'=> [ 'svg', ], |
|
| 208 | 208 | ], |
| 209 | 209 | 'ellipse'=> [ |
| 210 | - 'params'=> ['cx','cy','rx','ry',], |
|
| 211 | - 'only_in'=> ['svg',], |
|
| 210 | + 'params'=> [ 'cx', 'cy', 'rx', 'ry', ], |
|
| 211 | + 'only_in'=> [ 'svg', ], |
|
| 212 | 212 | ], |
| 213 | 213 | 'text'=> [ |
| 214 | - 'params'=> ['x','y',], |
|
| 215 | - 'only_in'=> ['svg',], |
|
| 214 | + 'params'=> [ 'x', 'y', ], |
|
| 215 | + 'only_in'=> [ 'svg', ], |
|
| 216 | 216 | ], |
| 217 | 217 | ], |
| 218 | 218 | 'HTML5'=> [ |
| 219 | - '*'=> [], |
|
| 219 | + '*'=> [ ], |
|
| 220 | 220 | 'charset'=> [ |
| 221 | 221 | 'name'=> 'meta', |
| 222 | - 'params'=> ['charset',], |
|
| 222 | + 'params'=> [ 'charset', ], |
|
| 223 | 223 | ], |
| 224 | 224 | 'equiv'=> [ |
| 225 | 225 | 'name'=> 'meta', |
| 226 | - 'name_value'=> ['http-equiv','content','scheme',], |
|
| 226 | + 'name_value'=> [ 'http-equiv', 'content', 'scheme', ], |
|
| 227 | 227 | ], |
| 228 | 228 | 'meta'=> [ |
| 229 | 229 | 'name'=> 'meta', |
| 230 | - 'name_value'=> ['name','content','scheme',], |
|
| 230 | + 'name_value'=> [ 'name', 'content', 'scheme', ], |
|
| 231 | 231 | ], |
| 232 | 232 | 'php'=> [ |
| 233 | 233 | 'opener'=> '<?php ', |
@@ -239,14 +239,14 @@ discard block |
||
| 239 | 239 | 'multiple'=> [ |
| 240 | 240 | [ |
| 241 | 241 | 'pattern'=> '/\{>$/', |
| 242 | - 'params'=> ['type',], |
|
| 243 | - 'default_attributes'=> ['codeset'=> 'codeset',], |
|
| 242 | + 'params'=> [ 'type', ], |
|
| 243 | + 'default_attributes'=> [ 'codeset'=> 'codeset', ], |
|
| 244 | 244 | 'embedding'=> 'code', |
| 245 | 245 | ], |
| 246 | 246 | [ |
| 247 | 247 | 'pattern'=> '/.?/', |
| 248 | 248 | 'name'=> 'code', |
| 249 | - 'params'=> ['type',], |
|
| 249 | + 'params'=> [ 'type', ], |
|
| 250 | 250 | ], |
| 251 | 251 | ], |
| 252 | 252 | ], |
@@ -255,13 +255,13 @@ discard block |
||
| 255 | 255 | [ |
| 256 | 256 | 'pattern'=> '/^-js @/', |
| 257 | 257 | 'name'=> 'script', |
| 258 | - 'default_attributes'=> ['type'=> 'text/javascript',], |
|
| 258 | + 'default_attributes'=> [ 'type'=> 'text/javascript', ], |
|
| 259 | 259 | 'link'=> 'src', |
| 260 | 260 | ], |
| 261 | 261 | [ |
| 262 | 262 | 'pattern'=> '/^-js\{>/', |
| 263 | 263 | 'name'=> 'script', |
| 264 | - 'default_attributes'=> ['type'=> 'text/javascript',], |
|
| 264 | + 'default_attributes'=> [ 'type'=> 'text/javascript', ], |
|
| 265 | 265 | 'embedding'=> 'js', |
| 266 | 266 | ], |
| 267 | 267 | ], |
@@ -271,90 +271,90 @@ discard block |
||
| 271 | 271 | [ |
| 272 | 272 | 'pattern'=> '/^-css @/', |
| 273 | 273 | 'name'=> 'link', |
| 274 | - 'default_attributes'=> ['rel'=> 'stylesheet','type'=> 'text/css',], |
|
| 274 | + 'default_attributes'=> [ 'rel'=> 'stylesheet', 'type'=> 'text/css', ], |
|
| 275 | 275 | 'link'=> 'href', |
| 276 | 276 | ], |
| 277 | 277 | [ |
| 278 | 278 | 'pattern'=> '/^-css\{>/', |
| 279 | 279 | 'name'=> 'style', |
| 280 | - 'default_attributes'=> ['type'=> 'text/css',], |
|
| 280 | + 'default_attributes'=> [ 'type'=> 'text/css', ], |
|
| 281 | 281 | 'embedding'=> 'css', |
| 282 | 282 | ], |
| 283 | 283 | ], |
| 284 | 284 | ], |
| 285 | 285 | 'icon'=> [ |
| 286 | 286 | 'name'=> 'link', |
| 287 | - 'default_attributes'=> ['rel'=> 'icon',], |
|
| 288 | - 'params'=> ['sizes',], |
|
| 287 | + 'default_attributes'=> [ 'rel'=> 'icon', ], |
|
| 288 | + 'params'=> [ 'sizes', ], |
|
| 289 | 289 | 'link'=> 'href', |
| 290 | 290 | ], |
| 291 | 291 | 'shortcut'=> [ |
| 292 | 292 | 'name'=> 'link', |
| 293 | - 'default_attributes'=> ['rel'=> 'shortcut icon','type'=> 'image/x-icon',], |
|
| 293 | + 'default_attributes'=> [ 'rel'=> 'shortcut icon', 'type'=> 'image/x-icon', ], |
|
| 294 | 294 | 'link'=> 'href', |
| 295 | 295 | ], |
| 296 | 296 | 'link'=> [ |
| 297 | 297 | 'name'=> 'link', |
| 298 | - 'params'=> ['rel',], |
|
| 298 | + 'params'=> [ 'rel', ], |
|
| 299 | 299 | 'link'=> 'href', |
| 300 | 300 | ], |
| 301 | 301 | 'a'=> [ |
| 302 | 302 | 'link'=> 'href', |
| 303 | - 'name_value'=> ['name',], |
|
| 303 | + 'name_value'=> [ 'name', ], |
|
| 304 | 304 | 'target'=> 'target', |
| 305 | 305 | ], |
| 306 | 306 | 'iframe'=> [ |
| 307 | 307 | 'link'=> 'src', |
| 308 | - 'default_attributes'=> ['frameborder'=> '0',], |
|
| 309 | - 'name_value'=> ['name',], |
|
| 308 | + 'default_attributes'=> [ 'frameborder'=> '0', ], |
|
| 309 | + 'name_value'=> [ 'name', ], |
|
| 310 | 310 | ], |
| 311 | 311 | 'img'=> [ |
| 312 | 312 | 'link'=> 'src', |
| 313 | 313 | 'alt'=> 'alt', |
| 314 | 314 | ], |
| 315 | - 'form'=> ['name'=> 'form', 'link'=> 'action', 'target'=> 'target', 'name_value'=> ['name',], 'default_attributes'=> ['method'=> 'post',],], |
|
| 316 | - 'post'=> ['name'=> 'form', 'link'=> 'action', 'target'=> 'target', 'name_value'=> ['name',], 'default_attributes'=> ['method'=> 'post',],], |
|
| 317 | - 'upload'=> ['name'=> 'form', 'link'=> 'action', 'target'=> 'target', 'name_value'=> ['name',], 'default_attributes'=> ['method'=> 'post','enctype'=> 'multipart/form-data',],], |
|
| 318 | - 'get'=> ['name'=> 'form', 'link'=> 'action', 'target'=> 'target', 'name_value'=> ['name',], 'default_attributes'=> ['method'=> 'get',],], |
|
| 315 | + 'form'=> [ 'name'=> 'form', 'link'=> 'action', 'target'=> 'target', 'name_value'=> [ 'name', ], 'default_attributes'=> [ 'method'=> 'post', ], ], |
|
| 316 | + 'post'=> [ 'name'=> 'form', 'link'=> 'action', 'target'=> 'target', 'name_value'=> [ 'name', ], 'default_attributes'=> [ 'method'=> 'post', ], ], |
|
| 317 | + 'upload'=> [ 'name'=> 'form', 'link'=> 'action', 'target'=> 'target', 'name_value'=> [ 'name', ], 'default_attributes'=> [ 'method'=> 'post', 'enctype'=> 'multipart/form-data', ], ], |
|
| 318 | + 'get'=> [ 'name'=> 'form', 'link'=> 'action', 'target'=> 'target', 'name_value'=> [ 'name', ], 'default_attributes'=> [ 'method'=> 'get', ], ], |
|
| 319 | 319 | |
| 320 | - 'input'=> ['name'=> 'input', 'default_attributes'=> ['type'=> 'hidden',], 'name_value'=> ['name', 'value', 'form',],], |
|
| 321 | - 'text'=> ['out'=> ['name'=> 'input', 'default_attributes'=> ['type'=> 'text',], 'name_value'=> ['name', 'value', 'form',], 'alt'=> 'placeholder',], 'in'=> ['svg'=> ['params'=> ['x','y',],],],], |
|
| 322 | - 'search'=> ['name'=> 'input', 'default_attributes'=> ['type'=> 'search',], 'name_value'=> ['name', 'value', 'form',], 'alt'=> 'placeholder',], |
|
| 323 | - 'password'=> ['name'=> 'input', 'default_attributes'=> ['type'=> 'password',], 'name_value'=> ['name', 'value', 'form',], 'alt'=> 'placeholder',], |
|
| 324 | - 'email'=> ['name'=> 'input', 'default_attributes'=> ['type'=> 'email',], 'name_value'=> ['name', 'value', 'form',], 'alt'=> 'placeholder',], |
|
| 325 | - 'url'=> ['name'=> 'input', 'default_attributes'=> ['type'=> 'url',], 'name_value'=> ['name', 'value', 'form',], 'alt'=> 'placeholder',], |
|
| 326 | - 'tel'=> ['name'=> 'input', 'default_attributes'=> ['type'=> 'tel',], 'name_value'=> ['name', 'value', 'form',], 'alt'=> 'placeholder',], |
|
| 327 | - 'number'=> ['name'=> 'input', 'default_attributes'=> ['type'=> 'number',], 'name_value'=> ['name', 'value', 'form',], 'alt'=> 'placeholder', 'params'=> ['min', 'step', 'max',],], |
|
| 328 | - 'range'=> ['name'=> 'input', 'default_attributes'=> ['type'=> 'range',], 'name_value'=> ['name', 'value', 'form',], 'params'=> ['min', 'step', 'max',],], |
|
| 329 | - 'radio'=> ['name'=> 'input', 'default_attributes'=> ['type'=> 'radio',], 'name_value'=> ['name', 'value', 'form',],], |
|
| 330 | - 'checkbox'=> ['name'=> 'input', 'default_attributes'=> ['type'=> 'checkbox',], 'name_value'=> ['name', 'value', 'form',],], |
|
| 331 | - 'date'=> ['name'=> 'input', 'default_attributes'=> ['type'=> 'date',], 'name_value'=> ['name', 'value', 'form',],], |
|
| 332 | - 'month'=> ['name'=> 'input', 'default_attributes'=> ['type'=> 'month',], 'name_value'=> ['name', 'value', 'form',],], |
|
| 333 | - 'week'=> ['name'=> 'input', 'default_attributes'=> ['type'=> 'week',], 'name_value'=> ['name', 'value', 'form',],], |
|
| 334 | - 'time'=> ['name'=> 'input', 'default_attributes'=> ['type'=> 'time',], 'name_value'=> ['name', 'value', 'form',],], |
|
| 335 | - 'datetime'=> ['name'=> 'input', 'default_attributes'=> ['type'=> 'datetime',], 'name_value'=> ['name', 'value', 'form',],], |
|
| 336 | - 'datetime-local'=> ['name'=> 'input', 'default_attributes'=> ['type'=> 'datetime-local',], 'name_value'=> ['name', 'value', 'form',],], |
|
| 337 | - 'color'=> ['name'=> 'input', 'default_attributes'=> ['type'=> 'color',], 'name_value'=> ['name', 'value', 'form',],], |
|
| 338 | - 'file'=> ['name'=> 'input', 'default_attributes'=> ['type'=> 'file',], 'name_value'=> ['name', 'form',], 'params'=> ['accept',],], |
|
| 320 | + 'input'=> [ 'name'=> 'input', 'default_attributes'=> [ 'type'=> 'hidden', ], 'name_value'=> [ 'name', 'value', 'form', ], ], |
|
| 321 | + 'text'=> [ 'out'=> [ 'name'=> 'input', 'default_attributes'=> [ 'type'=> 'text', ], 'name_value'=> [ 'name', 'value', 'form', ], 'alt'=> 'placeholder', ], 'in'=> [ 'svg'=> [ 'params'=> [ 'x', 'y', ], ], ], ], |
|
| 322 | + 'search'=> [ 'name'=> 'input', 'default_attributes'=> [ 'type'=> 'search', ], 'name_value'=> [ 'name', 'value', 'form', ], 'alt'=> 'placeholder', ], |
|
| 323 | + 'password'=> [ 'name'=> 'input', 'default_attributes'=> [ 'type'=> 'password', ], 'name_value'=> [ 'name', 'value', 'form', ], 'alt'=> 'placeholder', ], |
|
| 324 | + 'email'=> [ 'name'=> 'input', 'default_attributes'=> [ 'type'=> 'email', ], 'name_value'=> [ 'name', 'value', 'form', ], 'alt'=> 'placeholder', ], |
|
| 325 | + 'url'=> [ 'name'=> 'input', 'default_attributes'=> [ 'type'=> 'url', ], 'name_value'=> [ 'name', 'value', 'form', ], 'alt'=> 'placeholder', ], |
|
| 326 | + 'tel'=> [ 'name'=> 'input', 'default_attributes'=> [ 'type'=> 'tel', ], 'name_value'=> [ 'name', 'value', 'form', ], 'alt'=> 'placeholder', ], |
|
| 327 | + 'number'=> [ 'name'=> 'input', 'default_attributes'=> [ 'type'=> 'number', ], 'name_value'=> [ 'name', 'value', 'form', ], 'alt'=> 'placeholder', 'params'=> [ 'min', 'step', 'max', ], ], |
|
| 328 | + 'range'=> [ 'name'=> 'input', 'default_attributes'=> [ 'type'=> 'range', ], 'name_value'=> [ 'name', 'value', 'form', ], 'params'=> [ 'min', 'step', 'max', ], ], |
|
| 329 | + 'radio'=> [ 'name'=> 'input', 'default_attributes'=> [ 'type'=> 'radio', ], 'name_value'=> [ 'name', 'value', 'form', ], ], |
|
| 330 | + 'checkbox'=> [ 'name'=> 'input', 'default_attributes'=> [ 'type'=> 'checkbox', ], 'name_value'=> [ 'name', 'value', 'form', ], ], |
|
| 331 | + 'date'=> [ 'name'=> 'input', 'default_attributes'=> [ 'type'=> 'date', ], 'name_value'=> [ 'name', 'value', 'form', ], ], |
|
| 332 | + 'month'=> [ 'name'=> 'input', 'default_attributes'=> [ 'type'=> 'month', ], 'name_value'=> [ 'name', 'value', 'form', ], ], |
|
| 333 | + 'week'=> [ 'name'=> 'input', 'default_attributes'=> [ 'type'=> 'week', ], 'name_value'=> [ 'name', 'value', 'form', ], ], |
|
| 334 | + 'time'=> [ 'name'=> 'input', 'default_attributes'=> [ 'type'=> 'time', ], 'name_value'=> [ 'name', 'value', 'form', ], ], |
|
| 335 | + 'datetime'=> [ 'name'=> 'input', 'default_attributes'=> [ 'type'=> 'datetime', ], 'name_value'=> [ 'name', 'value', 'form', ], ], |
|
| 336 | + 'datetime-local'=> [ 'name'=> 'input', 'default_attributes'=> [ 'type'=> 'datetime-local', ], 'name_value'=> [ 'name', 'value', 'form', ], ], |
|
| 337 | + 'color'=> [ 'name'=> 'input', 'default_attributes'=> [ 'type'=> 'color', ], 'name_value'=> [ 'name', 'value', 'form', ], ], |
|
| 338 | + 'file'=> [ 'name'=> 'input', 'default_attributes'=> [ 'type'=> 'file', ], 'name_value'=> [ 'name', 'form', ], 'params'=> [ 'accept', ], ], |
|
| 339 | 339 | |
| 340 | - 'submit'=> ['name'=> 'button', 'default_attributes'=> ['type'=> 'submit',], 'name_value'=> ['name', 'value','form',], 'link'=> 'formaction', 'target'=> 'formtarget',], |
|
| 341 | - 'reset'=> ['name'=> 'button', 'default_attributes'=> ['type'=> 'reset',], 'name_value'=> ['form',],], |
|
| 342 | - 'button'=> ['name'=> 'button', 'default_attributes'=> ['type'=> 'button',],], |
|
| 340 | + 'submit'=> [ 'name'=> 'button', 'default_attributes'=> [ 'type'=> 'submit', ], 'name_value'=> [ 'name', 'value', 'form', ], 'link'=> 'formaction', 'target'=> 'formtarget', ], |
|
| 341 | + 'reset'=> [ 'name'=> 'button', 'default_attributes'=> [ 'type'=> 'reset', ], 'name_value'=> [ 'form', ], ], |
|
| 342 | + 'button'=> [ 'name'=> 'button', 'default_attributes'=> [ 'type'=> 'button', ], ], |
|
| 343 | 343 | |
| 344 | - 'textarea'=> ['name'=> 'textarea', 'name_value'=> ['name','value','form',],'alt'=> 'placeholder',], |
|
| 344 | + 'textarea'=> [ 'name'=> 'textarea', 'name_value'=> [ 'name', 'value', 'form', ], 'alt'=> 'placeholder', ], |
|
| 345 | 345 | |
| 346 | 346 | 'select'=> [ |
| 347 | - 'name_value'=> ['name', 'value','form',], |
|
| 347 | + 'name_value'=> [ 'name', 'value', 'form', ], |
|
| 348 | 348 | 'scope'=> 'select', |
| 349 | 349 | ], |
| 350 | 350 | 'datalist'=> [ |
| 351 | - 'params'=> ['id',], |
|
| 351 | + 'params'=> [ 'id', ], |
|
| 352 | 352 | 'scope'=> 'datalist', |
| 353 | 353 | ], |
| 354 | 354 | 'optgroup'=> [ |
| 355 | 355 | 'in'=> [ |
| 356 | 356 | 'select'=> [ |
| 357 | - 'name_value'=> ['label',], |
|
| 357 | + 'name_value'=> [ 'label', ], |
|
| 358 | 358 | ], |
| 359 | 359 | ], |
| 360 | 360 | ], |
@@ -362,20 +362,20 @@ discard block |
||
| 362 | 362 | 'in'=> [ |
| 363 | 363 | 'select'=> [ |
| 364 | 364 | 'scope_function'=> function( $scope ){ |
| 365 | - if( $scope['value']===$this['value'] ){ |
|
| 366 | - $this['selected']= 'selected'; |
|
| 365 | + if( $scope[ 'value' ]===$this[ 'value' ] ){ |
|
| 366 | + $this[ 'selected' ]='selected'; |
|
| 367 | 367 | }; |
| 368 | 368 | }, |
| 369 | - 'name_value'=> ['value', 'label',], |
|
| 369 | + 'name_value'=> [ 'value', 'label', ], |
|
| 370 | 370 | ], |
| 371 | 371 | 'datalist'=> [ |
| 372 | - 'name_value'=> ['value',], |
|
| 372 | + 'name_value'=> [ 'value', ], |
|
| 373 | 373 | ], |
| 374 | 374 | ], |
| 375 | 375 | ], |
| 376 | 376 | |
| 377 | 377 | 'param'=> [ |
| 378 | - 'name_value'=> ['name','value',], |
|
| 378 | + 'name_value'=> [ 'name', 'value', ], |
|
| 379 | 379 | ], |
| 380 | 380 | ]+$svgTags, |
| 381 | 381 | ], |