18 require_once SQ_CORE_PACKAGE_PATH.
'/designs/design_area/design_area.inc';
43 parent::__construct($assetid);
59 $format = $this->
attr(
'format');
73 }
else if ((array_get_index($_GET,
'SQ_ACTION') ==
'diff') && ($ASSET->status & SQ_SC_STATUS_SAFE_EDITING) && $ASSET->writeAccess(
'')) {
78 $num_previous_gets = count($GLOBALS[
'SQ_SYSTEM']->am->_get_asset_history);
82 $ASSET->printBodyWithPaintLayout();
83 $edited_contents = ob_get_contents();
87 $GLOBALS[
'SQ_SYSTEM']->setGlobalDefine(
'force_system_version', TRUE);
91 $used_asset_ids = array_unique(array_slice($GLOBALS[
'SQ_SYSTEM']->am->_get_asset_history, $num_previous_gets));
92 foreach ($used_asset_ids as $used_asset_id) {
93 $used_asset = $GLOBALS[
'SQ_SYSTEM']->am->getAsset($used_asset_id);
95 $used_asset->reload();
100 $num_previous_gets = count($GLOBALS[
'SQ_SYSTEM']->am->_get_asset_history);
104 $ASSET->printBodyWithPaintLayout();
105 $system_version_contents = ob_get_contents();
109 $GLOBALS[
'SQ_SYSTEM']->setGlobalDefine(
'force_system_version', FALSE);
113 $used_asset_ids = array_unique(array_slice($GLOBALS[
'SQ_SYSTEM']->am->_get_asset_history, $num_previous_gets));
114 foreach ($used_asset_ids as $used_asset_id) {
115 $used_asset = $GLOBALS[
'SQ_SYSTEM']->am->getAsset($used_asset_id);
117 $used_asset->reload();
122 require_once SQ_CORE_PACKAGE_PATH.
'/designs/design_areas/design_area_body/matrix_diff_highlighter.inc';
124 echo $highlighter->process($system_version_contents, $edited_contents);
129 if ($ASSET->_is_cacheable) {
130 $cm = $GLOBALS[
'SQ_SYSTEM']->am->getSystemAsset(
'cache_manager');
131 $body = $cm->loadFromCache($ASSET->id, $ASSET->type());
135 if (!$ASSET->_is_cacheable || ($body === FALSE)) {
137 $ASSET->printBodyWithPaintLayout();
138 $body = ob_get_contents();
144 case 'low_bandwidth':
147 $body = preg_replace(\'|\s+|\', \' \', $body);
148 $body = str_replace(\'<br />\', \'<br/>\', $body);
149 $body = str_replace(\'<br/>\', "\n", $body);
150 $body = preg_replace(\'|\n\s+|\', "\n", $body);
151 $body = preg_replace(\'|[\n]+|\', "\n", $body);
152 $body = str_replace("\n", \'<br/>\', $body);
160 $body = preg_replace(\'|<img([^>]*)>|Ui\',\'\',$body);
161 $body = preg_replace(\'|\\<embed(.*)>(.*)</embed>|i\',\'\',$body);
162 $body = preg_replace(\'|\\<object(.*)>(.*)</object>|i\',\'\',$body);