Public Member Functions | Data Fields

ilMetaData Class Reference

Public Member Functions

 ilMetaData ($a_type="", $a_id=0)
 Constructor public.
 clean ($a_data)
 setObject (&$a_obj)
 __initNestedSet ()
 read ()
 create ()
 create meta data object in db
 update ()
 update everything
 updateTitleAndDescription ($title, $description)
 delete ($a_name, $a_path, $a_index)
 delete meta data node
 add ($a_name, $a_path, $a_index=0)
 add meta data node
 getDom ()
 setElement ($a_name, $a_data)
 buffer value of one element
 getElement ($a_name, $a_path="", $a_index=0)
 get value of one element of the ILIAS meta data structure
 setImportIdentifierEntryID ($a_id)
 set identifier entry ID
 getImportIdentifierEntryID ()
 get identifier entry ID
 setTitle ($a_title)
 set title
 getTitle ()
 get title
 setMeta ($a_data)
 set (posted) meta data
 getMeta ()
 get meta data
 setSection ($a_section)
 set chosen meta data section
 getSection ()
 get chosen meta data section
 setID ($a_id)
 set object id
 getID ()
 get object id
 setType ($a_type)
 set object type
 getType ()
 get object type
 setLanguage ($a_lang)
 set language
 getLanguage ()
 get language
 setDescription ($a_desc)
 set description
 getDescription ()
 get description
 addTechnicalSection (&$a_tech)
 Technical section.
getTechnicalSections ()
 updateTechnicalSections ()
 readTechnicalSections ()
getTechnicalSection ($a_nr=1)
 get technical section number $a_nr (starting with 1!)
 getCountries ()
 getLanguages ()
 get iso conform languages see http://www.oasis-open.org/cover/iso639a.html
 setXMLContent ($a_xml, $a_encoding="UTF-8")
 set xml content of MetaData, start with <MetaData...>, end with </MetaData>, comply with ILIAS DTD, use utf-8!
 appendXMLContent ($a_xml)
 append xml content to MetaData setXMLContent must be called before and the same encoding must be used
 getXMLContent ()
 get xml content of MetaData

Data Fields

 $ilias
 $id
 $type
 $nested_obj
 $meta
 $section
 $obj
 $import_id
 $title
 $language
 $description
 $technicals

Detailed Description

Definition at line 40 of file class.ilMetaData.php.


Member Function Documentation

ilMetaData::__initNestedSet (  ) 

Definition at line 97 of file class.ilMetaData.php.

References getID(), and getType().

Referenced by add(), create(), delete(), getDom(), getElement(), read(), update(), and updateTitleAndDescription().

        {
                include_once("classes/class.ilNestedSetXML.php");

                $this->nested_obj =& new ilNestedSetXML();
                $this->nested_obj->init($this->getID(), $this->getType());
                return $this->nested_obj->initDom();
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilMetaData::add ( a_name,
a_path,
a_index = 0 
)

add meta data node

Definition at line 269 of file class.ilMetaData.php.

References __initNestedSet().

        {
                if ( $this->__initNestedSet() )
                {
                        $p = "//MetaData";
                        if ($a_path != "")
                        {
                                $p .= "/" . $a_path;
                        }
                        $attributes = array();
#               echo "Index: " . $a_index . " | Path: " . $a_path . " | Name: " . $a_name . "<br>\n";
                        switch ($a_name)
                        {
                                case "Relation"         :       $xml = '
                                                                                        <Relation>
                                                                                                <Resource>
                                                                                                        <Identifier_ Catalog="ILIAS" Entry=""/>
                                                                                                        <Description Language="' . $this->ilias->account->getLanguage() . '"/>
                                                                                                </Resource>
                                                                                        </Relation>
                                                                                ';
                                                                                $this->nested_obj->addXMLNode($p, $xml, $a_index);
                                                                                break;
                                case "Lifecycle":       $xml = '
                                                                                        <Lifecycle Status="Draft">
                                                                                                <Version Language="' . $this->ilias->account->getLanguage() . '"></Version>
                                                                                                <Contribute Role="Author">
                                                                                                        <Entity/>
                                                                                                        <Data/>
                                                                                                </Contribute>
                                                                                        </Lifecycle>
                                                                                ';
                                                                                $this->nested_obj->addXMLNode($p, $xml, $a_index);
                                                                                break;
                                case "Meta-Metadata":   $xml = '
                                                                                        <Meta-Metadata MetadataScheme="LOM v 1.0" Language="' . $this->ilias->account->getLanguage() . '">
                                                                                                <Identifier Catalog="ILIAS" Entry=""/>
                                                                                                <Contribute Role="Author">
                                                                                                        <Entity/>
                                                                                                        <Data/>
                                                                                                </Contribute>
                                                                                        </Meta-Metadata>
                                                                                ';
                                                                                $this->nested_obj->addXMLNode($p, $xml, $a_index);
                                                                                break;
                                case "Technical"        :       $xml = '
                                                                                        <Technical/>
                                                                                ';
                                                                                $this->nested_obj->addXMLNode($p, $xml, $a_index);
                                                                                break;
                                case "Educational"      :       $xml = '
                                                                                        <Educational InteractivityType="Active" LearningResourceType="Exercise" InteractivityLevel="Medium" SemanticDensity="Medium" IntendedEndUserRole="Learner" Context="Other" Difficulty="Medium">
                                                                                                <TypicalAgeRange></TypicalAgeRange>
                                                                                                <TypicalLearningTime></TypicalLearningTime>
                                                                                        </Educational>
                                                                                ';
                                                                                $this->nested_obj->addXMLNode($p, $xml, $a_index);
                                                                                break;
                                case "Rights"           :       $xml = '
                                                                                        <Rights Cost="No" CopyrightAndOtherRestrictions="No">
                                                                                                <Description Language="' . $this->ilias->account->getLanguage() . '"/>
                                                                                        </Rights>
                                                                                ';
                                                                                $this->nested_obj->addXMLNode($p, $xml, $a_index);
                                                                                break;
                                case "Annotation"       :       $xml = '
                                                                                        <Annotation>
                                                                                                <Entity/>
                                                                                                <Date/>
                                                                                                <Description Language="' . $this->ilias->account->getLanguage() . '"/>
                                                                                        </Annotation>
                                                                                ';
                                                                                $this->nested_obj->addXMLNode($p, $xml, $a_index);
                                                                                break;
                                case "Classification":  $xml = '
                                                                                        <Classification Purpose="Idea">
                                                                                                <TaxonPath>
                                                                                                        <Source Language="' . $this->ilias->account->getLanguage() . '"/>
                                                                                                        <Taxon Language="' . $this->ilias->account->getLanguage() . '" Id=""/>
                                                                                                </TaxonPath>
                                                                                                <Description Language="' . $this->ilias->account->getLanguage() . '"/>
                                                                                                <Keyword Language="' . $this->ilias->account->getLanguage() . '"/>
                                                                                        </Classification>
                                                                                ';
                                                                                $this->nested_obj->addXMLNode($p, $xml, $a_index);
                                                                                break;
                                case "Contribute"       :       $xml = '
                                                                                        <Contribute Role="Author">
                                                                                                <Entity/>
                                                                                                <Data/>
                                                                                        </Contribute>
                                                                                ';
                                                                                $this->nested_obj->addXMLNode($p, $xml, $a_index);
                                                                                break;
                                case "Requirement"      :       $xml = '
                                                                                        <Requirement>
                                                                                                <Type>
                                                                                                        <Browser Name="Any" MinimumVersion="" MaximumVersion=""/>
                                                                                                </Type>
                                                                                        </Requirement>
                                                                                ';
                                                                                $this->nested_obj->addXMLNode($p, $xml, $a_index);
                                                                                break;
                                case "OrComposite"      :       $xml = '
                                                                                        <OrComposite>
                                                                                                <Requirement>
                                                                                                        <Type>
                                                                                                                <Browser Name="Any" MinimumVersion="" MaximumVersion=""/>
                                                                                                        </Type>
                                                                                                </Requirement>
                                                                                        </OrComposite>
                                                                                ';
                                                                                $this->nested_obj->addXMLNode($p, $xml, $a_index);
                                                                                break;
                                case "TaxonPath"        :       $xml = '
                                                                                        <TaxonPath>
                                                                                                <Source Language="' . $this->ilias->account->getLanguage() . '"/>
                                                                                                <Taxon Language="' . $this->ilias->account->getLanguage() . '" Id=""/>
                                                                                        </TaxonPath>
                                                                                ';
                                                                                $this->nested_obj->addXMLNode($p, $xml, $a_index);
                                                                                break;
                                case "Taxon"            :       $value = "";
                                                                                $attributes[0] = array("name" => "Language", value => $this->ilias->account->getLanguage());
                                                                                $attributes[1] = array("name" => "Id", value => "");
                                                                                $this->nested_obj->addDomNode($p, $a_name, $value, $attributes, $a_index);
                                                                                break;
                                case "Identifier"       :       ;
                                case "Identifier_"      :       $value = "";
                                                                                $attributes[0] = array("name" => "Catalog", "value" => "");
                                                                                $attributes[1] = array("name" => "Entry", "value" => "");
                                                                                $this->nested_obj->addDomNode($p, $a_name, $value, $attributes, $a_index);
                                                                                break;
                                case "Language"         :       $value = "";
                                                                                $attributes[0] = array("name" => "Language", value => $this->ilias->account->getLanguage());
                                                                                $this->nested_obj->addDomNode($p, $a_name, $value, $attributes, $a_index);
                                                                                break;
                                case "InstallationRemarks"      :       ;
                                case "OtherPlattformRequirements"       :       ;
                                case "TypicalAgeRange"  :       ;
                                case "Title"            :       ;
                                case "Description"      :       ;
                                case "Coverage"         :       ;
                                case "Keyword"          :       $value = "";
                                                                                $attributes[0] = array("name" => "Language", value => $this->ilias->account->getLanguage());
                                                                                $this->nested_obj->addDomNode($p, $a_name, $value, $attributes, $a_index);
                                                                                break;
                                case "Location"         :       $value = "";
                                                                                $attributes[0] = array("name" => "Type", value => "LocalFile");
                                                                                $this->nested_obj->addDomNode($p, $a_name, $value, $attributes, $a_index);
                                                                                break;
                                default                         :       $value = "";
                                                                                $attributes = "";
                                                                                $this->nested_obj->addDomNode($p, $a_name, $value, $attributes, $a_index);
                                                                                break;
                        }
                        $this->nested_obj->updateFromDom();
                }
        }

Here is the call graph for this function:

ilMetaData::addTechnicalSection ( &$  a_tech  ) 

Technical section.

Parameters:
array $a_tech object (of class ilMetaTechnical)

Definition at line 602 of file class.ilMetaData.php.

        {
                $this->technicals[] =& $a_tech;
        }

ilMetaData::appendXMLContent ( a_xml  ) 

append xml content to MetaData setXMLContent must be called before and the same encoding must be used

Parameters:
string $a_xml xml content

Definition at line 728 of file class.ilMetaData.php.

        {
                $this->xml.= $a_xml;
        }

ilMetaData::clean ( a_data  ) 

Definition at line 83 of file class.ilMetaData.php.

Referenced by create().

        {
                $a_data = preg_replace("/&(?!amp;|lt;|gt;|quot;)/","&amp;",$a_data);
                $a_data = preg_replace("/</","&lt;",$a_data);
                $a_data = preg_replace("/>/","&gt;",$a_data);

                return $a_data;
        }

Here is the caller graph for this function:

ilMetaData::create (  ) 

create meta data object in db

Definition at line 143 of file class.ilMetaData.php.

References __initNestedSet(), clean(), getID(), and getType().

Referenced by read().

        {
#echo "<b>meta create()</b><br>";
                $this->__initNestedSet();
                if (is_object($this->obj))
                {
                        $metaData["title"] = $this->obj->getTitle();
                        $metaData["description"] = $this->obj->getDescription();
                }
                else
                {
                        $metaData["title"] = "NO TITLE";
                        $metaData["description"] = "";
                }

                // SUBSTITUTE '&' => '&amp;'
                $metaData["title"] = $this->clean($metaData["title"]);
                $metaData["description"] = $this->clean($metaData["description"]);

                $xml = '
                        <MetaData>
                                <General Structure="Hierarchical">
                                        <Identifier Catalog="ILIAS" Entry="il__' . $this->getType() . '_' . $this->getId() . '"></Identifier>
                                        <Title Language="' . $this->ilias->account->getLanguage() . '">' . $metaData["title"] . '</Title>
                                        <Description Language="' . $this->ilias->account->getLanguage() . '">' . $metaData["description"] . '</Description>
                                        <Keyword Language="' . $this->ilias->account->getLanguage() . '"></Keyword>
                                </General>
                        </MetaData>
                ';
                $this->nested_obj->import($xml, $this->getID(), $this->getType());
                return $metaData;
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilMetaData::delete ( a_name,
a_path,
a_index 
)

delete meta data node

Definition at line 249 of file class.ilMetaData.php.

References __initNestedSet().

Referenced by updateTechnicalSections().

        {
                if ($a_name != "")
                {
                        if ( $this->__initNestedSet() )
                        {
                                $p = "//MetaData";
                                if ($a_path != "")
                                {
                                        $p .= "/" . $a_path;
                                }
                                $this->nested_obj->deleteDomNode($p, $a_name, $a_index);
                                $this->nested_obj->updateFromDom();
                        }
                }
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilMetaData::getCountries (  ) 

Definition at line 641 of file class.ilMetaData.php.

References $lng.

        {
                global $lng;

                $lng->loadLanguageModule("meta");

                $cntcodes = array ("DE","ES","FR","GB","AT","CH","AF","AL","DZ","AS","AD","AO",
                        "AI","AQ","AG","AR","AM","AW","AU","AT","AZ","BS","BH","BD","BB","BY",
                        "BE","BZ","BJ","BM","BT","BO","BA","BW","BV","BR","IO","BN","BG","BF",
                        "BI","KH","CM","CA","CV","KY","CF","TD","CL","CN","CX","CC","CO","KM",
                        "CG","CK","CR","CI","HR","CU","CY","CZ","DK","DJ","DM","DO","TP","EC",
                        "EG","SV","GQ","ER","EE","ET","FK","FO","FJ","FI","FR","FX","GF","PF",
                        "TF","GA","GM","GE","DE","GH","GI","GR","GL","GD","GP","GU","GT","GN",
                        "GW","GY","HT","HM","HN","HU","IS","IN","ID","IR","IQ","IE","IL","IT",
                        "JM","JP","JO","KZ","KE","KI","KP","KR","KW","KG","LA","LV","LB","LS",
                        "LR","LY","LI","LT","LU","MO","MK","MG","MW","MY","MV","ML","MT","MH",
                        "MQ","MR","MU","YT","MX","FM","MD","MC","MN","MS","MA","MZ","MM","NA",
                        "NR","NP","NL","AN","NC","NZ","NI","NE","NG","NU","NF","MP","NO","OM",
                        "PK","PW","PA","PG","PY","PE","PH","PN","PL","PT","PR","QA","RE","RO",
                        "RU","RW","KN","LC","VC","WS","SM","ST","SA","CH","SN","SC","SL","SG",
                        "SK","SI","SB","SO","ZA","GS","ES","LK","SH","PM","SD","SR","SJ","SZ",
                        "SE","SY","TW","TJ","TZ","TH","TG","TK","TO","TT","TN","TR","TM","TC",
                        "TV","UG","UA","AE","GB","UY","US","UM","UZ","VU","VA","VE","VN","VG",
                        "VI","WF","EH","YE","ZR","ZM","ZW");
                $cntrs = array();
                foreach($cntcodes as $cntcode)
                {
                        $cntrs[$cntcode] = $lng->txt("meta_c_".$cntcode);
                }
                asort($cntrs);
                return $cntrs;

        }

ilMetaData::getDescription (  ) 

get description

Definition at line 592 of file class.ilMetaData.php.

Referenced by update().

        {
                return $this->description;
        }

Here is the caller graph for this function:

ilMetaData::getDom (  ) 

Definition at line 429 of file class.ilMetaData.php.

References __initNestedSet().

        {
                if ( $this->__initNestedSet() )
                {
                        return $this->nested_obj->initDom();
                }
        }

Here is the call graph for this function:

ilMetaData::getElement ( a_name,
a_path = "",
a_index = 0 
)

get value of one element of the ILIAS meta data structure

Definition at line 448 of file class.ilMetaData.php.

References __initNestedSet(), and setElement().

        {
                if ( $this->__initNestedSet() )
                {
                        $p = "//MetaData";
                        if ($a_path != "")
                        {
                                $p .= "/" . $a_path;
                        }
#               echo "Index: " . $a_index . " | Path: " . $p . " | Name: " . $a_name . "<br>\n";
                        $nodes = $this->nested_obj->getDomContent($p, $a_name, $a_index);
                        $this->setElement($a_name, $nodes);
#               vd($this->$a_name);
                        return $this->$a_name;
                }
        }

Here is the call graph for this function:

ilMetaData::getID (  ) 

get object id

Definition at line 544 of file class.ilMetaData.php.

Referenced by __initNestedSet(), and create().

        {
                return $this->id;
        }

Here is the caller graph for this function:

ilMetaData::getImportIdentifierEntryID (  ) 

get identifier entry ID

Definition at line 476 of file class.ilMetaData.php.

        {
                return $this->import_id;
        }

ilMetaData::getLanguage (  ) 

get language

Definition at line 576 of file class.ilMetaData.php.

        {
                return $this->language;
        }

ilMetaData::getLanguages (  ) 

get iso conform languages see http://www.oasis-open.org/cover/iso639a.html

Definition at line 679 of file class.ilMetaData.php.

References $lng.

Referenced by ilObjSystemFolderGUI::changeHeaderTitleObject(), ilGlossaryTermGUI::create(), ilObjCategoryGUI::createObject(), ilPCTableGUI::edit(), ilPCParagraphGUI::edit(), ilPCFileListGUI::edit(), ilObjCategoryGUI::editObject(), ilGlossaryTermGUI::editTerm(), ilPCTableGUI::insert(), ilPCParagraphGUI::insert(), ilPCFileListGUI::insert(), ilObjGlossaryGUI::listTerms(), ilPCSourcecodeGUI::setTemplateText(), ilBibItemGUI::showLangSel(), and ilMetaDataGUI::showLangSel().

        {
                global $lng;

                $lng->loadLanguageModule("meta");

                $lngcodes = array("aa","ab","af","am","ar","as","ay","az","ba","be","bg","bh",
                        "bi","bn","bo","br","ca","co","cs","cy","da","de","dz","el","en","eo",
                        "es","et","eu","fa","fi","fj","fo","fr","fy","ga","gd","gl","gn","gu",
                        "ha","he","hi","hr","hu","hy","ia","ie","ik","id","is","it","iu","ja",
                        "jv","ka","kk","kl","km","kn","ko","ks","ku","ky","la","ln",
                        "lo","lt","lv","mg","mi","mk","ml","mn","mo","mr","ms","mt",
                        "my","na","ne","nl","no","oc","om","or","pa","pl","ps","pt",
                        "qu","rm","rn","ro",
                        "ru","rw",
                        "sa","sd","sg","sh","si","sk","sl","sm","sn","so","sq","sr","ss","st",
                        "su","sv","sw","ta","te","tg","th","ti","tk","tl","tn","to","tr","ts",
                        "tt","tw","ug","uk","ur","uz","vi","vo","wo","xh","yi","yo","za","zh",
                        "zu");
                $langs = array();
                foreach($lngcodes as $lngcode)
                {
                        $langs[$lngcode] = $lng->txt("meta_l_".$lngcode);
                }
                asort($langs);
                return $langs;
        }

Here is the caller graph for this function:

ilMetaData::getMeta (  ) 

get meta data

Definition at line 512 of file class.ilMetaData.php.

        {
                return $this->meta;
        }

ilMetaData::getSection (  ) 

get chosen meta data section

Definition at line 528 of file class.ilMetaData.php.

        {
                return $this->section;
        }

& ilMetaData::getTechnicalSection ( a_nr = 1  ) 

get technical section number $a_nr (starting with 1!)

Definition at line 629 of file class.ilMetaData.php.

        {
                if ($a_nr > count($this->technicals))
                {
                        return false;
                }
                else
                {
                        return $this->technicals[$a_nr - 1];
                }
        }

& ilMetaData::getTechnicalSections (  ) 

Definition at line 607 of file class.ilMetaData.php.

        {
                return $this->technicals;
        }

ilMetaData::getTitle (  ) 

get title

Definition at line 496 of file class.ilMetaData.php.

Referenced by update().

        {
                return $this->title;
        }

Here is the caller graph for this function:

ilMetaData::getType (  ) 

get object type

Definition at line 560 of file class.ilMetaData.php.

Referenced by __initNestedSet(), create(), read(), update(), and updateTechnicalSections().

        {
                return $this->type;
        }

Here is the caller graph for this function:

ilMetaData::getXMLContent (  ) 

get xml content of MetaData

Definition at line 737 of file class.ilMetaData.php.

        {
        return $this->xml;
        }

ilMetaData::ilMetaData ( a_type = "",
a_id = 0 
)

Constructor public.

Definition at line 64 of file class.ilMetaData.php.

References $ilias, and read().

        {
                global $ilias;

                $this->ilias =& $ilias;

                $this->import_id = "";
                $this->title = "";
                $this->language = array();
                $this->description = "";
                $this->technicals = array();    // technical sections
                $this->type = $a_type;
                $this->id = $a_id;
                if($a_id != 0)
                {
                        $this->read();
                }
        }

Here is the call graph for this function:

ilMetaData::read (  ) 

Definition at line 106 of file class.ilMetaData.php.

References __initNestedSet(), create(), getType(), setDescription(), and setTitle().

Referenced by ilMetaData().

        {
                /* Get meta data from nested set */
                if ($this->getType() == "pg" ||
                        $this->getType() == "st" ||
                        $this->getType() == "lm" ||
                        $this->getType() == "glo" ||
                        $this->getType() == "mob" ||
                        $this->getType() == "crs" ||
                        $this->getType() == "sahs" ||
                        $this->getType() == "htlm" ||
                        $this->getType() == "tst" ||
                        $this->getType() == "qpl" ||
                        $this->getType() == "svy" ||
                        $this->getType() == "spl" ||
                        $this->getType() == "gdf" ||
                        $this->getType() == "dbk")
                {
                        if ( !$this->__initNestedSet() )
                        {
                                $metaData = $this->create();
                        }
                        else
                        {
                                $metaData["title"] = $this->nested_obj->getFirstDomContent("//MetaData/General/Title");
                                $metaData["description"] = $this->nested_obj->getFirstDomContent("//MetaData/General/Description");
                        }

                        $this->setTitle($metaData["title"]);
                        $this->setDescription($metaData["description"]);
                }

        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilMetaData::readTechnicalSections (  ) 

Definition at line 621 of file class.ilMetaData.php.

ilMetaData::setDescription ( a_desc  ) 

set description

Definition at line 584 of file class.ilMetaData.php.

Referenced by read(), update(), and updateTitleAndDescription().

        {
                $this->description = $a_desc;
        }

Here is the caller graph for this function:

ilMetaData::setElement ( a_name,
a_data 
)

buffer value of one element

Definition at line 440 of file class.ilMetaData.php.

Referenced by getElement().

        {
                $this->$a_name = $a_data;
        }

Here is the caller graph for this function:

ilMetaData::setID ( a_id  ) 

set object id

Definition at line 536 of file class.ilMetaData.php.

        {
                $this->id = $a_id;
        }

ilMetaData::setImportIdentifierEntryID ( a_id  ) 

set identifier entry ID

Definition at line 468 of file class.ilMetaData.php.

        {
                $this->import_id = $a_id;
        }

ilMetaData::setLanguage ( a_lang  ) 

set language

Definition at line 568 of file class.ilMetaData.php.

        {
                $this->language = $a_lang;
        }

ilMetaData::setMeta ( a_data  ) 

set (posted) meta data

Definition at line 504 of file class.ilMetaData.php.

        {
                $this->meta = $a_data;
        }

ilMetaData::setObject ( &$  a_obj  ) 

Definition at line 92 of file class.ilMetaData.php.

        {
                $this->obj =& $a_obj;
        }

ilMetaData::setSection ( a_section  ) 

set chosen meta data section

Definition at line 520 of file class.ilMetaData.php.

        {
                $this->section = $a_section;
        }

ilMetaData::setTitle ( a_title  ) 

set title

Definition at line 484 of file class.ilMetaData.php.

Referenced by read(), update(), and updateTitleAndDescription().

        {
                if ($a_title == "")
                {
                        $a_title = "NO TITLE";
                }
                $this->title = $a_title;
        }

Here is the caller graph for this function:

ilMetaData::setType ( a_type  ) 

set object type

Definition at line 552 of file class.ilMetaData.php.

        {
                $this->type = $a_type;
        }

ilMetaData::setXMLContent ( a_xml,
a_encoding = "UTF-8" 
)

set xml content of MetaData, start with <MetaData...>, end with </MetaData>, comply with ILIAS DTD, use utf-8!

Parameters:
string $a_xml xml content
string $a_encoding encoding of the content (here is no conversion done! it must be already utf-8 encoded at the time)

Definition at line 715 of file class.ilMetaData.php.

        {
                $this->encoding = $a_encoding;
                $this->xml = $a_xml;
        }

ilMetaData::update (  ) 

update everything

Definition at line 179 of file class.ilMetaData.php.

References $query, __initNestedSet(), getDescription(), getTitle(), getType(), setDescription(), setTitle(), ilUtil::stripSlashes(), and updateTechnicalSections().

Referenced by updateTitleAndDescription().

        {
#echo "<b>meta update()</b><br>";
                $query = "REPLACE INTO meta_data (obj_id, obj_type, title, language, description) VALUES (".
                                 "'".$this->getId()."', ".
                                 "'".$this->getType()."', ".
                                 "'".ilUtil::prepareDBString($this->getTitle())."', ".
                                 "'".$this->getLanguage()."', ".
                                 "'".ilUtil::prepareDBString($this->getDescription())."')";
                $this->ilias->db->query($query);
                $this->updateTechnicalSections();

                if ($this->getType() == "pg" ||
                        $this->getType() == "st" ||
                        $this->getType() == "lm" ||
                        $this->getType() == "crs" ||
                        $this->getType() == "glo" ||
                        $this->getType() == "gdf" ||
                        $this->getType() == "dbk" ||
                        $this->getType() == "tst" ||
                        $this->getType() == "qpl" ||
                        $this->getType() == "svy" ||
                        $this->getType() == "spl" ||
                        $this->getType() == "mob" ||
                        $this->getType() == "htlm" ||
                        $this->getType() == "sahs")
                {
#                       echo "Section: " . $this->section . "<br>\n";
                        if ( $this->__initNestedSet() )
                        {
                                $p = "//MetaData";
                                if ($this->section != "")
                                {
                                        $p .= "/" . $this->section;
                                }

                                $this->nested_obj->updateDomNode($p, $this->meta);
                                $this->nested_obj->updateFromDom();

                                /* editing meta data with editor: new title */
                                if (isset($this->meta["Title"]["Value"]))
                                {
                                        $this->setTitle(ilUtil::stripSlashes($this->meta["Title"]["Value"]));
                                        $this->setDescription(ilUtil::stripSlashes($this->meta["Description"][0]["Value"]));
                                }
                        }
                }
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilMetaData::updateTechnicalSections (  ) 

Definition at line 612 of file class.ilMetaData.php.

References delete(), and getType().

Referenced by update().

        {
                ilMetaTechnical::delete($this->getId(), $this->getType());
                foreach($this->technicals as $technical)
                {
                        $technical->create();
                }
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilMetaData::updateTitleAndDescription ( title,
description 
)

Definition at line 228 of file class.ilMetaData.php.

References $description, $title, __initNestedSet(), setDescription(), setTitle(), and update().

        {
                if ( $this->__initNestedSet() )
                {
                        $p = "//MetaData/General";
                        if ($this->section != "")
                        {
                                $p .= "/" . $this->section;
                        }
                        $this->nested_obj->replaceDomContent($p, "Title", 0, array("value" => $title));
                        $this->nested_obj->replaceDomContent($p, "Description", 0, array("value" => $description));
                        $this->nested_obj->updateFromDom();
                }
                $this->setTitle($title);
                $this->setDescription($description);
                $this->update();
        }

Here is the call graph for this function:


Field Documentation

ilMetaData::$description

Definition at line 57 of file class.ilMetaData.php.

Referenced by updateTitleAndDescription().

ilMetaData::$id

Definition at line 44 of file class.ilMetaData.php.

ilMetaData::$ilias

Definition at line 42 of file class.ilMetaData.php.

Referenced by ilMetaData().

ilMetaData::$import_id

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

ilMetaData::$language

Definition at line 56 of file class.ilMetaData.php.

ilMetaData::$meta

Definition at line 49 of file class.ilMetaData.php.

ilMetaData::$nested_obj

Definition at line 47 of file class.ilMetaData.php.

ilMetaData::$obj

Definition at line 52 of file class.ilMetaData.php.

ilMetaData::$section

Definition at line 50 of file class.ilMetaData.php.

ilMetaData::$technicals

Definition at line 58 of file class.ilMetaData.php.

ilMetaData::$title

Definition at line 55 of file class.ilMetaData.php.

Referenced by updateTitleAndDescription().

ilMetaData::$type

Definition at line 45 of file class.ilMetaData.php.


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