src/Util/CC.php
public function add_module($title) {
        $this->resource_count++;
        $resource_str = str_pad($this->resource_count.'',6,'0',STR_PAD_LEFT);
        $identifier = 'T_'.$resource_str;

        $xpath = new \DOMXpath($this);

        $items = $xpath->query(CC::item_xpath)->item(0);
        $module = $this->add_child_ns(CC::CC_1_1_CP, $items, 'item', null, array('identifier' => $identifier));
        $new_title = $this->add_child_ns(CC::CC_1_1_CP, $module, 'title', $title);
        return $module;
    }
public function add_module($title) {
        $this->resource_count++;
        $resource_str = str_pad($this->resource_count.'',6,'0',STR_PAD_LEFT);
        $identifier = 'T_'.$resource_str;

        $xpath = new \DOMXpath($this);

        $items = $xpath->query(CC::item_xpath)->item(0);
        $module = $this->add_child_ns(CC::CC_1_1_CP, $items, 'item', null, array('identifier' => $identifier));
        $new_title = $this->add_child_ns(CC::CC_1_1_CP, $module, 'title', $title);
        return $module;
    }
public function add_module ( $ title ) { $ this -> resource_count ++ ; $ resource_str = str_pad ( $ this -> resource_count . '' , 6 , '0' , STR_PAD_LEFT ) ; $ identifier = 'T_' . $ resource_str ; $ xpath = new \ DOMXpath ( $ this ) ; $ items = $ xpath -> query ( CC :: item_xpath ) -> item ( 0 ) ; $ module = $ this -> add_child_ns ( CC :: CC_1_1_CP , $ items , 'item' , null , array ( 'identifier' => $ identifier ) ) ; $ new_title = $ this -> add_child_ns ( CC :: CC_1_1_CP , $ module , 'title' , $ title ) ; return $ module ; }
Adds a module to the manifest

@param $title The title of the module

@return the DOMNode of the newly added module
Adds a module to the manifest