Example #1
0
File: index.php Project: hisapi/his
    echo "\n";
}
// xml mode
if ($mode_xml) {
    echo "\t\t\t<results>\n";
}
if ($mode_edit) {
    echo "<h1>";
    echo getTranslation("HIS Filter Expression Results and Recursive Sub-Processing Follows", $settings);
    echo ":</h1>";
}
if ($mode_edit) {
    echo "<pre>";
    //print_r($q);
    echo "<a name='filtering_toc'>";
    echo create_filtering_toc($q->obj_expression);
    echo "</a>";
}
if (strlen(trim($hf_expression)) > 0) {
    try {
        if ($hf_expression == "(.*)") {
            $matches = array(array('', $remote_content_collected));
            unset($matches[0][0]);
        } else {
            $hf_expression = "#" . $hf_expression . "#ism";
            preg_match_all($hf_expression, $remote_content_collected, $matches, PREG_SET_ORDER);
            for ($i = 0; $i < count($matches); $i++) {
                unset($matches[$i][0]);
            }
        }
        //echo htmlspecialchars(var_export($matches,true));
Example #2
0
function create_filtering_toc($exp)
{
    global $settings;
    $retval = "<ul>";
    foreach ($exp->obj_match_entries as $ome) {
        if (isset($ome->obj_expression)) {
            $notesection = "";
            if (isset($ome->obj_expression->obj_match_customs["-1.notesection"])) {
                $notesection = $ome->obj_expression->obj_match_customs["-1.notesection"]->value;
            }
            $is_link = true;
            if (strlen($notesection) == 0) {
                $notesection = getTranslation("(blank)", $settings);
                $is_link = false;
            }
            $is_link = true;
            if ($is_link) {
                $retval .= "<a href='#" . $ome->obj_expression->id . "_-1.notesection'>";
            }
            $retval .= htmlspecialchars($notesection);
            if ($is_link) {
                $retval .= "</a>";
            }
            $retval .= "<br/>";
        }
    }
    //echo "<pre>";
    //print_r($exp);
    if (isset($exp->obj_expression)) {
        echo "<pre>";
        print_r($exp->obj_expression);
    }
    foreach ($exp->obj_match_entries as $mes) {
        if (isset($mes->obj_expression)) {
            $retval .= create_filtering_toc($mes->obj_expression);
        }
    }
    $retval .= "</ul>";
    return $retval;
}