18 require_once SQ_INCLUDE_PATH.
'/asset_attribute.inc';
19 require_once SQ_FUDGE_PATH.
'/general/general.inc';
48 $this->_edit_params[
'width'] = 0;
49 $this->_edit_params[
'protocols'] = Array(
'http');
64 echo
'<b>URL Attribute " '.ucwords(str_replace(
'_',
' ', $this->name)).
' " ('.$this->name.
')</b><br />';
66 <table
class=
"sq-backend-table">
68 <td
class=
"sq-backend-section-heading" style=
"width: 100px;"><?php echo translate(
'width'); ?></td>
69 <td
class=
"sq-backend-table-cell">
72 text_box($prefix.
'_'.$this->name.
'_width', $this->_edit_params[
'width']);
74 echo $this->_edit_params[
'width'];
80 <td
class=
"sq-backend-section-heading" style=
"width: 100px;"><?php echo translate(
'protocols'); ?></td>
81 <td
class=
"sq-backend-table-cell">
84 text_box($prefix.
'_'.$this->name.
'_height', implode(
',', $this->_edit_params[
'protocols']));
86 echo $this->_edit_params[
'protocols'];
108 if (!empty($_POST[$prefix.
'_'.$this->name.
'_width'])) {
109 $this->_edit_params[
'width'] = $_POST[$prefix.
'_'.$this->name.
'_width'];
112 if (!empty($_POST[$prefix.
'_'.$this->name.
'_protocols'])) {
113 $protocols = str_replace(
' ',
'', $_POST[$prefix.
'_'.$this->name.
'_protocols']);
114 $this->_edit_params[
'protocols'] = explode(
',', $protocols);
118 $values[
'width'] = $this->_edit_params[
'width'];
119 $values[
'protocols'] = $this->_edit_params[
'protocols'];
137 if (!parent::setEditParams($node))
return false;
139 if (isset($node->attributes()->width)) {
140 $this->_edit_params[
'width'] = (int) $node->attributes()->width;
142 if (isset($node->attributes()->protocols)) {
143 $protocols = str_replace(
' ',
'', (
string)$node->attributes()->protocols);
144 $this->_edit_params[
'protocols'] = explode(
',', $protocols);
161 function paint($prefix, $read_only=
false)
164 echo htmlspecialchars(nl2br($this->value));
168 require_once SQ_LIB_PATH.
'/html_form/html_form.inc';
170 url_tester($prefix, $this->value, $this->_edit_params[
'protocols'], $this->_edit_params[
'width']);
187 require_once SQ_LIB_PATH.
'/html_form/html_form.inc';
189 if (!isset($_REQUEST[$prefix.
'_url']))
return false;
190 if (!isset($_REQUEST[$prefix.
'_protocol']))
return false;
192 $value = get_url_tester_url($prefix);
193 if ($this->value != $value && $this->
setValue($value)) {
194 $this->processed =
true;
196 $this->processed =
false;
212 $new_value = (string) $value;
213 if ($new_value != $value)
return false;