linea21-modules
[
class tree: linea21-modules
] [
index: linea21-modules
] [
all elements
]
changeLog
Readme.fr.txt
Packages:
linea21-core
linea21-externals
linea21-languages
linea21-modules
linea21-utils
Source for file add.php
Documentation is available at
add.php
<?php
/**
*
@package
linea21.modules
*
@subpackage
newsletter
*
@author
linea21 <info@linea21.com>
*
@version
$id SVN
*
@access
public
*
@license
http://opensource.org/licenses/gpl-3.0.html
*/
//////////// Check Inclusion de pages ////////////
if
(
!
function_exists
(
'AuthenthificationProcess'
))
{
include_once
(
"../lib/lib_common.php"
)
;
ReloadIndex
(
'admin'
)
;
}
////////////
?>
<div id="chemin">
<ul>
<li>
<a href="index.php">
<?
echo
$GLOBALS
[
'lang'
]
[
'way'
]
[
'home'
]
;
?>
</a>
</li>
<li>
<a href="
<?php
echo
$rub_link
;
?>
">
<?
echo
$GLOBALS
[
'lang'
]
[
'menu'
]
[
'news'
]
;
?>
</a>
</li>
<li>
<span>
<?
echo
formatNavTitle
(
$GLOBALS
[
'lang'
]
[
'newsletter'
]
[
'add'
]
)
;
?>
</span>
</li>
</ul>
</div>
<!--end barre haute -->
<?php
$form_title
=
''
;
$form_body
=
''
;
$mask_statut_D
=
'checked="checked"'
;
$mask_statut_W
=
''
;
$newsletter_object
=
new
newsletter
;
if
(
isset
(
$_POST
[
'enregistrer'
]
))
{
$data_table
=
unserialize
(
urldecode
(
$_POST
[
'data_table'
]
))
;
$result
=
$newsletter_object
->
AddNewsletter
(
$data_table
,
$sql_object
)
;
$link_confirm
=
"confirm.php?rub="
.
$rub
.
"&todo="
.
$todo
;
if
(
is_numeric
(
$result
))
header
(
"Location: "
.
$link_confirm
)
;
else
system_error
(
)
;
}
if
(
isset
(
$_POST
[
'valider'
]
))
{
$table
[
0
]
=
$_POST
[
'newsletter_title'
]
;
$table
[
1
]
=
$_POST
[
'newsletter_body'
]
;
$table
[
2
]
=
GetSessionElement
(
'id'
)
;
// ID posteur
$table
[
3
]
=
$_POST
[
'newsletter_statut'
]
;
$newsletter_object
=
new
newsletter
;
$integrity
=
$newsletter_object
->
CheckDataIntegrity
(
$table
)
;
if
(
is_string
(
$integrity
))
{
$text_format
=
'2FIELD'
;
}
else
{
$text_format
=
'2HTML'
;
}
$form_title
=
formatText
(
$_POST
[
'newsletter_title'
]
,
$text_format
)
;
$form_body
=
formatText
(
$_POST
[
'newsletter_body'
]
,
$text_format
)
;
if
(
$_POST
[
'newsletter_statut'
]
==
'D'
)
$mask_statut_D
=
"checked=\"checked\""
;
else
$mask_statut_D
=
''
;
if
(
$_POST
[
'newsletter_statut'
]
==
'W'
)
$mask_statut_W
=
"checked=\"checked\""
;
else
$mask_statut_P
=
''
;
$table
=
urlencode
(
serialize
(
$table
))
;
}
include_once
(
"quickicons.php"
)
;
?>
<?php
if
(
!
isset
(
$integrity
)
||
is_string
(
$integrity
))
{
?>
<div class="contentcontainer">
<?php
include_once
(
$dir
.
"/menurub.php"
)
;
?>
<div id="content">
<?php
if
(
isset
(
$integrity
)
&&
is_string
(
$integrity
))
display_errors
(
$integrity
)
;
?>
<h2>
<?
echo
formatTitleh2
(
$GLOBALS
[
'lang'
]
[
'newsletter'
]
[
'add_title'
]
)
;
?>
</h2>
<form id="addnews" action="
<?php
echo
$_SERVER
[
'SCRIPT_NAME'
]
;
?>
" method="post">
<p>
<label for="newsletter_title">
<?
echo
$GLOBALS
[
'lang'
]
[
'newsletter'
]
[
'title'
]
;
?>
: *</label>
<input name="newsletter_title" type="text" class="textfield" id="newsletter_title" maxlength="200" value="
<?php
echo
$form_title
;
?>
" />
</p>
<p>
<label for="newsletter_body">
<?
echo
$GLOBALS
[
'lang'
]
[
'newsletter'
]
[
'body'
]
;
?>
: *</label>
<textarea id="newsletter_body" name="newsletter_body" class="largetextfield"
<?php
echo
AREA_SETTINGS
;
?>
>
<?php
echo
$form_body
;
?>
</textarea>
</p>
<p>
<label for="statut_D">
<?
echo
$GLOBALS
[
'lang'
]
[
'newsletter'
]
[
'statut'
]
;
?>
: </label>
<input name="newsletter_statut" type="radio" id="statut_D" value="D"
<?php
echo
$mask_statut_D
;
?>
/><span class="radio">
<?php
echo
$GLOBALS
[
'lang'
]
[
'statut'
]
[
'draft'
]
;
?>
</span>
<input name="newsletter_statut" type="radio" id="statut_W" value="W"
<?php
echo
$mask_statut_W
;
?>
/><span class="radio">
<?php
echo
$GLOBALS
[
'lang'
]
[
'newsletter'
]
[
'nightsend'
]
;
?>
</span>
<br />
</p>
<div>
<input name="rub" type="hidden" value="
<?php
echo
$rub
;
?>
" id="rub" />
<input name="todo" type="hidden" value="
<?php
echo
$todo
;
?>
" id="todo" />
<?php
echo
cancel_button
(
'javascript:history.go(-1);'
)
;
?>
<input name="valider" type="submit" value="
<?
echo
$GLOBALS
[
'lang'
]
[
'btn'
]
[
'valid'
]
?>
" class="button" id="valider" />
</div>
</form>
</div>
<?php
include_once
(
$dir
.
"/help.php"
)
;
?>
</div>
<?php
// Récapitulatif
}
else
{
?>
<div class="contentcontainer">
<?php
include_once
(
$dir
.
"/menurub.php"
)
;
?>
<div id="content">
<h2>
<?
echo
formatTitleh2
(
$GLOBALS
[
'lang'
]
[
'recap'
]
[
'title'
]
)
;
?>
</h2>
<?php
echo
"<dl class=\"dl3\">\n"
;
echo
"<dt>"
.
$GLOBALS
[
'lang'
]
[
'newsletter'
]
[
'title'
]
.
"</dt>\n"
;
echo
"<dd>"
.
$form_title
.
"</dd>\n"
;
echo
"<dt>"
.
$GLOBALS
[
'lang'
]
[
'newsletter'
]
[
'body'
]
.
" :</dt>\n"
;
echo
"<dd>"
.
linkin_content
(
$form_body
)
.
"</dd>\n"
;
echo
"<dt>"
.
$GLOBALS
[
'lang'
]
[
'divers'
]
[
'statut'
]
.
"</dt>\n"
;
echo
"<dd>"
.
display_statut
(
$_POST
[
'newsletter_statut'
]
)
.
"</dd>\n"
;
echo
"</dl>\n"
;
?>
<form id="addscale" action="
<?php
echo
$_SERVER
[
'SCRIPT_NAME'
]
;
?>
" method="post">
<div>
<input name="rub" type="hidden" value="
<?php
echo
$rub
;
?>
" id="rub" />
<input name="todo" type="hidden" value="
<?php
echo
$todo
;
?>
" id="todo" />
<input name="data_table" type="hidden" value="
<?php
echo
$table
;
?>
" id="data_table" />
<?php
echo
cancel_button
(
'?rub=news&todo=list'
)
;
?>
<input name="retour" type="button" value="
<?
echo
$GLOBALS
[
'lang'
]
[
'btn'
]
[
'preview'
]
;
?>
" class="button" id="retour" onclick="history.go(-1);" />
<input name="enregistrer" type="submit" value="
<?
echo
$GLOBALS
[
'lang'
]
[
'btn'
]
[
'save'
]
;
?>
" class="button" id="valider" />
</div>
</form>
</div>
<?php
include_once
(
$dir
.
"/help.php"
)
;
?>
</div>
<?php
}
?>
Documentation generated on Sat, 08 Nov 2008 14:50:37 +0100 by
phpDocumentor 1.4.1