/** * Mostra mensagem de texto conforme o conte�do gravado * Caso nao exista a mensagem, envia para funcao de cadastrar nova */ function msg($s, $ed = 0) { global $LANG; global $messa, $messav; global $gerar, $edit_mode; $s = substr($s, 0, 40); $gerar = 0; /* verifica se existe $s no array de traducao */ if (isset($messa[$LANG][$s])) { /* se mode de edicao habilitado */ if ($edit_mode == 1 and $ed == 0) { /* valida se existe pagina dentro do array de validacao */ if (!in_array(page(), $messav[$LANG][$s])) { $sql = "select msg_pag from _messages where msg_field = '{$s}'"; $rlt = db_query($sql); $line = db_read($rlt); $array_check = $line['msg_pag']; if (strlen(trim($array_check)) == 0) { $array_check = array(); } else { $array_check = unserialize($array_check); } if (!is_array($array_check)) { $array_check = array(); } if (!in_array(page(), $array_check)) { array_push($array_check, page()); } $page = serialize($array_check); $sql = "update _messages set msg_pag = '{$page}' where msg_field = '{$s}' "; $rlt = db_query($sql); } } /* salva */ /* Campos para editar mensagens */ if ($ed == 0) { $img = '<A href="javascript:newxy2('; $img .= "'message_ed_pop.php?dd2=" . page() . "&dd1=" . $s; $img .= "',600,600);"; $img .= '">'; $img .= '<img src=img/icone_alert.png width=10 border=0>'; $img .= '</A>'; if ($edit_mode != 1) { $img = ''; } $link = $img; } else { $link = ''; } return $messa[$LANG][$s] . $link; } else { $msg = new message(); $ido = $msg->idioma(); foreach ($ido as $key => $value) { //echo '<HR>NOVO:'.$s.'<HR>'; $tela = msg_insert($s, $key); } return $s; } /** * Inserir nova mensagem se nao cadastrada */ }
} if (round($cpi[$r][0]) > 0) { $sql = "update " . $cl->tabela . " set msg_content='" . $dd[$r + 40] . "' "; $sql .= " where id_msg = " . $cpi[$r][0]; $rlt = db_query($sql); } } echo $cl->language_page_create(); echo ' <script> close(); </script> '; exit; } $idm = $cl->idioma(); ?> <form method="post" action="<?php // This file is part of the ProEthos Software. // // Copyright 2013, PAHO. All rights reserved. You can redistribute it and/or modify // ProEthos under the terms of the ProEthos License as published by PAHO, which // restricts commercial use of the Software. // // ProEthos is distributed in the hope that it will be useful, but WITHOUT ANY // WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A // PARTICULAR PURPOSE. See the ProEthos License for more details. // // You should have received a copy of the ProEthos License along with the ProEthos // Software. If not, see // https://raw.githubusercontent.com/bireme/proethos/master/LICENSE.txt