|
|
|
@ -1,4 +1,5 @@
|
|
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Project:
|
|
|
|
|
* Contenido Content Management System
|
|
|
|
@ -27,18 +28,17 @@
|
|
|
|
|
* }}
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
if(!defined('CON_FRAMEWORK')) {
|
|
|
|
|
die('Illegal call');
|
|
|
|
|
if (!defined('CON_FRAMEWORK')) {
|
|
|
|
|
die('Illegal call');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$area="lang";
|
|
|
|
|
$area = "lang";
|
|
|
|
|
|
|
|
|
|
if (!isset($action)) $action = "";
|
|
|
|
|
if (!isset($action))
|
|
|
|
|
$action = "";
|
|
|
|
|
|
|
|
|
|
if (!is_numeric($targetclient))
|
|
|
|
|
{
|
|
|
|
|
$targetclient = $client;
|
|
|
|
|
if (!is_numeric($targetclient)) {
|
|
|
|
|
$targetclient = $client;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$iGetIdlang = $idlang;
|
|
|
|
@ -46,85 +46,82 @@ $iGetIdlang = $idlang;
|
|
|
|
|
$sql = "SELECT
|
|
|
|
|
*
|
|
|
|
|
FROM
|
|
|
|
|
".$cfg["tab"]["lang"]." AS A,
|
|
|
|
|
".$cfg["tab"]["clients_lang"]." AS B
|
|
|
|
|
" . $cfg["tab"]["lang"] . " AS A,
|
|
|
|
|
" . $cfg["tab"]["clients_lang"] . " AS B
|
|
|
|
|
WHERE
|
|
|
|
|
A.idlang=B.idlang AND
|
|
|
|
|
B.idclient='".Contenido_Security::toInteger($targetclient)."'
|
|
|
|
|
B.idclient='" . Contenido_Security::toInteger($targetclient) . "'
|
|
|
|
|
ORDER BY A.idlang";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$db->query($sql);
|
|
|
|
|
|
|
|
|
|
$tpl->set('s','TARGETCLIENT',$targetclient);
|
|
|
|
|
$tpl->set('s', 'TARGETCLIENT', $targetclient);
|
|
|
|
|
|
|
|
|
|
$iLangCount = 0;
|
|
|
|
|
while ($db->next_record()) {
|
|
|
|
|
$iLangCount++;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$idlang = $db->f("idlang");
|
|
|
|
|
|
|
|
|
|
if ($db->f("active") == 0) {
|
|
|
|
|
//activate
|
|
|
|
|
//activate
|
|
|
|
|
$message = i18n("Activate language");
|
|
|
|
|
$active = "<a title=\"$message\" href=\"".$sess->url("main.php?area=$area&action=lang_activatelanguage&frame=$frame&targetclient=$targetclient&idlang=".$db->f("idlang"))."#clickedhere\"><img src=\"".$cfg["path"]["images"]."offline.gif"."\" border=\"0\" title=\"$message\" alt=\"$message\"></a>";
|
|
|
|
|
$active = "<a title=\"$message\" href=\"" . $sess->url("main.php?area=$area&action=lang_activatelanguage&frame=$frame&targetclient=$targetclient&idlang=" . $db->f("idlang")) . "#clickedhere\"><img src=\"" . $cfg["path"]["images"] . "offline.gif" . "\" border=\"0\" title=\"$message\" alt=\"$message\"></a>";
|
|
|
|
|
} else {
|
|
|
|
|
//deactivate
|
|
|
|
|
$message = i18n("Deactivate language");
|
|
|
|
|
$active = "<a title=\"$message\" class=action href=\"".$sess->url("main.php?area=$area&action=lang_deactivatelanguage&frame=$frame&targetclient=$targetclient&idlang=".$db->f("idlang"))."#clickedhere\"><img src=\"".$cfg["path"]["images"]."online.gif"."\" border=\"0\" title=\"$message\" alt=\"$message\"></a>";
|
|
|
|
|
$message = i18n("Deactivate language");
|
|
|
|
|
$active = "<a title=\"$message\" class=action href=\"" . $sess->url("main.php?area=$area&action=lang_deactivatelanguage&frame=$frame&targetclient=$targetclient&idlang=" . $db->f("idlang")) . "#clickedhere\"><img src=\"" . $cfg["path"]["images"] . "online.gif" . "\" border=\"0\" title=\"$message\" alt=\"$message\"></a>";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Delete Button
|
|
|
|
|
$deleteMsg = sprintf(i18n("Do you really want to delete the language %s?"),clHtmlSpecialChars($db->f("name")));
|
|
|
|
|
$deleteMsg = sprintf(i18n("Do you really want to delete the language %s?"), clHtmlSpecialChars($db->f("name")));
|
|
|
|
|
$deleteAct = i18n("Delete language");
|
|
|
|
|
$deletebutton = '<a title="'.$deleteAct.'" href="javascript://" onclick="box.confirm(\''.$deleteAct.'\', \''.$deleteMsg.'\', \'deleteLang('.$db->f("idlang").')\')"><img src="'.$cfg['path']['images'].'delete.gif" border="0" title="'.$deleteAct.'" alt="'.$deleteAct.'"></a>';
|
|
|
|
|
$deletebutton = '<a title="' . $deleteAct . '" href="javascript://" onclick="box.confirm(\'' . $deleteAct . '\', \'' . $deleteMsg . '\', \'deleteLang(' . $db->f("idlang") . ')\')"><img src="' . $cfg['path']['images'] . 'delete.gif" border="0" title="' . $deleteAct . '" alt="' . $deleteAct . '"></a>';
|
|
|
|
|
|
|
|
|
|
$bgcolor = ( is_int($tpl->dyn_cnt / 2) ) ? $cfg["color"]["table_light"] : $cfg["color"]["table_dark"];
|
|
|
|
|
|
|
|
|
|
$tpl->set('d', 'BGCOLOR', $bgcolor);
|
|
|
|
|
$tpl->set('d', 'LANGUAGE', '<a target="right_bottom" href="'.$sess->url("main.php?area=lang_edit&idlang=$idlang&frame=4").'">'.$db->f("name").'</a> <span style="font-size:10px">('.$idlang.')</span>');
|
|
|
|
|
$tpl->set('d', 'ACTIVATEBUTTON', $active);
|
|
|
|
|
$tpl->set('d', 'DELETEBUTTON', $deletebutton);
|
|
|
|
|
|
|
|
|
|
$tpl->set('d', 'BGCOLOR', $bgcolor);
|
|
|
|
|
$tpl->set('d', 'LANGUAGE', '<a target="right_bottom" href="' . $sess->url("main.php?area=lang_edit&idlang=$idlang&frame=4") . '">' . $db->f("name") . '</a> <span style="font-size:10px">(' . $idlang . ')</span>');
|
|
|
|
|
$tpl->set('d', 'ACTIVATEBUTTON', $active);
|
|
|
|
|
$tpl->set('d', 'DELETEBUTTON', $deletebutton);
|
|
|
|
|
//$tpl->set('d', 'ICON', '<a target="right_bottom" href="'.$sess->url("main.php?area=lang_edit&idlang=$idlang&frame=4").'"><img src="images/language.gif" border="0"></a>');
|
|
|
|
|
$tpl->set('d', 'ICON', '');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ($iGetIdlang == $idlang) {
|
|
|
|
|
$tpl->set('d', 'MARKED', ' id="marked" ');
|
|
|
|
|
} else {
|
|
|
|
|
$tpl->set('d', 'MARKED', '');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$tpl->next();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$newlanguageform = '<form name=newlanguage method="post" action="'.$sess->url("main.php?area=$area&frame=$frame").'">
|
|
|
|
|
'.$sess->hidden_session(true).'
|
|
|
|
|
$newlanguageform = '<form name=newlanguage method="post" action="' . $sess->url("main.php?area=$area&frame=$frame") . '">
|
|
|
|
|
' . $sess->hidden_session(true) . '
|
|
|
|
|
<input type="hidden" name="action" value="lang_newlanguage">
|
|
|
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
|
|
|
<tr><td class="text_medium">'.i18n("New language").':
|
|
|
|
|
<tr><td class="text_medium">' . i18n("New language") . ':
|
|
|
|
|
<INPUT type="text" name="name">
|
|
|
|
|
<INPUT type="image" src="'.$cfg['path']['images'].'but_ok.gif" border="0">
|
|
|
|
|
<INPUT type="image" src="' . $cfg['path']['images'] . 'but_ok.gif" border="0">
|
|
|
|
|
</td></tr></table></from>';
|
|
|
|
|
|
|
|
|
|
$tpl->set('s', 'NEWLANGUAGEFORM', $newlanguageform);
|
|
|
|
|
$tpl->set('s', 'SID', $sess->id);
|
|
|
|
|
|
|
|
|
|
if ( $tmp_notification ) {
|
|
|
|
|
if ($tmp_notification) {
|
|
|
|
|
|
|
|
|
|
$noti_html = '<tr><td colspan="3">'.$tmp_notification.'</td></tr>';
|
|
|
|
|
$noti_html = '<tr><td colspan="3">' . $tmp_notification . '</td></tr>';
|
|
|
|
|
$tpl->set('s', 'NOTIFICATION', $noti_html);
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
$tmp_notification = $notification->returnNotification("info", i18n("Language deleted"));
|
|
|
|
|
|
|
|
|
|
$noti_html = '<tr><td colspan="3">'.$tmp_notification.'</td></tr>';
|
|
|
|
|
|
|
|
|
|
$noti_html = '<tr><td colspan="3">' . $tmp_notification . '</td></tr>';
|
|
|
|
|
$tpl->set('s', 'NOTIFICATION', '');
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$tpl->set('s', 'LANG_COUNT', $iLangCount);
|
|
|
|
|
|
|
|
|
|
# Generate template
|
|
|
|
|
$tpl->generate($cfg['path']['templates'] . $cfg['templates']['lang_overview']);
|
|
|
|
|
|
|
|
|
|
?>
|