/**
* top level script (e.g. lm_edit.php)
*
*/
[...]
// set target script
$ilCtrl->setTargetScript("lm_edit.php");

// read call structure for top level gui class
$ilCtrl->getCallStructure("illmeditorgui");
[...]

// create an instance of top level gui class
$lm_editor_gui =& new ilLMEditorGUI();

// forward flow of control to top level gui class
$ilCtrl->forwardCommand($lm_editor_gui);







/**
* GUI class for learning module editor
*
* [...]
*
* identify all subclasses that are called by the current class
*
* @ilCtrl_Calls ilLMEditorGUI: ilObjDlBookGUI, ilMetaDataGUI, ilObjLearningModuleGUI
*
* (this information is stored into the database by 
* $ilCtrlStructureReader->getStructure() in the db update script)
*
* [...]
*/
class ilLMEditorGUI
{

	/**
	* Constructor
	* @access	public
	*/
	function ilLMEditorGUI()
	{
		global $ilias, $tpl, $lng, $objDefinition, $ilCtrl;

		// provide parameters that should be saved through multiple
		// requests
		$this->ctrl =& $ilCtrl;
		$this->ctrl->saveParameter($this, array("ref_id", "obj_id"));

	}

	
	/**
	* execute command
	*/
	function &executeCommand()
	{
		// determine next class in the call structure
		$next_class = $this->ctrl->getNextClass($this);

		switch($next_class)
		{
			// if another class is responsible to process current
			// command, forward the process of control to the
			// next class
			case "ilobjdlbookgui":
				$book_gui =& new ilObjDlBookGUI(...);
				$ret =& $this->ctrl->forwardCommand($book_gui);

				break;
				
			case "...":
				[...]
				break;
				
				[...]
				
				
			// process command, if current class is responsible
			// to do so
			default:
				$cmd = $this->ctrl->getCmd("view");
				$this->$cmd();
				break;
		}
	}
	
	
	
	/**
	* command method
	*/
	function foo()
	{
		[...]
	
		// generate a formaction attribute for a form
		$tpl->setVariable("FORMACTION",
			$this->ctrl->getFormAction($this));
			
			
		// generate a link to a method of the same GUI class
		$tpl->setVariable("LINK_TARGET",
			$this->ctrl->getLinkTarget($this, "view"));
	

		// generate a link to a method of another GUI class
		$tpl->setVariable("LINK_TARGET",
			$this->ctrl->getLinkTargetByClass("classnamegui", "edit"));
		
	}
	
}
