Subversion Repositories Applications.papyrus

Compare Revisions

Ignore whitespace Rev 24 → Rev 6

/trunk/papyrus/applications/admin_site/bibliotheque/adsi_cache.fonct.php
New file
0,0 → 1,159
<?
//------------------------------------------------------------------------------
// FICHIER : $RCSfile: adsi_cache.fonct.php,v $
// AUTEUR : $Author: jpm $
// VERSION : $Revision: 1.1 $
// DATE : $Date: 2004-06-16 14:26:35 $
//------------------------------------------------------------------------------
// GSite - Web site management in PHP - gus module
//
// Copyright (C) 2001 COUDOUNEAU Laurent (lc@gsite.org)
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
 
//==============================================================================
//==============================================================================
 
function listCaches ($db, $link, $project, $locale,
$baseURL, $baseURLjs,
$msg) {
//----------------------------------------------------------------------------
// Javascript.
$goMsg = addslashes (gs_getLabel ($db, $link, 'delete', $locale, 'gsite', false));
js_register ('deleteCache',
" function deleteCache (oSelect) {"."\n".
" var url = '$baseURLjs'+'&guscmd=delcache';"."\n".
" if (oSelect.selectedIndex != -1) {"."\n".
" url += '&gusprjid='+oSelect.options[oSelect.selectedIndex].value;"."\n".
" if (window.confirm ('$goMsg')) {"."\n".
" document.location = url;"."\n".
" }"."\n".
" }"."\n".
" }"."\n"
);
//----------------------------------------------------------------------------
// Buttons.
$i = 0;
//-- Delete cache.
$btInfos1[$i++] = array (
'text' => 'gus_del',
'appl' => 'gus',
'url' => 'javascript:deleteCache (document.gform.gselect)');
$btInfos1[$i++] = array ('space' => true);
//-- Logout.
$btInfos1[$i++] = array (
'text' => 'logout',
'appl' => 'gsite',
'url' => $baseURL.'&amp;auth_logout=1');
$button1 =
gs_genericButtons ($db, $link, $locale,
$btInfos1,
false);
//----------------------------------------------------------------------------
// List caches.
$query =
"select ".
"C_PROJECT, ".
"SUM(C_LENGTH) as UNZIP, ".
"SUM(C_GZ_LENGTH) as ZIP, ".
"COUNT(C_MD5_URL) as PAGES ".
"from $db.CACHE ".
"group by C_PROJECT ".
"order by C_PROJECT";
$result = mysql_query ($query, $link);
 
if (! $result) {
die ("Unable to perform query ($query / " . mysql_error ($link) . ")");
}
//----------------------------------------------------------------------------
// Build form.
$text = '';
$text .= "\n".'<FORM name="gform" action="document.php" method="get">';
$text .= "\n".' <SELECT class="gusInput" name="gselect" size="20" ondblclick="javascript:deleteCache (document.gform.gselect)">';
while ($row = mysql_fetch_object ($result)) {
$ratio = ((int) (($row->UNZIP / $row->ZIP) * 100)) / 100;
$size = ((int) (($row->ZIP / 1024) * 100)) / 100;
$infos = htmlentities ("$row->C_PROJECT ($row->PAGES pages - $size Ko - $ratio x)");
$text .= "\n".' <OPTION value="'.htmlentities ($row->C_PROJECT).'">';
$text .= $infos;
$text .= '</OPTION>';
}
$text .= "\n".' </SELECT>';
$text .= "\n".'</FORM>';
mysql_free_result ($result);
//----------------------------------------------------------------------------
// Build page.
$title = gs_getLabel ($db, $link, 'gus_title4', $locale, 'gus');
return
buildPage (
$button1,
'',
$title,
$text,
$msg);
}
 
//==============================================================================
//==============================================================================
 
function delCache ($db, $link, $gusprjid) {
$query = "delete from $db.CACHE where C_PROJECT='$gusprjid'";
$result = mysql_query ($query, $link);
 
if (! $result) {
die ("Unable to perform query ($query / " . mysql_error ($link) . ")");
}
}
 
//------------------------------------------------------------------------------
// $Log: not supported by cvs2svn $
// Revision 1.1 2003/10/10 09:58:21 alex
// installation
//
// Revision 1.1.1.1 2002/10/02 07:32:21 root
// initialisation site de Tela
//
// Revision 1.2 2002/06/14 07:22:22 lc
// Bug LC0021 : use js_register
//
// Revision 1.1 2002/02/26 08:22:21 lc
// Initial revision.
//
//-- End of source ------------------------------------------------------------
?>
/trunk/papyrus/applications/admin_site/bibliotheque/adsi_squelette.fonct.php
New file
0,0 → 1,287
<?
//------------------------------------------------------------------------------
// FICHIER : $RCSfile: adsi_squelette.fonct.php,v $
// AUTEUR : $Author: jpm $
// VERSION : $Revision: 1.1 $
// DATE : $Date: 2004-06-16 14:28:53 $
//------------------------------------------------------------------------------
// GSite - Web site management in PHP - gus module
//
// Copyright (C) 2001 COUDOUNEAU Laurent (lc@gsite.org)
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
 
//==============================================================================
//==============================================================================
 
function updatePresentation ($db, $link, $project, $locale,
$baseURL, $baseURLjs, $baseHidden,
$managedProject) {
//----------------------------------------------------------------------------
// JavaScript.
$not_empty = gs_getLabel ($db, $link, 'not_empty', $locale, false);
js_register ('validateAndSubmit',
" function validateAndSubmit (oForm) {"."\n".
" if (oForm.guspresP_LOOK_NAME.value == '') {"."\n".
" alert ('P_LOOK_NAME : $not_empty');"."\n".
" return;"."\n".
" }"."\n".
" "."\n".
" oForm.submit ();"."\n".
" }"."\n"
);
//----------------------------------------------------------------------------
// Query project : get presentation.
$query = "select * from $db.PROJECT where GS_PROJECT='$managedProject'";
$result = mysql_query ($query, $link);
if (! $result) {
die ("Unable to perform query ($query / " . mysql_error ($link) . ")");
}
$button = '';
$text = '';
$pres = '';
$msg = '';
$title = '';
if (mysql_num_rows ($result) != 1) {
//--------------------------------------------------------------------------
// Unknown project.
$msg = gs_getLabel ($db, $link, 'gus_unknown_prj', $locale, 'gus')." ($managedProject)";
$button =
gs_genericButtons ($db, $link, $locale,
array (
array (
'text' => 'back',
'appl' => 'gsite',
'url' => $baseURL)),
false);
} else {
//--------------------------------------------------------------------------
// Get row.
$row = mysql_fetch_object ($result);
$pres = $row->GS_PRESENTATION;
//--------------------------------------------------------------------------
// Get presentation.
$query = "select * from $db.".$pres."_PRESENTATION where P_LOOK_NAME='$row->GS_LOOK_NAME'";
$PRESresult = mysql_query ($query, $link);
if (! $PRESresult) {
die ("Unable to perform query ($query / " . mysql_error ($link) . ")");
}
$numFields = mysql_num_fields ($PRESresult);
//-- We already have a presentation ?
$title .= '&nbsp;: ';
if (mysql_num_rows ($PRESresult) == 0) {
$title .= gs_getLabel ($db, $link, 'gus_title5_not_exist', $locale, 'gus');
} else {
$title .= gs_getLabel ($db, $link, 'gus_title5_exist', $locale, 'gus');
}
//-- Get infos about fields.
$metaArray = array ();
for ($i = 0; $i < $numFields; $i++) {
$metaArray[$i] = mysql_fetch_field ($PRESresult);
}
//-- Get result.
$PRESrow = mysql_fetch_row ($PRESresult);
$dataArray = array ();
for ($i = 0; $i < $numFields; $i++) {
$dataArray[$i] = $PRESrow[$i];
}
//--------------------------------------------------------------------------
// Dump form.
$text = '';
$text .= "\n".'<FORM name="gform" action="document.php" method="post">';
$text .= "\n".' <TABLE cellspacing="0" cellpadding="0" border="0" summary="">';
for ($i = 0; $i < $numFields; $i++) {
$text .= "\n".' <TR>';
$text .= "\n".' <TD class="gusLabel">'.htmlentities ($metaArray[$i]->name).'&nbsp;:&nbsp;</TD>';
$text .= "\n".' <TD class="gusInput"><INPUT';
$text .= "\n".' class="gusInput"';
$text .= "\n".' type="text"';
$text .= "\n".' name="guspres'.$metaArray[$i]->name.'"';
$text .= "\n".' size="48"';
$text .= "\n".' maxlength="255"';
$text .= "\n".' value="'.htmlentities ((($dataArray[$i] == '') && ($metaArray[$i]->name == 'P_LOOK_NAME')
? $row->GS_LOOK_NAME
: $dataArray[$i])).'"></TD>';
$text .= "\n".' </TR>';
}
$text .= "\n".' <TR>';
$text .= "\n".' <TD align="center" colspan="2"><TABLE border="0" summary="" width="100%" cellpadding="0" cellspacing="0">';
$text .= "\n".' <TR>';
$text .= "\n".' <TD align="center"><INPUT type="image" src="Local/icons/validate.gif"></TD>';
$text .= "\n".' <TD align="center"><A href="'.$baseURL.'"><IMG '.
'border="0" src="Local/icons/cancel.gif" alt="" width="16" height="16"></A></TD>';
$text .= "\n".' </TR>';
$text .= "\n".' </TABLE></TD>';
$text .= "\n".' </TR>';
$text .= "\n".' </TABLE>';
$text .= "\n".' <INPUT type="hidden" name="gusprjid" value="'.htmlentities ($managedProject).'">';
$text .= "\n".' <INPUT type="hidden" name="gusprsid" value="'.htmlentities ($row->GS_LOOK_NAME).'">';
$text .= "\n".' <INPUT type="hidden" name="gusprjpres" value="'.htmlentities ($row->GS_PRESENTATION).'">';
$text .= "\n".' <INPUT type="hidden" name="guscmd" value="commitupdpres">';
$text .= $baseHidden;
$text .= "\n".'</FORM>';
}
mysql_free_result ($result);
//----------------------------------------------------------------------------
// Build page.
$title =
$managedProject.
(empty ($pres) ? '' : ' / '.$pres).
$title;
return
buildPage (
$button, '',
$title,
$text,
$msg);
}
 
//==============================================================================
//==============================================================================
 
function commitUpdatePresentation ($db, $link, $project, $locale,
$userLevel, $adminProject,
$baseURL, $baseURLjs) {
global $gusprjid;
global $gusprsid;
global $gusprjpres;
global $guspresP_LOOK_NAME;
//----------------------------------------------------------------------------
// Look name set ?
$msg = '';
if (isset ($guspresP_LOOK_NAME) && ($guspresP_LOOK_NAME != '')) {
//--------------------------------------------------------------------------
// This look name already exist ?
$query = "select * from $db.$gusprjpres"."_PRESENTATION where P_LOOK_NAME='$gusprsid'";
$result = mysql_query ($query, $link);
if (! $result) {
die ("Unable to perform query ($query / " . mysql_error ($link) . ")");
}
$presExist = (mysql_num_rows ($result) == 1);
mysql_free_result ($result);
//--------------------------------------------------------------------------
// We have a look name. We get others informations, and build request.
global $HTTP_POST_VARS;
$query = '';
reset ($HTTP_POST_VARS);
while (list ($key, $val) = each ($HTTP_POST_VARS)) {
if (substr ($key, 0, strlen ('guspres')) == 'guspres') {
if ($query != '') $query .= ', ';
$query .= substr ($key, strlen ('guspres'), strlen ($key) - strlen ('guspres'))."='$val'";
}
}
if ($presExist) {
$query = "update $db.$gusprjpres"."_PRESENTATION set ".$query." where P_LOOK_NAME='$gusprsid'";
} else {
$query = "insert into $db.$gusprjpres"."_PRESENTATION set ".$query;
}
//--------------------------------------------------------------------------
// Execute query.
$result = mysql_query ($query, $link);
if (! $result) {
die ("Unable to perform query ($query / " . mysql_error ($link) . ")");
}
} else {
$msg = gs_getLabel ($db, $link, 'gus_pres_noname', $locale, 'gus');
}
//----------------------------------------------------------------------------
// List all projects.
return
listProjects ($db, $link, $project, $locale,
$userLevel, $adminProject,
$baseURL, $baseURLjs,
$msg);
}
 
//------------------------------------------------------------------------------
// $Log: not supported by cvs2svn $
// Revision 1.1 2003/10/10 09:58:21 alex
// installation
//
// Revision 1.1.1.1 2002/10/02 07:32:21 root
// initialisation site de Tela
//
// Revision 1.2 2002/06/14 07:22:38 lc
// Bug LC0021 : use js_register
//
// Revision 1.1 2002/02/25 16:35:57 lc
// First revision.
//
//-- End of source ------------------------------------------------------------
?>
/trunk/papyrus/applications/admin_site/bibliotheque/adsi_style.fonct.php
New file
0,0 → 1,669
<?
//------------------------------------------------------------------------------
// FICHIER : $RCSfile: adsi_style.fonct.php,v $
// AUTEUR : $Author: jpm $
// VERSION : $Revision: 1.1 $
// DATE : $Date: 2004-06-16 14:29:01 $
//------------------------------------------------------------------------------
// GSite - Web site management in PHP - gus module
//
// Copyright (C) 2001 COUDOUNEAU Laurent (lc@gsite.org)
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
 
//==============================================================================
//==============================================================================
 
function addStyle ($db, $link) {
$styleName = substr (md5 (uniqid (rand ())), 0, 16);
$query = "insert into $db.STYLE set S_NAME='$styleName'";
$result = mysql_query ($query, $link);
 
if (! $result) {
die ("Unable to perform query ($query / " . mysql_error ($link) . ")");
}
}
 
//==============================================================================
//==============================================================================
 
function delStyle ($db, $link, $gusstyid) {
$query = "delete from $db.STYLE where S_NAME='$gusstyid'";
$result = mysql_query ($query, $link);
 
if (! $result) {
die ("Unable to perform query ($query / " . mysql_error ($link) . ")");
}
}
 
//==============================================================================
//==============================================================================
 
function updStyle ($db, $link, $locale, $gusstyid, $baseURL, $baseHidden, $msg = '') {
//----------------------------------------------------------------------------
// Get style.
$query = "select * from $db.STYLE where S_NAME='$gusstyid'";
$result = mysql_query ($query, $link);
 
if (! $result) {
die ("Unable to perform query ($query / " . mysql_error ($link) . ")");
}
$row = mysql_fetch_object ($result);
mysql_free_result ($result);
if (! $row) return '';
//----------------------------------------------------------------------------
// Labels.
$nameLabel = gs_getLabel ($db, $link, 'gus_name', $locale, 'gus').'&nbsp;:&nbsp;';
$txtcolLabel = gs_getLabel ($db, $link, 'gus_col_txt', $locale, 'gus').'&nbsp;:&nbsp;';
$col1Label = gs_getLabel ($db, $link, 'gus_col_1', $locale, 'gus').'&nbsp;:&nbsp;';
$col2Label = gs_getLabel ($db, $link, 'gus_col_2', $locale, 'gus').'&nbsp;:&nbsp;';
$col3Label = gs_getLabel ($db, $link, 'gus_col_3', $locale, 'gus').'&nbsp;:&nbsp;';
$col4Label = gs_getLabel ($db, $link, 'gus_col_4', $locale, 'gus').'&nbsp;:&nbsp;';
$col5Label = gs_getLabel ($db, $link, 'gus_col_5', $locale, 'gus').'&nbsp;:&nbsp;';
$col6Label = gs_getLabel ($db, $link, 'gus_col_6', $locale, 'gus').'&nbsp;:&nbsp;';
$col7Label = gs_getLabel ($db, $link, 'gus_col_7', $locale, 'gus').'&nbsp;:&nbsp;';
$txtinvcolLabel = gs_getLabel ($db, $link, 'gus_col_txt_inv', $locale, 'gus').'&nbsp;:&nbsp;';
$txtaltcolLabel = gs_getLabel ($db, $link, 'gus_col_txt_alert', $locale, 'gus').'&nbsp;:&nbsp;';
$fontfLabel = gs_getLabel ($db, $link, 'gus_font_fam', $locale, 'gus').'&nbsp;:&nbsp;';
$fonttLabel = gs_getLabel ($db, $link, 'gus_font_tiny', $locale, 'gus').'&nbsp;:&nbsp;';
$fontsLabel = gs_getLabel ($db, $link, 'gus_font_small', $locale, 'gus').'&nbsp;:&nbsp;';
$fontbLabel = gs_getLabel ($db, $link, 'gus_font_big', $locale, 'gus').'&nbsp;:&nbsp;';
//----------------------------------------------------------------------------
// Dump data.
$outputText = '';
$outputText .= "\n".'<TR>';
$outputText .= "\n".' <TD><FORM name="updform" action="document.php" method="POST">'.
'<TABLE align="center" summary="" cellspacing="0" cellpadding="0" border="0">';
if ($msg != '') {
$outputText .= "\n".' <TR><TD class="gusError" colspan="6">'.$msg.'</TD></TR>';
}
$outputText .= "\n".' <TR>';
$outputText .= "\n".' <TD class="gusLabel">'.$nameLabel.'</TD>';
$outputText .= "\n".' <TD class="gusInput" colspan="5"><INPUT';
$outputText .= "\n".' class="gusInput"';
$outputText .= "\n".' type="text"';
$outputText .= "\n".' name="gusname"';
$outputText .= "\n".' size="16"';
$outputText .= "\n".' maxlength="16"';
$outputText .= "\n".' value="'.htmlentities ($row->S_NAME).'"></TD>';
$outputText .= "\n".' </TR>';
$outputText .= "\n".' <TR><TD colspan="6"><IMG src="Local/vide.gif" alt="" width="1" height="5"></TD></TR>';
$outputText .= "\n".' <TR>';
$outputText .= "\n".' <TD class="gusLabel">'.$txtcolLabel.'</TD>';
$outputText .= "\n".' <TD class="gusInput"><INPUT';
$outputText .= "\n".' class="gusInput"';
$outputText .= "\n".' type="text"';
$outputText .= "\n".' name="guscoltxt"';
$outputText .= "\n".' size="10"';
$outputText .= "\n".' maxlength="16"';
$outputText .= "\n".' value="'.htmlentities ($row->S_COLOR_TEXT).'"></TD>';
$outputText .= "\n".' <TD bgcolor="'.$row->S_COLOR_TEXT.'"><IMG src="Local/vide.gif" alt="" width="20" height="20"></TD>';
$outputText .= "\n".' </TR>';
$outputText .= "\n".' <TR>';
$outputText .= "\n".' <TD class="gusLabel">'.$txtinvcolLabel.'</TD>';
$outputText .= "\n".' <TD class="gusInput"><INPUT';
$outputText .= "\n".' class="gusInput"';
$outputText .= "\n".' type="text"';
$outputText .= "\n".' name="guscolinvtxt"';
$outputText .= "\n".' size="10"';
$outputText .= "\n".' maxlength="16"';
$outputText .= "\n".' value="'.htmlentities ($row->S_COLOR_TEXT_INVERSE).'"></TD>';
$outputText .= "\n".' <TD bgcolor="'.$row->S_COLOR_TEXT_INVERSE.'"><IMG src="Local/vide.gif" alt="" width="20" height="20"></TD>';
$outputText .= "\n".' <TD class="gusLabel">'.$txtaltcolLabel.'</TD>';
$outputText .= "\n".' <TD class="gusInput"><INPUT';
$outputText .= "\n".' class="gusInput"';
$outputText .= "\n".' type="text"';
$outputText .= "\n".' name="guscolalttxt"';
$outputText .= "\n".' size="10"';
$outputText .= "\n".' maxlength="16"';
$outputText .= "\n".' value="'.htmlentities ($row->S_COLOR_TEXT_ALERT).'"></TD>';
$outputText .= "\n".' <TD bgcolor="'.$row->S_COLOR_TEXT_ALERT.'"><IMG src="Local/vide.gif" alt="" width="20" height="20"></TD>';
$outputText .= "\n".' </TR>';
$outputText .= "\n".' <TR><TD colspan="6"><IMG src="Local/vide.gif" alt="" width="1" height="5"></TD></TR>';
$outputText .= "\n".' <TR>';
$outputText .= "\n".' <TD class="gusLabel">'.$col1Label.'</TD>';
$outputText .= "\n".' <TD class="gusInput"><INPUT';
$outputText .= "\n".' class="gusInput"';
$outputText .= "\n".' type="text"';
$outputText .= "\n".' name="guscol1"';
$outputText .= "\n".' size="10"';
$outputText .= "\n".' maxlength="16"';
$outputText .= "\n".' value="'.htmlentities ($row->S_COLOR_1).'"></TD>';
$outputText .= "\n".' <TD bgcolor="'.$row->S_COLOR_1.'"><IMG src="Local/vide.gif" alt="" width="20" height="20"></TD>';
$outputText .= "\n".' <TD class="gusLabel">'.$col2Label.'</TD>';
$outputText .= "\n".' <TD class="gusInput"><INPUT';
$outputText .= "\n".' class="gusInput"';
$outputText .= "\n".' type="text"';
$outputText .= "\n".' name="guscol2"';
$outputText .= "\n".' size="10"';
$outputText .= "\n".' maxlength="16"';
$outputText .= "\n".' value="'.htmlentities ($row->S_COLOR_2).'"></TD>';
$outputText .= "\n".' <TD bgcolor="'.$row->S_COLOR_2.'"><IMG src="Local/vide.gif" alt="" width="20" height="20"></TD>';
$outputText .= "\n".' </TR>';
$outputText .= "\n".' <TR>';
$outputText .= "\n".' <TD class="gusLabel">'.$col3Label.'</TD>';
$outputText .= "\n".' <TD class="gusInput"><INPUT';
$outputText .= "\n".' class="gusInput"';
$outputText .= "\n".' type="text"';
$outputText .= "\n".' name="guscol3"';
$outputText .= "\n".' size="10"';
$outputText .= "\n".' maxlength="16"';
$outputText .= "\n".' value="'.htmlentities ($row->S_COLOR_3).'"></TD>';
$outputText .= "\n".' <TD bgcolor="'.$row->S_COLOR_3.'"><IMG src="Local/vide.gif" alt="" width="20" height="20"></TD>';
$outputText .= "\n".' </TR>';
$outputText .= "\n".' <TR>';
$outputText .= "\n".' <TD class="gusLabel">'.$col7Label.'</TD>';
$outputText .= "\n".' <TD class="gusInput"><INPUT';
$outputText .= "\n".' class="gusInput"';
$outputText .= "\n".' type="text"';
$outputText .= "\n".' name="guscol7"';
$outputText .= "\n".' size="10"';
$outputText .= "\n".' maxlength="16"';
$outputText .= "\n".' value="'.htmlentities ($row->S_COLOR_7).'"></TD>';
$outputText .= "\n".' <TD bgcolor="'.$row->S_COLOR_7.'"><IMG src="Local/vide.gif" alt="" width="20" height="20"></TD>';
$outputText .= "\n".' <TD class="gusLabel">'.$col4Label.'</TD>';
$outputText .= "\n".' <TD class="gusInput"><INPUT';
$outputText .= "\n".' class="gusInput"';
$outputText .= "\n".' type="text"';
$outputText .= "\n".' name="guscol4"';
$outputText .= "\n".' size="10"';
$outputText .= "\n".' maxlength="16"';
$outputText .= "\n".' value="'.htmlentities ($row->S_COLOR_4).'"></TD>';
$outputText .= "\n".' <TD bgcolor="'.$row->S_COLOR_4.'"><IMG src="Local/vide.gif" alt="" width="20" height="20"></TD>';
$outputText .= "\n".' </TR>';
$outputText .= "\n".' <TR>';
$outputText .= "\n".' <TD class="gusLabel">'.$col5Label.'</TD>';
$outputText .= "\n".' <TD class="gusInput"><INPUT';
$outputText .= "\n".' class="gusInput"';
$outputText .= "\n".' type="text"';
$outputText .= "\n".' name="guscol5"';
$outputText .= "\n".' size="10"';
$outputText .= "\n".' maxlength="16"';
$outputText .= "\n".' value="'.htmlentities ($row->S_COLOR_5).'"></TD>';
$outputText .= "\n".' <TD bgcolor="'.$row->S_COLOR_5.'"><IMG src="Local/vide.gif" alt="" width="20" height="20"></TD>';
$outputText .= "\n".' <TD class="gusLabel">'.$col6Label.'</TD>';
$outputText .= "\n".' <TD class="gusInput"><INPUT';
$outputText .= "\n".' class="gusInput"';
$outputText .= "\n".' type="text"';
$outputText .= "\n".' name="guscol6"';
$outputText .= "\n".' size="10"';
$outputText .= "\n".' maxlength="16"';
$outputText .= "\n".' value="'.htmlentities ($row->S_COLOR_6).'"></TD>';
$outputText .= "\n".' <TD bgcolor="'.$row->S_COLOR_6.'"><IMG src="Local/vide.gif" alt="" width="20" height="20"></TD>';
$outputText .= "\n".' </TR>';
$outputText .= "\n".' <TR><TD colspan="6"><IMG src="Local/vide.gif" alt="" width="1" height="5"></TD></TR>';
$outputText .= "\n".' <TR>';
$outputText .= "\n".' <TD class="gusLabel">'.$fontfLabel.'</TD>';
$outputText .= "\n".' <TD class="gusInput" colspan="5"><INPUT';
$outputText .= "\n".' class="gusInput"';
$outputText .= "\n".' type="text"';
$outputText .= "\n".' name="gusfontf"';
$outputText .= "\n".' size="64"';
$outputText .= "\n".' maxlength="255"';
$outputText .= "\n".' value="'.htmlentities ($row->S_FONT_FAMILY).'"></TD>';
$outputText .= "\n".' </TR>';
$outputText .= "\n".' <TR>';
$outputText .= "\n".' <TD class="gusLabel">'.$fonttLabel.'</TD>';
$outputText .= "\n".' <TD class="gusInput" colspan="5"><INPUT';
$outputText .= "\n".' class="gusInput"';
$outputText .= "\n".' type="text"';
$outputText .= "\n".' name="gusfontt"';
$outputText .= "\n".' size="8"';
$outputText .= "\n".' maxlength="8"';
$outputText .= "\n".' value="'.htmlentities ($row->S_FONT_SIZE_TINY).'"></TD>';
$outputText .= "\n".' </TR>';
$outputText .= "\n".' <TR>';
$outputText .= "\n".' <TD class="gusLabel">'.$fontsLabel.'</TD>';
$outputText .= "\n".' <TD class="gusInput" colspan="5"><INPUT';
$outputText .= "\n".' class="gusInput"';
$outputText .= "\n".' type="text"';
$outputText .= "\n".' name="gusfonts"';
$outputText .= "\n".' size="8"';
$outputText .= "\n".' maxlength="8"';
$outputText .= "\n".' value="'.htmlentities ($row->S_FONT_SIZE_SMALL).'"></TD>';
$outputText .= "\n".' </TR>';
$outputText .= "\n".' <TR>';
$outputText .= "\n".' <TD class="gusLabel">'.$fontbLabel.'</TD>';
$outputText .= "\n".' <TD class="gusInput" colspan="5"><INPUT';
$outputText .= "\n".' class="gusInput"';
$outputText .= "\n".' type="text"';
$outputText .= "\n".' name="gusfontb"';
$outputText .= "\n".' size="8"';
$outputText .= "\n".' maxlength="8"';
$outputText .= "\n".' value="'.htmlentities ($row->S_FONT_SIZE_BIG).'"></TD>';
$outputText .= "\n".' </TR>';
$outputText .= "\n".' <TR><TD colspan="6"><IMG src="Local/vide.gif" alt="" width="1" height="10"></TD></TR>';
$bodyStyle =
"background-color: $row->S_COLOR_1;";
$frameStyle =
"background-color: $row->S_COLOR_2;";
$backStyle =
"background-color: $row->S_COLOR_3;";
$onStyle =
"font-family:$row->S_FONT_FAMILY;".
"font-size:$row->S_FONT_SIZE_SMALL;".
"text-align:center; vertical-align=middle;".
"color:$row->S_COLOR_TEXT;".
"background-color:$row->S_COLOR_7;";
$offStyle =
"font-family:$row->S_FONT_FAMILY;".
"font-size:$row->S_FONT_SIZE_SMALL;".
"text-align:center; vertical-align=middle;".
"color:$row->S_COLOR_TEXT;".
"background-color:$row->S_COLOR_4;";
$texttStyle =
"font-family:$row->S_FONT_FAMILY;".
"font-size:$row->S_FONT_SIZE_TINY;".
"text-align:left; vertical-align=top;".
"color:$row->S_COLOR_TEXT;".
"background-color:$row->S_COLOR_3;";
$textsStyle =
"font-family:$row->S_FONT_FAMILY;".
"font-size:$row->S_FONT_SIZE_SMALL;".
"text-align:left; vertical-align=top;".
"color:$row->S_COLOR_TEXT;".
"background-color:$row->S_COLOR_3;";
$textbStyle =
"font-family:$row->S_FONT_FAMILY;".
"font-size:$row->S_FONT_SIZE_BIG;".
"text-align:left; vertical-align=top;".
"color:$row->S_COLOR_TEXT;".
"background-color:$row->S_COLOR_3;";
$alertStyle =
"font-family:$row->S_FONT_FAMILY;".
"font-size:$row->S_FONT_SIZE_SMALL;font-weight:bold;".
"text-align:left; vertical-align=top;".
"color:$row->S_COLOR_TEXT_ALERT;".
"background-color:$row->S_COLOR_3;";
$labelStyle =
"font-family:$row->S_FONT_FAMILY;".
"font-size:$row->S_FONT_SIZE_SMALL;font-weight:bold;".
"text-align:left; vertical-align=top;".
"color:$row->S_COLOR_TEXT;".
"background-color:$row->S_COLOR_5;";
$inputStyle =
"font-family:$row->S_FONT_FAMILY;".
"font-size:$row->S_FONT_SIZE_SMALL;".
"text-align:left; vertical-align=top;".
"color:$row->S_COLOR_TEXT;".
"background-color:$row->S_COLOR_6;";
$outputText .= "\n".' <TR>';
$outputText .= "\n".' <TD colspan="6" style="'.$bodyStyle.'"><BR><TABLE align="center" summary="" cellspacing="0" cellpadding="0" border="0">';
$outputText .= "\n".' <TR>';
$outputText .= "\n".' <TD style="'.$frameStyle.'"><IMG src="Local/vide.gif" alt="" width="1" height="1"></TD>';
$outputText .= "\n".' <TD style="'.$frameStyle.'"><IMG src="Local/vide.gif" alt="" width="78" height="1"></TD>';
$outputText .= "\n".' <TD style="'.$frameStyle.'"><IMG src="Local/vide.gif" alt="" width="1" height="1"></TD>';
$outputText .= "\n".' <TD><IMG src="Local/vide.gif" alt="" width="10" height="1"></TD>';
$outputText .= "\n".' <TD style="'.$frameStyle.'"><IMG src="Local/vide.gif" alt="" width="1" height="1"></TD>';
$outputText .= "\n".' <TD style="'.$frameStyle.'"><IMG src="Local/vide.gif" alt="" width="78" height="1"></TD>';
$outputText .= "\n".' <TD style="'.$frameStyle.'"><IMG src="Local/vide.gif" alt="" width="1" height="1"></TD>';
$outputText .= "\n".' <TD><IMG src="Local/vide.gif" alt="" width="229" height="1"></TD>';
$outputText .= "\n".' <TD><IMG src="Local/vide.gif" alt="" width="1" height="1"></TD>';
$outputText .= "\n".' </TR>';
$outputText .= "\n".' <TR>';
$outputText .= "\n".' <TD style="'.$frameStyle.'"><IMG src="Local/vide.gif" alt="" width="1" height="15"></TD>';
$outputText .= "\n".' <TD style="'.$onStyle.'">Azerty</TD>';
$outputText .= "\n".' <TD style="'.$frameStyle.'"><IMG src="Local/vide.gif" alt="" width="1" height="15"></TD>';
$outputText .= "\n".' <TD><IMG src="Local/vide.gif" alt="" width="10" height="1"></TD>';
$outputText .= "\n".' <TD style="'.$frameStyle.'"><IMG src="Local/vide.gif" alt="" width="1" height="15"></TD>';
$outputText .= "\n".' <TD style="'.$offStyle.'">Qwerty</TD>';
$outputText .= "\n".' <TD style="'.$frameStyle.'"><IMG src="Local/vide.gif" alt="" width="1" height="15"></TD>';
$outputText .= "\n".' </TR>';
$outputText .= "\n".' <TR>';
$outputText .= "\n".' <TD style="'.$frameStyle.'" colspan="9"><IMG src="Local/vide.gif" alt="" width="400" height="1"></TD>';
$outputText .= "\n".' </TR>';
$outputText .= "\n".' <TR>';
$outputText .= "\n".' <TD style="'.$frameStyle.'"><IMG src="Local/vide.gif" alt="" width="1" height="10"></TD>';
$outputText .= "\n".' <TD style="'.$backStyle.'" colspan="7"><IMG src="Local/vide.gif" alt="" width="398" height="1"></TD>';
$outputText .= "\n".' <TD style="'.$frameStyle.'"><IMG src="Local/vide.gif" alt="" width="1" height="10"></TD>';
$outputText .= "\n".' </TR>';
$outputText .= "\n".' <TR>';
$outputText .= "\n".' <TD style="'.$frameStyle.'"><IMG src="Local/vide.gif" alt="" width="1" height="10"></TD>';
$outputText .= "\n".' <TD style="'.$texttStyle.'" colspan="7">&nbsp;text tiny</TD>';
$outputText .= "\n".' <TD style="'.$frameStyle.'"><IMG src="Local/vide.gif" alt="" width="1" height="10"></TD>';
$outputText .= "\n".' </TR>';
$outputText .= "\n".' <TR>';
$outputText .= "\n".' <TD style="'.$frameStyle.'"><IMG src="Local/vide.gif" alt="" width="1" height="10"></TD>';
$outputText .= "\n".' <TD style="'.$textsStyle.'" colspan="7">&nbsp;text medium</TD>';
$outputText .= "\n".' <TD style="'.$frameStyle.'"><IMG src="Local/vide.gif" alt="" width="1" height="10"></TD>';
$outputText .= "\n".' </TR>';
$outputText .= "\n".' <TR>';
$outputText .= "\n".' <TD style="'.$frameStyle.'"><IMG src="Local/vide.gif" alt="" width="1" height="10"></TD>';
$outputText .= "\n".' <TD style="'.$textbStyle.'" colspan="7">&nbsp;text big</TD>';
$outputText .= "\n".' <TD style="'.$frameStyle.'"><IMG src="Local/vide.gif" alt="" width="1" height="10"></TD>';
$outputText .= "\n".' </TR>';
$outputText .= "\n".' <TR>';
$outputText .= "\n".' <TD style="'.$frameStyle.'"><IMG src="Local/vide.gif" alt="" width="1" height="10"></TD>';
$outputText .= "\n".' <TD style="'.$alertStyle.'" colspan="7">&nbsp;text alert</TD>';
$outputText .= "\n".' <TD style="'.$frameStyle.'"><IMG src="Local/vide.gif" alt="" width="1" height="10"></TD>';
$outputText .= "\n".' </TR>';
$outputText .= "\n".' <TR>';
$outputText .= "\n".' <TD style="'.$frameStyle.'"><IMG src="Local/vide.gif" alt="" width="1" height="10"></TD>';
$outputText .= "\n".' <TD style="'.$backStyle.'" colspan="7"><IMG src="Local/vide.gif" alt="" width="398" height="1"></TD>';
$outputText .= "\n".' <TD style="'.$frameStyle.'"><IMG src="Local/vide.gif" alt="" width="1" height="10"></TD>';
$outputText .= "\n".' </TR>';
$outputText .= "\n".' <TR>';
$outputText .= "\n".' <TD style="'.$frameStyle.'"><IMG src="Local/vide.gif" alt="" width="1" height="10"></TD>';
$outputText .= "\n".' <TD style="'.$labelStyle.'" colspan="7">&nbsp;label</TD>';
$outputText .= "\n".' <TD style="'.$frameStyle.'"><IMG src="Local/vide.gif" alt="" width="1" height="10"></TD>';
$outputText .= "\n".' </TR>';
$outputText .= "\n".' <TR>';
$outputText .= "\n".' <TD style="'.$frameStyle.'"><IMG src="Local/vide.gif" alt="" width="1" height="10"></TD>';
$outputText .= "\n".' <TD style="'.$inputStyle.'" colspan="7">&nbsp;input</TD>';
$outputText .= "\n".' <TD style="'.$frameStyle.'"><IMG src="Local/vide.gif" alt="" width="1" height="10"></TD>';
$outputText .= "\n".' </TR>';
$outputText .= "\n".' <TR>';
$outputText .= "\n".' <TD style="'.$frameStyle.'"><IMG src="Local/vide.gif" alt="" width="1" height="10"></TD>';
$outputText .= "\n".' <TD style="'.$backStyle.'" colspan="7"><IMG src="Local/vide.gif" alt="" width="398" height="1"></TD>';
$outputText .= "\n".' <TD style="'.$frameStyle.'"><IMG src="Local/vide.gif" alt="" width="1" height="10"></TD>';
$outputText .= "\n".' </TR>';
$outputText .= "\n".' <TR>';
$outputText .= "\n".' <TD style="'.$frameStyle.'" colspan="9"><IMG src="Local/vide.gif" alt="" width="400" height="1"></TD>';
$outputText .= "\n".' </TR>';
$outputText .= "\n".' </TABLE><BR></TD>';
$outputText .= "\n".' </TR>';
$outputText .= "\n".' <TR><TD colspan="6"><IMG src="Local/vide.gif" alt="" width="1" height="10"></TD></TR>';
$outputText .= "\n".' <TR>';
$outputText .= "\n".' <TD align="center" colspan="6"><TABLE border="0" summary="" width="100%" cellpadding="0" cellspacing="0">';
$outputText .= "\n".' <TR>';
$outputText .= "\n".' <TD align="center"><INPUT type="image" src="Local/icons/validate.gif"></TD>';
$outputText .= "\n".' <TD align="center"><A href="'.$baseURL.'"><IMG '.
'border="0" src="Local/icons/cancel.gif" alt="" width="16" height="16"></A></TD>';
$outputText .= "\n".' </TR>';
$outputText .= "\n".' </TABLE></TD>';
$outputText .= "\n".' </TR>';
$outputText .= "\n".' </TABLE>';
$outputText .= "\n".' <INPUT type="hidden" name="guscmd" value="commitupdsty">';
$outputText .= "\n".' <INPUT type="hidden" name="gusstyid" value="'.$gusstyid.'">';
$outputText .= $baseHidden;
$outputText .= "\n".' </FORM></TD>';
$outputText .= "\n".'</TR>';
return $outputText;
}
 
//==============================================================================
//==============================================================================
 
function commitUpdStyle ($db, $link, $locale, $gusstyid, &$msg) {
//----------------------------------------------------------------------------
// Form variables.
global $gusname;
global $guscoltxt;
global $guscolinvtxt;
global $guscolalttxt;
global $guscol1;
global $guscol2;
global $guscol3;
global $guscol4;
global $guscol5;
global $guscol6;
global $guscol7;
global $gusfontf;
global $gusfontt;
global $gusfonts;
global $gusfontb;
//----------------------------------------------------------------------------
// We have to update the name ?
if ($gusname != $gusstyid) {
$query = "select * from $db.STYLE where S_NAME='$gusname'";
$result = mysql_query ($query, $link);
if (! $result) {
die ("Unable to perform query ($query / " . mysql_error ($link) . ")");
}
$row = mysql_fetch_row ($result);
mysql_free_result ($result);
if ($row) {
$msg =
gs_getLabel ($db, $link, 'gus_duplicate_sty', $locale, 'gus').
"&nbsp;($gusname)";
return $gusstyid;
}
}
$query =
"update $db.STYLE set".
" S_NAME='$gusname'".
", S_COLOR_TEXT='$guscoltxt'".
", S_COLOR_TEXT_INVERSE='$guscolinvtxt'".
", S_COLOR_TEXT_ALERT='$guscolalttxt'".
", S_COLOR_1='$guscol1'".
", S_COLOR_2='$guscol2'".
", S_COLOR_3='$guscol3'".
", S_COLOR_4='$guscol4'".
", S_COLOR_5='$guscol5'".
", S_COLOR_6='$guscol6'".
", S_COLOR_7='$guscol7'".
", S_FONT_FAMILY='$gusfontf'".
", S_FONT_SIZE_TINY='$gusfontt'".
", S_FONT_SIZE_SMALL='$gusfonts'".
", S_FONT_SIZE_BIG='$gusfontb'".
" where S_NAME='$gusstyid'";
$result = mysql_query ($query, $link);
if (! $result) {
die ("Unable to perform query ($query / " . mysql_error ($link) . ")");
}
return $gusname;
}
 
//==============================================================================
//==============================================================================
 
function listStyles ($db, $link, $project, $locale,
$baseURL, $baseURLjs,
$msg) {
//----------------------------------------------------------------------------
// Javascript.
$goMsg = addslashes (gs_getLabel ($db, $link, 'delete', $locale, 'gsite', false));
js_register ('modifyStyle',
" function modifyStyle (oSelect) {"."\n".
" var url = '$baseURLjs'+'&guscmd=updsty';"."\n".
" if (oSelect.selectedIndex != -1) {"."\n".
" url += '&gusstyid='+oSelect.options[oSelect.selectedIndex].value;"."\n".
" document.location = url;"."\n".
" }"."\n".
" }"."\n"
);
js_register ('deleteStyle',
" function deleteStyle (oSelect) {"."\n".
" var url = '$baseURLjs'+'&guscmd=delsty';"."\n".
" if (oSelect.selectedIndex != -1) {"."\n".
" url += '&gusstyid='+oSelect.options[oSelect.selectedIndex].value;"."\n".
" if (window.confirm ('$goMsg')) {"."\n".
" document.location = url;"."\n".
" }"."\n".
" }"."\n".
" }"."\n"
);
//----------------------------------------------------------------------------
// Buttons.
$i = 0;
//-- Modify style.
$btInfos1[$i++] = array (
'text' => 'gus_mod',
'appl' => 'gus',
'url' => 'javascript:modifyStyle (document.gform.gselect)');
//-- Add style.
$btInfos1[$i++] = array (
'text' => 'gus_add',
'appl' => 'gus',
'url' => $baseURL.'&amp;guscmd=addsty');
//-- Delete style.
$btInfos1[$i++] = array (
'text' => 'gus_del',
'appl' => 'gus',
'url' => 'javascript:deleteStyle (document.gform.gselect)');
$btInfos1[$i++] = array ('space' => true);
//-- Logout.
$btInfos1[$i++] = array (
'text' => 'logout',
'appl' => 'gsite',
'url' => $baseURL.'&amp;auth_logout=1');
$button1 =
gs_genericButtons ($db, $link, $locale,
$btInfos1,
false);
//----------------------------------------------------------------------------
// List styles.
$query = "select * from $db.STYLE order by S_NAME";
$STYresult = mysql_query ($query, $link);
 
if (! $STYresult) {
die ("Unable to perform query ($query / " . mysql_error ($link) . ")");
}
//----------------------------------------------------------------------------
// Build form.
$text = '';
$text .= "\n".'<FORM name="gform" action="document.php" method="get">';
$text .= "\n".' <SELECT class="gusInput" name="gselect" size="20" ondblclick="javascript:modifyStyle (document.gform.gselect)">';
while ($row = mysql_fetch_object ($STYresult)) {
$text .= "\n".' <OPTION value="'.htmlentities ($row->S_NAME).'">';
$text .= htmlentities ($row->S_NAME);
$text .= '</OPTION>';
}
$text .= "\n".' </SELECT>';
$text .= "\n".'</FORM>';
mysql_free_result ($STYresult);
//----------------------------------------------------------------------------
// Build page.
$title = gs_getLabel ($db, $link, 'gus_title3', $locale, 'gus');
return
buildPage (
$button1,
'',
$title,
$text,
$msg);
}
 
//------------------------------------------------------------------------------
// $Log: not supported by cvs2svn $
// Revision 1.1 2003/10/10 09:58:21 alex
// installation
//
// Revision 1.1.1.1 2002/10/02 07:32:21 root
// initialisation site de Tela
//
// Revision 1.3 2002/06/14 07:23:23 lc
// Bug LC0021 : use js_register
//
// Revision 1.2 2002/05/30 14:49:39 lc
// Admin of tiny font size.
//
// Revision 1.1 2002/02/25 16:35:57 lc
// First revision.
//
//-- End of source ------------------------------------------------------------
?>