14 |
|
|
15 |
/** |
/** |
16 |
* <A> tag class |
* <A> tag class |
17 |
|
* @tutorial HTMLTagClass.cls#constructor |
18 |
* @package phpHtmlLib |
* @package phpHtmlLib |
19 |
*/ |
*/ |
20 |
class Atag extends HTMLTagClass { |
class Atag extends HTMLTagClass { |
598 |
var $_tag = "hr"; |
var $_tag = "hr"; |
599 |
function _set_flags() { |
function _set_flags() { |
600 |
parent::_set_flags(); |
parent::_set_flags(); |
601 |
$this->_flags &= ~_NEWLINEAFTEROPENTAG; |
$this->_flags &= ~(_NEWLINEAFTEROPENTAG | _CONTENTREQUIRED | _CLOSETAGREQUIRED); |
602 |
} |
} |
603 |
} // HRtag |
} // HRtag |
604 |
|
|
1313 |
* any attributes set for the <tr> it won't use |
* any attributes set for the <tr> it won't use |
1314 |
* the defaults. |
* the defaults. |
1315 |
* |
* |
1316 |
|
* {@source } |
1317 |
* @param array $attributes - the default attributes |
* @param array $attributes - the default attributes |
1318 |
|
* @return none |
1319 |
*/ |
*/ |
1320 |
function set_default_row_attributes( $attributes ) { |
function set_default_row_attributes( $attributes ) { |
1321 |
|
|
1328 |
* any attributes set for the <td> it won't use |
* any attributes set for the <td> it won't use |
1329 |
* the defaults. |
* the defaults. |
1330 |
* |
* |
1331 |
|
* {@source } |
1332 |
* @param array $attributes - the default attributes |
* @param array $attributes - the default attributes |
1333 |
|
* @return none |
1334 |
*/ |
*/ |
1335 |
function set_default_col_attributes( $attributes ) { |
function set_default_col_attributes( $attributes ) { |
1336 |
|
|
1342 |
/** |
/** |
1343 |
* update the attributes of a particular element or td. |
* update the attributes of a particular element or td. |
1344 |
* |
* |
1345 |
|
* {@source } |
1346 |
* @param int $row row # of the table to edit |
* @param int $row row # of the table to edit |
1347 |
* @param int $col column # of the table to edit |
* @param int $col column # of the table to edit |
1348 |
* @param array $attributes array of name=>value pairs |
* @param array $attributes array of name=>value pairs |
1349 |
* @public |
* @return none |
|
* |
|
1350 |
*/ |
*/ |
1351 |
function set_cell_attributes( $row, $col, $attributes=array() ) { |
function set_cell_attributes( $row, $col, $attributes=array() ) { |
1352 |
|
|
1360 |
/** |
/** |
1361 |
* update the attributes of a particular row or tr. |
* update the attributes of a particular row or tr. |
1362 |
* |
* |
1363 |
|
* {@source } |
1364 |
* @param int $row row # of the table to edit |
* @param int $row row # of the table to edit |
1365 |
* @param int $col column # of the table to edit |
* @param int $col column # of the table to edit |
1366 |
* @param array $attributes array of name=>value pairs |
* @param array $attributes array of name=>value pairs |
1367 |
* @public |
* @return mixed -1 if the row doesn't exist already |
|
* |
|
1368 |
*/ |
*/ |
1369 |
function set_row_attributes( $row, $attributes ) { |
function set_row_attributes( $row, $attributes ) { |
1370 |
if ($this->_content[$row]) { |
if ($this->_content[$row]) { |
1374 |
} |
} |
1375 |
} |
} |
1376 |
|
|
1377 |
|
/** |
1378 |
|
* This method sets/resets the content for a specific |
1379 |
|
* cell in the table |
1380 |
|
* |
1381 |
|
* {@source } |
1382 |
|
* @param int the row number |
1383 |
|
* @param int the column number |
1384 |
|
* @param mixed the cell content |
1385 |
|
* @return mixed -1 if the cell doesn't exist already |
1386 |
|
*/ |
1387 |
function set_cell_content( $row, $col, $content) { |
function set_cell_content( $row, $col, $content) { |
1388 |
|
|
1389 |
$item = &$this->_get_element($row); |
$item = &$this->_get_element($row); |
1399 |
} |
} |
1400 |
} |
} |
1401 |
|
|
1402 |
|
/** |
1403 |
|
* This method is used to set a summary |
1404 |
|
* attribute on the table for speech-synthesizing |
1405 |
|
* non-visual browsers |
1406 |
|
* |
1407 |
|
* {@source } |
1408 |
|
* @param string the summary |
1409 |
|
* @return none |
1410 |
|
*/ |
1411 |
|
function set_summary($summary) { |
1412 |
|
$this->set_tag_attribute("summary", $summary); |
1413 |
|
} |
1414 |
|
|
1415 |
} // TABLEtag |
} // TABLEtag |
1416 |
|
|
1417 |
/** |
/** |
1448 |
*/ |
*/ |
1449 |
class TDtag extends HTMLTagClass { |
class TDtag extends HTMLTagClass { |
1450 |
var $_tag = "td"; |
var $_tag = "td"; |
1451 |
|
|
1452 |
|
/** |
1453 |
|
* This is a helper for setting the colspan |
1454 |
|
* attribute |
1455 |
|
* |
1456 |
|
* @param int - the colspan value |
1457 |
|
*/ |
1458 |
|
function set_colspan($colspan) { |
1459 |
|
$this->set_tag_attribute('colspan', (int)$colspan); |
1460 |
|
} |
1461 |
|
|
1462 |
|
/** |
1463 |
|
* This is a helper for setting the rowspan |
1464 |
|
* attribute |
1465 |
|
* |
1466 |
|
* @param int - the rowspan value |
1467 |
|
*/ |
1468 |
|
function set_rowspan($rowspan) { |
1469 |
|
$this->set_tag_attribute('rowspan', (int)$rowspan); |
1470 |
|
} |
1471 |
|
|
1472 |
|
|
1473 |
}// TDtag |
}// TDtag |
1474 |
|
|
1475 |
|
|