Changeset 10191 in spip-zone
- Timestamp:
- Mar 6, 2007, 10:15:39 AM (14 years ago)
- Location:
- _plugins_/_stable_/crayons
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
_plugins_/_stable_/crayons/action/crayons_html.php
r10185 r10191 51 51 52 52 $valeur = valeur_colonne_table($type, $champ, $id); 53 spip_log(" $valeur = valeur_colonne_table($type, $champ, $id);");54 spip_log($champ);53 #spip_log(" $valeur = valeur_colonne_table($type, $champ, $id);"); 54 #spip_log($champ); 55 55 if ($valeur === false) { 56 56 return array("$type $id $champ: " . _U('crayons:pas_de_valeur'), 6); -
_plugins_/_stable_/crayons/plugin.xml
r9344 r10191 49 49 <inclure>tetecrayons.php</inclure> 50 50 </pipeline> 51 <pipeline> 52 <nom>header_prive</nom> 53 <action>insert_head</action> 54 <inclure>tetecrayons.php</inclure> 55 </pipeline> 56 51 57 </plugin> -
_plugins_/_stable_/crayons/tetecrayons.php
r10185 r10191 11 11 else 12 12 return true; 13 } 14 15 // Le pipeline header_prive (pour y tester les crayons) 16 function Crayons_insert_head($head) { 17 // Pages crayonnables 18 if (!in_array(_request('exec'), array('articles'))) 19 return $head; 20 21 // Est-on autorise ? 22 include_spip('inc/autoriser'); 23 switch (_request('exec')) { 24 case 'articles': 25 $droits = autoriser('modifier', 'article', _request('id_article')); 26 break; 27 28 default: 29 $droits=false; 30 } 31 32 if (!$droits) 33 return $head; 34 35 include_spip('inc/crayons'); 36 return Crayons_preparer_page($head, '*', wdgcfg(), 'head'); 13 37 } 14 38 … … 51 75 } 52 76 53 function Crayons_preparer_page($page, $droits, $wdgcfg = array() ) {77 function Crayons_preparer_page($page, $droits, $wdgcfg = array(), $mode='page') { 54 78 lang_select($GLOBALS['auteur_session']['lang']); 55 79 … … 90 114 // 'crayons:erreur_ou_interdit')))); 91 115 92 $pos_head = strpos($page, '</head>');93 if ($pos_head === false)94 return $page;95 96 116 $incHead = <<<EOH 97 117 … … 103 123 EOH; 104 124 125 126 if ($mode == 'head') 127 return $page . $incHead; 128 129 $pos_head = strpos($page, '</head>'); 130 if ($pos_head === false) 131 return $page; 132 105 133 return substr_replace($page, $incHead, $pos_head, 0); 134 106 135 } 107 136
Note: See TracChangeset
for help on using the changeset viewer.