AAAAhome/academiac/www/administrator/components/com_csvi/helpers/file/export/xml/google.php 0000604 00000010514 15147633337 0025556 0 ustar 00 contents = ''.chr(10);
$this->contents .= 'contents .= 'xmlns:c="http://base.google.com/cns/1.0">'.chr(10);
$this->contents .= ''.chr(10);
// Get the XML channel header
$settings = JRequest::getVar('settings');
$this->contents .= ''.$settings->get('google_base.gb_title').''.chr(10);
$this->contents .= ''.$settings->get('google_base.gb_link').''.chr(10);
$this->contents .= ''.$settings->get('google_base.gb_description').''.chr(10);
return $this->contents;
}
/**
* Creates the XML footer
*
* @see $contents
* @return string XML header
*/
function FooterText() {
$this->contents = ''.chr(10);
$this->contents .= ''.chr(10);
return $this->contents;
}
/**
* Opens an XML item node
*
* @see $contents
* @return string XML node data
*/
function NodeStart() {
$this->contents = '- '.chr(10);
return $this->contents;
}
/**
* Closes an XML item node
*
* @see $contents
* @return string XML node data
*/
function NodeEnd() {
$this->contents = '
'.chr(10);
return $this->contents;
}
/**
* Adds an XML element
*
* @see $node
* @return string XML element
*/
function Element($column_header, $cdata=false) {
if (stristr($column_header, 'c:')) {
$this->node = '<'.$column_header.' type="string">';
}
else $this->node = '<'.$column_header.'>';
if ($cdata) $this->node .= 'node .= $this->contents;
if ($cdata) $this->node .= ']]>';
$this->node .= ''.$column_header.'>';
$this->node .= "\n";
return $this->node;
}
/**
* Handles all content and modifies special cases
*
* @see $contents
* @return string formatted XML element
*/
function ContentText($content, $column_header, $fieldname, $cdata=false) {
switch ($fieldname) {
case 'custom_shipping':
switch($column_header) {
case 'g:shipping':
if (strpos($content, ':')) {
list($country, $service, $price) = explode(":", $content);
$this->contents = '
'.$country.'
'.$service.'
'.$price.'
';
}
else $this->contents = '';
break;
}
break;
case 'custom':
switch($column_header) {
case 'g:tech_spec_link':
$cdate = true;
$this->contents = $content;
break;
case 'g:tax':
list($country, $region, $rate, $tax_ship) = explode(":", $content);
$this->contents = '
'.$country.'
'.$region.'
'.$rate.'
'.$tax_ship.'
';
break;
default:
$this->contents = $content;
break;
}
break;
case 'category_path':
$paths = explode("|", $content);
$content = '';
foreach ($paths as $id => $path) {
$this->contents = str_replace('/', '>', $path);
$content .= $this->Element($column_header, $cdata);
}
return $content;
break;
case 'manufacturer_name':
case 'product_url':
$cdata = true;
default:
$this->contents = $content;
break;
}
if (empty($column_header)) $column_header = $fieldname;
return $this->Element($column_header, $cdata);
}
}
?>