projects
/
php-utility-classes.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add functions for easily adding images
[php-utility-classes.git]
/
include
/
cbsm
/
util
/
document.php-class
diff --git
a/include/cbsm/util/document.php-class
b/include/cbsm/util/document.php-class
index e641d23c56364fec3610153d65803280cf03c726..c06354458f6d3438ad9e847b3838fe0c2916eeb4 100755
(executable)
--- a/
include/cbsm/util/document.php-class
+++ b/
include/cbsm/util/document.php-class
@@
-172,6
+172,9
@@
class ExtendedDocument extends DOMDocument {
function appendLink($target, $value = '') {
return $this->appendChild($this->createElementLink($target, $value));
}
function appendLink($target, $value = '') {
return $this->appendChild($this->createElementLink($target, $value));
}
+ function appendImage($src, $alt_text = '') {
+ return $this->appendChild($this->createElementImage($src, $alt_text));
+ }
function appendFormDiv($action, $method, $name) {
$formelem = $this->appendChild($this->createElementForm($action, $method, $name));
return $formelem->appendElement('div');
function appendFormDiv($action, $method, $name) {
$formelem = $this->appendChild($this->createElementForm($action, $method, $name));
return $formelem->appendElement('div');
@@
-237,6
+240,13
@@
class ExtendedDocument extends DOMDocument {
return $link;
}
return $link;
}
+ function createElementImage($src, $alt_text = '') {
+ $link = $this->createElement('img');
+ $link->setAttribute('src', $src);
+ $link->setAttribute('alt', $alt_text);
+ return $link;
+ }
+
function createElementForm($action, $method, $name) {
$formelem = $this->createElement('form');
$formelem->setAttribute('action', $action);
function createElementForm($action, $method, $name) {
$formelem = $this->createElement('form');
$formelem->setAttribute('action', $action);