17 require_once SQ_INCLUDE_PATH.
'/asset_edit/asset_edit_fns.inc';
18 require_once SQ_CORE_PACKAGE_PATH.
'/data_source/data_source/data_source_edit_fns.inc';
41 parent::__construct();
58 $url = html_entity_decode($asset->attr(
'url'));
59 $wa = $asset->writeAccess(
'attributes');
61 text_box($prefix.
'feed_url', $url, 30);
83 $url = htmlentities($asset->attr(
'url'));
84 if (isset($_POST[$prefix.
'feed_url'])) {
85 $link = htmlentities(trim($_POST[$prefix.
'feed_url']));
86 if (strcasecmp($url, $link) != 0) {
87 $asset->setAttrValue(
'url', $link);
108 $tags = unserialize(html_entity_decode($asset->attr(
'tags')));
109 $wa = $asset->writeAccess(
'attributes');
111 text_area($prefix.
'tag_names', !empty($tags) ? implode(
',', $tags) :
'', 40);
114 echo !empty($tags) ? implode(
',', $tags) :
'';
133 $current_tags = htmlentities($asset->attr(
'tags'));
134 if (isset($_POST[$prefix.
'tag_names'])) {
135 $posted_tags = htmlentities($_POST[$prefix.
'tag_names']);
136 if (strcasecmp($current_tags, $posted_tags) != 0) {
137 $exploded = explode(
',', $posted_tags);
139 array_walk($exploded, Array(&$this,
'_trimValue'));
140 $asset->setAttrValue(
'tags', serialize($exploded));
161 $tags = unserialize(html_entity_decode($asset->attr(
'tags')));
162 $tag_attributes = unserialize(html_entity_decode($asset->attr(
'tag_attributes')));
163 $wa = $asset->writeAccess(
'attributes');
165 <table
class=
"sq-backend-table">
167 <th><?php echo translate(
'tag');?></th>
168 <th><?php echo translate(
'attributes');?></th>
171 for ($i=0; $i<count($tags); $i++) {
174 <td><?php echo $tags[$i];?> </td>
176 <td><?php text_box($prefix.
'tagattr_'.$i, isset($tag_attributes[$tags[$i]]) ? implode(
',', $tag_attributes[$tags[$i]]) :
'', 30); ?> </td>
178 <td><?php echo isset($tag_attributes[$tags[$i]]) ? implode(
',', $tag_attributes[$tags[$i]]) :
''; ?> </td>
205 $tags = unserialize(html_entity_decode($asset->attr(
'tags')));
207 foreach ($_POST as $tag => $attributes) {
208 if ($tag === $prefix.
'tagattr_'.$i) {
209 $exploded = explode(
',', htmlentities($attributes));
211 array_walk($exploded, Array(&$this,
'_trimValue'));
212 if (isset($tags[$i])) $results[$tags[$i]] = $exploded;
216 if (!empty($results)) {
217 $asset->setAttrValue(
'tag_attributes', serialize($results));
236 $value = trim($value);
253 $tags = unserialize(html_entity_decode($asset->attr(
'cdata_tags')));
254 $wa = $asset->writeAccess(
'attributes');
256 text_area($prefix.
'cdata_tag_names', !empty($tags) ? implode(
',', $tags) :
'', 40);
259 echo !empty($tags) ? implode(
',', $tags) :
'';
278 $current_tags = htmlentities($asset->attr(
'cdata_tags'));
279 if (isset($_POST[$prefix.
'cdata_tag_names'])) {
280 $posted_tags = htmlentities($_POST[$prefix.
'cdata_tag_names']);
282 if (strcasecmp($current_tags, $posted_tags) != 0) {
283 $exploded = explode(
',', $posted_tags);
285 array_walk($exploded, Array(&$this,
'_trimValue'));
286 $asset->setAttrValue(
'cdata_tags', serialize($exploded));
288 $asset->setResultSet(Array(), $asset->attr(
'url'));
289 $asset->getResultSet($asset->attr(
'url'));