API16

JApplicationHelper/parseXMLLangMetaFile: Difference between revisions

From Joomla! Documentation

m removing red link to edit, no existant pages
m preparing for archive only
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
<span class="editsection" style="font-size:76%;">
<nowiki>[<! removed edit link to red link >]</nowiki>
</span>
<! removed transcluded page call, red link never existed >
<! removed transcluded page call, red link never existed >


Line 65: Line 61:
</source>
</source>


<span class="editsection" style="font-size:76%;">
 
<nowiki>[<! removed edit link to red link >]</nowiki>
</span>
<! removed transcluded page call, red link never existed >
<! removed transcluded page call, red link never existed >


===Examples===
===Examples===
<CodeExamplesForm />
=== Code Examples ===
<dpl>
<dpl>
  noresultsheader=\n
  noresultsheader=\n
  category=parseXMLLangMetaFile
  category=parseXMLLangMetaFile
  category=JApplicationHelper
  category=JApplicationHelper
  category=CodeExample
  namespace=CodeExample
  category=MethodExample
  category=MethodExample
  include=*
  include=*

Latest revision as of 01:18, 25 March 2017

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

Syntax

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

Defined in

libraries/joomla/application/helper.php

Importing

jimport( 'joomla.application.helper' );

Source Body

public static function parseXMLLangMetaFile($path)
{
        // Read the file to see if it's a valid component XML file
        $xml = JFactory::getXML($path);

        if( ! $xml)
        {
                return false;
        }

        /*
         * Check for a valid XML root tag.
         *
         * Should be 'langMetaData'.
         */
        if ($xml->getName() != 'metafile') {
                unset($xml);
                return false;
        }

        $data = array();

        $data['name'] = (string)$xml->name;
        $data['type'] = $xml->attributes()->type;

        $data['creationDate'] =((string)$xml->creationDate) ? (string)$xml->creationDate : JText::_('Unknown');
        $data['author'] =((string)$xml->author) ? (string)$xml->author : JText::_('Unknown');

        $data['copyright'] = (string)$xml->copyright;
        $data['authorEmail'] = (string)$xml->authorEmail;
        $data['authorUrl'] = (string)$xml->authorUrl;
        $data['version'] = (string)$xml->version;
        $data['description'] = (string)$xml->description;
        $data['group'] = (string)$xml->group;

        return $data;
}


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

Examples

Code Examples