-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathmessage_modifier.php
executable file
·122 lines (118 loc) · 5.48 KB
/
message_modifier.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
<?php
require_once __DIR__ . "/auth.php";
if(! est_autorise("acces_configuration")) exit;
$request = Symfony\Component\HttpFoundation\Request::createFromGlobals();
$errorCode = 0;
try
{
ActionsAdminMessage::getInstance()->action($request);
} catch(TheliaAdminException $e) {
Tlog::error($e->getCode());
$errorCode = $e->getCode();
}
if (!isset($lang))
$lang = ActionsLang::instance()->get_id_langue_courante();
$message = new Message();
$message->charger_id($request->query->get("id"));
$messagedesc = new Messagedesc($message->id, $lang);
?>
<!DOCTYPE html>
<html lang="fr">
<head>
<?php require_once("title.php"); ?>
</head>
<body>
<?php
ActionsAdminModules::instance()->inclure_module_admin("message_modifier_top");
$menu = "configuration";
$breadcrumbs = Breadcrumb::getInstance()->getConfigurationList(trad('Gestion_messages', 'admin'), 'message.php', trad('modifier', 'admin'));
require_once("entete.php");
?>
<div class="row-fluid">
<div class="span12">
<h3><?php echo trad('MODIFICATION_MESSAGE', 'admin'); ?></h3>
<?php
ActionsAdminModules::instance()->inclure_module_admin("message_modifier");
?>
<form method="post" action="message_modifier.php">
<input type="hidden" name="action" value="modifier">
<input type="hidden" name="id" value="<?php echo $message->id; ?>">
<input type="hidden" name="lang" value="<?php echo $lang; ?>">
<p>
<button class="btn btn-large btn-block btn-primary" type="submit"><?php echo trad('VALIDER_LES_MODIFICATIONS', 'admin'); ?></button>
</p>
<table class="table table-striped">
<tbody>
<tr>
<td class="span4"><?php echo trad('Changer_langue', 'admin'); ?></td>
<td class="span8">
<ul class="nav nav-pills">
<?php foreach (LangAdmin::getInstance()->getList() as $displayLang): ?>
<li class="<?php if ($displayLang->id == $lang) { ?>active<?php } ?>"><a href="message_modifier.php?id=<?php echo $message->id; ?>&lang=<?php echo $displayLang->id; ?>" class="change-page"><img src="gfx/lang<?php echo $displayLang->id; ?>.gif" /></a></li>
<?php endforeach; ?>
</ul>
</td>
</tr>
<tr>
<td><?php echo trad('Nom_message', 'admin'); ?></td>
<td><?php echo $message->nom; ?></td>
</tr>
<tr>
<td><?php echo trad('Intitule_message', 'admin'); ?></td>
<td><input type="text" name="intitule" value="<?php echo htmlspecialchars($messagedesc->intitule); ?>" class="span12"></td>
</tr>
<tr>
<td><?php echo trad('Titre_message', 'admin'); ?></td>
<td><input type="text" name="titre" value="<?php echo htmlspecialchars($messagedesc->titre); ?>" class="span12"></td>
</tr>
<tr>
<td><p><?php echo trad('Chapo', 'admin'); ?></p><p><small><?php echo trad('courte_descript_format_texte', 'admin'); ?></small></p></td>
<td><textarea name="chapo" class="span12"><?php echo $messagedesc->chapo; ?></textarea></td>
</tr>
<tr>
<td><p><?php echo trad('Description', 'admin'); ?></p><p><small><?php echo trad('format_html', 'admin'); ?></small></p></td>
<td><textarea name="description" rows="15" class="span12"><?php echo htmlspecialchars($messagedesc->description) ?></textarea> </td>
</tr>
<tr>
<td><p><?php echo trad('Description', 'admin'); ?></p><p><small><?php echo trad('format_text', 'admin'); ?></small></p></td>
<td><textarea name="descriptiontext" rows="15" class="span12"><?php echo $messagedesc->descriptiontext; ?></textarea> </td>
</tr>
</tbody>
</table>
<p>
<button class="btn btn-large btn-block btn-primary" type="submit"><?php echo trad('VALIDER_LES_MODIFICATIONS', 'admin'); ?></button>
</p>
</form>
</div>
</div>
<?php if($errorCode > 0): ?>
<div class="modal hide fade in" id="messageError">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3><?php echo trad('Cautious', 'admin'); ?></h3>
</div>
<div class="modal-body">
<div class="alert alert-error">
<h4 class="alert-heading"><?php echo trad('message_error','admin') ?></h4>
<p><?php echo trad('message_'.$errorCode,'admin'); ?></p>
</div>
</div>
<div class="modal-footer">
<a class="btn" href="message.php"><?php echo trad('Valider', 'admin'); ?></a>
</div>
</div>
</div>
<?php endif; ?>
<?php
ActionsAdminModules::instance()->inclure_module_admin("message_modifier_bottom");
?>
<?php require_once("pied.php"); ?>
<script type="text/javascript">
$(document).ready(function(){
<?php if($errorCode > 0): ?>
$("#messageError").modal("show");
<?php endif; ?>
});
</script>
</body>
</html>