$output .= " </mmtemplate>\n"; } // the stylesheets foreach ($stylesheet_ids as $id) { $stylesheet = $styleops->LoadStylesheetByID($id); $_name = _trim_themename($stylesheet->name); $output .= " <stylesheet>\n"; $output .= " <cssname>" . $_name . "</cssname>\n"; $output .= " <cssmediatype>" . $stylesheet->media_type . "</cssmediatype>\n"; $output .= " <cssdata><![CDATA[" . base64_encode($stylesheet->value) . "]]></cssdata>\n"; $output .= " </stylesheet>\n"; } foreach ($associations as $assoc1) { foreach ($assoc1['css'] as $t_assoc2) { $tname = _trim_themename($assoc1['tname']); $assoc2 = _trim_themename($t_assoc2); $output .= " <assoc>\n"; $output .= " <assoc_tname>" . $tname . "</assoc_tname>\n"; $output .= " <assoc_cssname>" . $assoc2 . "</assoc_cssname>\n"; $output .= " </assoc>\n"; } } // the files foreach ($urls as $oneurl) { $contents = file_get_contents($gCms->config['root_path'] . DIRECTORY_SEPARATOR . $oneurl); if (!$contents) { continue; } $encoded = base64_encode($contents); $output .= " <reference>\n"; $output .= " <refname>" . basename($oneurl) . "</refname>\n";
continue; } if (count($onereference) != 4) { // stylesheet name exists $this->DisplayErrorPage($id, $params, $returnid, $this->Lang('error_badembed', $onesheet->name)); } $allreferences[] = $onereference; $onereference = array(); break; case 'MMTEMPLATE_NAME': $onemmtemplate['origname'] = $value; $t_arr = explode('.tpl', $value); if (is_array($t_arr)) { $value = $t_arr[0]; } $onemmtemplate['name'] = $theme . " : " . _trim_themename($value); break; case 'MMTEMPLATE_DATA': $onemmtemplate['data'] = base64_decode($value); break; case 'MMTEMPLATE': if ($type != 'close') { continue; } if (count($onemmtemplate) != 3) { // stylesheet name exists $this->DisplayErrorPage($id, $params, $returnid, $this->Lang('error_badxml')); } $mmtemplates[] = $onemmtemplate; } }
function _trim_mmtemplate($name) { return _trim_themename($name, 'mmtemplate'); }