示例#1
0
 public static function get_richtext($content)
 {
     $richtext = XMLParser::getXMLdata($content);
     $out = array();
     foreach ($richtext[0] as $obj) {
         if ($obj['tag'] == 'BLOCK' && $obj['type'] == 'complete') {
             if (substr($obj['attributes']['ID'], 0, 8) == 'richtext') {
                 $name = substr($obj['attributes']['ID'], 8);
                 $out[$name]['target'] = $obj['attributes']['TARGET'];
                 $out[$name]['content'] = $obj["value"];
             }
         }
     }
     return $out;
 }
示例#2
0
function panel_get_richtext_blocks($content)
{
    $richtext = XMLParser::getXMLdata($content);
    $out = array();
    $ind = 0;
    foreach ($richtext[0] as $obj) {
        if ($obj['tag'] == 'BLOCK' && $obj['type'] == 'complete') {
            if (substr($obj['attributes']['ID'], 0, 8) == 'richtext') {
                //$name = substr($obj['attributes']['ID'], 8);
                $ind++;
                $out[$ind]['id'] = $obj['attributes']['ID'];
                $out[$ind]['target'] = $obj['attributes']['TARGET'];
                $out[$ind]['content'] = $obj["value"];
            }
        }
    }
    return $out;
}