<script type="text/javascript">
tinymce.init({
		language : 'fr_FR',
        selector: "textarea",
        plugins: [
                "advlist autolink autosave link image lists charmap print preview hr anchor pagebreak spellchecker",
                "searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media nonbreaking",
                "table contextmenu directionality emoticons template textcolor paste fullpage textcolor filemanager"
        ],

        toolbar1: "newdocument fullpage | bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | styleselect formatselect fontselect fontsizeselect | code",
        toolbar2: "cut copy paste | searchreplace | bullist numlist | outdent indent blockquote | undo redo | link unlink anchor image media code | inserttime preview | forecolor backcolor",
        toolbar3: "table | hr removeformat | subscript superscript | charmap emoticons | print fullscreen | ltr rtl | spellchecker | visualchars visualblocks nonbreaking template pagebreak restoredraft",

        menubar: true,
        toolbar_items_size: 'small',

        style_formats: [
                {title: 'Bold text', inline: 'b'},
                {title: 'Red text', inline: 'span', styles: {color: '#ff0000'}},
                {title: 'Red header', block: 'h1', styles: {color: '#ff0000'}},
                {title: 'Example 1', inline: 'span', classes: 'example1'},
                {title: 'Example 2', inline: 'span', classes: 'example2'},
                {title: 'Table styles'},
                {title: 'Table row 1', selector: 'tr', classes: 'tablerow1'}
        ],

        templates: [
                {title: 'Test template 1', content: 'Test 1'},
                {title: 'Test template 2', content: 'Test 2'}
        ]
});</script>
	
	<div class="row-fluid sortable">
       	<div class="box-header well" data-original-title>
						<h2><i class="icon-edit"></i> Form article</h2>
						
					</div>
					<div class="box-content">
					
					<?php if(isset($article[0]["nom"])) { ?>
						<form class="form-horizontal" method="post" action="modifierarticle">
						  <fieldset>
							<legend>Modifier un article</legend>
							<?php echo $article[0]['text'];?>
							
							<div class="control-group">
							  <label class="control-label" for="libelle">ID </label>
							  <div class="controls">
								<input type="text" class="span6 typeahead" id="id"  name="id" data-provide="typeahead" data-items="4" value="<?php echo $article[0]['id'];?>" readonly>
							  </div>
							</div>
							
							<div class="control-group">
							  <label class="control-label" for="libelle">Nom </label>
							  <div class="controls">
								<input type="text" class="span6 typeahead" id="libelle"  name="nom" data-provide="typeahead" data-items="4" value="<?php echo $article[0]['nom'];?>">
							  </div>
							</div>
							
							<div class="control-group">
							  <label class="control-label" for="libelle">Texte </label>
							  <div class="controls">
                                <textarea name="texte" style="width:100%" value="">
								 <?php echo $article[0]['text'];?>
								</textarea>
							   </div>
							</div>    
							
						
							
							<div class="form-actions">
							  <button type="submit" class="btn btn-primary">Enregistrer</button>
							  <a href="<?php echo URL::site('admin/listearticles'); ?>" class="btn">Annuler</a>
							</div>
						  </fieldset>
						  
						</form>   
                         <?php } else {echo "Cet element n'existe pas ! "; } ?>
					</div>
				</div><!--/span-->
	</div>