Esempio n. 1
0
function TrataDadosMontagem($template)
{
    if (isset($_SESSION['caso']) && $_SESSION['caso'] != 0) {
        $cas = new Caso();
        $itens = $cas->CarregaMontagem($_SESSION['caso']);
        if ($itens != false) {
            foreach ($itens as $item) {
                //$html .= '<li class="ui-state-default' . (($item->Fixo == 1) ? ' fixo' : '') . '" id="' . $item->Prefixo . $item->Chave . '">' . $item->Item . (($item->Fixo == 1) ? ' (Fixo)' : '') . '</li>';
                $html .= '<li class="conteudo-caso ' . ($item->Fixo == 1 ? 'ui-state-default' : 'ui-state-hover') . ' " id="' . $item->Prefixo . $item->Chave . '" title="' . strip_tags($item->Item) . '">' . strip_tags(substr($item->Item, 0, 90)) . '</li>';
            }
            $template = str_replace("<!--montagemcaso-->", $html, $template);
            return $template;
        } else {
            return $cas->getErro();
        }
    } else {
        return "@lng[Erro ao localizar o caso de estudo]";
    }
}