All pastes #753546 Raw Edit

Cory

public php v1 · immutable
#753546 ·published 2007-10-29 10:18 UTC
rendered paste body
<?phpdefined( '_VALID_MOS' ) or die( 'Appel direct interdit' );// Pour la liste dÈroulante gÈnÈrer en AJAXheader('Content-type: text/html; charset=iso-8859-1'); class HTML_Evenement {function showField( $rows, $pageNav, $option, $search, $lists ){		global $mosConfig_live_site,$database;?><script type="text/javascript">function cbsaveorder( n ) {	cbcheckAll_button( n );	submitform('saveOrder');}//needed by sbsaveorder functionfunction cbcheckAll_button( n ) {	for ( var j = 0; j <= n; j++ ) {		box = eval( "document.adminForm.cb" + j );		if ( box.checked == false ) {			box.checked = true;		}	}}function recherche_enter(ev){	 if (!ev) var ev = window.event; 	 if(ev.keyCode == 13)	 document.adminForm.submit();}</script><form action="index2.php" method="post" name="adminForm">  <table class="adminheading">    <tr>      <th>Formulaire d'&eacute;v&eacute;nement du genre "<?php echo $_SESSION['nom_genre']; ?>"</th>	</tr>	<tr>	   <td colspan="2" align="right">Filtre par genre :      <?php echo $lists['genre']; ?>      </td>    </tr>	<tr>      <td colspan="2" align="right">Filtre:      <input type="text" name="search" value="<?php echo $search;?>" class="inputbox" onKeyPress="recherche_enter(event);" />      </td>	</tr>  </table>  <table class="adminlist">    <tr>      <th width="2%" class="title">#        </td>      <th width="3%" class="title"> <input type="checkbox" name="toggle" value="" onClick="checkAll(<?php echo count($rows); ?>);" />      </th>      <th width="10%" class="title">Nom</th>      <th width="10%" class="title">Titre</th>      <th width="10%" class="title">Type</th>      <th width="5%" class="title">Publier</th>      <th width="5%" class="title" colspan="2">R&eacute;organiser</th>      <th width="1%"><a href="javascript: cbsaveorder( <?php echo count( $rows )-1; ?> )"><img src="images/filesave.png" border="0" width="16" height="16" alt="Save Order" /></a></th>    </tr>    <?php		$k = 0;		$imgpath='images/';				for ($i=0, $n=count( $rows ); $i < $n; $i++) 		{						$row =& $rows[$i];			mosMakeHtmlSafe($row);			    $img 	= $row->published ? 'publish_g.png' : 'publish_x.png';		    $task = $row->published ?  'fieldPublishedNo' : 'fieldPublishedYes';					$alt 	= $row->published ? 'PubliÈ' : 'Non PubliÈ';        ?>   <tr class="<?php echo "row$k"; ?>">	<td>		<?php echo $pageNav->rowNumber( $i ); ?>	</td>    <td>		<input type="checkbox" id="cb<?php echo $i;?>" name="cid[]" value="<?php echo $row->fieldid; ?>" onClick="isChecked(this.checked);" />	</td>    <td>		<a href="#editField" onClick="return listItemTask('cb<?php echo $i;?>','editField')"> <?php echo $row->name; ?> </a> 	</td>    <td>		<?php echo $row->title; ?>	</td>    <td>		<?php echo $row->type; ?>	</td>    <td width="10%">		<a href="javascript: void(0);" onClick="return listItemTask('cb<?php echo $i;?>		','<?php echo $task;?>')"><img src="<?php echo $imgpath.$img;?>" width="12" height="12" border="0" alt="<?php echo $alt; ?>" /></a>	</td>      <td>	  	<?php    if (($i > 0 || ($i+$pageNav->limitstart > 0)) && $row->tab == @$rows[$i-1]->tab) { ?>        <a href="#reorder" onClick="return listItemTask('cb<?php echo $i;?>','orderupField')"> <img src="images/uparrow.png" width="12" height="12" border="0" alt="Move Up"> </a>        <?php    } ?>      </td>      <td>	  	<?php    if (($i < $n-1 || $i+$pageNav->limitstart < $pageNav->total-1) && $row->tab == @$rows[$i+1]->tab) { ?>        <a href="#reorder" onClick="return listItemTask('cb<?php echo $i;?>','orderdownField')"> <img src="images/downarrow.png" width="12" height="12" border="0" alt="Move Down"> </a>        <?php    } ?>      </td>      <td align="center"><input type="text" name="order[]" size="5" value="<?php echo $row->ordering; ?>" class="text_area" style="text-align: center" />      </td>    </tr>    <?php $k = 1 - $k; } ?>  </table>  <?php echo $pageNav->getListFooter(); ?>  <input type="hidden" name="option" value="<?php echo $option;?>" />  <input type="hidden" name="task" value="showField" />  <input type="hidden" name="boxchecked" value="0" /></form><?php }function editField( &$row, $lists, $fieldvalues, $option, $tabid ) {		global $my, $acl, $task, $mosConfig_live_site;				$id_genre = $_SESSION['id_genre'];		// lien pour la feuille CSS		outputCbTemplate(2);		// lien html pour le javascript		echo initToolTip();	?>		<script type="text/javascript">	  function getObject(obj) {		var strObj;		if (document.all) {		  strObj = document.all.item(obj);		} else if (document.getElementById) {		  strObj = document.getElementById(obj);		}		return strObj;	  }	  	   function submitbutton(pressbutton) {		 if (pressbutton == 'showField') {		   document.adminForm.type.disabled=false;		   submitform(pressbutton);		   return;		 }		 var coll = document.adminForm;		 var errorMSG = '';		 var iserror=0;		 if (coll != null) {		   var elements = coll.elements;		   // loop through all input elements in form		   for (var i=0; i < elements.length; i++) {			 // check if element is mandatory; here mosReq=1			 if (elements.item(i).getAttribute('mosReq') == 1) {			   if (elements.item(i).value == '') {				 //alert(elements.item(i).getAttribute('mosLabel') + ':' + elements.item(i).getAttribute('mosReq'));				 // add up all error messages				 errorMSG += elements.item(i).getAttribute('mosLabel') + ' : <?php echo _UE_REQUIRED_ERROR; ?>\n';				 // notify user by changing background color, in this case to red				 elements.item(i).style.background = "red";				 iserror=1;			   }			 }		   }		 }		 if(iserror==1) {		   alert(errorMSG);		 } else {		   document.adminForm.type.disabled=false;		   submitform(pressbutton);		 }	   }		  function insertRow() {		var oTable = getObject("fieldValuesBody");		var oRow, oCell ,oCellCont, oInput;		var i, j;		i=document.adminForm.valueCount.value;		i++;		// Create and insert rows and cells into the first body.		oRow = document.createElement("TR");		oTable.appendChild(oRow);			oCell = document.createElement("TD");		oInput=document.createElement("INPUT");		oInput.name="vNames["+i+"]";		oInput.setAttribute('mosLabel','Name');		oInput.setAttribute('mosReq',0);		oCell.appendChild(oInput);		oRow.appendChild(oCell);		oInput.focus();			document.adminForm.valueCount.value=i;	  }		  function disableAll() {		var elem;		elem=getObject('divValues');		elem.style.visibility = 'hidden';		elem.style.display = 'none';		elem=getObject('divColsRows');		elem.style.visibility = 'hidden';		elem.style.display = 'none';		elem=getObject('divWeb');		elem.style.visibility = 'hidden';		elem.style.display = 'none';		elem=getObject('divText');		elem.style.visibility = 'hidden';		elem.style.display = 'none';		if (elem=getObject('vNames[0]')) {		  elem.setAttribute('mosReq',0);		}	  }	  	  function selType(sType) {		var elem;		//alert(sType);		switch (sType) {		  case 'editorta':		  case 'textarea':			disableAll();			elem=getObject('divText');			elem.style.visibility = 'visible';			elem.style.display = 'block';			elem=getObject('divColsRows');			elem.style.visibility = 'visible';			elem.style.display = 'block';		  break;		  		  case 'emailaddress':		  case 'password':		  case 'text':			disableAll();			elem=getObject('divText');			elem.style.visibility = 'visible';			elem.style.display = 'block';		  break;		  		  case 'select':		  case 'multiselect':			disableAll();			elem=getObject('divValues');			elem.style.visibility = 'visible';			elem.style.display = 'block';			if (elem=getObject('vNames[0]')) {			  elem.setAttribute('mosReq',1);			}		  break;		  		  case 'radio':		  case 'multicheckbox':			disableAll();			elem=getObject('divColsRows');			elem.style.visibility = 'visible';			elem.style.display = 'block';			elem=getObject('divValues');			elem.style.visibility = 'visible';			elem.style.display = 'block';			if (elem=getObject('vNames[0]')) {			  elem.setAttribute('mosReq',1);			}		  break;			  case 'webaddress':			disableAll();			elem=getObject('divWeb');			elem.style.visibility = 'visible';			elem.style.display = 'block';		  break;			  case 'delimiter':		  default: 			disableAll();		}	  }		  function prep4SQL(o){		if(o.value!='') {			o.value=o.value.replace('<?php echo "id".$id_genre; ?>_','');				o.value='<?php echo "id".$id_genre; ?>_' + o.value.replace(/[^a-zA-Z]+/g,'');		}	  }		</script><table class="adminheading">		<tr>       	<th class="edit"><?php echo $row->fieldid ? 'Modification' : 'Ajout';?> d'un champ au formulaire d'&eacute;v&eacute;nement de genre "<?php echo $_SESSION['nom_genre'];?>"</th></table><form action="index2.php?option=com_evenement&task=saveField" method="POST" name="adminForm">  <table cellpadding="4" cellspacing="1" border="0" width="100%" class="adminform">    <tr>      <td width="20%">Type:</td>      <td width="20%"><?php echo $lists['type']; ?></td>      <td>&nbsp;</td>    </tr>    <tr>      <td width="20%">Nom du champ:</td>      <td align=left  width="20%"><input name="name" type="text" class="inputbox" onChange="prep4SQL(this);" value="<?php echo htmlentities($row->name); ?>" maxlength="255" mosReq=1 mosLabel="Nom" />	  <span class="cbFieldIcons"> <img src="<?php echo $mosConfig_live_site;?>/administrator/components/com_evenement/plugin/templates/luna/tooltip.png" style="border: 0pt none ;" alt="i" title="" onMouseOver="return overlib('Nom dans la base de donnÈes', CAPTION, 'Nom champs?');" onMouseOut="return nd();" height="16" width="16"></span></td>	  <td>&nbsp;</td>    </tr>    <tr>      <td width="20%">Titre:</td>      <td width="20%" align=left><input name="title" type="text" class="inputbox" value="<?php echo htmlentities($row->title); ?>" maxlength="255" mosReq=1 mosLabel="Titre" />      <span class="cbFieldIcons"> <img src="<?php echo $mosConfig_live_site;?>/administrator/components/com_evenement/plugin/templates/luna/tooltip.png" style="border: 0pt none ;" alt="i" title="" onMouseOver="return overlib('Libell&eacute; du champ dans le formulaire de saisie', CAPTION, 'Titre?');" onMouseOut="return nd();" height="16" width="16"></span></td>	  <td>&nbsp;</td>    </tr>    <tr>      <td width="20%">Description (info-bulle): texte ou HTML:</td>      <td width="20%" align=left><textarea name="description" cols=50 rows=8 maxlength='255' mosReq=0 mosLabel="Description" class="inputbox"><?php echo $row->description; ?></textarea></td>      <td>&nbsp;</td>    </tr>    <tr>      <td width="20%">Publi&eacute;:</td>      <td width="20%"><?php echo $lists['published']; ?></td>      <td>&nbsp;</td>    </tr>    <tr>      <td width="20%">Taille (size):</td>      <td width="20%"><input name="size" type="text" class="inputbox" value="<?php echo $row->size; ?>" maxlength="255" mosLabel="Size" /></td>      <td>&nbsp;</td>    </tr>  </table>  <div id=page1  class="pagetext"> </div>  <div id=divText  class="pagetext">    <table cellpadding="4" cellspacing="1" border="0" width="100%" class="adminform">      <tr>        <td width="20%">Max Length:</td>        <td width="20%"><input name="maxlength" type="text" class="inputbox" value="<?php echo $row->maxlength; ?>" maxlength="255" mosLabel="Max Length" /></td>        <td>&nbsp;</td>      </tr>    </table>  </div>  <div id=divColsRows  class="pagetext">    <table cellpadding="4" cellspacing="1" border="0" width="100%" class="adminform">      <tr>        <td width="20%">Cols:</td>        <td width="20%"><input name="cols" type="text" class="inputbox" value="<?php echo $row->cols; ?>" maxlength="255" mosLabel="Cols" /></td>        <td>&nbsp;</td>      </tr>      <tr>        <td width="20%">Rows:</td>        <td width="20%"><input name="rows" type="text" class="inputbox" value="<?php echo $row->rows; ?>" maxlength="255"  mosLabel="Rows" /></td>        <td>&nbsp;</td>      </tr>    </table>  </div>  <div id=divWeb  class="pagetext">    <table cellpadding="4" cellspacing="1" border="0" width="100%" class="adminform">      <tr>        <td width="20%">Type:</td>        <td width="20%"><?php echo $lists['webaddresstypes']; ?></td>        <td>&nbsp;</td>      </tr>    </table>  </div>  <div id=divValues style="text-align:left;"> Utiliser le boutton ci-dessous pour ajouter de nouvelles valeurs.<br />    <input type=button onClick="insertRow();" value="Ajouter une valeur" />    <table align=left id="divFieldValues" cellpadding="4" cellspacing="1" border="0" width="100%" class="adminform" >      <thead>      <th width="20%">Nom</th>        </thead>      <tbody id="fieldValuesBody">        <tr>          <td></td>        </tr>        <?php				//echo "count:".count( $fieldvalues );			//print_r (array_values($fieldvalues));			for ($i=0, $n=count( $fieldvalues ); $i < $n; $i++) {				//print "count:".$i;				$fieldvalue = $fieldvalues[$i];				echo "<tr>\n<td width=\"20%\"><input type=text mosReq=0  mosLabel='Value' value=\"".stripslashes($fieldvalue->fieldtitle)."\" name=vNames[".$i."] /></td></tr>\n";			}			if(count( $fieldvalues )< 1) {				echo "<tr>\n<td width=\"20%\"><input type=text mosReq=0  mosLabel='Value' value='' name=vNames[0] /></td></tr>\n";				$i=0;			}		?>      </tbody>    </table>  </div>  <table cellpadding="4" cellspacing="1" border="0" width="100%" class="adminform">    <tr>      <td colspan="3">&nbsp;</td>    </tr>  </table>  <input type="hidden" name="valueCount" value=<?php echo $i; ?> />  <input type="hidden" name="fieldid" value="<?php echo $row->fieldid; ?>" />  <input type="hidden" name="option" value="<?php echo $option; ?>" />  <input type="hidden" name="task" value="" /></form><?php 		if($row->fieldid > 0) {			print "<script type=\"text/javascript\"> document.adminForm.name.readOnly=true; </script>";				print "<script type=\"text/javascript\"> document.adminForm.type.disabled=true; </script>";				}			print "<script type=\"text/javascript\"> disableAll(); </script>";			print "<script type=\"text/javascript\"> selType('".$row->type."'); </script>";		}function newEvenement($option, $lists, $row ){	global $database,$_REQUEST, $mainframe,$mosConfig_live_site;	// Script pour l'ajout de genre	$script ='<script  type="text/javascript" src="'.$mosConfig_live_site.'/administrator/components/com_evenement/js/tabledeleterow.js"></script>';	$script .='<script  type="text/javascript" src="'.$mosConfig_live_site.'/administrator/components/com_evenement/js/ajaxRecherche.php"></script>';	$script .='<script  type="text/javascript" src="'.$mosConfig_live_site.'/mambots/editors/tinymce/jscripts/tiny_mce/tiny_mce_src.js"></script>';	$mainframe->addCustomHeadTag($script);		// lien pour la feuille CSS	outputCbTemplate(2);	// lien html pour le javascript	echo initToolTip();	$calendars = new cbCalendars(2);		$tabs = new cbTabs( 0, 2, $calendars );		if(!empty($_SESSION['genre_id'])) // controle	$tabcontent=$tabs->getEditTabs($row, $_SESSION['genre_id']);	//chemin des images du composant	$templatePath = selectTemplate(1);	?>	<script type="text/javascript">	tinyMCE.init({		theme : "advanced",		language : "en",		mode : "specific_textareas",		document_base_url : "http://sd922.sivit.org/delta/",		relative_urls : false,		remove_script_host : false,		save_callback : "TinyMCE_Save",		invalid_elements : "script,applet,iframe",		theme_advanced_toolbar_location : "top",		theme_advanced_source_editor_height : "550",		theme_advanced_source_editor_width : "750",		directionality: "ltr",		force_br_newlines : "false",		force_p_newlines : "true",		content_css : "http://sd922.sivit.org/delta/templates/rhuk_solarflare_ii/css/template_css.css", 		debug : false,		cleanup : true,		cleanup_on_startup : false,		safari_warning : false,		plugins : "advlink, advimage, , preview, searchreplace, insertdatetime, emotions, advhr, flash, table, fullscreen, layer, style, visualchars, media, nonbreaking",		theme_advanced_buttons2_add : ", preview, search,replace, insertdate, inserttime, emotions, insertlayer, moveforward, movebackward, absolute",		theme_advanced_buttons3_add : ", advhr, flash, tablecontrols, fullscreen, styleprops, visualchars, media, nonbreaking",		plugin_insertdate_dateFormat : "%Y-%m-%d",		plugin_insertdate_timeFormat : "%H:%M:%S",		plugin_preview_width : "750",		plugin_preview_height : "550",		extended_valid_elements : "a[name|href|target|title|onclick], img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name], , hr[class|width|size|noshade]",		disk_cache : true,		debug : false,		theme_advanced_disable : "bold,italic",		fullscreen_settings : {			theme_advanced_path_location : "top"		}	});	function TinyMCE_Save(editor_id, content, node)	{		base_url = tinyMCE.settings['document_base_url'];		var vHTML = content;		if (true == true){			vHTML = tinyMCE.regexpReplace(vHTML, 'href\s*=\s*"?'+base_url+'', 'href="', 'gi');			vHTML = tinyMCE.regexpReplace(vHTML, 'src\s*=\s*"?'+base_url+'', 'src="', 'gi');			vHTML = tinyMCE.regexpReplace(vHTML, 'mce_real_src\s*=\s*"?', '', 'gi');			vHTML = tinyMCE.regexpReplace(vHTML, 'mce_real_href\s*=\s*"?', '', 'gi');		}		return vHTML;	}			function submitbutton(pressbutton) {				 if (pressbutton == 'showEvenement') 		 {		   submitform(pressbutton);		   return;		 }		 var coll = document.adminForm;		 var errorMSG = '';		 var iserror=0;		 if (coll != null) {		   var elements = coll.elements;		   // loop through all input elements in form		   for (var i=0; i < elements.length; i++) {			 // check if element is mandatory; here mosReq=1			 if (elements.item(i).getAttribute('mosReq') == 1) {			   if (elements.item(i).value == '') {				 //alert(elements.item(i).getAttribute('mosLabel') + ':' + elements.item(i).getAttribute('mosReq'));				 // add up all error messages				 errorMSG += elements.item(i).getAttribute('mosLabel') + ' : <?php echo _UE_REQUIRED_ERROR; ?>\n';				 // notify user by changing background color, in this case to red				 elements.item(i).style.background = "red";				 iserror=1;			   }			 }		   }		 }		 if(iserror==1) {		   alert(errorMSG);		 } else {		 	// selection de toute la liste d'ÈvËnement fils		   var nbEvtFils = document.getElementById('evt_fils').options.length;		   for(i=0;i<nbEvtFils;i++)		   {		   		document.getElementById('evt_fils').options[i].selected=true		   }		   submitform(pressbutton);		 }	   }	   	// Recherche AJAX et contruction de la liste dÈroulante		function searchAjax(id_evt,nbCaractere)		{							// Recherche evenement			if(document.getElementById('recherche_parent').value.length>=nbCaractere)			{				// Ce setTimeout permet de lancÈ la recherche pas a la frappe de chaque lettre				setTimeout(function(){ 					Recherche(document.getElementById('recherche_parent').value,id_evt);				},500);			}			else			{							if(document.getElementById('parent'))				document.getElementById('parent').options.length=0;				document.getElementById('searchEvt').innerHTML='';			}						}				function Ajouter() {			var form = document.adminForm;			var o=new Option(form.parent.options[form.parent.options.selectedIndex].text,form.parent.value);			form.evt_fils.options[form.evt_fils.options.length]=o;			if(form.evt_fils.options.length>0)			{				document.getElementById('evtFilsSuppr').style.display='';				document.getElementById('parent').options.length=0;				document.getElementById('searchEvt').innerHTML='';							}		}				function Supprimer(list) {		if (list.options.selectedIndex>=0) {			list.options[list.options.selectedIndex]=null;		} else {			alert("Suppression impossible : aucune ligne sÈlectionnÈe");		}				if(list.options.length<1)			document.getElementById('evtFilsSuppr').style.display='none';		}	  </script><form action="index2.php" method="post" name="adminForm">  <!-- TAB -->  <table class="adminheading">    <tr>      <th> Ajout d'un &eacute;v&eacute;nement de genre "<?php echo $_SESSION['genre_nom'];?>"</th>    </tr>  </table>  <table class="adminform" id="tblSample">    <tr>      <th colspan="2"> Ev&eacute;nement </th>    </tr>    <tr height="35px">      <td align="right" >Publi&eacute;&nbsp;:</td>      <td><?php echo $lists['published'] ." <img src='".$templatePath."required.gif' width='16' height='16' alt='*' title='"._UE_FIELDREQUIRED."' />";?> </td>    </tr>    <tr height="35px">      <td  align="right">Nom&nbsp;:&nbsp;</td>      <td><input type="text" name="nom" id="nom" mosReq="1" mosLabel="Nom" class="inputbox" value="<?php echo htmlentities($row->nom) ;?>" size="90" maxlength="250" /><?php echo " <img src='".$templatePath."required.gif' width='16' height='16' alt='*' title='"._UE_FIELDREQUIRED."' />";?></td>    </tr>    <tr  height="35px">      <td align="right">Compl&eacute;ment du nom&nbsp;:&nbsp;</td>      <td><input type="text" name="nom_compl" id="nom_compl" mosReq="0" mosLabel="Complement du nom" class="inputbox" value="<?php echo htmlentities($row->nom_compl) ;?>"  maxlength="500"  size="90" />      </td>    </tr>	 <tr  height="35px">      <td align="right">Crit&egrave;re compl&eacute;mentaire&nbsp;:&nbsp;</td>      <td><input type="text" name="critere_compl" id="critere_compl" mosReq="0" mosLabel="Crit&egrave;re compl&eacute;mentaire&nbsp;" class="inputbox" value="<?php echo htmlentities($row->critere_compl) ;?>"  maxlength="200"  size="90" />	  <span class="cbFieldIcons"> <img src="<?php echo $mosConfig_live_site;?>/administrator/components/com_evenement/plugin/templates/luna/tooltip.png" style="border: 0pt none ;" alt="i" title="Information" onMouseOver="return overlib('Permet de diffÈrencier des ÈvÈnements de mÍme nom', CAPTION, 'CritËre complÈmentaire?');" onMouseOut="return nd();" height="16" width="16"></span>      </td>    </tr>	<tr  height="35px">      <td align="right">Description&nbsp;:&nbsp;</td>      <td><textarea name="description" id="description" mosReq="0" mosLabel="Description" cols="64" rows="20" style="height:350px;" mce_editable="true"><?php echo $row->description; ?></textarea></td>    </tr>	<tr  height="35px">	<td align="right">Genre&nbsp;:&nbsp;</td>	<td><?php 	  	echo $lists['genre']." <img src='".$templatePath."required.gif' width='16' height='16' alt='*' title='"._UE_FIELDREQUIRED."' />";?>	</td> </tr>	<tbody id="fieldValuesBody"><?php echo $lists['suplGenre']; ?>    </tbody>	<tr>	<td>&nbsp;</td>	<td><a href="javascript:void(0);" onClick="addRowToTable();"><img src="<?php echo $mosConfig_live_site; ?>/administrator/images/expandall.png" alt="ajout" border="0" align="absmiddle"/> Ajouter un genre</a></td>	</tr>		<tr  height="35px">      <td align="right">Recherche d'&eacute;v&eacute;nement fils&nbsp;:&nbsp;</td>	  <td><input name="recherche_parent" type="text" id="recherche_parent" value="Rechercher un &eacute;v&eacute;nement" size="35" maxlength="50" onKeyUp="javascript:searchAjax(<?php echo "'".$row->id."'";?>, 4);" onClick="this.value='';"/>		  <a href="javascript:void(0);" onClick="javascript:searchAjax(<?php echo "'".$row->id."'";?>,0);" >&nbsp;<img src="<?php echo $mosConfig_live_site; ?>/administrator/images/valide_form.png" alt="Ajout" border="0" align="texttop"/></a>		  <div id="searchEvt"></div>	  </td>	 </tr>	<tr id="evtFilsSuppr" <?php if(empty($lists['parent'])) echo 'style="display:none "'; ?>>	  <td align="right">Liste d'&eacute;v&eacute;nement fils&nbsp;:&nbsp;</td>	  <td><?php	  	if(empty($lists['parent']))		{			echo '<SELECT name="evt_fils[]" size=3 multiple id="evt_fils" align=top >				</SELECT>				<a href="javascript:void(0);" onClick="Supprimer(document.adminForm.evt_fils)" >&nbsp;<img src="'.$mosConfig_live_site.'/administrator/images/collapseall.png" alt="Supprimer" border="0" align="texttop"/>&nbsp;Supprimer l\'&eacute;v&egrave;nement fils s&eacute;lectionn&eacute;</a>';	 	}		else			echo $lists['parent'];?>	  </td>	</tr>    <tr  height="35px">      <td align="right">Jeune Public&nbsp:&nbsp;</td>	  <td> <input name="jeune_public" type="checkbox" id="jeune_public" value="1" <?php if($row->jeune_public == 1)echo ' checked="checked"'; ?>/></td>    </tr>	<tr  height="35px">      <td align="right">Age minimum du public&nbsp:&nbsp;</td>	  <td><input type="text" name="public_age" id="public_age" mosReq="0" mosLabel="jeune_public" class="inputbox" value="<?php if(!empty($row->public_age)) echo $row->public_age; ?>" maxlength="2" size="2" />      ans</td>    </tr>    <tr  height="35px">      <td align="right">Ajouter un m&eacute;dia&nbsp;:&nbsp;</td>      <td><input name="file" type="file" maxlength="250" /></td>    </tr>    <tr  height="35px">      <td align="right">&nbsp;</td>      <td>Titre&nbsp;:&nbsp;        <input type="text" name="titre_media" mosReq=0 mosLabel="Titre media" class="inputbox" value="" maxlength="250" size="90" /></td>    </tr>    <tr  height="35px">      <td>&nbsp;</td>      <td>L&eacute;gende&nbsp;:&nbsp;        <input type="text" name="legende_media" mosReq=0 mosLabel="Legende media" class="inputbox" value="" maxlength="250" size="90" /></td>    </tr>    <tr  height="35px">      <td>&nbsp;</td>      <td><a href="#">Ajouter un m&eacute;dia</a></td>    </tr>    </tr>      </table>  <br />  <?php	echo "<div class='message'>".$regErrorMSG."</div>\n";	echo "<table class='adminform' id='userEditTable'><tr>				<th colspan='2'>				Informations compl&eacute;mentaires				</th>			</tr><tr><td width='100%'>\n";	echo $tabcontent;	echo "</td></tr></table>";	 	?>  <input type="hidden" name="id" value="<?php echo $row->id; ?>" />  <input type="hidden" name="date_creation" value="<?php if($row->date_creation) { echo $row->date_creation;}else{echo date("Y-m-d H:i:s");} ?>" />  <input type="hidden" name="date_update" value="<?php echo date("Y-m-d H:i:s"); ?>" />  <input type="hidden" name="task" value="saveEvenement" />  <input type="hidden" name="option" value="<?php echo $option; ?>" />  			  <div style="align:center;">    <?php	echo getFieldIcons(1,"","",true)." | <img src='".$templatePath."required.gif' width='16' height='16' alt='*' title='"._UE_FIELDREQUIRED."' /> "._UE_FIELDREQUIRED;		?>  </div></form><?php	}	// Permet de demander confirmation pour la suppression en cascade	function deleteEvtMessage( $tableau, $nbRespresentation, $option)	{		// infos du tableau celon ce select "LG.id as id_evt_genre, LG.id_evt, G.name, L.nom"				$phrase='';		//print_r($tableau);		foreach($tableau as $ligne)		{			$mesGenre=array();			// les identifiants ‡ supprimer (id_evt)			$idevtSuppr[]=$ligne[0]->id_evenement;			for($i=0;$i<count($ligne);$i++)			{				$mesGenre[]=$ligne[$i]->name;				$nomevt = $ligne[$i]->nom;			}			$phrase .= 'L\'ÈvÈnement " <b>'.$nomevt.' </b>" que vous Ítes sur le point de supprimer appartiens au(x) genre(s) "<b> '.implode (", ",$mesGenre).' </b>" et possËde <b>'.$nbRespresentation[0].'</b> future(s) reprÈsentation(s) !<br />';		}		$phrase .='<br /><p>Etes-Vous sur de vouloir supprimer ce(s) ÈvÈnement(s) ?</p>';		//Controle		if(count($mesGenre)>0)			echo $phrase;		else			echo "Une erreur est survenue veuillez rÈessayer.";?>		<form action="index2.php" method="post" name="adminForm">		<input type="hidden" name="idevtSuppr" value="<?php echo implode(",",$idevtSuppr); ?>">		<input type="hidden" name="option" value="<?php echo $option;?>" />		<input type="hidden" name="task" value="" />		<input type="hidden" name="hidemainmenu" value="0">		</form><?php	}	function showEvenement( &$rows, &$pageNav, $option, $search, $lists) 	{			global $my,$database,$mainframe, $mosConfig_live_site;				mosCommonHTML::loadOverlib();				// Entete pour le calendrier		$script ='<link rel="stylesheet" type="text/css" href="'.$mosConfig_live_site.'/administrator/components/com_evenement/js/epoch_styles.css" />					<script type="text/javascript" src="'.$mosConfig_live_site.'/administrator/components/com_evenement/js/epoch_classes.js"></script>';				$mainframe->addCustomHeadTag($script);						// Entete pour le calendrier		$scriptCalendar = '		<link rel="stylesheet" type="text/css" media="all" href="http://sdc/sitejoomla/administrator/components/com_evenement/plugin/templates/luna/calendar.css" title="win2k-cold-1" />		<script type="text/javascript" src="'.$mosConfig_live_site.'/administrator/components/com_evenement/js/calendar.js"></script>		<script type="text/javascript" src="'.$mosConfig_live_site.'/administrator/components/com_evenement/plugin/language/default_language/calendar-locals.js"></script>		<script type="text/javascript" src="'.$mosConfig_live_site.'/administrator/components/com_evenement/js/calendar-setup.js"></script>';				$mainframe->addCustomHeadTag($scriptCalendar);?>		<script type="text/javascript">			var ms_cal;   			// chargement du calendrier  			window.onload = function () {										ms_cal  = new Epoch('cal','popup',document.getElementById('filtre_date'),false);			};							// Lorsque l'on appui sur entrer on lance la recherche			// Code valide avec IE et FF			function recherche_enter(ev)			{				 if (!ev) var ev = window.event; 				 if(ev.keyCode == 13)				 document.adminForm.submit();			}		</script>		<form action="index2.php" method="post" name="adminForm">		<table class="adminheading">		<tr>       		<th class="cpanel"> Gestion des &eacute;v&eacute;nements du genre "<?php echo $_SESSION['genre_nom']; ?>" </th>      	</tr>		<tr>			<td colspan="2" align="right">			Filtre par genre :			<?php echo $lists['genre']; ?>			</td>		</tr>		<tr>			<td colspan="2" align="right">			Filtre par nom:			<input name="search" type="text" class="text_area" id="search" onKeyPress="recherche_enter(event);" value="<?php echo htmlspecialchars( $search['nom'] );?>"  />						</td>		</tr>		<tr>			<td colspan="2" align="right">			Filtre &agrave; partir de :			<input class="inputbox" name="filtre_date" readonly="readonly" id="filtre_date" value="<?php echo $search['date']; ?>" type="text" size="10" >			</script>			</td>		</tr>		<tr>			<td colspan="2" align="right">			Trier par :			<?php echo $lists['trie']; ?>			</td>		</tr>		</table>		<table class="adminlist">		<tr>			<th width="5">			#			</th>			<th width="20">			<input type="checkbox" name="toggle" value="" onClick="checkAll(<?php echo count( $rows ); ?>);" />			</th>			<th align="left">			Nom			</th>			<th align="center">			Crit&egrave;re compl&eacute;mentaire			</th>			<th align="center">			Date de cr&eacute;ation			</th>			<th width="18%" align="left">			Genre			</th>			<th width="10%" align="center">			Publi&eacute;			</th>		</tr>		<?php		$k = 0;		for ($i=0, $n=count( $rows ); $i < $n; $i++) {			$row = &$rows[$i];			mosMakeHtmlSafe($row);			$link 	= 'index2.php?option=com_evenement&task=newEvenement&hidemainmenu=1&cid='. $row->id;			$checked 	= mosCommonHTML::CheckedOutProcessing( $row, $i );			$published= mosCommonHTML::PublishedProcessing( $row, $i ) ;									// date au format francais			$madate=$row->date_creation;			$tabdate = explode(" ", $madate);			$tabdate = explode("-", $tabdate[0]);			$madate = $tabdate[2].'/'.$tabdate[1].'/'.$tabdate[0];			$presentation='';			?>			<tr class="<?php echo "row$k"; ?>">				<td>				<?php echo $pageNav->rowNumber( $i ); ?>				</td>				<td>				<?php echo $checked; ?>				</td>				<td>				<a href="<?php echo $link; ?>" title="Edit EvÈnement">				<?php echo $row->nom; ?>				</a>				</td>				<td align="center">				<?php echo $row->critere_compl ; ?>				</td>				<td align="center">				<?php echo $madate ; ?>				</td>				<td>				<?php				// Genre parent, pour une presentation des sous genres				$niveau = $row->niveau;				$pre 	= '<sup>L</sup>&nbsp;';				$spacer = '.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';				if($niveau>1)				{					for($x=1;$x<$niveau;$x++)					{						$presentation.=$spacer;					}					$presentation.=$pre;				}				 echo $presentation.$row->name ; ?>				</td>				<td align="center">				<?php  echo $published;?>				</td>			</tr>			<?php			$k = 1 - $k;		}		?>		</table>		<?php echo $pageNav->getListFooter(); ?>		<input type="hidden" name="option" value="<?php echo $option;?>" />		<input type="hidden" name="task" value="showEvenement" />		<input type="hidden" name="boxchecked" value="0" />		<input type="hidden" name="hidemainmenu" value="0">		</form>		<?php			}}?>