editProjectView.php 2.29 KB
Newer Older
1 2
<?php
	if(!isset($admin)){
3
		header('Location:/patate');
4 5 6 7 8 9 10
		exit();
	}
?>

<article>
	<h3>Édition du projet #<?php echo $project['id']; ?></h3>

11
	<form action="/patate/project/<?php echo $project['slug'] ?>/edit" method="post" accept-charset="utf-8">
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29

		<input type="hidden" name="id" value="<?php echo $project['id']; ?>"  />

		<article class="input">
			<label for="inputTitle">Nom du projet</label>
			<input type="text" name="name" value="<?php echo $project['name']; ?>" id="inputName" />
		</article>
		
		<article class="input">
			<label for="inputLink">Lien vers le projet</label>
			<input type="url" name="link" value="<?php echo $project['link']; ?>" id="inputLink" />
		</article>

		<article class="input">
			<label for="inputShortContent">Résumé</label>
			<textarea name="shortContent" id="inputShortContent"><?php echo $project['shortContent']; ?></textarea>
		</article>
		
30 31
		<section class="input">
			<label for="inputContent">Description (code)</label>
32
			<textarea name="content" id="inputContent"><?php echo $project['content']; ?></textarea>
33 34 35 36
		</section>

		<section class="input">
			<label for="editContent">Description</label>
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
			<article class="wysiwyg">
				<div>
					<button type="button" onclick="wysiwyg('h4')"  title="title">📌</button>
					<button type="button" onclick="wysiwyg('b')"  title="bold"><b>B</b></button>
					<button type="button" onclick="wysiwyg('i')"  title="italic"><i>i</i></button>
					<button type="button" onclick="wysiwyg('u')"  title="underline"><u>U</u></button>
					<button type="button" onclick="wysiwyg_img()" title="image">📷</button>
					<button type="button" onclick="wysiwyg_align('left')"  title="align left"></button>
					<button type="button" onclick="wysiwyg_align('center')"  title="center"></button>
					<button type="button" onclick="wysiwyg_align('right')"  title="align right"></button>
					<button type="button" onclick="wysiwyg_list()" title="list">📋</button>
					<button type="button" onclick="wysiwyg_link()" title="link">🔗</button>
					<button type="button" onclick="wysiwyg_code()" title="code">🎲</button>
				</div>
				
				<div id="editContent" contentEditable="true"><?php echo htmlspecialchars_decode($project['content']); ?></div>
			</article>
54
		</section>
55 56 57 58 59

		<input type="submit" value="Éditer" />

	</form>
</article>