Public feed #891267

Mine

public text v1 · immutable
Raw Edit
·published 2008-02-04 14:38 UTC
rendered paste body


        // If the context does not exist, we create a node for it; otherwise we just use it.
        if ( !$result->length )
        {
            $contextNode = $dom->createElement( 'context' );
            $nameNode = $dom->createElement( 'name', htmlspecialchars( $context ) );
            $contextNode->appendChild( $nameNode );
            $root->appendChild( $contextNode );
        }
        else
        {
            $contextNode = $result->item( 0 )->parentNode;
        }

        // for every entry, we add a new message
        foreach ( $data as $info )
        {
            // check if the string is already there
            $xpath = new DOMXPath( $dom );
            $result = $xpath->query( '/message/name[text()="' . htmlspecialchars( $info->original ) . '"]', $contextNode );
            if ( $result->length )
            {
                continue;
            }
<?xml version="1.0"?>
<!DOCTYPE TS>
<TS>
<context>
    <name>contentstructuremenu/show_content_structure</name>
    <message>
        <source>Node ID: %node_id Visibility: %visibility</source>
        <translation>Knoop ID: %node_id Zichtbaar: %visibility</translation>
    </message>
</context>