Actions

API15

JApplicationHelper/parseXMLLangMetaFile

From Joomla! Documentation

< API15:JApplicationHelper
Replacement filing cabinet.png
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.

[<! removed edit link to red link >]

<! removed transcluded page call, red link never existed >

Contents

Syntax

parseXMLLangMetaFile($path)
Parameter Name Default Value Description
$path

Defined in

libraries/joomla/application/helper.php

Importing

jimport( 'joomla.application.helper' );

Source Body

function parseXMLLangMetaFile($path)
{
        // Read the file to see if it's a valid component XML file
        $xml = & JFactory::getXMLParser('Simple');
 
        if (!$xml->loadFile($path)) {
                unset($xml);
                return false;
        }
 
        /*
         * Check for a valid XML root tag.
         *
         * Should be 'langMetaData'.
         */
        if ($xml->document->name() != 'metafile') {
                unset($xml);
                return false;
        }
 
        $data = array();
 
        $element = & $xml->document->name[0];
        $data['name'] = $element ? $element->data() : '';
        $data['type'] = $element ? $xml->document->attributes("type") : '';
 
        $element = & $xml->document->creationDate[0];
        $data['creationdate'] = $element ? $element->data() : JText::_('Unknown');
 
        $element = & $xml->document->author[0];
 
        $data['author'] = $element ? $element->data() : JText::_('Unknown');
 
        $element = & $xml->document->copyright[0];
        $data['copyright'] = $element ? $element->data() : '';
 
        $element = & $xml->document->authorEmail[0];
        $data['authorEmail'] = $element ? $element->data() : '';
 
        $element = & $xml->document->authorUrl[0];
        $data['authorUrl'] = $element ? $element->data() : '';
 
        $element = & $xml->document->version[0];
        $data['version'] = $element ? $element->data() : '';
 
        $element = & $xml->document->description[0];
        $data['description'] = $element ? $element->data() : '';
 
        $element = & $xml->document->group[0];
        $data['group'] = $element ? $element->group() : '';
        return $data;
}

[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >

Examples

<CodeExamplesForm />