00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00038 if (!is_object($this)) die('Not called from cObj!');
00039
00040 $globalMeta = $conf['global.'];
00041 $local = $conf['local.'];
00042 $regular = array();
00043 $DC = array();
00044
00045 $localDescription = trim($this->stdWrap($local['description'],$local['description.']));
00046 $localKeywords = trim($this->stdWrap($local['keywords'],$local['keywords.']));
00047
00048
00049 if (substr($globalMeta['description_2'],0,2)=='{$') {$globalMeta['description_2'] = '';}
00050 if (substr($globalMeta['keywords_2'],0,2)=='{$') {$globalMeta['keywords_2'] = '';}
00051 if (!$conf['flags.']['useSecondaryDescKey']) {
00052 unset($globalMeta['keywords_2']);
00053 unset($globalMeta['description_2']);
00054 }
00055
00056
00057 if ($globalMeta['description'] || $globalMeta['description_2'] || $localDescription) {
00058 $val = trim($globalMeta['description']);
00059 if ($globalMeta['description_2']) {
00060 $val = ($val?ereg_replace('\.$','',$val).'. ':'').$globalMeta['description_2'];
00061 }
00062 if ($localDescription) {
00063 if ($conf['flags.']['alwaysGlobalDescription'] ) {
00064 $val = ereg_replace('\.$','',$localDescription).'. '.$val;
00065 } else {
00066 $val = $localDescription;
00067 }
00068 }
00069 $val=trim($val);
00070 $regular[] = '<meta name="description" content="'.htmlspecialchars($val).'" />';
00071 $DC[] = '<meta name="DC.Description" content="'.htmlspecialchars($val).'" />';
00072 }
00073 if ($globalMeta['keywords'] || $globalMeta['keywords_2'] || $localKeywords) {
00074 $val = trim($globalMeta['keywords']);
00075 if ($globalMeta['keywords_2']) {
00076 $val = ereg_replace(',$','',$val).','.$globalMeta['keywords_2'];
00077 }
00078 if ($localKeywords) {
00079 if ($conf['flags.']['alwaysGlobalKeywords'] ) {
00080 $val = ereg_replace(',$','',$localKeywords).','.$val;
00081 } else {
00082 $val = $localKeywords;
00083 }
00084 }
00085 $val=trim(ereg_replace(',$','',trim($val)));
00086 $val=implode(',',t3lib_div::trimExplode(',',$val,1));
00087 $regular[] = '<meta name="keywords" content="'.htmlspecialchars($val).'" />';
00088 $DC[] = '<meta name="DC.Subject" content="'.htmlspecialchars($val).'" />';
00089 }
00090 if ($globalMeta['robots']) {
00091 $regular[] = '<meta name="robots" content="'.htmlspecialchars($globalMeta['robots']).'" />';
00092 }
00093 if ($globalMeta['copyright']) {
00094 $regular[] = '<meta name="copyright" content="'.htmlspecialchars($globalMeta['copyright']).'" />';
00095 $DC[] = '<meta name="DC.Rights" content="'.htmlspecialchars($globalMeta['copyright']).'" />';
00096 }
00097 if ($globalMeta['language']) {
00098 $regular[] = '<meta http-equiv="content-language" content="'.htmlspecialchars($globalMeta['language']).'" />';
00099 $DC[] = '<meta name="DC.Language" scheme="NISOZ39.50" content="'.htmlspecialchars($globalMeta['language']).'" />';
00100 }
00101 if ($globalMeta['email']) {
00102 $regular[] = '<link rev="made" href="mailto:'.htmlspecialchars($globalMeta['email']).'" />';
00103 $regular[] = '<meta http-equiv="reply-to" content="'.htmlspecialchars($globalMeta['email']).'" />';
00104 }
00105 if ($globalMeta['author']) {
00106 $regular[] = '<meta name="author" content="'.htmlspecialchars($globalMeta['author']).'" />';
00107 $DC[] = '<meta name="DC.Creator" content="'.htmlspecialchars($globalMeta['author']).'" />';
00108 }
00109 if ($globalMeta['distribution']) {
00110 $regular[] = '<meta name="distribution" content="'.htmlspecialchars($globalMeta['distribution']).'" />';
00111 }
00112 if ($globalMeta['rating']) {
00113 $regular[] = '<meta name="rating" content="'.htmlspecialchars($globalMeta['rating']).'" />';
00114 }
00115 if ($globalMeta['revisit']) {
00116 $regular[] = '<meta name="revisit-after" content="'.htmlspecialchars($globalMeta['revisit']).'" />';
00117 }
00118
00119 $DC[] = '<link rel="schema.dc" href="http://purl.org/metadata/dublin_core_elements" />';
00120
00121
00122 if (!$conf['flags.']['DC']) {$DC=array();}
00123
00124 $content ='';
00125 $content.= implode($regular,chr(10)).chr(10);
00126 $content.= implode($DC,chr(10)).chr(10);
00127
00128 ?>