/** * Load a flexform in memory * * @param mixed $flexForm can be an xml string or an array or a key array. * @param string $flexFormName (optinal) give a name to the flexform in order to be stored for further use. * @return void */ function load($flexForm, $flexFormName = '') { //handle the case $flexForm is a string. It can be a xml string or key array if (is_string($flexForm)) { //test if $flexForm already exists in the memory. In this case load the flexform according to its key if (array_key_exists($flexForm, tx_div2007_ff::$flexForms)) { self::$flexForm = tx_div2007_ff::$flexForms[$flexForm]; } else { //if false, it means it is *still* a string to convert in an array self::$flexForm = t3lib_div::xml2array($flexForm); } } else { //else it is right away an array, load it in memory self::$flexForm = $flexForm; } //true when the flexform is going to be stored for further use if ($flexFormName != '') { self::setFlexForm($flexFormName, self::$flexForm); } }