function try_information_template($text) { global $titles; $matches = array(); preg_match_all('/span\\s+id="field-[^"]+"/', $text, &$matches); $matches = $matches[0]; if (count($matches) == 0) { return false; } $ret = false; foreach ($matches as $m) { $t = array_pop(explode($m, $text, 2)); $title = array(); preg_match('/\\s+title="[^"]*"/', $t, &$title); $title = $title[0]; $title = array_pop(explode('title="', $title, 2)); $title = substr($title, 0, -1); $title = urldecode($title); $k = explode('field-', $m); $k = str_replace('"', '', $k[1]); $titles[$k] = $title; $ret = true; } wiki2html($titles['description']); wiki2html($titles['date']); wiki2html($titles['author']); wiki2html($titles['source']); wiki2html($titles['permission']); wiki2html($titles['otherversions']); return $ret; }
function HTMLNotasTermino($array) { if (count($array[notas])) { for ($iNota = 0; $iNota < count($array[notas]); ++$iNota) { if ($array[notas][$iNota][id]) { $body .= '<div class="NA" id="' . $array[notas][$iNota][tipoNota] . $array[notas][$iNota][id] . '">'; $body .= '<dl id="notas">'; switch ($array[notas][$iNota][tipoNota]) { case 'NA': $tipoNota = LABEL_NA; break; case 'NH': $tipoNota = LABEL_NH; break; case 'NC': $tipoNota = LABEL_NC; break; case 'NB': $tipoNota = LABEL_NB; break; case 'NP': $tipoNota = LABEL_NP; break; } //idioma de la nota //Rellenar si esta vacion $array[notas][$iNota][lang_nota] = !$array[notas][$iNota][lang_nota] ? $_SESSION["CFGIdioma"] : $array[notas][$iNota][lang_nota]; //no mostrar si es igual al idioma del vocabulario $label_lang_nota = $array[notas][$iNota][lang_nota] == $_SESSION["CFGIdioma"] ? '' : ' (' . $array[notas][$iNota][lang_nota] . ')'; if ($_SESSION[$_SESSION["CFGURL"]][ssuser_id]) { $body .= '<dt> <a title="' . LABEL_EditarNota . '" href="' . $PHP_SELF . '?editNota=' . $array[notas][$iNota][id] . '&taskterm=editNote&tema=' . $array[idTema] . '"><img alt="' . LABEL_EditarNota . '" src="../common/images/icons/page_edit.png"/></a> <a title="' . LABEL_EditarNota . '" href="' . $PHP_SELF . '?editNota=' . $array[notas][$iNota][id] . '&taskterm=editNote&tema=' . $array[idTema] . '">' . $tipoNota . '</a>' . $label_lang_nota . '</dt><dd> ' . wiki2html($array[notas][$iNota][nota]) . '</dd>'; } else { $body .= '<dt>' . $tipoNota . $label_lang_nota . '</dt><dd> ' . wiki2html($array[notas][$iNota][nota]) . '</dd>'; } $body .= '</dl>'; $body .= '</div>'; } //fin de if id nota } // fin del for } return $body; }
function HTMLNotasTermino($array) { if (count($array["notas"])) { for ($iNota = 0; $iNota < count($array[notas]); ++$iNota) { if ($array[notas][$iNota][id]) { $body .= '<div class="NA" id="' . $array[notas][$iNota][tipoNota] . $array[notas][$iNota][id] . '">'; $body .= '<dl id="notas">'; switch ($array[notas][$iNota][tipoNota]) { case 'NA': $tipoNota = LABEL_NA; break; case 'NH': $tipoNota = LABEL_NH; break; case 'NC': $tipoNota = LABEL_NC; break; case 'NB': $tipoNota = LABEL_NB; break; case 'NP': $tipoNota = LABEL_NP; break; } $tipoNota = in_array($array[notas][$iNota][tipoNota_id], array(8, 9, 10, 11, 15)) ? arrayReplace(array(8, 9, 10, 11, 15), array(LABEL_NA, LABEL_NH, LABEL_NB, LABEL_NP, LABEL_NC), $array[notas][$iNota][tipoNota_id]) : $array[notas][$iNota][tipoNotaLabel]; //idioma de la nota //Rellenar si esta vacion $array[notas][$iNota][lang_nota] = !$array[notas][$iNota][lang_nota] ? $_SESSION["CFGIdioma"] : $array[notas][$iNota][lang_nota]; //no mostrar si es igual al idioma del vocabulario $label_lang_nota = $array[notas][$iNota][lang_nota] == $_SESSION["CFGIdioma"] ? '' : ' (' . $array[notas][$iNota][lang_nota] . ')'; if ($_SESSION[$_SESSION["CFGURL"]][ssuser_id]) { $body .= '<dt> <a title="' . LABEL_EditarNota . '" href="index.php?editNota=' . $array["notas"][$iNota]["id"] . '&taskterm=editNote&tema=' . $array["idTema"] . '">' . $tipoNota . '</a>' . $label_lang_nota; $body .= ' <a role="button" class="btn btn-primary btn-xs" href="index.php?editNota=' . $array["notas"][$iNota]["id"] . '&taskterm=editNote&tema=' . $array["idTema"] . '">' . ucfirst(LABEL_EditarNota) . '</a>'; $body .= ' <a role="button" class="btn btn-danger btn-xs" href="index.php?tema=' . $array["idTema"] . '&idTema=' . $array["idTema"] . '&idNota=' . $array["notas"][$iNota]["id"] . '&taskNota=rem" name="eliminarNota" title="' . LABEL_EliminarNota . '"/>' . ucfirst(LABEL_EliminarNota) . '</a>'; $body .= '</dt>'; $body .= '<dd> ' . wiki2html($array["notas"][$iNota]["nota"]); $body .= '<div class="footnote">' . $array["notas"][$iNota]["cuando_nota"] . '</div>'; $body .= '</dd>'; } else { $body .= '<dt>' . $tipoNota . $label_lang_nota . '</dt><dd> ' . wiki2html($array[notas][$iNota][nota]) . '</dd>'; } $body .= '</dl>'; $body .= '</div>'; } //fin de if id nota } // fin del for } return $body; }