18 require_once SQ_CORE_PACKAGE_PATH.
'/content_type/content_type_edit_fns.inc';
41 parent::__construct();
57 if ($asset->writeAccess(
'attributes')) {
58 $size = $GLOBALS[
'SQ_SYSTEM']->getUserPrefs($asset->type(),
'SQ_RAW_HTML_SIZE');
59 $html = $asset->attr(
'html');
61 $em = $GLOBALS[
'SQ_SYSTEM']->getEventManager();
63 $prepared_keywords = Array();
64 $keyword_vars = Array(
'keywords' => &$keywords);
65 $em->broadcastEvent($asset,
'requestKeywords', $keyword_vars);
66 if (!empty($keywords)) {
67 foreach ($keywords as $key => $name) {
68 $prepared_keywords[
'%'.$key.
'%'] = $name;
70 keyword_selector($prepared_keywords, $prefix.
'_html');
72 text_area($prefix.
'_html', $html,
'',
'', 0,
'style="width: '.$size[
'width'].
'; height: '.$size[
'height'].
'; font-family: \'Courier New\', Courier, monospace; display: block"');
91 if ($asset->writeAccess(
'attributes')) {
92 if (isset($_POST[$prefix.
'_html'])) {
93 $html = $_POST[$prefix.
'_html'];
94 $current_html = $asset->attr(
'html');
95 if ($html != $current_html) {
96 if ($asset->setAttrValue(
'html', $html))
return TRUE;