src/Util/CC.php
public function add_resource_item($module, $title=null, $type, $identifier, $file) {
        $identifier_ref = $identifier."_R";

        $xpath = new \DOMXpath($this);

        $new_item = $this->add_child_ns(CC::CC_1_1_CP, $module, 'item', null, array('identifier' => $identifier, "identifierref" => $identifier_ref));
        if ( $title != null ) {
            $new_title = $this->add_child_ns(CC::CC_1_1_CP, $new_item, 'title', $title);
        }

        $resources = $xpath->query(CC::resource_xpath)->item(0);
        $identifier_ref = $identifier."_R";
        $new_resource = $this->add_child_ns(CC::CC_1_1_CP, $resources, 'resource', null, array('identifier' => $identifier_ref, "type" => $type));
        $new_file = $this->add_child_ns(CC::CC_1_1_CP, $new_resource, 'file', null, array("href" => $file));
        return $file;
    }
public function add_resource_item($module, $title=null, $type, $identifier, $file) {
        $identifier_ref = $identifier."_R";

        $xpath = new \DOMXpath($this);

        $new_item = $this->add_child_ns(CC::CC_1_1_CP, $module, 'item', null, array('identifier' => $identifier, "identifierref" => $identifier_ref));
        if ( $title != null ) {
            $new_title = $this->add_child_ns(CC::CC_1_1_CP, $new_item, 'title', $title);
        }

        $resources = $xpath->query(CC::resource_xpath)->item(0);
        $identifier_ref = $identifier."_R";
        $new_resource = $this->add_child_ns(CC::CC_1_1_CP, $resources, 'resource', null, array('identifier' => $identifier_ref, "type" => $type));
        $new_file = $this->add_child_ns(CC::CC_1_1_CP, $new_resource, 'file', null, array("href" => $file));
        return $file;
    }
public function add_resource_item ( $ module , $ title = null , $ type , $ identifier , $ file ) { $ identifier_ref = $ identifier . "_R" ; $ xpath = new \ DOMXpath ( $ this ) ; $ new_item = $ this -> add_child_ns ( CC :: CC_1_1_CP , $ module , 'item' , null , array ( 'identifier' => $ identifier , "identifierref" => $ identifier_ref ) ) ; if ( $ title != null ) { $ new_title = $ this -> add_child_ns ( CC :: CC_1_1_CP , $ new_item , 'title' , $ title ) ; } $ resources = $ xpath -> query ( CC :: resource_xpath ) -> item ( 0 ) ; $ identifier_ref = $ identifier . "_R" ; $ new_resource = $ this -> add_child_ns ( CC :: CC_1_1_CP , $ resources , 'resource' , null , array ( 'identifier' => $ identifier_ref , "type" => $ type ) ) ; $ new_file = $ this -> add_child_ns ( CC :: CC_1_1_CP , $ new_resource , 'file' , null , array ( "href" => $ file ) ) ; return $ file ; }
Add a resource to the manifest.
Add a resource to the manifest .