1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
| <?php
require_once('../classes/exist_phpapi.inc');
// definition de la cote et du numéro de fragment
$ref_bib_doc = $fragment_en_cours->fragment->getCote();
$ref_bib_cote = $ref_bib_doc;
$ref_bib_num_frag = $fragment_en_cours->fragment->getNumeroFragment();
$affichage_possible=true;
$affichage_possible_img=true;
$file_name = null;
if (($ref_bib_doc=='') || ($ref_bib_num_frag=='')) {
$affichage_possible=false;
$affichage_possible_img=false;
}
else {
$file_name=$ref_bib_doc.'-'.$ref_bib_num_frag.'.jpg';
$path_img=PATH_APPLICATION.'/files/fragments/'.$ref_bib_doc.'/'.$file_name;
if (!file_exists($path_img)) {
$affichage_possible_img=false;
}
else {
$taille_div_img=80; // TODO : temporaire
}
$ref_bib_doc .= '-ver3.xml';
$fragment='';
$db_xml = new xqueryBP();
$fragment=$db_xml->getFragmentSelonSaCoteEtSonNumero($ref_bib_doc, $ref_bib_num_frag);// retourne une partie du doc xml
if ($fragment=='') {
$fragment='<item><fragment></fragment></item>';
$affichage_possible=false;
}
$xml=new DOMDocument();
$xml->loadXML('<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="'.PATH_APPLICATION.'/templates/affichage_fragment_diplo.xsl"?>'.$fragment);
$xsl=new DOMDocument();
$xsl->load(PATH_APPLICATION.'/templates/affichage_fragment_diplo.xsl', LIBXML_NOCDATA);
$proc = new XSLTProcessor();
$proc->importStylesheet($xsl);
//===
$xml2=new DOMDocument();
$xml2->loadXML('<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="'.PATH_APPLICATION.'/templates/affichage_fragment_norm.xsl"?>'.$fragment);
$xsl2=new DOMDocument();
$xsl2->load(PATH_APPLICATION.'/templates/affichage_fragment_norm.xsl', LIBXML_NOCDATA);
$proc2 = new XSLTProcessor();
$proc2->importStylesheet($xsl2);
}
</script>';
/*### IMG - TITRE ###*/
if ($affichage_possible_img) {
?>
<script type="text/javascript">
jQuery(document).ready(function(){
jQuery("#viewer_<?php echo $id_item.'_'.$fragment_en_cours->getId() ?>").iviewer({
src: "show_fragment.php?file=<?php echo $file_name ?>",
update_on_resize: true,
ui_disabled: false,
zoom_delta:1.2,
initCallback: function () {
var object = this;
jQuery("#in").click(function(){ object.zoom_by(1);});
jQuery("#out").click(function(){ object.zoom_by(-1);});
}
});
// Pour chaque viewer, masquer les icones fit, orig et update
jQuery('.iviewer_zoom_status').css('display', 'none');
jQuery('.iviewer_zoom_fit').css('display', 'none');
jQuery('.iviewer_zoom_zero').css('display', 'none');
// Placer les icônes in et out sur la droite du bloc .viewer
jQuery('.iviewer_zoom_in').css('position', 'relative').css('float', 'right').css('margin-right', '28px').css('top', '8px');
jQuery('.iviewer_zoom_out').css('position', 'relative').css('float', 'right').css('margin-right', '5px').css('top', '42px');
});
</script>
<?php
echo '<div class="imagette" title="'.$ref_bib_cote.'_'.$ref_bib_num_frag.'" style="height: '.$taille_div_img.'px;">
<div id="viewer_'.$id_item.'_'.$fragment_en_cours->getId().'" class="viewer"></div>
</div>';
}
else {
echo '<div class="img_indisponible" title="'.gettext('Imagette indisponible').'" style="height: '.$taille_div_img.'px;">'
.gettext('Imagette indisponible').'
</div>';
}
/*### FRAGMENT - LECTURE SIMPLE ###*/
// Body
echo '<div id="fragment_body_'.$id_item.'_'.$fragment_en_cours->getId().'" class="bloc_fragment_body" title="'.$fragment_en_cours->getNotesGenerales().'">';
// marques & notes en marge
echo '<div class="bloc_fragment_body_marques" title="'.gettext('Marques et notes en marges').'">';
// CONTENU
echo '</div>';
// marques & notes en marge
echo '<div class="bloc_fragment_body_tei" title="'.gettext('Transcription').'">';
if ($affichage_possible==true) {
echo $proc->transformToXml($xml);
}
else {
echo 'Voir la transcription';
}
echo '</div>';
echo '</div>'; |
Partager