You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

257 lines
7.0 KiB

<?php
if (!defined('_ECRIRE_INC_VERSION')) {
return;
}
function typoenluminee_porte_plume_barre_pre_charger($barres) {
$barre = &$barres['edition'];
$barre->cacher('italic');
$barre->cacher('stroke_through');
$barre->cacher('notes');
$barre->cacher('sepCode');
$barre->cacher('grpCode');
$module_barre = 'barre_outils';
if (intval($GLOBALS['spip_version_branche']) > 2) {
$module_barre = 'barreoutils';
}
$barre->set('header1', array(
// groupe formatage paragraphe
'dropMenu' => array(
array(
'id' => 'intertitre',
'name' => _T('barre_intertitre'),
'className' => 'outil_intertitre1',
'openWith' => "\n{{{",
'closeWith' => "}}}\n",
'display' => true,
'selectionType' => 'line',
),
array(
'id' => 'intertitre2',
'name' => _T('enlumtypo:barre_intertitre2'),
'className' => 'outil_intertitre2',
'openWith' => "\n{{{**",
'closeWith' => "}}}\n",
'display' => true,
'selectionType' => 'line',
),
array(
'id' => 'intertitre3',
'name' => _T('enlumtypo:barre_intertitre3'),
'className' => 'outil_intertitre3',
'openWith' => "\n{{{***",
'closeWith' => "}}}\n",
'display' => true,
'selectionType' => 'line',
),
array(
'id' => 'alignerdroite',
'name' => _T('enlumtypo:barre_alignerdroite'),
'className' => 'outil_alignerdroite',
'openWith' => "\n[/",
'closeWith' => "/]\n",
'display' => true,
'selectionType' => 'line',
),
array(
'id' => 'alignergauche',
'name' => _T('enlumtypo:barre_alignergauche'),
'className' => 'outil_alignergauche',
'openWith' => "\n[!",
'closeWith' => "!]\n",
'display' => true,
'lang' => array('ar', 'fa'),
'selectionType' => 'line',
),
array(
'id' => 'cadretexte',
'name' => _T('enlumtypo:barre_encadrer'),
'className' => 'outil_cadretexte',
'openWith' => "\n[(",
'closeWith' => ")]\n",
'display' => true,
'selectionType' => 'line',
),
array(
'id' => 'barre_cadre',
'name' => _T($module_barre . ':barre_cadre'),
'className' => 'outil_barre_cadre',
'openWith' => "\n&lt;cadre&gt;",
'closeWith' => "&lt;/cadre&gt;\n",
'display' => true,
'selectionType' => 'line',
),
),
));
$barre->set('bold', array(
// groupe formatage texte
'dropMenu' => array(
// Italic - {
array(
'id' => 'italic',
'name' => _T('barreoutils:barre_italic'),
'key' => 'I',
'className' => 'outil_italic',
'replaceWith' => "function(h){ return espace_si_accolade(h, '{', '}');}",
//'openWith' => '{',
//'closeWith' => '}',
'display' => true,
'selectionType' => 'word',
),
// Petites capitales
array(
'id' => 'petitescapitales',
'name' => _T('enlumtypo:barre_petitescapitales'),
'className' => 'outil_petitescapitales',
'openWith' => '<sc>',
'closeWith' => '</sc>',
'display' => true,
'selectionType' => 'word',
),
// montrer une suppression
array(
'id' => 'stroke_through_et',
'name' => _T('enlumtypo:barre_barre'), // :-)
'className' => 'outil_stroke_through_et',
'openWith' => '<del>',
'closeWith' => '</del>',
'display' => true,
'selectionType' => 'word',
),
// Mise en évidence (gras + couleur)
array(
'id' => 'miseenevidence',
'name' => _T('enlumtypo:barre_miseenevidence'),
'className' => 'outil_miseenevidence',
'openWith' => '[*',
'closeWith' => '*]',
'display' => true,
'selectionType' => 'word',
),
// Mise en évidence2 (gras + autre couleur)
array(
'id' => 'miseenevidence2',
'name' => _T('enlumtypo:barre_miseenevidence2'),
'className' => 'outil_miseenevidence2',
'openWith' => '[**',
'closeWith' => '*]',
'display' => true,
'selectionType' => 'word',
),
// Mise en exposant
array(
'id' => 'exposant',
'name' => _T('enlumtypo:barre_exposant'),
'className' => 'outil_exposant',
'openWith' => '<sup>',
'closeWith' => '</sup>',
'display' => true,
'selectionType' => 'word',
),
// Mise en indice
array(
'id' => 'indice',
'name' => _T('enlumtypo:barre_indice'),
'className' => 'outil_indice',
'openWith' => '<sub>',
'closeWith' => '</sub>',
'display' => true,
'selectionType' => 'word',
),
// cadre spip
array(
'id' => 'barre_code',
'name' => _T($module_barre . ':barre_code'),
'className' => 'outil_barre_code',
'openWith' => '&lt;code&gt;',
'closeWith' => '&lt;/code&gt;',
'display' => true,
'selectionType' => 'word',
),
),
));
$barre->set('link', array(
// groupe formatage texte
'dropMenu' => array(
array(
'id' => 'notes',
'name' => _T('barreoutils:barre_note'),
'className' => 'outil_notes',
'openWith' => '[[',
'closeWith' => ']]',
'display' => true,
'selectionType' => 'word',
),
),
));
// Appel Tableau
$barre->ajouterApres('notes', array(
'id' => 'barre_tableau',
'name' => _T('enlumtypo:barre_tableau'),
'className' => 'outil_barre_tableau',
'replaceWith' => "function(markitup) { zone_selection = markitup.textarea; jQuery.modalboxload('".url_absolue(generer_url_public(
'typoenluminee_tableau_edit',
"modalbox=oui"
))."',{minWidth: '90%', minHeight: '90%', iframe: true, type: 'iframe'});}",
'display' => true,
'selectionType' => 'line',
));
$barre->set('quote', array(
'openWith' => '<quote>',
'closeWith' => '</quote>',
));
$barre->set('quote', array(
'dropMenu' => array(
// poesie spip
array(
'id' => 'barre_poesie',
'name' => _T($module_barre . ':barre_poesie'),
'className' => 'outil_barre_poesie',
'openWith' => "\n&lt;poesie&gt;\n",
'closeWith' => "\n&lt;/poesie&gt;\n",
'display' => true,
'selectionType' => 'word',
),
),
));
return $barres;
}
function typoenluminee_porte_plume_lien_classe_vers_icone($flux) {
// Récupérer la définition des icônes vanillas afin d'en réutiliser certaines
$definition_icones = charger_fonction('icones', 'barre_outils/edition');
$icones = $definition_icones();
return array_merge($flux, array(
'outil_intertitre1' => $icones['outil_header1'], //'intertitre.png'
'outil_intertitre2' => array('intertitre2.png', '0'),
'outil_intertitre3' => array('intertitre3.png', '0'),
'outil_alignerdroite' => array('right.png', '0'),
'outil_alignergauche' => array('left.png', '0'),
'outil_stroke_through_et' => $icones['outil_stroke_through'], //'text_strikethrough.png'
'outil_cadretexte' => array('cadretexte.png', '0'),
'outil_speciaux' => array('tag.png', '0'),
'outil_barre_code' => array('page_white_code_red.png', '0'),
'outil_barre_cadre' => array('page_white_code.png', '0'),
'outil_miseenevidence' => array('miseenevidence.png', '0'),
'outil_miseenevidence2' => array('miseenevidence2.png', '0'),
'outil_exposant' => array('exposant.png', '0'),
'outil_indice' => array('indice.png', '0'),
'outil_petitescapitales' => array('petitescapitales.png', '0'),
'outil_barre_poesie' => array('poesie.png', '0'),
'outil_barre_tableau' => array('barre-tableau.png', '0'),
));
}