~dangarner/xibo/server-layout-media-permissions

« back to all changes in this revision

Viewing changes to server/lib/pages/region.class.php

  • Committer: Dan Garner
  • Date: 2011-08-18 23:34:53 UTC
  • Revision ID: dan@xibo.org.uk-20110818233453-q1cz35j6jb483v70
[server] Tweaks to permissions. XMDS to have GetResource call. Other small changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
585
585
 
586
586
        return $regionNode->getAttribute('name');
587
587
    }
 
588
 
 
589
    /**
 
590
     * Get media node type
 
591
     * @param <int> $layoutId
 
592
     * @param <string> $regionId
 
593
     * @param <string> $mediaId
 
594
     * @return <string>
 
595
     */
 
596
    public function GetMediaNodeType($layoutId, $regionId, $mediaId)
 
597
    {
 
598
        $db =& $this->db;
 
599
 
 
600
        //Load the XML for this layout
 
601
        $xml = new DOMDocument("1.0");
 
602
        $xml->loadXML($this->GetLayoutXml($layoutId));
 
603
 
 
604
        //Find the region
 
605
        $xpath = new DOMXPath($xml);
 
606
        $mediaNodeList = $xpath->query('//region[@id="' . $regionId . '"]/media[@id="' . $mediaId . '"]');
 
607
        $mediaNode = $mediaNodeList->item(0);
 
608
 
 
609
        return $mediaNode->getAttribute('type');
 
610
    }
588
611
}
589
612
?>