| 1 |
lars |
1 |
<?php
|
|
|
2 |
|
|
|
3 |
require_once(HTML2PS_DIR.'value.border.class.php');
|
|
|
4 |
require_once(HTML2PS_DIR.'value.border.edge.class.php');
|
|
|
5 |
|
|
|
6 |
class CSSPseudoTableBorder extends CSSPropertyHandler {
|
|
|
7 |
var $_defaultValue;
|
|
|
8 |
|
|
|
9 |
function CSSPseudoTableBorder() {
|
|
|
10 |
$this->CSSPropertyHandler(true, false);
|
|
|
11 |
|
|
|
12 |
$this->_defaultValue = BorderPDF::create(array('top' => array('width' => Value::fromString('2px'),
|
|
|
13 |
'color' => array(0,0,0),
|
|
|
14 |
'style' => BS_NONE),
|
|
|
15 |
'right' => array('width' => Value::fromString('2px'),
|
|
|
16 |
'color' => array(0,0,0),
|
|
|
17 |
'style' => BS_NONE),
|
|
|
18 |
'bottom' => array('width' => Value::fromString('2px'),
|
|
|
19 |
'color' => array(0,0,0),
|
|
|
20 |
'style' => BS_NONE),
|
|
|
21 |
'left' => array('width' => Value::fromString('2px'),
|
|
|
22 |
'color' => array(0,0,0),
|
|
|
23 |
'style' => BS_NONE)));
|
|
|
24 |
}
|
|
|
25 |
|
|
|
26 |
function default_value() {
|
|
|
27 |
return $this->_defaultValue->copy();
|
|
|
28 |
}
|
|
|
29 |
|
|
|
30 |
function get_property_code() {
|
|
|
31 |
return CSS_HTML2PS_TABLE_BORDER;
|
|
|
32 |
}
|
|
|
33 |
|
|
|
34 |
function get_property_name() {
|
|
|
35 |
return '-html2ps-table-border';
|
|
|
36 |
}
|
|
|
37 |
|
|
|
38 |
function inherit($old_state, &$new_state) {
|
|
|
39 |
// Determine parent 'display' value
|
|
|
40 |
$parent_display = $old_state[CSS_DISPLAY];
|
|
|
41 |
|
|
|
42 |
// Inherit from table rows and tables
|
|
|
43 |
$inherit_from = array('table-row', 'table', 'table-row-group', 'table-header-group', 'table-footer-group');
|
|
|
44 |
if (array_search($parent_display, $inherit_from) !== FALSE) {
|
|
|
45 |
$this->replace_array($this->get($old_state),
|
|
|
46 |
$new_state);
|
|
|
47 |
return;
|
|
|
48 |
}
|
|
|
49 |
|
|
|
50 |
$this->replace_array($this->default_value(), $new_state);
|
|
|
51 |
return;
|
|
|
52 |
}
|
|
|
53 |
}
|
|
|
54 |
|
|
|
55 |
CSS::register_css_property(new CSSPseudoTableBorder());
|
|
|
56 |
|
|
|
57 |
?>
|