Public Member Functions

ilModuleReader Class Reference

Inheritance diagram for ilModuleReader:
Collaboration diagram for ilModuleReader:

Public Member Functions

 ilModuleReader ()
 getModules ()
 setHandlers ($a_xml_parser)
 set event handler should be overwritten by inherited class private
 clearTables ()
 clear the tables
 handlerBeginTag ($a_xml_parser, $a_name, $a_attribs)
 start tag handler
 handlerEndTag ($a_xml_parser, $a_name)
 end tag handler
 handlerCharacterData ($a_xml_parser, $a_data)
 end tag handler

Detailed Description

Definition at line 34 of file class.ilModuleReader.php.


Member Function Documentation

ilModuleReader::clearTables (  ) 

clear the tables

Definition at line 65 of file class.ilModuleReader.php.

References $q.

Referenced by getModules().

        {
                global $ilDB;

                $q = "DELETE FROM module";;
                $ilDB->query($q);

                $q = "DELETE FROM module_class";;
                $ilDB->query($q);

        }

Here is the caller graph for this function:

ilModuleReader::getModules (  ) 

Definition at line 43 of file class.ilModuleReader.php.

References clearTables(), and ilSaxParser::startParsing().

        {
                if (!$this->executed)
                {
                        $this->clearTables();
                        $this->startParsing();
                        $this->executed = true;
                }
        }

Here is the call graph for this function:

ilModuleReader::handlerBeginTag ( a_xml_parser,
a_name,
a_attribs 
)

start tag handler

Parameters:
ressouce internal xml_parser_handler
string element tag name
array element attributes private

Definition at line 86 of file class.ilModuleReader.php.

References $q.

        {
                global $ilDB;

                $this->current_tag = $a_name;
                
                switch ($a_name)
                {
                        case 'module':
                                $this->current_module = $a_attribs["name"];
                                $q = "INSERT INTO module (name, dir) VALUES ".
                                        "(".$ilDB->quote($a_attribs["name"]).",".
                                        $ilDB->quote($a_attribs["dir"]).")";
                                $ilDB->query($q);
                                break;
                                
                        case 'baseclass':
                                $q = "INSERT INTO module_class (module, class, dir) VALUES ".
                                        "(".$ilDB->quote($this->current_module).",".
                                        $ilDB->quote($a_attribs["name"]).",".
                                        $ilDB->quote($a_attribs["dir"]).")";
                                $ilDB->query($q);
                                break;
                                
                }
        }

ilModuleReader::handlerCharacterData ( a_xml_parser,
a_data 
)

end tag handler

Parameters:
ressouce internal xml_parser_handler
string data private

Definition at line 132 of file class.ilModuleReader.php.

        {
                // DELETE WHITESPACES AND NEWLINES OF CHARACTER DATA
                $a_data = preg_replace("/\n/","",$a_data);
                $a_data = preg_replace("/\t+/","",$a_data);

                if (!empty($a_data))
                {
                        switch ($this->current_tag)
                        {
                                case '':
                        }
                }
        }

ilModuleReader::handlerEndTag ( a_xml_parser,
a_name 
)

end tag handler

Parameters:
ressouce internal xml_parser_handler
string element tag name private

Definition at line 120 of file class.ilModuleReader.php.

        {
        }

ilModuleReader::ilModuleReader (  ) 

Definition at line 37 of file class.ilModuleReader.php.

References ilSaxParser::ilSaxParser().

        {
                $this->executed = false;
                parent::ilSaxParser(ILIAS_ABSOLUTE_PATH."/modules.xml");
        }

Here is the call graph for this function:

ilModuleReader::setHandlers ( a_xml_parser  ) 

set event handler should be overwritten by inherited class private

Reimplemented from ilSaxParser.

Definition at line 54 of file class.ilModuleReader.php.

        {
                xml_set_object($a_xml_parser,$this);
                xml_set_element_handler($a_xml_parser,'handlerBeginTag','handlerEndTag');
                xml_set_character_data_handler($a_xml_parser,'handlerCharacterData');
        }


The documentation for this class was generated from the following file: