19,7 → 19,7 |
// | License along with this library; if not, write to the Free Software | |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
// +------------------------------------------------------------------------------------------------------+ |
// CVS : $Id: pap_script.fonct.php,v 1.5 2008-08-26 15:32:57 alexandre_tb Exp $ |
// CVS : $Id: pap_script.fonct.php,v 1.6 2008-10-01 08:25:00 alexandre_tb Exp $ |
/** |
* Les fonctions permettant d'inclure des scripts. |
* |
35,7 → 35,7 |
*@author Alexandre GRANIER <alexandre@tela-botanica.org> |
*@author Laurent COUDOUNEAU <lc@gsite.org> |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.5 $ $Date: 2008-08-26 15:32:57 $ |
*@version $Revision: 1.6 $ $Date: 2008-10-01 08:25:00 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
|
130,15 → 130,13 |
*/ |
function GEN_stockerFichierScript($id_fichier, $chemin_fichier, $type_fichier = 'text/javascript', $attributs = array()) |
{ |
global $_GEN_commun; |
|
if (empty($_GEN_commun['script_fichier'][$id_fichier])) { |
$_GEN_commun['script_fichier'][$id_fichier]['type'] = $type_fichier; |
$_GEN_commun['script_fichier'][$id_fichier]['chemin'] = $chemin_fichier; |
$_GEN_commun['script_fichier'][$id_fichier]['attributs'] = $attributs; |
if (empty($GLOBALS['_GEN_commun']['script_fichier'][$id_fichier])) { |
$GLOBALS['_GEN_commun']['script_fichier'][$id_fichier]['type'] = $type_fichier; |
$GLOBALS['_GEN_commun']['script_fichier'][$id_fichier]['chemin'] = $chemin_fichier; |
$GLOBALS['_GEN_commun']['script_fichier'][$id_fichier]['attributs'] = $attributs; |
} else { |
if (GEN_DEBOGAGE) { |
$_GEN_commun['debogage_info'] .= |
$GLOBALS['_GEN_commun']['debogage_info'] .= |
'ERREUR Papyrus : cet identifiant de fichier à déjà été enregistré par GEN_stockerFichierJavascript(). <br />'. |
'Identifiant : '. $id_fichier .'<br />'. |
'Ligne n° : '. __LINE__ .'<br />'. |
161,12 → 159,12 |
*/ |
function GEN_afficherScript() |
{ |
global $_GEN_commun; |
|
$sortie = ''; |
|
$fichiers = ''; |
if (isset($_GEN_commun['script_fichier'])) { |
while (list($cle, $valeur) = each($_GEN_commun['script_fichier'])) { |
if (isset($GLOBALS['_GEN_commun']['script_fichier'])) { |
while (list($cle, $valeur) = each($GLOBALS['_GEN_commun']['script_fichier'])) { |
$fichiers .= str_repeat(' ', 8).'<script type="'.$valeur['type'].'" src="'.$valeur['chemin'].'"'; |
if (is_array ($valeur['attributs'])) foreach ($valeur['attributs'] as $attr => $val) $fichiers .= ' '.$attr.'="'.$val.'"'; |
$fichiers .= '></script>'."\n"; |
178,16 → 176,16 |
|
|
$fonctions = ''; |
while (list($cle, $valeur) = each($_GEN_commun['script_fonction'])) { |
while (list($cle, $valeur) = each($GLOBALS['_GEN_commun']['script_fonction'])) { |
$fonctions .= $valeur; |
} |
|
$code = ''; |
$code = $_GEN_commun['script_code']; |
$code = $GLOBALS['_GEN_commun']['script_code']; |
|
if ($fonctions != '' || $code != '') { |
$sortie .= "\n"; |
$sortie .= str_repeat(' ', 8).'<script type="'.$_GEN_commun['script_type'].'">'."\n"; |
$sortie .= str_repeat(' ', 8).'<script type="'.$GLOBALS['_GEN_commun']['script_type'].'">'."\n"; |
$sortie .= str_repeat(' ', 12).'<!--/*--><![CDATA[//><!--'."\n"; |
$sortie .= $fonctions."\n"; |
$sortie .= $code."\n"; |
220,6 → 218,9 |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: not supported by cvs2svn $ |
* Revision 1.5 2008-08-26 15:32:57 alexandre_tb |
* ajout du parametre $attributs dans la fonction GEN_stockerFichierScript |
* |
* Revision 1.4 2007-09-06 14:45:06 neiluj |
* ajout de la balise PAPYRUS_BODY_ATTRIBUTS |
* |