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

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

        $sub_module = $this->add_child_ns(CC::CC_1_1_CP, $module, 'item', null, array('identifier' => $identifier));
        $new_title = $this->add_child_ns(CC::CC_1_1_CP, $sub_module, 'title',$title);
        return $sub_module;
    }
public function add_sub_module ( $ module , $ title ) { $ this -> resource_count ++ ; $ resource_str = str_pad ( $ this -> resource_count . '' , 6 , '0' , STR_PAD_LEFT ) ; $ identifier = 'T_' . $ resource_str ; $ sub_module = $ this -> add_child_ns ( CC :: CC_1_1_CP , $ module , 'item' , null , array ( 'identifier' => $ identifier ) ) ; $ new_title = $ this -> add_child_ns ( CC :: CC_1_1_CP , $ sub_module , 'title' , $ title ) ; return $ sub_module ; }
Adds a sub module to a module

As a note, while some LMS's are happpy with deeply nested
sub-module trees, other LMS's prefre a strict two-layer
module / submodule structure.

@param $sub_module DOMNode The module where we are adding the submodule
@param $title The title of the sub module

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