2
0
mirror of https://github.com/ACSPRI/queXS synced 2024-04-02 12:12:16 +00:00

Merging the Limesurvey 1.91+ branch of queXS in to the trunk

This commit is contained in:
azammitdcarf
2011-09-08 01:58:41 +00:00
parent dfa55a3b9e
commit eaa9578ab8
2312 changed files with 811461 additions and 597534 deletions

View File

@@ -1,3 +1,10 @@
queXS 1.5.0 - Changes since 1.4.0:
New features:
*Updated to Limesurvey 1.91+
*Data export via Limesurvey allowing for limitations by queXS questionnaire / sample
*Select the first respondent for an appointment by default
queXS 1.4.0 - Changes since 1.3.0:
New features:

View File

@@ -193,15 +193,23 @@ display_questionnaire_chooser($questionnaire_id);
if ($questionnaire_id)
{
print "<p><a href='?data&amp;questionnaire_id=$questionnaire_id'>". T_("Download all data for this questionnaire") . "</a></p>";
$sql = "SELECT lime_sid
FROM questionnaire
WHERE questionnaire_id = $questionnaire_id";
$ls = $db->GetRow($sql);
$lsid = $ls['lime_sid'];
print "<p><a href='" . LIME_URL . "admin/admin.php?action=exportresults&amp;sid=$lsid'>". T_("Download data for this questionnaire via Limesurvey") . "</a></p>";
print "<h3>" . T_("Please select a sample") . "</h3>";
$sample_import_id = false;
if (isset($_GET['sample_import_id'])) $sample_import_id = bigintval($_GET['sample_import_id']);
display_sample_chooser($questionnaire_id,$sample_import_id);
if ($sample_import_id)
{
print "<p><a href='?data&amp;questionnaire_id=$questionnaire_id&amp;sample_import_id=$sample_import_id'>" . T_("Download data for this sample") . "</a></p>";
print "<p><a href='" .LIME_URL . "admin/admin.php?action=exportresults&amp;sid=$lsid&amp;quexsfilterinc=$questionnaire_id:$sample_import_id'>" . T_("Download data for this sample via Limesurvey") . "</a></p>";
//get sample vars
$sql = "SELECT sv.var as value, sv.var as description
FROM `sample_var` as sv

View File

@@ -49,9 +49,10 @@ xhtml_head(T_("Administrative Tools"),true,array("../css/table.css","../css/admi
print "<div id='menu'><ul class='navmenu'>";
print "<li><h3>" . T_("Questionnaire creation and management") . "</h3>";
print "<ul><li><a href=\"?page=new.php\">" . T_("Create a new questionnaire") . "</a></li>";
print "<ul><li><a href='?page=" . LIME_URL ."admin/admin.php?action=newsurvey'>" . T_("Create an instrument in Limesurvey") . "</a></li>";
print "<li><a href=\"?page=new.php\">" . T_("Create a new questionnaire") . "</a></li>";
print "<li><a href=\"?page=questionnairelist.php\">" . T_("Questionnaire management") . "</a></li>";
print "<li><a href=\"?page=" . LIME_URL . "admin/admin.php\">" . T_("Administer questionnaires with Limesurvey") . "</a></li></ul></li>";
print "<li><a href=\"?page=" . LIME_URL . "admin/admin.php\">" . T_("Administer instruments with Limesurvey") . "</a></li></ul></li>";
print "<li><h3>" . T_("Sample/List management") . "</h3><ul>";
print "<li><a href=\"?page=import.php\">" . T_("Import a sample file (in CSV form)") . "</a></li>";

View File

@@ -82,25 +82,11 @@ if (isset($_POST['import_file']))
$rs_answeringmachine = $db->qstr(html_entity_decode($_POST['rs_answeringmachine'],get_magic_quotes_gpc()));
$info = $db->qstr(html_entity_decode($_POST['info'],get_magic_quotes_gpc()));
if ($_POST['select'] == "new")
{
//create one from scratch
include_once("../functions/functions.limesurvey.php");
$lime_sid = create_limesurvey_questionnaire($name);
}
else
{
//use existing lime instrument
$lime_sid = bigintval($_POST['select']);
}
if ($_POST['selectrs'] == "new")
{
//create one from scratch
include_once("../functions/functions.limesurvey.php");
$lime_rs_sid = create_limesurvey_questionnaire($db->qstr(T_("Respondent Selection for ") . $_POST['description']),false);
}
else if (is_numeric($_POST['selectrs']))
if (is_numeric($_POST['selectrs']))
{
$lime_rs_sid = bigintval($_POST['selectrs']);
}
@@ -114,7 +100,6 @@ if (isset($_POST['import_file']))
{
$qid = $db->Insert_ID();
print "<p>" . T_("Successfully inserted") . " $name " . T_("as questionnaire") . " $qid, " . T_("linked to") . " $lime_sid</p>";
print "<p>" . T_("You must now edit and activate the questionnaire") . "</p>";
}else
{
print "<p>" . T_("Error: Failed to insert questionnaire") . "</p>";
@@ -129,7 +114,7 @@ if (isset($_POST['import_file']))
<form enctype="multipart/form-data" action="" method="post">
<p><input type="hidden" name="MAX_FILE_SIZE" value="1000000000" /></p>
<p><? echo T_("Name for questionnaire:"); ?> <input type="text" name="description"/></p>
<p><? echo T_("Select creation type:"); ?> <select name="select"><option value="new"><? echo T_("Create new questionnaire in Limesurvey"); ?></option><?
<p><? echo T_("Select limesurvey instrument:");
$sql = "SELECT s.sid as sid, sl.surveyls_title AS title
FROM " . LIME_PREFIX . "surveys AS s
LEFT JOIN " . LIME_PREFIX . "surveys_languagesettings AS sl ON ( s.sid = sl.surveyls_survey_id
@@ -140,14 +125,20 @@ $surveys = $db->GetAll($sql);
if (!empty($surveys))
{
print "<select name='select'>";
foreach($surveys as $s)
{
print "<option value=\"{$s['sid']}\">" . T_("Existing questionnaire:") . " {$s['title']}</option>";
print "<option value=\"{$s['sid']}\">" . T_("Existing instrument:") . " {$s['title']}</option>";
}
print "</select>";
}
?></select></p>
else
{
print "<a href='" . LIME_URL ."admin/admin.php?action=newsurvey'>" . T_("Create an instrument in Limesurvey") ."</a>";
}
?></p>
<p><? echo T_("Respondent selection type:"); ?>
<select name="selectrs" onchange="if(this.value=='old') show(this,'rstext'); else hide(this,'rstext');"><option value="none"><? echo T_("No respondent selection (go straight to questionnaire)"); ?></option><option value="old"><? echo T_("Use basic respondent selection text (below)"); ?></option><option value="new"><? echo T_("Create new respondent selection questionnaire in Limesurvey"); ?></option>
<select name="selectrs" onchange="if(this.value=='old') show(this,'rstext'); else hide(this,'rstext');"><option value="none"><? echo T_("No respondent selection (go straight to questionnaire)"); ?></option><option value="old"><? echo T_("Use basic respondent selection text (below)"); ?></option>
<?
$sql = "SELECT s.sid as sid, sl.surveyls_title AS title
FROM " . LIME_PREFIX . "surveys AS s
@@ -161,7 +152,7 @@ if (!empty($surveys))
{
foreach($surveys as $s)
{
print "<option value=\"{$s['sid']}\">" . T_("Existing questionnaire:") . " {$s['title']}</option>";
print "<option value=\"{$s['sid']}\">" . T_("Existing instrument:") . " {$s['title']}</option>";
}
}

View File

@@ -71,6 +71,7 @@ xhtml_head(T_("Operator Performance"),true,array("../css/table.css"),array("../j
//xhtml_table($rs,array("firstName","completions","totalcalls","time","callt","CPH","CALLSPH","effectiveness"),array(T_("Operator"),T_("Completions"),T_("Calls"),T_("Total time"),T_("Call time"),T_("Completions p/h"),T_("Calls p/h"),T_("Effectiveness")));
$questionnaire_id = false;
print "<h3>" . T_("Please select a questionnaire") . "</h3>";
if (isset($_GET['questionnaire_id'])) $questionnaire_id = bigintval($_GET['questionnaire_id']);
display_questionnaire_chooser($questionnaire_id);
@@ -93,6 +94,8 @@ if ($questionnaire_id)
$rs = $db->GetAll($sql);
print "<h3>" . T_("Please select a shift") . "</h3>";
display_chooser($rs,"shift_id","shift_id",true,"questionnaire_id=$questionnaire_id");
if ($shift_id)

View File

@@ -158,7 +158,7 @@ if (isset($_GET['modify']))
echo "<h1>" . $rs['description'] . "</h1>";
echo "<p><a href='?'>" . T_("Go back") . "</a></p>";
echo "<p><a href='" . LIME_URL . "admin/admin.php?sid={$rs['lime_sid']}'>" . T_("Edit questionnaire in Limesurvey") . "</a></p>";
echo "<p><a href='" . LIME_URL . "admin/admin.php?sid={$rs['lime_sid']}'>" . T_("Edit instrument in Limesurvey") . "</a></p>";
?>
<form action="?modify=<? echo $questionnaire_id; ?>" method="post">
<p><? echo T_("Name for questionnaire:"); ?> <input type="text" name="description" value="<? echo $rs['description']; ?>"/></p>

View File

@@ -66,6 +66,7 @@ $sql = "SELECT ca1 AS callattempts, COUNT( ca1 ) AS sample
xhtml_table($db->GetAll($sql),array("sample","callattempts"),array(T_("Number of cases"),T_("Call attempts made")),"tclass",false,array("sample"));
print "<h2>" . T_("Please select a questionnaire") . "</h2>";
$questionnaire_id = false;
if (isset($_GET['questionnaire_id'])) $questionnaire_id = bigintval($_GET['questionnaire_id']);
display_questionnaire_chooser($questionnaire_id);
@@ -79,9 +80,14 @@ if ($questionnaire_id)
GROUP BY call_attempt.case_id) AS t1
GROUP BY ca1";
print "<h2>" . T_("This project") . "</h2>";
xhtml_table($db->GetAll($sql),array("sample","callattempts"),array(T_("Number of cases"),T_("Call attempts made")),"tclass",false,array("sample"));
$cal = $db->GetAll($sql);
if (!empty($cal))
{
xhtml_table($cal,array("sample","callattempts"),array(T_("Number of cases"),T_("Call attempts made")),"tclass",false,array("sample"));
print "<h2>" . T_("Please select a sample") . "</h2>";
$sample_import_id = false;
if (isset($_GET['sample_import_id'])) $sample_import_id = bigintval($_GET['sample_import_id']);
display_sample_chooser($questionnaire_id,$sample_import_id);
@@ -96,11 +102,15 @@ if ($questionnaire_id)
GROUP BY call_attempt.case_id) AS t1
GROUP BY ca1";
print "<h2>" . T_("This sample") . "</h2>";
xhtml_table($db->GetAll($sql),array("sample","callattempts"),array(T_("Number of cases"),T_("Call attempts made")),"tclass",false,array("sample"));
$cal = $db->GetAll($sql);
if (!empty($cal))
{
xhtml_table($cal,array("sample","callattempts"),array(T_("Number of cases"),T_("Call attempts made")),"tclass",false,array("sample"));
$questionnaire_sample_quota_row_id = false;
if (isset($_GET['questionnaire_sample_quota_row_id'])) $questionnaire_sample_quota_row_id = bigintval($_GET['questionnaire_sample_quota_row_id']);
print "<h2>" . T_("Please select a quota") . "</h2>";
display_quota_chooser($questionnaire_id,$sample_import_id,$questionnaire_sample_quota_row_id);
if ($questionnaire_sample_quota_row_id)
@@ -115,16 +125,21 @@ if ($questionnaire_id)
GROUP BY call_attempt.case_id) AS t1
GROUP BY ca1";
print "<h2>" . T_("This quota") . "</h2>";
xhtml_table($db->GetAll($sql),array("sample","callattempts"),array(T_("Number of cases"),T_("Call attempts made")),"tclass",false,array("sample"));
$cal = $db->GetAll($sql);
if (empty($cal))
print "<p>" . T_("No calls for this quota") . "</p>";
else
xhtml_table($cal,array("sample","callattempts"),array(T_("Number of cases"),T_("Call attempts made")),"tclass",false,array("sample"));
}
}
else
print "<p>" . T_("No calls for this sample") . "</p>";
}
}
else
print "<p>" . T_("No calls for this questionnaire") . "</p>";
}
xhtml_foot();
?>

View File

@@ -121,7 +121,9 @@ xhtml_head(T_("Appointment"),true,array("css/respondent.css"),$js);
//select a respondent from a list or create a new one
print("<p>" . T_("Select a respondent") . "</p>");
display_respondent_list($case_id,isset($_GET['respondent_id'])?bigintval($_GET['respondent_id']):false);
$sr = display_respondent_list($case_id,isset($_GET['respondent_id'])?bigintval($_GET['respondent_id']):false,true);
if ($sr != false) $_GET['respondent_id'] = $sr;
if(isset($_GET['respondent_id']) && $_GET['respondent_id'] == 0)
{

File diff suppressed because it is too large Load Diff

View File

@@ -178,8 +178,9 @@ function return_contact_phone_list($case_id)
*
* @param int $case_id The case ID
* @param bool|int $respondent_id The respondent already selected or false if none selected
* @param bool $first Select the first respondent available if none specifically selected?
*/
function display_respondent_list($case_id,$respondent_id = false)
function display_respondent_list($case_id,$respondent_id = false,$first = false)
{
global $db;
@@ -195,6 +196,13 @@ function display_respondent_list($case_id,$respondent_id = false)
foreach($rs as $r)
{
$rid = $r['respondent_id'];
if ($respondent_id == false && $first == true)
{
$first = false;
$selected = "selected='selected'";
$respondent_id = $rid;
}
else
$selected = "";
if ($rid == $respondent_id) $selected="selected='selected'";
print "<option value='?respondent_id=$rid' $selected>{$r['firstName']} {$r['lastName']}</option>";
@@ -202,6 +210,7 @@ function display_respondent_list($case_id,$respondent_id = false)
}
print "<option value='?respondent_id=0' class='addresp'>" . T_("Add respondent") . "</option></select></div>";
return $respondent_id;
}

View File

@@ -173,7 +173,8 @@ function get_stats_by_shift($questionnaire_id,$shift_id)
*/
function sec_to_time($seconds)
{
$h = 0;
$m = 0;
if($seconds >= 3600){
$h = floor($seconds/3600);
$seconds = ($seconds%3600);

View File

@@ -117,10 +117,16 @@ function xhtml_table($content,$fields,$head = false,$class = "tclass",$highlight
foreach ($fields as $e)
{
print "<td>{$row[$e]}</td>";
print "<td>";
if (isset($row[$e])) print $row[$e];
print "</td>";
if ($total && in_array($e,$total))
{
if (!isset($tot[$e]))
$tot[$e] = 0;
$tot[$e] += $row[$e];
}
}
print "</tr>";
}
if ($total)

View File

@@ -1,7 +1,7 @@
<?php
/**
* LimeSurvey
* Copyright (C) 2007 The LimeSurvey Project Team / Carsten Schmitz
* Copyright (C) 2010 The LimeSurvey Project Team / Carsten Schmitz
* All rights reserved.
* License: GNU/GPL License v2 or later, see LICENSE.php
* LimeSurvey is free software. This version may have been modified pursuant
@@ -10,7 +10,7 @@
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*
* $Id: COPYRIGHT.php 5431 2008-08-16 21:05:52Z c_schmitz $
* $Id: COPYRIGHT.php 8540 2010-03-31 11:37:19Z texens $
*/
// no direct access
@@ -18,84 +18,48 @@ if (!isset($dbprefix) || isset($_REQUEST['dbprefix'])) {die("Cannot run this scr
?>
LimeSurvey derives from copyrighted works licensed under the GNU General
Public License. This version has been modified pursuant to the
GNU General Public License as of August 5, 2007, and as distributed,
it includes or is derivative of works licensed under the GNU General
Public License or other free or open source software licenses, including
works copyrighted by any or all of the following, from 2003 through 2007:
Public License. This version has been modified pursuant to the GNU
General Public License as of August 5, 2007, and as distributed, it
includes or is derivative of works licensed under the GNU General Public
License or other free or open source software licenses, including works
copyrighted by any or all of the following, from 2003 through 2010:
Jason Cleeland, Carsten Schmitz, Thibault Le Meur, Josef Prandstetter,
David Olivier, Gustavo San Roman, Sébastien Gaugry, Esteban Adrián Pérez,
Gasper Koren, Yeung Kai Sun, Shawn Wales, Ronald Leenes, Mario Marani,
Darrel O'Pry, Marco Ermini, Patrick McKnight, Chris Wessells, Johannes Kutsam,
Karyl Stein, Arjen Gideonse, Nikolay Tsanov, Thomas Lee, Liang Zhao,
Katarina Pavic, Mikkel Skovgaard Sørensen, Rolf Njor Jensen, Johan Geertsma,
Ronald Leenes, Peter De Berdt, Patrick Drews, Peter Sereinigg,
Artemis Mendrinos, David Selmeczi, Gabriele Carioli, Masaru Ryumae,
Odd-Jarle Kristoffersen, Eirik Sunde, Rosaura Gazzola, Job Vieira Lúcio,
Bogdan Anastasiei, Alexei G. Tchernov, Alexander Shilov, Gasper Koren,
Luis M. Martinez, Juan Rafael Fernández, Jose Luis Ramirez, Björn Mildh,
Niklas Andersson, Vinh Ngo and Mitchell Butler.
Tony Partner, David Olivier, Gustavo San Roman, S<EFBFBD>bastien Gaugry,
Esteban Adri<72>n P<>rez, Gasper Koren, Yeung Kai Sun, Shawn Wales, Ronald
Leenes, Mario Marani, Darrel O'Pry, Marco Ermini, Patrick McKnight,
Chris Wessells, Johannes Kutsam, Livio Finos, Karyl Stein, Arjen
Gideonse, Nikolay Tsanov, Thomas Lee, Liang Zhao, Katarina Pavic, Mikkel
Skovgaard S<>rensen, Rolf Njor Jensen, Johan Geertsma, Ronald Leenes,
Peter De Berdt, Patrick Drews, Peter Sereinigg, Artemis Mendrinos, David
Selmeczi, Gabriele Carioli, Masaru Ryumae, Odd-Jarle Kristoffersen,
Eirik Sunde, Rosaura Gazzola, Job Vieira L<>cio, Bogdan Anastasiei,
Alexei G. Tchernov, Alexander Shilov, Gasper Koren, Luis M. Martinez,
Juan Rafael Fern<72>ndez, Jose Luis Ramirez, Bj<42>rn Mildh, Niklas Andersson,
Vinh Ngo and Mitchell Butler. LimeSurvey also includes or is derivative
of works distributed under the following copyright notices: PHPSurveyor
---- Copyright: Jason Cleeland, 2003 License: GNU General Public License
(GPL V2 or later) ADOdb ---- Copyright: John Lim, 2004 License: GNU
Lesser General Public License (LGPL) PHP-gettext ---- Copyright: Danilo
Segan, 2003, 2006 License: GNU General Public License (GPL V2 or later)
LimeSurvey also includes or is derivative of works distributed under the following copyright notices:
DHTML Calendar Widget ---- Copyright: Mihai Bazon, 2002-2005 License:
GNU Lesser General Public License (LGPL) Slider ---- Copyright: Erik
Arvidsson, 1999 - 2002 License: GNU General Public License SHA256 static
class ---- Copyright: Developer's Network (2005) Author: feyd _at_
devnetwork .dot. net License: GNU Lesser General Public License (LGPL)
PHPSurveyor
----
Copyright: Jason Cleeland, 2003
License: GNU General Public License (GPL V2 or later)
tabPANE ---- Copyright: Emil A Eklund (2004) http://webfx.eae.net
License: Apache Software License 2.0 PEAR ---- Copyright: 1997-2004 The
PHP Group License: PHP license phpMailer ---- Copyright: 2001 - 2003
Brent R. Matzelle License: GNU Lesser General Public License (LGPL)
ADOdb
----
Copyright: John Lim, 2004
Sanitize Library ---- Copyright: 2002,2003 Free Software Foundation
License: GNU General Public License (GPL) TCPDF Class ---- Copyright:
2006 Nicola Asuni License: GNU Lesser General Public License (LGPL)
mint_idea Template ---- Copyright: David Kohout
http://www.davidkohout.cz License: GNU General Public License (GPL)
arPHP Class ---- Copyright: 2009 Khaled Al-Shamaa http://www.ar-php.org
License: GNU Lesser General Public License (LGPL)
PHP-gettext
----
Copyright: Danilo Segan, 2003, 2006
License: GNU General Public License (GPL V2 or later)
DHTML Calendar Widget
----
Copyright: Mihai Bazon, 2002-2005
License: GNU Lesser General Public License (LGPL)
Slider
----
Copyright: Erik Arvidsson, 1999 - 2002
License: GNU General Public License
SHA256 static class
----
Copyright: Developer's Network (2005)
Author: feyd _at_ devnetwork .dot. net
License: GNU Lesser General Public License (LGPL)
tabPANE
----
Copyright: Emil A Eklund (2004) http://webfx.eae.net
License: Apache Software License 2.0
PEAR
----
Copyright: 1997-2004 The PHP Group
License: PHP license
phpMailer
----
Copyright: 2001 - 2003 Brent R. Matzelle
License: GNU Lesser General Public License (LGPL)
Sanitize Library
----
Copyright: 2002,2003 Free Software Foundation
License: GNU General Public License (GPL)
TCPDF Class
----
Copyright: 2006 Nicola Asuni
License: GNU Lesser General Public License (LGPL)
mint_idea Template
----
Copyright: David Kohout http://www.davidkohout.cz
License: GNU General Public License (GPL)

View File

@@ -1,340 +1,266 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991
Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA Everyone is permitted to copy and distribute verbatim
copies of this license document, but changing it is not allowed.
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
Preamble The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
General Public License applies to most of the Free Software Foundation's
software and to any other program whose authors commit to using it.
(Some other Free Software Foundation software is covered by the GNU
Library General Public License instead.) You can apply it to your
programs, too. When we speak of free software, we are referring to
freedom, not price. Our General Public Licenses are designed to make
sure that you have the freedom to distribute copies of free software
(and charge for this service if you wish), that you receive source code
or can get it if you want it, that you can change the software or use
pieces of it in new free programs; and that you know you can do these
things. To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
distribute copies of the software, or if you modify it. For example, if
you distribute copies of such a program, whether gratis or for a fee,
you must give the recipients all the rights that you have. You must make
sure that they, too, receive or can get the source code. And you must
show them these terms so they know their rights. We protect your rights
with two steps: (1) copyright the software, and (2) offer you this
license which gives you legal permission to copy, distribute and/or
modify the software. Also, for each author's protection and ours, we
want to make certain that everyone understands that there is no warranty
for this free software. If the software is modified by someone else and
passed on, we want its recipients to know that what they have is not the
original, so that any problems introduced by others will not reflect on
the original authors' reputations. Finally, any free program is
threatened constantly by software patents. We wish to avoid the danger
that redistributors of a free program will individually obtain patent
licenses, in effect making the program proprietary. To prevent this, we
have made it clear that any patent must be licensed for everyone's free
use or not licensed at all. The precise terms and conditions for
copying, distribution and modification follow. GNU GENERAL PUBLIC
LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
0. This License applies to any program or other work which contains a
notice placed by the copyright holder saying it may be distributed under
the terms of this General Public License. The "Program", below, refers
to any such program or work, and a "work based on the Program" means
either the Program or any derivative work under copyright law: that is
to say, a work containing the Program or a portion of it, either
verbatim or with modifications and/or translated into another language.
(Hereinafter, translation is included without limitation in the term
"modification".) Each licensee is addressed as "you". Activities other
than copying, distribution and modification are not covered by this
License; they are outside its scope. The act of running the Program is
not restricted, and the output from the Program is covered only if its
contents constitute a work based on the Program (independent of having
been made by running the Program). Whether that is true depends on what
the Program does. 1. You may copy and distribute verbatim copies of the
Program's source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the notices
that refer to this License and to the absence of any warranty; and give
any other recipients of the Program a copy of this License along with
the Program. You may charge a fee for the physical act of transferring a
copy, and you may at your option offer warranty protection in exchange
for a fee. 2. You may modify your copy or copies of the Program or any
portion of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
above, provided that you also meet all of these conditions: a) You must
cause the modified files to carry prominent notices stating that you
changed the files and the date of any change. b) You must cause any work
that you distribute or publish, that in whole or in part contains or is
derived from the Program or any part thereof, to be licensed as a whole
at no charge to all third parties under the terms of this License. c) If
the modified program normally reads commands interactively when run, you
must cause it, when started running for such interactive use in the most
ordinary way, to print or display an announcement including an
appropriate copyright notice and a notice that there is no warranty (or
else, saying that you provide a warranty) and that users may
redistribute the program under these conditions, and telling the user
how to view a copy of this License. (Exception: if the Program itself is
interactive but does not normally print such an announcement, your work
based on the Program is not required to print an announcement.) These
requirements apply to the modified work as a whole. If identifiable
sections of that work are not derived from the Program, and can be
reasonably considered independent and separate works in themselves, then
this License, and its terms, do not apply to those sections when you
distribute them as separate works. But when you distribute the same
sections as part of a whole which is a work based on the Program, the
distribution of the whole must be on the terms of this License, whose
permissions for other licensees extend to the entire whole, and thus to
each and every part regardless of who wrote it. Thus, it is not the
intent of this section to claim rights or contest your rights to work
written entirely by you; rather, the intent is to exercise the right to
control the distribution of derivative or collective works based on the
Program. In addition, mere aggregation of another work not based on the
Program with the Program (or with a work based on the Program) on a
volume of a storage or distribution medium does not bring the other work
under the scope of this License. 3. You may copy and distribute the
Program (or a work based on it, under Section 2) in object code or
executable form under the terms of Sections 1 and 2 above provided that
you also do one of the following: a) Accompany it with the complete
corresponding machine-readable source code, which must be distributed
under the terms of Sections 1 and 2 above on a medium customarily used
for software interchange; or, b) Accompany it with a written offer,
valid for at least three years, to give any third party, for a charge no
more than your cost of physically performing source distribution, a
complete machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
customarily used for software interchange; or, c) Accompany it with the
information you received as to the offer to distribute corresponding
source code. (This alternative is allowed only for noncommercial
distribution and only if you received the program in object code or
executable form with such an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
making modifications to it. For an executable work, complete source code
means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to control
compilation and installation of the executable. However, as a special
exception, the source code distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies the
executable. If distribution of executable or object code is made by
offering access to copy from a designated place, then offering
equivalent access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
compelled to copy the source along with the object code. 4. You may not
copy, modify, sublicense, or distribute the Program except as expressly
provided under this License. Any attempt otherwise to copy, modify,
sublicense or distribute the Program is void, and will automatically
terminate your rights under this License. However, parties who have
received copies, or rights, from you under this License will not have
their licenses terminated so long as such parties remain in full
compliance. 5. You are not required to accept this License, since you
have not signed it. However, nothing else grants you permission to
modify or distribute the Program or its derivative works. These actions
are prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
Program), you indicate your acceptance of this License to do so, and all
its terms and conditions for copying, distributing or modifying the
Program or works based on it. 6. Each time you redistribute the Program
(or any work based on the Program), the recipient automatically receives
a license from the original licensor to copy, distribute or modify the
Program subject to these terms and conditions. You may not impose any
further restrictions on the recipients' exercise of the rights granted
herein. You are not responsible for enforcing compliance by third
parties to this License. 7. If, as a consequence of a court judgment or
allegation of patent infringement or for any other reason (not limited
to patent issues), conditions are imposed on you (whether by court
order, agreement or otherwise) that contradict the conditions of this
License, they do not excuse you from the conditions of this License. If
you cannot distribute so as to satisfy simultaneously your obligations
under this License and any other pertinent obligations, then as a
consequence you may not distribute the Program at all. For example, if a
patent license would not permit royalty-free redistribution of the
Program by all those who receive copies directly or indirectly through
you, then the only way you could satisfy both it and this License would
be to refrain entirely from distribution of the Program. If any portion
of this section is held invalid or unenforceable under any particular
circumstance, the balance of the section is intended to apply and the
section as a whole is intended to apply in other circumstances. It is
not the purpose of this section to induce you to infringe any patents or
other property right claims or to contest validity of any such claims;
this section has the sole purpose of protecting the integrity of the
free software distribution system, which is implemented by public
license practices. Many people have made generous contributions to the
wide range of software distributed through that system in reliance on
consistent application of that system; it is up to the author/donor to
decide if he or she is willing to distribute software through any other
system and a licensee cannot impose that choice. This section is
intended to make thoroughly clear what is believed to be a consequence
of the rest of this License. 8. If the distribution and/or use of the
Program is restricted in certain countries either by patents or by
copyrighted interfaces, the original copyright holder who places the
Program under this License may add an explicit geographical distribution
limitation excluding those countries, so that distribution is permitted
only in or among countries not thus excluded. In such case, this License
incorporates the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
address new problems or concerns. Each version is given a distinguishing
version number. If the Program specifies a version number of this
License which applies to it and "any later version", you have the option
of following the terms and conditions either of that version or of any
later version published by the Free Software Foundation. If the Program
does not specify a version number of this License, you may choose any
version ever published by the Free Software Foundation. 10. If you wish
to incorporate parts of the Program into other free programs whose
distribution conditions are different, write to the author to ask for
permission. For software which is copyrighted by the Free Software
Foundation, write to the Free Software Foundation; we sometimes make
exceptions for this. Our decision will be guided by the two goals of
preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally. NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE
ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH
YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS
REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT
HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE
PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS
OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR
THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply
These Terms to Your New Programs If you develop a new program, and you
want it to be of the greatest possible use to the public, the best way
to achieve this is to make it free software which everyone can
redistribute and change under these terms. To do so, attach the
following notices to the program. It is safest to attach them to the
start of each source file to most effectively convey the exclusion of
warranty; and each file should have at least the "copyright" line and a
pointer to where the full notice is found.
END OF TERMS AND CONDITIONS
<one
line to give the program's name and a brief idea of what it does.>
Copyright (C)
<year>
<name of author>
How to Apply These Terms to Your New Programs
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version. This program 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 General Public License for more details. You should have received a
copy of the GNU General Public License along with this program; if not,
write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
Boston, MA 02111-1307 USA Also add information on how to contact you by
electronic and paper mail. If the program is interactive, make it output
a short notice like this when it starts in an interactive mode:
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
Gnomovision version 69, Copyright (C) year name of author Gnomovision
comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is
free software, and you are welcome to redistribute it under certain
conditions; type `show c' for details. The hypothetical commands `show
w' and `show c' should show the appropriate parts of the General Public
License. Of course, the commands you use may be called something other
than `show w' and `show c'; they could even be mouse-clicks or menu
items--whatever suits your program. You should also get your employer
(if you work as a programmer) or your school, if any, to sign a
"copyright disclaimer" for the program, if necessary. Here is a sample;
alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest
in the program `Gnomovision' (which makes passes at compilers) written
by James Hacker.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.
<signature of Ty Coon>
, 1 April 1989 Ty Coon, President of Vice This General Public License
does not permit incorporating your program into proprietary programs. If
your program is a subroutine library, you may consider it more useful to
permit linking proprietary applications with the library. If this is
what you want to do, use the GNU Library General Public License instead
of this License.

View File

@@ -1,5 +0,0 @@
AuthType Basic
AuthName "queXS CATI: Authentication Required"
AuthUserFile /var/opt/quexs/htpasswd
AuthGroupFile /var/opt/quexs/htgroup
require group admin

View File

@@ -10,7 +10,7 @@
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*
* $Id: access_denied.php 7140 2009-06-18 06:56:20Z mennodekker $
* $Id: access_denied.php 10925 2011-09-02 14:12:02Z c_schmitz $
*/
@@ -19,57 +19,57 @@ if (!isset($dbprefix) || isset($_REQUEST['dbprefix'])) {die("Cannot run this scr
if (isset($_SESSION['loginID']))
{
$accesssummary = "<br /><strong>".$clang->gT("Access denied!")."</strong><br />\n";
$accesssummary = "<p><strong>".$clang->gT("Access denied!")."</strong><br />\n";
$action=returnglobal('action');
if ( $action == "dumpdb" )
{
$accesssummary .= "<p>".$clang->gT("You are not allowed dump the database!")."</p>";
$accesssummary .= "<p>".$clang->gT("You are not allowed dump the database!")."<br />";
$accesssummary .= "<a href='$scriptname'>".$clang->gT("Continue")."</a><br />&nbsp;\n";
}
elseif($action == "dumplabel")
{
$accesssummary .= "<p>".$clang->gT("You are not allowed export a label set!")."</p>";
$accesssummary .= "<p>".$clang->gT("You are not allowed export a label set!")."<br />";
$accesssummary .= "<a href='$scriptname'>".$clang->gT("Continue")."</a><br />&nbsp;\n";
}
elseif($action == "edituser")
{
$accesssummary .= $clang->gT("You are not allowed to change user data!");
$accesssummary .= "<p>".$clang->gT("You are not allowed to change user data!");
$accesssummary .= "<br /><br /><a href='$scriptname?action=editusers'>".$clang->gT("Continue")."</a><br />&nbsp;\n";
}
elseif($action == "newsurvey")
{
$accesssummary .= "<p>".$clang->gT("You are not allowed to create new surveys!")."</p>";
$accesssummary .= "<p>".$clang->gT("You are not allowed to create new surveys!")."<br />";
$accesssummary .= "<a href='$scriptname'>".$clang->gT("Continue")."</a><br />&nbsp;\n";
}
elseif($action == "deletesurvey")
{
$accesssummary .= "<p>".$clang->gT("You are not allowed to delete this survey!")."</p>";
$accesssummary .= "<p>".$clang->gT("You are not allowed to delete this survey!")."<br />";
$accesssummary .= "<a href='$scriptname?sid={$sid}'>".$clang->gT("Continue")."</a><br />&nbsp;\n";
}
elseif($action == "addquestion")
{
$accesssummary .= "<p>".$clang->gT("You are not allowed to add new questions for this survey!")."</p>";
$accesssummary .= "<p>".$clang->gT("You are not allowed to add new questions for this survey!")."<br />";
$accesssummary .= "<a href='$scriptname?sid={$sid}'>".$clang->gT("Continue")."</a><br />&nbsp;\n";
}
elseif($action == "activate")
{
$accesssummary .= "<p>".$clang->gT("You are not allowed to activate this survey!")."</p>";
$accesssummary .= "<p>".$clang->gT("You are not allowed to activate this survey!")."<br />";
$accesssummary .= "<a href='$scriptname?sid={$sid}'>".$clang->gT("Continue")."</a><br />&nbsp;\n";
}
elseif($action == "deactivate")
{
$accesssummary .= "<p>".$clang->gT("You are not allowed to deactivate this survey!")."</p>";
$accesssummary .= "<p>".$clang->gT("You are not allowed to deactivate this survey!")."<br />";
$accesssummary .= "<a href='$scriptname?sid={$sid}'>".$clang->gT("Continue")."</a><br />&nbsp;\n";
}
elseif($action == "addgroup")
{
$accesssummary .= "<p>".$clang->gT("You are not allowed to add a group to this survey!")."</p>";
$accesssummary .= "<p>".$clang->gT("You are not allowed to add a group to this survey!")."<br />";
$accesssummary .= "<a href='$scriptname?sid={$sid}'>".$clang->gT("Continue")."</a><br />&nbsp;\n";
}
elseif($action == "ordergroups")
{
$accesssummary .= "<p>".$clang->gT("You are not allowed to order groups in this survey!")."</p>";
$accesssummary .= "<p>".$clang->gT("You are not allowed to order groups in this survey!")."<br />";
$accesssummary .= "<a href='$scriptname?sid={$sid}'>".$clang->gT("Continue")."</a><br />&nbsp;\n";
}
elseif($action == "editsurvey")
@@ -115,27 +115,34 @@ if (isset($_SESSION['loginID']))
}
elseif($action == "CSRFwarn")
{
$accesssummary .= "<p><font color='red'>".$clang->gT("Security Alert")."</font>: ".$clang->gT("Someone may be trying to use your LimeSurvey session (CSRF attack suspected). If you just clicked on a malicious link, please report this to your system administrator.")."</p>";
$accesssummary .= "<a href='$scriptname?sid={$sid}'>".$clang->gT("Continue")."</a><br />&nbsp;\n";
$sURLID='';
if (isset($sid)) {
$sURLID="?sid={$sid}";
}
$accesssummary .= "<p><span color='errortitle'>".$clang->gT("Security alert")."</span>: ".$clang->gT("Someone may be trying to use your LimeSurvey session (CSRF attack suspected). If you just clicked on a malicious link, please report this to your system administrator.").'<br>'.$clang->gT('Also this problem can occur when you are working/editing in LimeSurvey in several browser windows/tabs at the same time.')."</p>";
$accesssummary .= "<a href='{$scriptname}{$sURLID}'>".$clang->gT("Continue")."</a><br />&nbsp;\n";
}
elseif($action == "FakeGET")
{
$accesssummary .= "<p><font color='red'>".$clang->gT("Security Alert")."</font>: ".$clang->gT("Someone may be trying to use your LimeSurvey session by using dangerous GET requests (CSRF attack suspected). If you just clicked on a malicious link, please report this to your system administrator.")."</p>";
$accesssummary .= "<p><span class='errortitle'>".$clang->gT("Security alert")."</span>: ".$clang->gT("Someone may be trying to use your LimeSurvey session (CSRF attack suspected). If you just clicked on a malicious link, please report this to your system administrator.").'<br>'.$clang->gT('Also this problem can occur when you are working/editing in LimeSurvey in several browser windows/tabs at the same time.')."</p>";
$accesssummary .= "<a href='$scriptname?sid={$sid}'>".$clang->gT("Continue")."</a><br />&nbsp;\n";
}
else
{
$accesssummary .= "<br />".$clang->gT("You are not allowed to perform this operation!")."<br />\n";
if(!empty($sid))
{
$accesssummary .= "<br /><br /><a href='$scriptname?sid=$sid>".$clang->gT("Continue")."</a><br />&nbsp;\n";
}
elseif(!empty($ugid))
//elseif(isset($_GET['ugid']))
{
$accesssummary .= "<br /><br /><a href='$scriptname?action=editusergroups&ugid={$ugid}'>".$clang->gT("Continue")."</a><br />&nbsp;\n";
}
else
{
$accesssummary .= "<br /><br /><a href='$scriptname'>".$clang->gT("Continue")."</a><br />&nbsp;\n";
}
}
}
?>

View File

@@ -10,579 +10,75 @@
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*
* $Id: activate.php 7453 2009-08-12 14:41:09Z c_schmitz $
* $Id: activate.php 10925 2011-09-02 14:12:02Z c_schmitz $
*/
//Ensure script is not run directly, avoid path disclosure
include_once("login_check.php"); //Login Check dies also if the script is started directly
include_once("activate_functions.php");
$postsid=returnglobal('sid');
$activateoutput='';
$qtypes=getqtypelist('','array');
if (!isset($_POST['ok']) || !$_POST['ok'])
{
if (isset($_GET['fixnumbering']) && $_GET['fixnumbering'])
{
//Fix a question id - requires renumbering a question
$oldqid = $_GET['fixnumbering'];
$query = "SELECT qid FROM {$dbprefix}questions ORDER BY qid DESC";
$result = db_select_limit_assoc($query, 1) or safe_die($query."<br />".$connect->ErrorMsg());
while ($row=$result->FetchRow()) {$lastqid=$row['qid'];}
$newqid=$lastqid+1;
$query = "UPDATE {$dbprefix}questions SET qid=$newqid WHERE qid=$oldqid";
$result = $connect->Execute($query) or safe_die($query."<br />".$connect->ErrorMsg());
//Update conditions.. firstly conditions FOR this question
$query = "UPDATE {$dbprefix}conditions SET qid=$newqid WHERE qid=$oldqid";
$result = $connect->Execute($query) or safe_die($query."<br />".$connect->ErrorMsg());
//Now conditions based upon this question
$query = "SELECT cqid, cfieldname FROM {$dbprefix}conditions WHERE cqid=$oldqid";
$result = db_execute_assoc($query) or safe_die($query."<br />".$connect->ErrorMsg());
while ($row=$result->FetchRow())
{
$switcher[]=array("cqid"=>$row['cqid'], "cfieldname"=>$row['cfieldname']);
}
if (isset($switcher))
{
foreach ($switcher as $switch)
{
$query = "UPDATE {$dbprefix}conditions
SET cqid=$newqid,
cfieldname='".str_replace("X".$oldqid, "X".$newqid, $switch['cfieldname'])."'
WHERE cqid=$oldqid";
$result = $connect->Execute($query) or safe_die($query."<br />".$connect->ErrorMsg());
}
}
//Now question_attributes
$query = "UPDATE {$dbprefix}question_attributes SET qid=$newqid WHERE qid=$oldqid";
$result = $connect->Execute($query) or safe_die($query."<br />".$connect->ErrorMsg());
//Now answers
$query = "UPDATE {$dbprefix}answers SET qid=$newqid WHERE qid=$oldqid";
$result = $connect->Execute($query) or safe_die($query."<br />".$connect->ErrorMsg());
fixNumbering($_GET['fixnumbering']);
}
$baselang = GetBaseLanguageFromSurveyID($postsid);
$groupquery = "SELECT g.gid,g.group_name,count(q.qid) as count from {$dbprefix}questions as q RIGHT JOIN {$dbprefix}groups as g ON q.gid=g.gid WHERE g.sid=$postsid AND g.language='$baselang' AND q.language='$baselang' group by g.gid,g.group_name;";
$groupresult=db_execute_assoc($groupquery) or safe_die($groupquery."<br />".$connect->ErrorMsg());
while ($row=$groupresult->FetchRow())
{ //TIBO
if ($row['count'] == 0)
{
$failedgroupcheck[]=array($row['gid'], $row['group_name'], ": ".$clang->gT("This group does not contain any question(s)."));
}
}
//CHECK TO MAKE SURE ALL QUESTION TYPES THAT REQUIRE ANSWERS HAVE ACTUALLY GOT ANSWERS
//THESE QUESTION TYPES ARE:
// # "L" -> LIST
// # "O" -> LIST WITH COMMENT
// # "M" -> MULTIPLE OPTIONS
// # "P" -> MULTIPLE OPTIONS WITH COMMENTS
// # "A", "B", "C", "E", "F", "H", "^" -> Various Array Types
// # "R" -> RANKING
// # "U" -> FILE CSV MORE
// # "I" -> FILE CSV ONE
// # ":" -> Array Multi Flexi Numbers
// # ";" -> Array Multi Flexi Text
// # "1" -> MULTI SCALE
$chkquery = "SELECT qid, question, gid FROM {$dbprefix}questions WHERE sid={$_GET['sid']} AND type IN ('L', 'O', 'M', 'P', 'A', 'B', 'C', 'E', 'F', 'R', 'J', '!', '^', ':', '1')";
$chkresult = db_execute_assoc($chkquery) or safe_die ("Couldn't get list of questions<br />$chkquery<br />".$connect->ErrorMsg());
while ($chkrow = $chkresult->FetchRow())
{
$chaquery = "SELECT * FROM {$dbprefix}answers WHERE qid = {$chkrow['qid']} ORDER BY sortorder, answer";
$charesult=$connect->Execute($chaquery);
$chacount=$charesult->RecordCount();
if (!$chacount > 0)
{
$failedcheck[]=array($chkrow['qid'], $chkrow['question'], ": ".$clang->gT("This question is a multiple answer type question but has no answers."), $chkrow['gid']);
}
}
//NOW CHECK THAT ALL QUESTIONS HAVE A 'QUESTION TYPE' FIELD
$chkquery = "SELECT qid, question, gid FROM {$dbprefix}questions WHERE sid={$_GET['sid']} AND type = ''";
$chkresult = db_execute_assoc($chkquery) or safe_die ("Couldn't check questions for missing types<br />$chkquery<br />".$connect->ErrorMsg());
while ($chkrow = $chkresult->FetchRow())
{
$failedcheck[]=array($chkrow['qid'], $chkrow['question'], ": ".$clang->gT("This question does not have a question 'type' set."), $chkrow['gid']);
}
//CHECK THAT FLEXIBLE LABEL TYPE QUESTIONS HAVE AN "LID" SET
$chkquery = "SELECT qid, question, gid FROM {$dbprefix}questions WHERE sid={$_GET['sid']} AND type IN ('F', 'H', 'W', 'Z', ':', '1') AND (lid = 0 OR lid is null)";
$chkresult = db_execute_assoc($chkquery) or safe_die ("Couldn't check questions for missing LIDs<br />$chkquery<br />".$connect->ErrorMsg());
while($chkrow = $chkresult->FetchRow()){
$failedcheck[]=array($chkrow['qid'], $chkrow['question'], ": ".$clang->gT("This question requires a Labelset, but none is set."), $chkrow['gid']);
} // while
//CHECK THAT FLEXIBLE LABEL TYPE QUESTIONS HAVE AN "LID1" SET FOR MULTI SCALE
$chkquery = "SELECT qid, question, gid FROM {$dbprefix}questions WHERE sid={$_GET['sid']} AND (type ='1') AND (lid1 = 0 OR lid1 is null)";
$chkresult = db_execute_assoc($chkquery) or safe_die ("Couldn't check questions for missing LIDs<br />$chkquery<br />".$connect->ErrorMsg());
while($chkrow = $chkresult->FetchRow()){
$failedcheck[]=array($chkrow['qid'], $chkrow['question'], ": ".$clang->gT("This question requires a second Labelset, but none is set."), $chkrow['gid']);
} // while
//NOW check that all used labelsets have all necessary languages
$chkquery = "SELECT qid, question, gid, lid FROM {$dbprefix}questions WHERE sid={$_GET['sid']} AND type IN ('F', 'H', 'W', 'Z', ':', '1') AND (lid > 0) AND (lid is not null)";
$chkresult = db_execute_assoc($chkquery) or safe_die ("Couldn't check questions for missing LID languages<br />$chkquery<br />".$connect->ErrorMsg());
$slangs = GetAdditionalLanguagesFromSurveyID($surveyid);
$baselang = GetBaseLanguageFromSurveyID($surveyid);
array_unshift($slangs,$baselang);
while ($chkrow = $chkresult->FetchRow())
{
foreach ($slangs as $surveylanguage)
{
$chkquery2 = "SELECT lid FROM {$dbprefix}labels WHERE language='$surveylanguage' AND (lid = {$chkrow['lid']}) ";
$chkresult2 = db_execute_assoc($chkquery2);
if ($chkresult2->RecordCount()==0)
{
$failedcheck[]=array($chkrow['qid'], $chkrow['question'], ": ".$clang->gT("The labelset used in this question does not exists or is missing a translation."), $chkrow['gid']);
}
} //foreach
} //while
//CHECK THAT ALL CONDITIONS SET ARE FOR QUESTIONS THAT PRECEED THE QUESTION CONDITION
//A: Make an array of all the qids in order of appearance
// $qorderquery="SELECT * FROM {$dbprefix}questions, {$dbprefix}groups WHERE {$dbprefix}questions.gid={$dbprefix}groups.gid AND {$dbprefix}questions.sid={$_GET['sid']} ORDER BY {$dbprefix}groups.sortorder, {$dbprefix}questions.title";
// $qorderresult=$connect->Execute($qorderquery) or safe_die("Couldn't generate a list of questions in order<br />$qorderquery<br />".$connect->ErrorMsg());
// $qordercount=$qorderresult->RecordCount();
// $c=0;
// while ($qorderrow=$qorderresult->FetchRow())
// {
// $qidorder[]=array($c, $qorderrow['qid']);
// $c++;
// }
//TO AVOID NATURAL SORT ORDER ISSUES, FIRST GET ALL QUESTIONS IN NATURAL SORT ORDER, AND FIND OUT WHICH NUMBER IN THAT ORDER THIS QUESTION IS
$qorderquery = "SELECT * FROM {$dbprefix}questions WHERE sid=$surveyid AND type not in ('S', 'D', 'T', 'Q')";
$qorderresult = db_execute_assoc($qorderquery) or safe_die ("$qorderquery<br />".$connect->ErrorMsg());
$qrows = array(); //Create an empty array in case FetchRow does not return any rows
while ($qrow = $qorderresult->FetchRow()) {$qrows[] = $qrow;} // Get table output into array
usort($qrows, 'CompareGroupThenTitle'); // Perform a case insensitive natural sort on group name then question title of a multidimensional array
$c=0;
foreach ($qrows as $qr)
{
$qidorder[]=array($c, $qrow['qid']);
$c++;
}
$qordercount="";
//1: Get each condition's question id
$conquery= "SELECT {$dbprefix}conditions.qid, cqid, {$dbprefix}questions.question, "
. "{$dbprefix}questions.gid "
. "FROM {$dbprefix}conditions, {$dbprefix}questions, {$dbprefix}groups "
. "WHERE {$dbprefix}conditions.qid={$dbprefix}questions.qid "
. "AND {$dbprefix}questions.gid={$dbprefix}groups.gid ORDER BY {$dbprefix}conditions.qid";
$conresult=db_execute_assoc($conquery) or safe_die("Couldn't check conditions for relative consistency<br />$conquery<br />".$connect->ErrorMsg());
//2: Check each conditions cqid that it occurs later than the cqid
while ($conrow=$conresult->FetchRow())
{
$cqidfound=0;
$qidfound=0;
$b=0;
while ($b<$qordercount)
{
if ($conrow['cqid'] == $qidorder[$b][1])
{
$cqidfound = 1;
$b=$qordercount;
}
if ($conrow['qid'] == $qidorder[$b][1])
{
$qidfound = 1;
$b=$qordercount;
}
if ($qidfound == 1)
{
$failedcheck[]=array($conrow['qid'], $conrow['question'], ": ".$clang->gT("This question has a condition set, however the condition is based on a question that appears after it."), $conrow['gid']);
}
$b++;
}
}
//CHECK THAT ALL THE CREATED FIELDS WILL BE UNIQUE
$fieldmap=createFieldMap($surveyid, "full");
if (isset($fieldmap))
{
foreach($fieldmap as $fielddata)
{
$fieldlist[]=$fielddata['fieldname'];
}
$fieldlist=array_reverse($fieldlist); //let's always change the later duplicate, not the earlier one
}
$checkKeysUniqueComparison = create_function('$value','if ($value > 1) return true;');
@$duplicates = array_keys (array_filter (array_count_values($fieldlist), $checkKeysUniqueComparison));
if (isset($duplicates))
{
foreach ($duplicates as $dup)
{
$badquestion=arraySearchByKey($dup, $fieldmap, "fieldname", 1);
$fix = "[<a href='$scriptname?action=activate&amp;sid=$surveyid&amp;fixnumbering=".$badquestion['qid']."'>Click Here to Fix</a>]";
$failedcheck[]=array($badquestion['qid'], $badquestion['question'], ": Bad duplicate fieldname $fix", $badquestion['gid']);
}
}
// Check consistency for groups and questions
$failedgroupcheck = checkGroup($postsid);
$failedcheck = checkQuestions($postsid, $surveyid, $qtypes);
//IF ANY OF THE CHECKS FAILED, PRESENT THIS SCREEN
if ((isset($failedcheck) && $failedcheck) || (isset($failedgroupcheck) && $failedgroupcheck))
{
$activateoutput .= "<br />\n<table bgcolor='#FFFFFF' width='500' align='center' style='border: 1px solid #555555' cellpadding='6' cellspacing='0'>\n";
$activateoutput .= "\t\t\t\t<tr bgcolor='#555555'><td height='4'><font size='1' face='verdana' color='white'><strong>".$clang->gT("Activate Survey")." ($surveyid)</strong></font></td></tr>\n";
$activateoutput .= "\t<tr>\n";
$activateoutput .= "\t\t<td align='center' bgcolor='#ffeeee'>\n";
$activateoutput .= "\t\t\t<font color='red'><strong>".$clang->gT("Error")."</strong><br />\n";
$activateoutput .= "\t\t\t".$clang->gT("Survey does not pass consistency check")."</font>\n";
$activateoutput .= "\t\t</td>\n";
$activateoutput .= "\t</tr>\n";
$activateoutput .= "\t<tr>\n";
$activateoutput .= "\t\t<td>\n";
$activateoutput .= "\t\t\t<strong>".$clang->gT("The following problems have been found:")."</strong><br />\n";
$activateoutput .= "\t\t\t<ul>\n";
$activateoutput .= "<br />\n<div class='messagebox ui-corner-all'>\n";
$activateoutput .= "<div class='header ui-widget-header'>".$clang->gT("Activate Survey")." ($surveyid)</div>\n";
$activateoutput .= "<div class='warningheader'>\n".$clang->gT("Error")."<br />\n";
$activateoutput .= $clang->gT("Survey does not pass consistency check")."</div>\n";
$activateoutput .= "<p>\n";
$activateoutput .= "<strong>".$clang->gT("The following problems have been found:")."</strong><br />\n";
$activateoutput .= "<ul>\n";
if (isset($failedcheck) && $failedcheck)
{
foreach ($failedcheck as $fc)
{
$activateoutput .= "\t\t\t\t<li> Question qid-{$fc[0]} (\"<a href='$scriptname?sid=$surveyid&amp;gid=$fc[3]&amp;qid=$fc[0]'>{$fc[1]}</a>\"){$fc[2]}</li>\n";
$activateoutput .= "<li> Question qid-{$fc[0]} (\"<a href='$scriptname?sid=$surveyid&amp;gid=$fc[3]&amp;qid=$fc[0]'>{$fc[1]}</a>\"){$fc[2]}</li>\n";
}
}
if (isset($failedgroupcheck) && $failedgroupcheck)
{
foreach ($failedgroupcheck as $fg)
{
$activateoutput .= "\t\t\t\t<li> Group gid-{$fg[0]} (\"<a href='$scriptname?sid=$surveyid&amp;gid=$fg[0]'>{$fg[1]}</a>\"){$fg[2]}</li>\n";
}
$activateoutput .= "\t\t\t</ul>\n";
$activateoutput .= "\t\t\t".$clang->gT("The survey cannot be activated until these problems have been resolved.")."\n";
$activateoutput .= "\t\t</td>\n";
$activateoutput .= "\t</tr>\n";
$activateoutput .= "</table><br />&nbsp;\n";
}
$activateoutput .= "</ul>\n";
$activateoutput .= $clang->gT("The survey cannot be activated until these problems have been resolved.")."\n";
$activateoutput .= "</div><br />&nbsp;\n";
return;
}
$activateoutput .= "<br />\n<div class='messagebox'>\n";
$activateoutput .= "\t\t\t\t<div class='header'>".$clang->gT("Activate Survey")." ($surveyid)</div>\n";
$activateoutput .= "\t\t<div class='warningheader'>\n";
$activateoutput .= "<br />\n<div class='messagebox ui-corner-all'>\n";
$activateoutput .= "<div class='header ui-widget-header'>".$clang->gT("Activate Survey")." ($surveyid)</div>\n";
$activateoutput .= "<div class='warningheader'>\n";
$activateoutput .= $clang->gT("Warning")."<br />\n";
$activateoutput .= $clang->gT("READ THIS CAREFULLY BEFORE PROCEEDING")."\n";
$activateoutput .= "\t\t\t</div>\n";
$activateoutput .= "\t</div>\n";
$activateoutput .= $clang->gT("You should only activate a survey when you are absolutely certain that your survey setup is finished and will not need changing.")."<br /><br />\n";
$activateoutput .= $clang->gT("Once a survey is activated you can no longer:")."<ul><li>".$clang->gT("Add or delete groups")."</li><li>".$clang->gT("Add or remove answers to Multiple Answer questions")."</li><li>".$clang->gT("Add or delete questions")."</li></ul>\n";
$activateoutput .= $clang->gT("However you can still:")."<ul><li>".$clang->gT("Edit (change) your questions code, text or type")."</li><li>".$clang->gT("Edit (change) your group names")."</li><li>".$clang->gT("Add, Remove or Edit pre-defined question answers (except for Multi-answer questions)")."</li><li>".$clang->gT("Change survey name or description")."</li></ul>\n";
$activateoutput .= $clang->gT("Once data has been entered into this survey, if you want to add or remove groups or questions, you will need to de-activate this survey, which will move all data that has already been entered into a separate archived table.")."<br /><br />\n";
$activateoutput .= "\t\t\t<input type='submit' value=\"".$clang->gT("Activate Survey")."\" onclick=\"".get2post("$scriptname?action=activate&amp;ok=Y&amp;sid={$_GET['sid']}")."\" />\n";
$activateoutput .= $clang->gT("Once a survey is activated you can no longer:")."<ul><li>".$clang->gT("Add or delete groups")."</li><li>".$clang->gT("Add or delete questions")."</li><li>".$clang->gT("Add or delete subquestions or change their codes")."</li></ul>\n";
$activateoutput .= $clang->gT("However you can still:")."<ul><li>".$clang->gT("Edit your questions code/title/text and advanced options")."</li><li>".$clang->gT("Edit your group names or descriptions")."</li><li>".$clang->gT("Add, remove or edit answer options")."</li><li>".$clang->gT("Change survey name or description")."</li></ul>\n";
$activateoutput .= $clang->gT("Once data has been entered into this survey, if you want to add or remove groups or questions, you will need to deactivate this survey, which will move all data that has already been entered into a separate archived table.")."<br /><br />\n";
$activateoutput .= "\t<input type='submit' value=\"".$clang->gT("Activate Survey")."\" onclick=\"".get2post("$scriptname?action=activate&amp;ok=Y&amp;sid={$_GET['sid']}")."\" />\n";
$activateoutput .= "</div><br />&nbsp;\n";
}
else
{
//Create the survey responses table
$createsurvey = "id I NOTNULL AUTO PRIMARY,\n";
$createsurvey .= " submitdate T,\n";
$createsurvey .= " startlanguage C(20) NOTNULL ,\n";
//Check for any additional fields for this survey and create necessary fields (token and datestamp)
$pquery = "SELECT private, allowregister, datestamp, ipaddr, refurl FROM {$dbprefix}surveys WHERE sid={$postsid}";
$presult=db_execute_assoc($pquery);
while($prow=$presult->FetchRow())
{
if ($prow['private'] == "N")
{
$createsurvey .= " token C(36),\n";
$surveynotprivate="TRUE";
}
if ($prow['allowregister'] == "Y")
{
$surveyallowsregistration="TRUE";
}
if ($prow['datestamp'] == "Y")
{
$createsurvey .= " datestamp T NOTNULL,\n";
$createsurvey .= " startdate T NOTNULL,\n";
}
if ($prow['ipaddr'] == "Y")
{
$createsurvey .= " ipaddr X,\n";
}
//Check to see if 'refurl' field is required.
if ($prow['refurl'] == "Y")
{
$createsurvey .= " refurl X,\n";
}
}
//Get list of questions for the base language
$aquery = " SELECT * FROM ".db_table_name('questions').", ".db_table_name('groups')
." WHERE ".db_table_name('questions').".gid=".db_table_name('groups').".gid "
." AND ".db_table_name('questions').".sid={$postsid} "
." AND ".db_table_name('groups').".language='".GetbaseLanguageFromSurveyid($postsid). "' "
." AND ".db_table_name('questions').".language='".GetbaseLanguageFromSurveyid($postsid). "' "
." ORDER BY group_order, question_order";
$aresult = db_execute_assoc($aquery);
while ($arow=$aresult->FetchRow()) //With each question, create the appropriate field(s)
{
if ( substr($createsurvey, strlen($createsurvey)-2, 2) != ",\n") {$createsurvey .= ",\n";}
if ($arow['type'] != "M" && $arow['type'] != "A" && $arow['type'] != "B" &&
$arow['type'] != "C" && $arow['type'] != "E" && $arow['type'] != "F" &&
$arow['type'] != "H" && $arow['type'] != "P" && $arow['type'] != "R" &&
$arow['type'] != "Q" && $arow['type'] != "^" && $arow['type'] != "J" &&
$arow['type'] != "K" && $arow['type'] != ":" && $arow['type'] != ";" &&
$arow['type'] != "1")
{
$createsurvey .= " `{$arow['sid']}X{$arow['gid']}X{$arow['qid']}`";
switch($arow['type'])
{
case "N": //NUMERICAL
$createsurvey .= " F";
break;
case "S": //SHORT TEXT
if ($databasetype=='mysql' || $databasetype=='mysqli') {$createsurvey .= " X";}
else {$createsurvey .= " C(255)";}
break;
case "L": //LIST (RADIO)
case "!": //LIST (DROPDOWN)
case "W":
case "Z":
$createsurvey .= " C(5)";
if ($arow['other'] == "Y")
{
$createsurvey .= ",\n`{$arow['sid']}X{$arow['gid']}X{$arow['qid']}other` X";
}
break;
case "I": // CSV ONE
$createsurvey .= " C(5)";
break;
case "O": //DROPDOWN LIST WITH COMMENT
$createsurvey .= " C(5),\n `{$arow['sid']}X{$arow['gid']}X{$arow['qid']}comment` X";
break;
case "T": //LONG TEXT
$createsurvey .= " X";
break;
case "U": //HUGE TEXT
$createsurvey .= " X";
break;
case "D": //DATE
$createsurvey .= " D";
break;
case "5": //5 Point Choice
case "G": //Gender
case "Y": //YesNo
case "X": //Boilerplate
$createsurvey .= " C(1)";
break;
}
}
elseif ($arow['type'] == "M" || $arow['type'] == "A" || $arow['type'] == "B" ||
$arow['type'] == "C" || $arow['type'] == "E" || $arow['type'] == "F" ||
$arow['type'] == "H" || $arow['type'] == "P" || $arow['type'] == "^")
{
//MULTI ENTRY
$abquery = "SELECT a.*, q.other FROM {$dbprefix}answers as a, {$dbprefix}questions as q"
." WHERE a.qid=q.qid AND sid={$postsid} AND q.qid={$arow['qid']} "
." AND a.language='".GetbaseLanguageFromSurveyid($postsid). "' "
." AND q.language='".GetbaseLanguageFromSurveyid($postsid). "' "
." ORDER BY a.sortorder, a.answer";
$abresult=db_execute_assoc($abquery) or safe_die ("Couldn't get perform answers query<br />$abquery<br />".$connect->ErrorMsg());
while ($abrow=$abresult->FetchRow())
{
$createsurvey .= " `{$arow['sid']}X{$arow['gid']}X{$arow['qid']}{$abrow['code']}` C(5),\n";
if ($abrow['other']=="Y") {$alsoother="Y";}
if ($arow['type'] == "P")
{
$createsurvey .= " `{$arow['sid']}X{$arow['gid']}X{$arow['qid']}{$abrow['code']}comment` X,\n";
}
}
if ((isset($alsoother) && $alsoother=="Y") && ($arow['type']=="M" || $arow['type']=="P" || $arow['type']=="1")) //Sc: check!
{
$createsurvey .= " `{$arow['sid']}X{$arow['gid']}X{$arow['qid']}other` X,\n";
if ($arow['type']=="P")
{
$createsurvey .= " `{$arow['sid']}X{$arow['gid']}X{$arow['qid']}othercomment` X,\n";
}
}
}
elseif ($arow['type'] == ":" || $arow['type'] == ";")
{
//MULTI ENTRY
$abquery = "SELECT a.*, q.other FROM {$dbprefix}answers as a, {$dbprefix}questions as q"
." WHERE a.qid=q.qid AND sid={$postsid} AND q.qid={$arow['qid']} "
." AND a.language='".GetbaseLanguageFromSurveyid($postsid). "' "
." AND q.language='".GetbaseLanguageFromSurveyid($postsid). "' "
." ORDER BY a.sortorder, a.answer";
$abresult=db_execute_assoc($abquery) or die ("Couldn't get perform answers query<br />$abquery<br />".$connect->ErrorMsg());
$ab2query = "SELECT ".db_table_name('labels').".*
FROM ".db_table_name('questions').", ".db_table_name('labels')."
WHERE sid=$surveyid
AND ".db_table_name('labels').".lid=".db_table_name('questions').".lid
AND ".db_table_name('labels').".language='".GetbaseLanguageFromSurveyid($postsid)."'
AND ".db_table_name('questions').".qid=".$arow['qid']."
ORDER BY ".db_table_name('labels').".sortorder, ".db_table_name('labels').".title";
$ab2result=db_execute_assoc($ab2query) or die("Couldn't get list of labels in createFieldMap function (case :)<br />$ab2query<br />".htmlspecialchars($connection->ErrorMsg()));
while($ab2row=$ab2result->FetchRow())
{
$lset[]=$ab2row;
}
while ($abrow=$abresult->FetchRow())
{
foreach($lset as $ls)
{
$createsurvey .= " `{$arow['sid']}X{$arow['gid']}X{$arow['qid']}{$abrow['code']}_{$ls['code']}` X,\n";
}
}
unset($lset);
}
elseif ($arow['type'] == "Q")
{
$abquery = "SELECT a.*, q.other FROM {$dbprefix}answers as a, {$dbprefix}questions as q WHERE a.qid=q.qid AND sid={$postsid} AND q.qid={$arow['qid']} "
." AND a.language='".GetbaseLanguageFromSurveyid($postsid). "' "
." AND q.language='".GetbaseLanguageFromSurveyid($postsid). "' "
." ORDER BY a.sortorder, a.answer";
$abresult=db_execute_assoc($abquery) or safe_die ("Couldn't get perform answers query<br />$abquery<br />".$connect->ErrorMsg());
while ($abrow = $abresult->FetchRow())
{
$createsurvey .= " `{$arow['sid']}X{$arow['gid']}X{$arow['qid']}{$abrow['code']}`";
if ($databasetype=='mysql' || $databasetype=='mysqli')
{
$createsurvey .= " X";
}
else
{
$createsurvey .= " C(255)";
}
$createsurvey .= ",\n";
}
$activateoutput = activateSurvey($postsid,$surveyid);
}
elseif ($arow['type'] == "K") //Multiple Numeric - replica of multiple short text, except numbers only
{
$abquery = "SELECT a.*, q.other FROM {$dbprefix}answers as a, {$dbprefix}questions as q WHERE a.qid=q.qid AND sid={$postsid} AND q.qid={$arow['qid']} "
." AND a.language='".GetbaseLanguageFromSurveyid($postsid). "' "
." AND q.language='".GetbaseLanguageFromSurveyid($postsid). "' "
." ORDER BY a.sortorder, a.answer";
$abresult=db_execute_assoc($abquery) or safe_die ("Couldn't get perform answers query<br />$abquery<br />".$connect->ErrorMsg());
while ($abrow = $abresult->FetchRow())
{
$createsurvey .= " `{$arow['sid']}X{$arow['gid']}X{$arow['qid']}{$abrow['code']}` F,\n";
}
} //End if ($arow['type'] == "K")
/* elseif ($arow['type'] == "J")
{
$abquery = "SELECT {$dbprefix}answers.*, {$dbprefix}questions.other FROM {$dbprefix}answers, {$dbprefix}questions WHERE {$dbprefix}answers.qid={$dbprefix}questions.qid AND sid={$_GET['sid']} AND {$dbprefix}questions.qid={$arow['qid']} ORDER BY {$dbprefix}answers.sortorder, {$dbprefix}answers.answer";
$abresult=db_execute_assoc($abquery) or safe_die ("Couldn't get perform answers query<br />$abquery<br />".$connect->ErrorMsg());
while ($abrow = $abresultt->FetchRow())
{
$createsurvey .= " `{$arow['sid']}X{$arow['gid']}X{$arow['qid']}{$abrow['code']}` C(5),\n";
}
}*/
elseif ($arow['type'] == "R")
{
//MULTI ENTRY
$abquery = "SELECT a.*, q.other FROM {$dbprefix}answers as a, {$dbprefix}questions as q"
." WHERE a.qid=q.qid AND sid={$postsid} AND q.qid={$arow['qid']} "
." AND a.language='".GetbaseLanguageFromSurveyid($postsid). "' "
." AND q.language='".GetbaseLanguageFromSurveyid($postsid). "' "
." ORDER BY a.sortorder, a.answer";
$abresult=$connect->Execute($abquery) or safe_die ("Couldn't get perform answers query<br />$abquery<br />".$connect->ErrorMsg());
$abcount=$abresult->RecordCount();
for ($i=1; $i<=$abcount; $i++)
{
$createsurvey .= " `{$arow['sid']}X{$arow['gid']}X{$arow['qid']}$i` C(5),\n";
}
}
elseif ($arow['type'] == "1")
{
$abquery = "SELECT a.*, q.other FROM {$dbprefix}answers as a, {$dbprefix}questions as q"
." WHERE a.qid=q.qid AND sid={$postsid} AND q.qid={$arow['qid']} "
." AND a.language='".GetbaseLanguageFromSurveyid($postsid). "' "
." AND q.language='".GetbaseLanguageFromSurveyid($postsid). "' "
." ORDER BY a.sortorder, a.answer";
$abresult=db_execute_assoc($abquery) or safe_die ("Couldn't get perform answers query<br />$abquery<br />".$connect->ErrorMsg());
$abcount=$abresult->RecordCount();
while ($abrow = $abresult->FetchRow())
{
$abmultiscalequery = "SELECT a.*, q.other FROM {$dbprefix}answers as a, {$dbprefix}questions as q, {$dbprefix}labels as l"
." WHERE a.qid=q.qid AND sid={$postsid} AND q.qid={$arow['qid']} "
." AND l.lid=q.lid AND sid={$postsid} AND q.qid={$arow['qid']} AND l.title = '' "
." AND l.language='".GetbaseLanguageFromSurveyid($postsid). "' "
." AND q.language='".GetbaseLanguageFromSurveyid($postsid). "' ";
$abmultiscaleresult=$connect->Execute($abmultiscalequery) or safe_die ("Couldn't get perform answers query<br />$abmultiscalequery<br />".$connect->ErrorMsg());
$abmultiscaleresultcount =$abmultiscaleresult->RecordCount();
$abmultiscaleresultcount = 1;
for ($j=0; $j<=$abmultiscaleresultcount; $j++)
{
$createsurvey .= " `{$arow['sid']}X{$arow['gid']}X{$arow['qid']}{$abrow['code']}#$j` C(5),\n";
}
}
}
}
// If last question is of type MCABCEFHP^QKJR let's get rid of the ending coma in createsurvey
$createsurvey = rtrim($createsurvey, ",\n")."\n"; // Does nothing if not ending with a comma
$tabname = "{$dbprefix}survey_{$postsid}"; # not using db_table_name as it quotes the table name (as does CreateTableSQL)
$taboptarray = array('mysql' => 'ENGINE='.$databasetabletype.' CHARACTER SET utf8 COLLATE utf8_unicode_ci',
'mysqli'=> 'ENGINE='.$databasetabletype.' CHARACTER SET utf8 COLLATE utf8_unicode_ci');
$dict = NewDataDictionary($connect);
$sqlarray = $dict->CreateTableSQL($tabname, $createsurvey, $taboptarray);
$execresult=$dict->ExecuteSQLArray($sqlarray,1);
if ($execresult==0 || $execresult==1)
{
$activateoutput .= "<br />\n<table width='350' align='center' style='border: 1px solid #555555' cellpadding='1' cellspacing='0'>\n" .
"<tr bgcolor='#555555'><td height='4'><font size='1' face='verdana' color='white'><strong>".$clang->gT("Activate Survey")." ($surveyid)</strong></font></td></tr>\n" .
"<tr><td>\n" .
"<font color='red'>".$clang->gT("Survey could not be actived.")."</font><br />\n" .
"<center><a href='$scriptname?sid={$postsid}'>".$clang->gT("Main Admin Screen")."</a></center>\n" .
"DB ".$clang->gT("Error").":<br />\n<font color='red'>" . $connect->ErrorMsg() . "</font>\n" .
"<pre>$createsurvey</pre>\n" .
"</td></tr></table></br>&nbsp;\n" .
"</body>\n</html>";
}
if ($execresult != 0 && $execresult !=1)
{
$anquery = "SELECT autonumber_start FROM {$dbprefix}surveys WHERE sid={$postsid}";
if ($anresult=db_execute_assoc($anquery))
{
//if there is an autonumber_start field, start auto numbering here
while($row=$anresult->FetchRow())
{
if ($row['autonumber_start'] > 0)
{
$autonumberquery = "ALTER TABLE {$dbprefix}survey_{$postsid} AUTO_INCREMENT = ".$row['autonumber_start'];
if ($result = $connect->Execute($autonumberquery))
{
//We're happy it worked!
}
else
{
//Continue regardless - it's not the end of the world
}
}
}
}
$activateoutput .= "<br />\n<table class='alertbox'>\n";
$activateoutput .= "\t\t\t\t<tr><td height='4'><strong>".$clang->gT("Activate Survey")." ($surveyid)</td></tr>\n";
$activateoutput .= "\t\t\t\t<tr><td align='center'><font class='successtitle'>".$clang->gT("Survey has been activated. Results table has been successfully created.")."</font><br /><br />\n";
$acquery = "UPDATE {$dbprefix}surveys SET active='Y' WHERE sid=".returnglobal('sid');
$acresult = $connect->Execute($acquery);
// Private means data privacy, not closed access survey
// if (isset($surveynotprivate) && $surveynotprivate) //This survey is tracked, and therefore a tokens table MUST exist
// {
// $activateoutput .= $clang->gT("This is not an anonymous survey. A token table must also be created.")."<br /><br />\n";
// $activateoutput .= "<input type='submit' value='".$clang->gT("Initialise Tokens")."' onclick=\"window.open('$scriptname?action=tokens&amp;sid={$_GET['sid']}&amp;createtable=Y', '_self')\" />\n";
// }
// elseif (isset($surveyallowsregistration) && $surveyallowsregistration == "TRUE")
if (isset($surveyallowsregistration) && $surveyallowsregistration == "TRUE")
{
$activateoutput .= $clang->gT("This survey allows public registration. A token table must also be created.")."<br /><br />\n";
$activateoutput .= "<input type='submit' value='".$clang->gT("Initialise Tokens")."' onclick=\"".get2post("$scriptname?action=tokens&amp;sid={$postsid}&amp;createtable=Y")."\" />\n";
}
else
{
$activateoutput .= $clang->gT("This survey is now active, and responses can be recorded.")."<br /><br />\n";
$activateoutput .= "<strong>".$clang->gT("Open-access mode").":</strong> ".$clang->gT("No invitation code is needed to complete the survey.")."<br />".$clang->gT("You can switch to the closed-access mode by initialising a token table with the button below.")."<br /><br />\n";
$activateoutput .= "<input type='submit' value='".$clang->gT("Switch to closed-access mode")."' onclick=\"".get2post("$scriptname?action=tokens&amp;sid={$postsid}&amp;createtable=Y")."\" />\n";
$activateoutput .= "<input type='submit' value='".$clang->gT("No, thanks.")."' onclick=\"".get2post("$scriptname?sid={$postsid}")."\" />\n";
}
$activateoutput .= "\t\t\t\t</font></font></td></tr></table><br />&nbsp;\n";
}
}
?>

View File

@@ -0,0 +1,529 @@
<?php
/*
* LimeSurvey
* Copyright (C) 2007 The LimeSurvey Project Team / Carsten Schmitz
* All rights reserved.
* License: GNU/GPL License v2 or later, see LICENSE.php
* LimeSurvey is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*
* $Id: activate_functions.php 9671 2010-12-21 20:02:24Z c_schmitz $
* Files Purpose: holds functions to activate a survey and precheck the consistency of the survey
*/
/**
* fixes the numbering of questions
* @global $dbprefix $dbprefix
* @global $connect $connect
* @global $clang $clang
* @param <type> $fixnumbering
*/
function fixNumbering($fixnumbering)
{
global $dbprefix, $connect, $clang;
//Fix a question id - requires renumbering a question
$oldqid = $fixnumbering;
$query = "SELECT qid FROM {$dbprefix}questions ORDER BY qid DESC";
$result = db_select_limit_assoc($query, 1) or safe_die($query."<br />".$connect->ErrorMsg());
while ($row=$result->FetchRow()) {$lastqid=$row['qid'];}
$newqid=$lastqid+1;
$query = "UPDATE {$dbprefix}questions SET qid=$newqid WHERE qid=$oldqid";
$result = $connect->Execute($query) or safe_die($query."<br />".$connect->ErrorMsg());
// Update subquestions
$query = "UPDATE {$dbprefix}questions SET parent_qid=$newqid WHERE parent_qid=$oldqid";
$result = $connect->Execute($query) or safe_die($query."<br />".$connect->ErrorMsg());
//Update conditions.. firstly conditions FOR this question
$query = "UPDATE {$dbprefix}conditions SET qid=$newqid WHERE qid=$oldqid";
$result = $connect->Execute($query) or safe_die($query."<br />".$connect->ErrorMsg());
//Now conditions based upon this question
$query = "SELECT cqid, cfieldname FROM {$dbprefix}conditions WHERE cqid=$oldqid";
$result = db_execute_assoc($query) or safe_die($query."<br />".$connect->ErrorMsg());
while ($row=$result->FetchRow())
{
$switcher[]=array("cqid"=>$row['cqid'], "cfieldname"=>$row['cfieldname']);
}
if (isset($switcher))
{
foreach ($switcher as $switch)
{
$query = "UPDATE {$dbprefix}conditions
SET cqid=$newqid,
cfieldname='".str_replace("X".$oldqid, "X".$newqid, $switch['cfieldname'])."'
WHERE cqid=$oldqid";
$result = $connect->Execute($query) or safe_die($query."<br />".$connect->ErrorMsg());
}
}
//Now question_attributes
$query = "UPDATE {$dbprefix}question_attributes SET qid=$newqid WHERE qid=$oldqid";
$result = $connect->Execute($query) or safe_die($query."<br />".$connect->ErrorMsg());
//Now answers
$query = "UPDATE {$dbprefix}answers SET qid=$newqid WHERE qid=$oldqid";
$result = $connect->Execute($query) or safe_die($query."<br />".$connect->ErrorMsg());
}
/**
* checks consistency of groups
* @global $dbprefix
* @global $connect
* @global $clang
* @return <type>
*/
function checkGroup($postsid)
{
global $dbprefix, $connect, $clang;
$baselang = GetBaseLanguageFromSurveyID($postsid);
$groupquery = "SELECT g.gid,g.group_name,count(q.qid) as count from {$dbprefix}questions as q RIGHT JOIN {$dbprefix}groups as g ON q.gid=g.gid AND g.language=q.language WHERE g.sid=$postsid AND g.language='$baselang' group by g.gid,g.group_name;";
$groupresult=db_execute_assoc($groupquery) or safe_die($groupquery."<br />".$connect->ErrorMsg());
while ($row=$groupresult->FetchRow())
{ //TIBO
if ($row['count'] == 0)
{
$failedgroupcheck[]=array($row['gid'], $row['group_name'], ": ".$clang->gT("This group does not contain any question(s)."));
}
}
if(isset($failedgroupcheck))
return $failedgroupcheck;
else
return false;
}
/**
* checks questions in a survey for consistency
* @global <type> $dbprefix
* @global <type> $connect
* @global <type> $clang
* @param <type> $postsid
* @param <type> $surveyid
* @return array $faildcheck
*/
function checkQuestions($postsid, $surveyid, $qtypes)
{
global $dbprefix, $connect, $clang;
//CHECK TO MAKE SURE ALL QUESTION TYPES THAT REQUIRE ANSWERS HAVE ACTUALLY GOT ANSWERS
//THESE QUESTION TYPES ARE:
// # "L" -> LIST
// # "O" -> LIST WITH COMMENT
// # "M" -> Multiple choice
// # "P" -> Multiple choice with comments
// # "A", "B", "C", "E", "F", "H", "^" -> Various Array Types
// # "R" -> RANKING
// # "U" -> FILE CSV MORE
// # "I" -> LANGUAGE SWITCH
// # ":" -> Array Multi Flexi Numbers
// # ";" -> Array Multi Flexi Text
// # "1" -> MULTI SCALE
$chkquery = "SELECT qid, question, gid, type FROM {$dbprefix}questions WHERE sid={$surveyid} and parent_qid=0";
$chkresult = db_execute_assoc($chkquery) or safe_die ("Couldn't get list of questions<br />$chkquery<br />".$connect->ErrorMsg());
while ($chkrow = $chkresult->FetchRow())
{
if ($qtypes[$chkrow['type']]['subquestions']>0)
{
$chaquery = "SELECT * FROM {$dbprefix}questions WHERE parent_qid = {$chkrow['qid']} ORDER BY question_order";
$charesult=$connect->Execute($chaquery);
$chacount=$charesult->RecordCount();
if ($chacount == 0)
{
$failedcheck[]=array($chkrow['qid'], $chkrow['question'], ": ".$clang->gT("This question is a subquestion type question but has no configured subquestions."), $chkrow['gid']);
}
}
if ($qtypes[$chkrow['type']]['answerscales']>0)
{
$chaquery = "SELECT * FROM {$dbprefix}answers WHERE qid = {$chkrow['qid']} ORDER BY sortorder, answer";
$charesult=$connect->Execute($chaquery);
$chacount=$charesult->RecordCount();
if ($chacount == 0)
{
$failedcheck[]=array($chkrow['qid'], $chkrow['question'], ": ".$clang->gT("This question is a multiple answer type question but has no answers."), $chkrow['gid']);
}
}
}
//NOW CHECK THAT ALL QUESTIONS HAVE A 'QUESTION TYPE' FIELD SET
$chkquery = "SELECT qid, question, gid FROM {$dbprefix}questions WHERE sid={$_GET['sid']} AND type = ''";
$chkresult = db_execute_assoc($chkquery) or safe_die ("Couldn't check questions for missing types<br />$chkquery<br />".$connect->ErrorMsg());
while ($chkrow = $chkresult->FetchRow())
{
$failedcheck[]=array($chkrow['qid'], $chkrow['question'], ": ".$clang->gT("This question does not have a question 'type' set."), $chkrow['gid']);
}
//ChECK THAT certain array question types have answers set
$chkquery = "SELECT q.qid, question, gid FROM {$dbprefix}questions as q WHERE (select count(*) from {$dbprefix}answers as a where a.qid=q.qid and scale_id=0)=0 and sid={$_GET['sid']} AND type IN ('F', 'H', 'W', 'Z', '1') and q.parent_qid=0";
$chkresult = db_execute_assoc($chkquery) or safe_die ("Couldn't check questions for missing answers<br />$chkquery<br />".$connect->ErrorMsg());
while($chkrow = $chkresult->FetchRow()){
$failedcheck[]=array($chkrow['qid'], $chkrow['question'], ": ".$clang->gT("This question requires answers, but none are set."), $chkrow['gid']);
} // while
//CHECK THAT DUAL Array has answers set
$chkquery = "SELECT q.qid, question, gid FROM {$dbprefix}questions as q WHERE (select count(*) from {$dbprefix}answers as a where a.qid=q.qid and scale_id=1)=0 and sid={$_GET['sid']} AND type='1' and q.parent_qid=0";
$chkresult = db_execute_assoc($chkquery) or safe_die ("Couldn't check questions for missing 2nd answer set<br />$chkquery<br />".$connect->ErrorMsg());
while($chkrow = $chkresult->FetchRow()){
$failedcheck[]=array($chkrow['qid'], $chkrow['question'], ": ".$clang->gT("This question requires a second answer set but none is set."), $chkrow['gid']);
} // while
//CHECK THAT ALL CONDITIONS SET ARE FOR QUESTIONS THAT PRECEED THE QUESTION CONDITION
//A: Make an array of all the qids in order of appearance
// $qorderquery="SELECT * FROM {$dbprefix}questions, {$dbprefix}groups WHERE {$dbprefix}questions.gid={$dbprefix}groups.gid AND {$dbprefix}questions.sid={$_GET['sid']} ORDER BY {$dbprefix}groups.sortorder, {$dbprefix}questions.title";
// $qorderresult=$connect->Execute($qorderquery) or safe_die("Couldn't generate a list of questions in order<br />$qorderquery<br />".$connect->ErrorMsg());
// $qordercount=$qorderresult->RecordCount();
// $c=0;
// while ($qorderrow=$qorderresult->FetchRow())
// {
// $qidorder[]=array($c, $qorderrow['qid']);
// $c++;
// }
//TO AVOID NATURAL SORT ORDER ISSUES, FIRST GET ALL QUESTIONS IN NATURAL SORT ORDER, AND FIND OUT WHICH NUMBER IN THAT ORDER THIS QUESTION IS
$qorderquery = "SELECT * FROM {$dbprefix}questions WHERE sid=$surveyid AND type not in ('S', 'D', 'T', 'Q')";
$qorderresult = db_execute_assoc($qorderquery) or safe_die ("$qorderquery<br />".$connect->ErrorMsg());
$qrows = array(); //Create an empty array in case FetchRow does not return any rows
while ($qrow = $qorderresult->FetchRow()) {$qrows[] = $qrow;} // Get table output into array
usort($qrows, 'GroupOrderThenQuestionOrder'); // Perform a case insensitive natural sort on group name then question title of a multidimensional array
$c=0;
foreach ($qrows as $qr)
{
$qidorder[]=array($c, $qrow['qid']);
$c++;
}
$qordercount="";
//1: Get each condition's question id
$conquery= "SELECT {$dbprefix}conditions.qid, cqid, {$dbprefix}questions.question, "
. "{$dbprefix}questions.gid "
. "FROM {$dbprefix}conditions, {$dbprefix}questions, {$dbprefix}groups "
. "WHERE {$dbprefix}conditions.qid={$dbprefix}questions.qid "
. "AND {$dbprefix}questions.gid={$dbprefix}groups.gid ORDER BY {$dbprefix}conditions.qid";
$conresult=db_execute_assoc($conquery) or safe_die("Couldn't check conditions for relative consistency<br />$conquery<br />".$connect->ErrorMsg());
//2: Check each conditions cqid that it occurs later than the cqid
while ($conrow=$conresult->FetchRow())
{
$cqidfound=0;
$qidfound=0;
$b=0;
while ($b<$qordercount)
{
if ($conrow['cqid'] == $qidorder[$b][1])
{
$cqidfound = 1;
$b=$qordercount;
}
if ($conrow['qid'] == $qidorder[$b][1])
{
$qidfound = 1;
$b=$qordercount;
}
if ($qidfound == 1)
{
$failedcheck[]=array($conrow['qid'], $conrow['question'], ": ".$clang->gT("This question has a condition set, however the condition is based on a question that appears after it."), $conrow['gid']);
}
$b++;
}
}
//CHECK THAT ALL THE CREATED FIELDS WILL BE UNIQUE
$fieldmap=createFieldMap($surveyid, "full");
if (isset($fieldmap))
{
foreach($fieldmap as $fielddata)
{
$fieldlist[]=$fielddata['fieldname'];
}
$fieldlist=array_reverse($fieldlist); //let's always change the later duplicate, not the earlier one
}
$checkKeysUniqueComparison = create_function('$value','if ($value > 1) return true;');
@$duplicates = array_keys (array_filter (array_count_values($fieldlist), $checkKeysUniqueComparison));
if (isset($duplicates))
{
foreach ($duplicates as $dup)
{
$badquestion=arraySearchByKey($dup, $fieldmap, "fieldname", 1);
$fix = "[<a href='$scriptname?action=activate&amp;sid=$surveyid&amp;fixnumbering=".$badquestion['qid']."'>Click Here to Fix</a>]";
$failedcheck[]=array($badquestion['qid'], $badquestion['question'], ": Bad duplicate fieldname $fix", $badquestion['gid']);
}
}
if(isset($failedcheck))
return $failedcheck;
else
return false;
}
/**
* Function to activate a survey
* @global $dbprefix $dbprefix
* @global $connect $connect
* @global $clang $clang
* @param int $postsid
* @param int $surveyid
* @return string
*/
function activateSurvey($postsid,$surveyid, $scriptname='admin.php')
{
global $dbprefix, $connect, $clang, $databasetype,$databasetabletype, $uploaddir;
$createsurvey='';
$activateoutput='';
$createsurveytimings='';
$createsurveydirectory=false;
//Check for any additional fields for this survey and create necessary fields (token and datestamp)
$pquery = "SELECT anonymized, allowregister, datestamp, ipaddr, refurl, savetimings FROM {$dbprefix}surveys WHERE sid={$postsid}";
$presult=db_execute_assoc($pquery);
$prow=$presult->FetchRow();
if ($prow['allowregister'] == "Y")
{
$surveyallowsregistration="TRUE";
}
if ($prow['savetimings'] == "Y")
{
$savetimings="TRUE";
}
//strip trailing comma and new line feed (if any)
$createsurvey = rtrim($createsurvey, ",\n");
//strip trailing comma and new line feed (if any)
$createsurvey = rtrim($createsurvey, ",\n");
//Get list of questions for the base language
$fieldmap=createFieldMap($surveyid);
foreach ($fieldmap as $arow) //With each question, create the appropriate field(s)
{
if ($createsurvey!='') {$createsurvey .= ",\n";}
$createsurvey .= ' `'.$arow['fieldname'].'`';
switch($arow['type'])
{
case 'startlanguage':
$createsurvey .= " C(20) NOTNULL";
break;
case 'id':
$createsurvey .= " I NOTNULL AUTO PRIMARY";
$createsurveytimings .= " `{$arow['fieldname']}` I NOTNULL PRIMARY,\n";
break;
case "startdate":
case "datestamp":
$createsurvey .= " T NOTNULL";
break;
case "submitdate":
$createsurvey .= " T";
break;
case "lastpage":
$createsurvey .= " I";
break;
case "N": //NUMERICAL
$createsurvey .= " F";
break;
case "S": //SHORT TEXT
if ($databasetype=='mysql' || $databasetype=='mysqli') {$createsurvey .= " X";}
else {$createsurvey .= " C(255)";}
break;
case "L": //LIST (RADIO)
case "!": //LIST (DROPDOWN)
case "M": //Multiple choice
case "P": //Multiple choice with comment
case "O": //DROPDOWN LIST WITH COMMENT
if ($arow['aid'] != 'other' && strpos($arow['aid'],'comment')===false && strpos($arow['aid'],'othercomment')===false)
{
$createsurvey .= " C(5)";
}
else
{
$createsurvey .= " X";
}
break;
case "K": // Multiple Numerical
$createsurvey .= " F";
break;
case "U": //Huge text
case "Q": //Multiple short text
case "T": //LONG TEXT
case ";": //Multi Flexi
case ":": //Multi Flexi
$createsurvey .= " X";
break;
case "D": //DATE
$createsurvey .= " D";
break;
case "5": //5 Point Choice
case "G": //Gender
case "Y": //YesNo
case "X": //Boilerplate
$createsurvey .= " C(1)";
break;
case "I": //Language switch
$createsurvey .= " C(20)";
break;
case "|":
$createsurveydirectory = true;
if (strpos($arow['fieldname'], "_"))
$createsurvey .= " I1";
else
$createsurvey .= " X";
break;
case "ipaddress":
if ($prow['ipaddr'] == "Y")
$createsurvey .= " X";
break;
case "url":
if ($prow['refurl'] == "Y")
$createsurvey .= " X";
break;
case "token":
if ($prow['anonymized'] == "N")
{
$createsurvey .= " C(36)";
}
break;
default:
$createsurvey .= " C(5)";
}
}
$timingsfieldmap = createTimingsFieldMap($surveyid);
$createsurveytimings .= '`'.implode("` F DEFAULT '0',\n`",array_keys($timingsfieldmap)) . "` F DEFAULT '0'";
// If last question is of type MCABCEFHP^QKJR let's get rid of the ending coma in createsurvey
$createsurvey = rtrim($createsurvey, ",\n")."\n"; // Does nothing if not ending with a comma
$tabname = "{$dbprefix}survey_{$postsid}"; # not using db_table_name as it quotes the table name (as does CreateTableSQL)
$taboptarray = array('mysql' => 'ENGINE='.$databasetabletype.' CHARACTER SET utf8 COLLATE utf8_unicode_ci',
'mysqli'=> 'ENGINE='.$databasetabletype.' CHARACTER SET utf8 COLLATE utf8_unicode_ci');
$dict = NewDataDictionary($connect);
$sqlarray = $dict->CreateTableSQL($tabname, $createsurvey, $taboptarray);
if (isset($savetimings) && $savetimings=="TRUE")
{
$tabnametimings = $tabname .'_timings';
$sqlarraytimings = $dict->CreateTableSQL($tabnametimings, $createsurveytimings, $taboptarray);
}
$execresult=$dict->ExecuteSQLArray($sqlarray,1);
if ($execresult==0 || $execresult==1)
{
$activateoutput .= "<br />\n<div class='messagebox ui-corner-all'>\n" .
"<div class='header ui-widget-header'>".$clang->gT("Activate Survey")." ($surveyid)</div>\n" .
"<div class='warningheader'>".$clang->gT("Survey could not be actived.")."</div>\n" .
"<p>" .
$clang->gT("Database error:")."\n <font color='red'>" . $connect->ErrorMsg() . "</font>\n" .
"<pre>$createsurvey</pre>\n
<a href='$scriptname?sid={$postsid}'>".$clang->gT("Main Admin Screen")."</a>\n</div>" ;
}
if ($execresult != 0 && $execresult !=1)
{
$anquery = "SELECT autonumber_start FROM {$dbprefix}surveys WHERE sid={$postsid}";
if ($anresult=db_execute_assoc($anquery))
{
//if there is an autonumber_start field, start auto numbering here
while($row=$anresult->FetchRow())
{
if ($row['autonumber_start'] > 0)
{
if ($databasetype=='odbc_mssql' || $databasetype=='odbtp' || $databasetype=='mssql_n' || $databasetype=='mssqlnative') {
mssql_drop_primary_index('survey_'.$postsid);
mssql_drop_constraint('id','survey_'.$postsid);
$autonumberquery = "alter table {$dbprefix}survey_{$postsid} drop column id ";
$connect->Execute($autonumberquery);
$autonumberquery = "alter table {$dbprefix}survey_{$postsid} add [id] int identity({$row['autonumber_start']},1)";
$connect->Execute($autonumberquery);
}
else
{
$autonumberquery = "ALTER TABLE {$dbprefix}survey_{$postsid} AUTO_INCREMENT = ".$row['autonumber_start'];
$result = @$connect->Execute($autonumberquery);
}
}
}
if (isset($savetimings) && $savetimings=="TRUE")
{
$dict->ExecuteSQLArray($sqlarraytimings,1); // create a timings table for this survey
}
}
$activateoutput .= "<br />\n<div class='messagebox ui-corner-all'>\n";
$activateoutput .= "<div class='header ui-widget-header'>".$clang->gT("Activate Survey")." ($surveyid)</div>\n";
$activateoutput .= "<div class='successheader'>".$clang->gT("Survey has been activated. Results table has been successfully created.")."</div><br /><br />\n";
// create the survey directory where the uploaded files can be saved
if ($createsurveydirectory)
if (!file_exists($uploaddir."/surveys/" . $postsid . "/files"))
{
if (!(mkdir($uploaddir."/surveys/" . $postsid . "/files", 0777, true)))
{
$activateoutput .= "<div class='warningheader'>".
$clang->gT("The required directory for saving the uploaded files couldn't be created. Please check file premissions on the limesurvey/upload/surveys directory.") . "</div>";
}
else
{
file_put_contents($uploaddir."/surveys/" . $postsid . "/files/index.html",'<html><head></head><body></body></html>');
}
}
$acquery = "UPDATE {$dbprefix}surveys SET active='Y' WHERE sid=".$surveyid;
$acresult = $connect->Execute($acquery);
if (isset($surveyallowsregistration) && $surveyallowsregistration == "TRUE")
{
$activateoutput .= $clang->gT("This survey allows public registration. A token table must also be created.")."<br /><br />\n";
$activateoutput .= "<input type='submit' value='".$clang->gT("Initialise tokens")."' onclick=\"".get2post("$scriptname?action=tokens&amp;sid={$postsid}&amp;createtable=Y")."\" />\n";
}
else
{
$activateoutput .= $clang->gT("This survey is now active, and responses can be recorded.")."<br /><br />\n";
$activateoutput .= "<strong>".$clang->gT("Open-access mode").":</strong> ".$clang->gT("No invitation code is needed to complete the survey.")."<br />".$clang->gT("You can switch to the closed-access mode by initialising a token table with the button below.")."<br /><br />\n";
$activateoutput .= "<input type='submit' value='".$clang->gT("Switch to closed-access mode")."' onclick=\"".get2post("$scriptname?action=tokens&amp;sid={$postsid}&amp;createtable=Y")."\" />\n";
$activateoutput .= "<input type='submit' value='".$clang->gT("No, thanks.")."' onclick=\"".get2post("$scriptname?sid={$postsid}")."\" />\n";
}
$activateoutput .= "</div><br />&nbsp;\n";
$lsrcOutput = true;
}
if($scriptname=='lsrc')
{
if($lsrcOutput==true)
return true;
else
return $activateoutput;
}
else
{
return $activateoutput;
}
}
function mssql_drop_constraint($fieldname, $tablename)
{
global $dbprefix, $connect, $modifyoutput;
// find out the name of the default constraint
// Did I already mention that this is the most suckiest thing I have ever seen in MSSQL database?
$dfquery ="SELECT c_obj.name AS constraint_name
FROM sys.sysobjects AS c_obj INNER JOIN
sys.sysobjects AS t_obj ON c_obj.parent_obj = t_obj.id INNER JOIN
sys.sysconstraints AS con ON c_obj.id = con.constid INNER JOIN
sys.syscolumns AS col ON t_obj.id = col.id AND con.colid = col.colid
WHERE (c_obj.xtype = 'D') AND (col.name = '$fieldname') AND (t_obj.name='{$dbprefix}{$tablename}')";
$defaultname=$connect->GetRow($dfquery);
if ($defaultname!=false)
{
modify_database("","ALTER TABLE [prefix_$tablename] DROP CONSTRAINT {$defaultname[0]}"); echo $modifyoutput; flush();
}
}
function mssql_drop_primary_index($tablename)
{
global $dbprefix, $connect, $modifyoutput;
// find out the constraint name of the old primary key
$pkquery = "SELECT CONSTRAINT_NAME "
."FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS "
."WHERE (TABLE_NAME = '{$dbprefix}{$tablename}') AND (CONSTRAINT_TYPE = 'PRIMARY KEY')";
$primarykey=$connect->GetOne($pkquery);
if ($primarykey!=false)
{
modify_database("","ALTER TABLE [prefix_{$tablename}] DROP CONSTRAINT {$primarykey}"); echo $modifyoutput; flush();
}
}

View File

@@ -10,7 +10,7 @@
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*
* $Id: admin.php 7156 2009-06-22 15:51:06Z lemeur $
* $Id: admin.php 10925 2011-09-02 14:12:02Z c_schmitz $
*/
// Security Checked: POST, GET, SESSION, REQUEST, returnglobal, DB
@@ -29,15 +29,12 @@ if (version_compare(PHP_VERSION,'5','>=')&& !(function_exists('domxml_new_doc'))
require_once(dirname(__FILE__).'/../config-defaults.php');
require_once(dirname(__FILE__).'/../common.php');
require_once('htmleditor-functions.php');
//@ini_set('session.gc_maxlifetime', $sessionlifetime); Might cause problems in client??
// Reset FileManagerContext
$_SESSION['FileManagerContext']='';
if (!isset($adminlang)) {$adminlang=returnglobal('adminlang');} // Admin language
if (!isset($surveyid)) {$surveyid=returnglobal('sid');} //SurveyID
if (!isset($ugid)) {$ugid=returnglobal('ugid');} //Usergroup-ID
if (!isset($gid)) {$gid=returnglobal('gid');} //GroupID
@@ -49,16 +46,16 @@ if (!isset($subaction)) {$subaction=returnglobal('subaction');} //Desired subact
if (!isset($editedaction)) {$editedaction=returnglobal('editedaction');} // for html editor integration
if ($action != 'showprintablesurvey')
if ($action != 'showprintablesurvey' && substr($action,0,4)!= 'ajax')
{
$adminoutput = helpscreenscript();
$adminoutput .= "<table width='100%' border='0' cellpadding='0' cellspacing='0' >\n"
."\t<tr>\n"
."\t\t<td valign='top' align='center' bgcolor='#F8F8FF'>\n";
} else {$adminoutput='';}
$adminoutput="<div id='wrapper'>";
}
else
{
$adminoutput='';
}
if($casEnabled)
if($casEnabled==true)
{
include_once("login_check_cas.php");
}
@@ -77,16 +74,10 @@ if ( $action == 'FakeGET')
include('access_denied.php');
}
if(isset($_SESSION['loginID']) && $action!='login')
if(isset($_SESSION['loginID']))
{
//VARIOUS DATABASE OPTIONS/ACTIONS PERFORMED HERE
if ($action == 'delsurvey' || $action == 'delgroup' ||
$action == 'delquestion' || $action == 'insertnewsurvey'||
$action == 'copynewquestion' || $action == 'insertnewgroup' || $action == 'insertCSV' ||
$action == 'insertnewquestion' || $action == 'updatesurvey' || $action == 'updatesurvey2' ||
$action == 'updategroup' || $action == 'deactivate' || $action == 'savepersonalsettings' ||
$action == 'updatequestion' || $action == 'modanswer' || $action == 'renumberquestions' ||
$action == 'delattribute' || $action == 'addattribute' || $action == 'editattribute')
if (in_array($action, array('updateemailtemplates','delsurvey','delgroup','delquestion','insertsurvey','updatesubquestions','copynewquestion','insertquestiongroup','insertCSV','insertquestion','updatesurveysettings','updatesurveysettingsandeditlocalesettings','updatesurveylocalesettings','updategroup','deactivate','savepersonalsettings','updatequestion','updateansweroptions','renumberquestions','updatedefaultvalues')))
{
include('database.php');
}
@@ -104,7 +95,7 @@ sendcacheheaders();
`superadmin`
*/
if ($action == 'importsurvey')
if ($action == 'importsurvey' || $action == 'copysurvey')
{
if ($_SESSION['USER_RIGHT_CREATE_SURVEY']==1) {include('http_importsurvey.php');}
else { include('access_denied.php');}
@@ -129,6 +120,16 @@ elseif ($action == 'checkintegrity')
if ($_SESSION['USER_RIGHT_CONFIGURATOR']==1) {include('integritycheck.php');}
else { include('access_denied.php');}
}
elseif ($action == "globalsettings")
{
if ($_SESSION['USER_RIGHT_CONFIGURATOR']==1) {globalsettingsdisplay();}
else { include("access_denied.php");}
}
elseif ($action == "globalsettingssave")
{
if ($_SESSION['USER_RIGHT_CONFIGURATOR']==1) {globalsettingssave();}
else { include("access_denied.php");}
}
elseif ($action=='labels' || $action=='newlabelset' || $action=='insertlabelset' ||
$action=='deletelabelset' || $action=='editlabelset' || $action=='modlabelsetanswers' ||
$action=='updateset' || $action=='importlabels' ||$action == 'importlabelresources')
@@ -146,6 +147,7 @@ elseif ($action=='templates' || $action=='templatecopy' || $action=='templatesav
/* Check survey right actions for validity
Currently existing survey rights:
`edit_survey_property`
@@ -156,169 +158,158 @@ elseif ($action=='templates' || $action=='templatecopy' || $action=='templatesav
`activate_survey`
*/
if (isset($surveyid) && $surveyid)
{
$surquery = "SELECT * FROM {$dbprefix}surveys_rights WHERE sid=".db_quote($surveyid)." AND uid = ".db_quote($_SESSION['loginID']); //Getting rights for this survey
$surresult = db_execute_assoc($surquery);
$surrows = $surresult->FetchRow();
}
if ($action == 'activate')
{
if($surrows['activate_survey'] || $_SESSION['USER_RIGHT_SUPERADMIN'] == 1) {include('activate.php');}
if(bHasSurveyPermission($surveyid,'surveyactivation','update')) {include('activate.php');}
else { include('access_denied.php');}
}
elseif ($action == 'conditions')
{
if($surrows['define_questions'] || $_SESSION['USER_RIGHT_SUPERADMIN'] == 1) {include('conditionshandling.php');}
if(bHasSurveyPermission($surveyid,'surveycontent','read')) {include('conditionshandling.php');}
else { include('access_denied.php');}
}
elseif ($action == 'importsurvresources')
elseif ($action == 'importsurveyresources')
{
if ($surrows['define_questions'] || $_SESSION['USER_RIGHT_SUPERADMIN'] == 1) {$_SESSION['FileManagerContext']="edit:survey:$surveyid";include('import_resources_zip.php');}
else { include('access_denied.php');}
}
elseif ($action == 'exportstructurecsv')
{
if($surrows['export'] || $_SESSION['USER_RIGHT_SUPERADMIN'] == 1) {include('export_structure_csv.php');}
if (bHasSurveyPermission($surveyid,'surveycontent','import')) {$_SESSION['FileManagerContext']="edit:survey:$surveyid";include('import_resources_zip.php');}
else { include('access_denied.php');}
}
elseif ($action == 'exportstructureLsrcCsv')
{
if($surrows['export'] || $_SESSION['USER_RIGHT_SUPERADMIN'] == 1) {include('export_structure_lsrc.php');}
if(bHasSurveyPermission($surveyid,'surveycontent','export')) {include('export_structure_lsrc.php');}
else { include('access_denied.php');}
}
elseif ($action == 'exportstructurequexml')
{
if($surrows['export'] || $_SESSION['USER_RIGHT_SUPERADMIN'] == 1) {include('export_structure_quexml.php');}
if(bHasSurveyPermission($surveyid,'surveycontent','export')) {include('export_structure_quexml.php');}
else { include('access_denied.php');}
}
elseif ($action == 'exportstructurexml')
{
if(bHasSurveyPermission($surveyid,'surveycontent','export')) {include('export_structure_xml.php');}
else { include('access_denied.php');}
}
elseif ($action == 'exportstructurecsvGroup')
{
if(bHasSurveyPermission($surveyid,'surveycontent','export')) {include('dumpgroup.php');}
else { include('access_denied.php');}
}
elseif ($action == 'exportstructureLsrcCsvGroup')
{
if(bHasSurveyPermission($surveyid,'surveycontent','export')) {include('dumpgroup.php');}
else { include('access_denied.php');}
}
elseif ($action == 'exportstructurecsvQuestion')
{
if(bHasSurveyPermission($surveyid,'surveycontent','export')) {include('dumpquestion.php');}
else { include('access_denied.php');}
}
elseif ($action == 'exportstructureLsrcCsvQuestion')
{
if(bHasSurveyPermission($surveyid,'surveycontent','export')) {include('dumpquestion.php');}
else { include('access_denied.php');}
}
elseif ($action == 'exportsurvresources')
{
if($surrows['export'] || $_SESSION['USER_RIGHT_SUPERADMIN'] == 1) {$_SESSION['FileManagerContext']="edit:survey:$surveyid";include('export_resources_zip.php');}
else { include('access_denied.php');}
}
elseif ($action == 'dumpquestion')
{
if($surrows['export'] || $_SESSION['USER_RIGHT_SUPERADMIN'] == 1) {include('dumpquestion.php');}
else { include('access_denied.php');}
}
elseif ($action == 'dumpgroup')
{
if($surrows['export'] || $_SESSION['USER_RIGHT_SUPERADMIN'] == 1) {include('dumpgroup.php');}
if(bHasSurveyPermission($surveyid,'surveycontent','export')) {$_SESSION['FileManagerContext']="edit:survey:$surveyid";include('export_resources_zip.php');}
else { include('access_denied.php');}
}
elseif ($action == 'deactivate')
{
if($surrows['activate_survey'] || $_SESSION['USER_RIGHT_SUPERADMIN'] == 1) {include('deactivate.php');}
if(bHasSurveyPermission($surveyid,'surveyactivation','update')) {include('deactivate.php');}
else { include('access_denied.php');}
}
elseif ($action == 'deletesurvey')
{
if($surrows['delete_survey'] || $_SESSION['USER_RIGHT_SUPERADMIN'] == 1) {include('deletesurvey.php');}
if(bHasSurveyPermission($surveyid,'survey','delete')) {include('deletesurvey.php');}
else { include('access_denied.php');}
}
elseif ($action == 'resetsurveylogic')
{
if($surrows['define_questions'] || $_SESSION['USER_RIGHT_SUPERADMIN'] == 1) {include('resetsurveylogic.php');}
if(bHasSurveyPermission($surveyid,'surveycontent','update')) {include('resetsurveylogic.php');}
else { include('access_denied.php');}
}
elseif ($action == 'importgroup')
{
if($surrows['define_questions'] || $_SESSION['USER_RIGHT_SUPERADMIN'] == 1) {include('importgroup.php');}
if(bHasSurveyPermission($surveyid,'surveycontent','import')) {include('importgroup.php');}
else { include('access_denied.php');}
}
elseif ($action == 'importquestion')
{
if($surrows['define_questions'] || $_SESSION['USER_RIGHT_SUPERADMIN'] == 1) {include('importquestion.php');}
if(bHasSurveyPermission($surveyid,'surveycontent','import')) {include('importquestion.php');}
else { include('access_denied.php');}
}
elseif ($action == 'listcolumn')
{
if($surrows['browse_response'] || $_SESSION['USER_RIGHT_SUPERADMIN'] == 1) {include('listcolumn.php');}
if(bHasSurveyPermission($surveyid,'statistics','read')) {include('listcolumn.php');}
else { include('access_denied.php');}
}
elseif ($action == 'previewquestion')
{
if($surrows['define_questions'] || $_SESSION['USER_RIGHT_SUPERADMIN'] == 1) {include('preview.php');}
if(bHasSurveyPermission($surveyid,'surveycontent','read')) {include('preview.php');}
else { include('access_denied.php');}
}
elseif ($action=='addgroup' || $action=='editgroup')
elseif ($action == 'previewgroup')
{
if($surrows['define_questions'] || $_SESSION['USER_RIGHT_SUPERADMIN'] == 1) {$_SESSION['FileManagerContext']="edit:group:$surveyid"; include('grouphandling.php');}
else { include('access_denied.php');}
require_once('../index.php');
exit;
}
elseif ($action == 'vvexport')
elseif ($action=='addgroup' || $action=='editgroup' || $action=='ordergroups')
{
if($surrows['browse_response'] || $_SESSION['USER_RIGHT_SUPERADMIN'] == 1) {include('vvexport.php');}
else { include('access_denied.php');}
}
elseif ($action == 'vvimport')
{
if($surrows['browse_response'] || $_SESSION['USER_RIGHT_SUPERADMIN'] == 1) {include('vvimport.php');}
else { include('access_denied.php');}
}
elseif ($action == 'importoldresponses')
{
if($surrows['browse_response'] || $_SESSION['USER_RIGHT_SUPERADMIN'] == 1) {include('importoldresponses.php');}
if(bHasSurveyPermission($surveyid,'surveycontent','read')) {$_SESSION['FileManagerContext']="edit:group:$surveyid"; include('questiongrouphandling.php');}
else { include('access_denied.php');}
}
elseif ($action == 'saved')
{
if($surrows['browse_response'] || $_SESSION['USER_RIGHT_SUPERADMIN'] == 1) {include('saved.php');}
if(bHasSurveyPermission($surveyid,'responses','read')) {include('saved.php');}
else { include('access_denied.php');}
}
elseif ($action == 'exportresults')
//<AdV>
elseif ($action == 'translate')
{
if($surrows['export'] || $_SESSION['USER_RIGHT_SUPERADMIN'] == 1) {include('exportresults.php');}
else { include('access_denied.php');}
}
elseif ($action == 'exportspss')
{
if($surrows['export'] || $_SESSION['USER_RIGHT_SUPERADMIN'] == 1) {include('export_data_spss.php');}
else { include('access_denied.php');}
}
elseif ($action == 'exportr')
{
if($surrows['export'] || $_SESSION['USER_RIGHT_SUPERADMIN'] == 1) {include('export_data_r.php');}
else { include('access_denied.php');}
}
elseif ($action == 'statistics')
{
if($surrows['browse_response'] || $_SESSION['USER_RIGHT_SUPERADMIN'] == 1) {include('statistics.php');}
else { include('access_denied.php');}
}
elseif ($action == 'dataentry')
{
if($surrows['browse_response'] || $_SESSION['USER_RIGHT_SUPERADMIN'] == 1) {include('dataentry.php');}
else { include('access_denied.php');}
}
elseif ($action == 'browse')
{
if($surrows['browse_response'] || $_SESSION['USER_RIGHT_SUPERADMIN'] == 1) {include('browse.php');}
if(bHasSurveyPermission($surveyid,'translations','read')) {$_SESSION['FileManagerContext']="edit:translate:$surveyid"; include('translate.php');}
else { include('access_denied.php'); }
}
//</AdV>
elseif ($action == 'tokens')
{
if($surrows['activate_survey'] || $_SESSION['USER_RIGHT_SUPERADMIN'] == 1) {$_SESSION['FileManagerContext']="edit:emailsettings:$surveyid"; include('tokens.php');}
if(bHasSurveyPermission($surveyid,'tokens','read'))
{
$_SESSION['FileManagerContext']="edit:emailsettings:$surveyid";
include('tokens.php');
}
else { include('access_denied.php'); }
}
elseif ($action == 'emailtemplates')
{
$_SESSION['FileManagerContext']="edit:emailsettings:$surveyid";
}
elseif ($action == 'iteratesurvey')
{
if( ($surrows['browse_response'] && $surrows['activate_survey']) || $_SESSION['USER_RIGHT_SUPERADMIN'] == 1) {include('iterate_survey.php');}
if(bHasSurveyPermission($surveyid,'surveyactivation','update')) {include('iterate_survey.php');}
else { include('access_denied.php');}
}
elseif ($action=='showquexmlsurvey')
{
include('quexmlsurvey.php'); //No special right needed to show the printable survey
include('quexmlsurvey.php'); //Same rights as printable
}
elseif ($action=='showprintablesurvey')
{
include('printablesurvey.php'); //No special right needed to show the printable survey
}
elseif ($action=='listcolumn')
{
include('listcolumn.php');
}
elseif ($action=='update')
{
if( $_SESSION['USER_RIGHT_SUPERADMIN'] == 1) include($homedir.'/update/updater.php');
else { include('access_denied.php');}
}
elseif ($action=='assessments' || $action=='assessmentdelete' || $action=='assessmentedit' || $action=='assessmentadd' || $action=='assessmentupdate')
{
if($surrows['define_questions'] || $_SESSION['USER_RIGHT_SUPERADMIN'] == 1) {
if(bHasSurveyPermission($surveyid,'assessments','read')) {
$_SESSION['FileManagerContext']="edit:assessments:$surveyid";
include('assessments.php');
}
@@ -349,8 +340,13 @@ elseif ($action == 'replacementfields')
include('access_denied.php');
}
break;
case 'updatesurvey':
if ($_SESSION['USER_RIGHT_SUPERADMIN'] == 1 || $surrows['edit_survey_property'])
case 'editsurveylocalesettings':
case 'updatesurveysettingsandeditlocalesettings':
case 'translatetitle':
case 'translatedescription':
case 'translatewelcome':
case 'translateend':
if (bHasSurveyPermission($surveyid,'surveysettings','update') && bHasSurveyPermission($surveyid,'surveylocale','read'))
{
$_SESSION['FileManagerContext']="edit:survey:$surveyid";
include('fck_LimeReplacementFields.php');exit;
@@ -361,7 +357,8 @@ elseif ($action == 'replacementfields')
}
break;
case 'tokens': // email
if ( $_SESSION['USER_RIGHT_SUPERADMIN'] == 1 || $surrows['activate_survey'])
case 'emailtemplates': // email
if (bHasSurveyPermission($surveyid,'tokens','update'))
{
$_SESSION['FileManagerContext']="edit:emailsettings:$surveyid";
include('fck_LimeReplacementFields.php');exit;
@@ -374,7 +371,9 @@ elseif ($action == 'replacementfields')
case 'editquestion':
case 'copyquestion':
case 'addquestion':
if ( $_SESSION['USER_RIGHT_SUPERADMIN'] == 1 || $surrows['define_questions'])
case 'translatequestion':
case 'translatequestion_help':
if (bHasSurveyPermission($surveyid,'surveycontent','read'))
{
$_SESSION['FileManagerContext']="edit:question:$surveyid";
include('fck_LimeReplacementFields.php');exit;
@@ -386,7 +385,9 @@ elseif ($action == 'replacementfields')
break;
case 'editgroup':
case 'addgroup':
if ( $_SESSION['USER_RIGHT_SUPERADMIN'] == 1 || $surrows['define_questions'])
case 'translategroup':
case 'translategroup_desc':
if (bHasSurveyPermission($surveyid,'surveycontent','read'))
{
$_SESSION['FileManagerContext']="edit:group:$surveyid";
include('fck_LimeReplacementFields.php');exit;
@@ -397,7 +398,8 @@ elseif ($action == 'replacementfields')
}
break;
case 'editanswer':
if ( $_SESSION['USER_RIGHT_SUPERADMIN'] == 1 || $surrows['define_questions'])
case 'translateanswer':
if (bHasSurveyPermission($surveyid,'surveycontent','read'))
{
$_SESSION['FileManagerContext']="edit:answer:$surveyid";
include('fck_LimeReplacementFields.php');exit;
@@ -409,7 +411,7 @@ elseif ($action == 'replacementfields')
break;
case 'assessments':
case 'assessmentedit':
if($surrows['define_questions'] || $_SESSION['USER_RIGHT_SUPERADMIN'] == 1) {
if(bHasSurveyPermission($surveyid,'assessments','read')) {
$_SESSION['FileManagerContext']="edit:assessments:$surveyid";
include('fck_LimeReplacementFields.php');
}
@@ -419,37 +421,126 @@ elseif ($action == 'replacementfields')
break;
}
}
if (!isset($assessmentsoutput) && !isset($statisticsoutput) && !isset($browseoutput) && !isset($savedsurveyoutput) && !isset( $listcolumnoutput ) &&
!isset($dataentryoutput) && !isset($conditionsoutput) && !isset($importoldresponsesoutput) && !isset($exportspssoutput) && !isset($exportroutput) &&
!isset($vvoutput) && !isset($tokenoutput) && !isset($exportoutput) && !isset($templatesoutput) && !isset($iteratesurveyoutput) &&
(isset($surveyid) || $action=='listurveys' || $action=='personalsettings' || $action=='checksettings' || //Still to check
$action=='editsurvey' || $action=='updatesurvey' || $action=='ordergroups' ||
$action=='newsurvey' || $action=='listsurveys' ||
$action=='surveyrights' || $action=='quotas') )
elseif ($action == 'ajaxtranslategoogleapi')
{
if ($action=='editsurvey' || $action=='updatesurvey')
if(bHasSurveyPermission($surveyid,'translations','read'))
{
include('translate_google_api.php');
}
else
{
include('access_denied.php');
}
}
elseif ($action=='ajaxowneredit' || $action == 'ajaxgetusers'){
include('surveylist.php');
}
if (!isset($assessmentsoutput) && !isset($statisticsoutput) && !isset($browseoutput) &&
!isset($savedsurveyoutput) && !isset($listcolumnoutput) && !isset($conditionsoutput) &&
!isset($importoldresponsesoutput) && !isset($exportroutput) && !isset($vvoutput) &&
!isset($tokenoutput) && !isset($exportoutput) && !isset($templatesoutput) && !isset($translateoutput) && //<AdV>
!isset($iteratesurveyoutput) && (substr($action,0,4)!= 'ajax') && ($action!='update') &&
(isset($surveyid) || $action == "" || preg_match('/^(personalsettings|statistics|copysurvey|importsurvey|editsurveysettings|editsurveylocalesettings|updatesurveysettings|updatesurveysettingsandeditlocalesettings|updatedefaultvalues|ordergroups|dataentry|newsurvey|globalsettings|editusergroups|editusergroup|exportspss|surveyrights|quotas|editusers|login|browse|vvimport|vvexport|setuserrights|modifyuser|setusertemplates|deluser|adduser|userrights|usertemplates|moduser|addusertogroup|deleteuserfromgroup|globalsettingssave|savepersonalsettings|addusergroup|editusergroupindb|usergroupindb|finaldeluser|delusergroup|mailusergroup|mailsendusergroup)$/',$action)))
{
if ($action=='editsurveysettings' || $action=='editsurveylocalesettings')
{
$_SESSION['FileManagerContext']="edit:survey:$surveyid";
}
include('html_functions.php');
include('html.php');
}
if ($action=='addquestion' || $action=='copyquestion' || $action=='editquestion' ||
$action=='orderquestions' || $action=='editattribute' || $action=='delattribute' ||
$action=='addattribute' )
{if($surrows['define_questions'] || $_SESSION['USER_RIGHT_SUPERADMIN'] == 1) {$_SESSION['FileManagerContext']="edit:question:$surveyid";include('questionhandling.php');}
if ($action == "listsurveys"){
include('html_functions.php');
include('html.php');
include('surveylist.php');
}
if ($action == 'dataentry')
{
if (bHasSurveyPermission($surveyid, 'responses','read') || bHasSurveyPermission($surveyid, 'responses','create') || bHasSurveyPermission($surveyid, 'responses','update'))
{
include('dataentry.php');
}
else
{
include('access_denied.php');
}
}
elseif ($action == 'exportresults')
{
if(bHasSurveyPermission($surveyid,'responses','export')) {include('exportresults.php');}
else { include('access_denied.php');}
}
elseif ($action == 'statistics')
{
if(bHasSurveyPermission($surveyid,'statistics','read')) {include('statistics.php');}
else { include('access_denied.php');}
}
elseif ($action == 'importoldresponses')
{
if(bHasSurveyPermission($surveyid,'responses','create')) {include('importoldresponses.php');}
else { include('access_denied.php');}
}
elseif ($action == 'exportspss')
{
if(bHasSurveyPermission($surveyid,'responses','export'))
{
include('export_data_spss.php');
}
else
{
include('access_denied.php');
}
}
elseif ($action == 'browse')
{
if(bHasSurveyPermission($surveyid,'responses','read') || bHasSurveyPermission($surveyid,'statistics','read') || bHasSurveyPermission($surveyid,'responses','export'))
{
include('browse.php');
}
else
{
include('access_denied.php');
}
}
elseif ($action == 'exportr')
{
if(bHasSurveyPermission($surveyid,'responses','export')) {include('export_data_r.php');}
else { include('access_denied.php');}
}
elseif ($action == 'vvexport')
{
if(bHasSurveyPermission($surveyid,'responses','export')) {include('vvexport.php');}
else { include('access_denied.php');}
}
elseif ($action == 'vvimport')
{
if(bHasSurveyPermission($surveyid,'responses','create')) {include('vvimport.php');}
else { include('access_denied.php');}
}
if ($action=='addquestion' || $action=='copyquestion' || $action=='editquestion' || $action=='editdefaultvalues' ||
$action=='orderquestions' || $action=='ajaxquestionattributes' || $action=='ajaxlabelsetpicker' || $action=='ajaxlabelsetdetails')
{
if(bHasSurveyPermission($surveyid,'surveycontent','read'))
{
$_SESSION['FileManagerContext']="edit:question:$surveyid";
include('questionhandling.php');
}
else
{
include('access_denied.php');
}
}
if ($action=='adduser' || $action=='deluser' || $action=='moduser' || $action=='setusertemplates' || $action=='usertemplates' || //Still to check
if ($action=='adduser' || $action=='deluser'|| $action=='finaldeluser' || $action=='moduser' || $action=='setusertemplates' || $action=='usertemplates' || //Still to check
$action=='userrights' || $action=='modifyuser' || $action=='editusers' ||
$action=='addusergroup' || $action=='editusergroup' || $action=='mailusergroup' ||
$action=='delusergroup' || $action=='usergroupindb' || $action=='mailsendusergroup' ||
$action=='editusergroupindb' || $action=='editusergroups' || $action=='deleteuserfromgroup' ||
$action=='addusertogroup' || $action=='setuserrights' || $action=='setasadminchild')
{
include ('userrighthandling.php');
}
@@ -458,14 +549,14 @@ elseif ($action == 'replacementfields')
// For some output we dont want to have the standard admin menu bar
if (!isset($labelsoutput) && !isset($templatesoutput) && !isset($printablesurveyoutput) &&
!isset($assessmentsoutput) && !isset($tokenoutput) && !isset($browseoutput) && !isset($exportspssoutput) && !isset($exportroutput) &&
!isset($dataentryoutput) && !isset($statisticsoutput)&& !isset($savedsurveyoutput) &&
!isset($dataentryoutput) && !isset($statisticsoutput)&& !isset($savedsurveyoutput) && !isset($translateoutput) && //<AdV>
!isset($exportoutput) && !isset($importoldresponsesoutput) && !isset($conditionsoutput) &&
!isset($vvoutput) && !isset($listcolumnoutput) && !isset($importlabelresources) && !isset($iteratesurveyoutput))
!isset($vvoutput) && !isset($listcolumnoutput) && !isset($importlabelresources) && !isset($iteratesurveyoutput) &&
(substr($action,0,4)!= 'ajax') && $action!='update' && $action!='showphpinfo')
{
$adminoutput.= showadminmenu();
}
if (isset($databaseoutput)) {$adminoutput.= $databaseoutput;}
if (isset($templatesoutput)) {$adminoutput.= $templatesoutput;}
if (isset($accesssummary )) {$adminoutput.= $accesssummary;}
@@ -479,11 +570,14 @@ elseif ($action == 'replacementfields')
if (isset($answersummary )) {$adminoutput.= $answersummary;}
if (isset($cssummary )) {$adminoutput.= $cssummary;}
if (isset($listcolumnoutput)) {$adminoutput.= $listcolumnoutput;}
if (isset($ajaxoutput)) {$adminoutput.= $ajaxoutput;}
if (isset($editgroup)) {$adminoutput.= $editgroup;}
if (isset($editquestion)) {$adminoutput.= $editquestion;}
if (isset($editdefvalues)) {$adminoutput.= $editdefvalues;}
if (isset($editsurvey)) {$adminoutput.= $editsurvey;}
if (isset($translateoutput)) {$adminoutput.= $translateoutput;} //<AdV>
if (isset($quotasoutput)) {$adminoutput.= $quotasoutput;}
if (isset($labelsoutput)) {$adminoutput.= $labelsoutput;}
if (isset($listsurveys)) {$adminoutput.= $listsurveys; }
@@ -498,9 +592,11 @@ elseif ($action == 'replacementfields')
if (isset($newanswer)) {$adminoutput.= $newanswer;}
if (isset($editanswer)) {$adminoutput.= $editanswer;}
if (isset($assessmentsoutput)) {$adminoutput.= $assessmentsoutput;}
if (isset($sHTMLOutput)) {$adminoutput.= $sHTMLOutput;}
if (isset($importsurvey)) {$adminoutput.= $importsurvey;}
if (isset($importsurvresourcesoutput)) {$adminoutput.= $importsurvresourcesoutput;}
if (isset($importsurveyresourcesoutput)) {$adminoutput.= $importsurveyresourcesoutput;}
if (isset($importgroup)) {$adminoutput.= $importgroup;}
if (isset($importquestion)) {$adminoutput.= $importquestion;}
if (isset($printablesurveyoutput)) {$adminoutput.= $printablesurveyoutput;}
@@ -521,74 +617,69 @@ elseif ($action == 'replacementfields')
if (isset($dumpdboutput)) {$adminoutput.= $dumpdboutput;}
if (isset($exportspssoutput)) {$adminoutput.= $exportspssoutput;}
if (isset($exportroutput)) {$adminoutput.= $exportroutput;}
if (isset($loginsummary)) {$adminoutput.= $loginsummary;}
if (!isset($printablesurveyoutput) && ($subaction!='export'))
if (!isset($printablesurveyoutput) && $subaction!='export' && (substr($action,0,4)!= 'ajax'))
{
if (!isset($_SESSION['metaHeader'])) {$_SESSION['metaHeader']='';}
$adminoutput = getAdminHeader($_SESSION['metaHeader']).$adminoutput; // All future output is written into this and then outputted at the end of file
unset($_SESSION['metaHeader']);
$adminoutput.= "\t\t</td>\n".helpscreen()
. "\t</tr>\n"
. "</table>\n";
$adminoutput.= "</div>\n";
if(!isset($_SESSION['checksessionpost']))
{
$_SESSION['checksessionpost'] = '';
}
$adminoutput .= "<script type=\"text/javascript\">\n"
. "<!--\n"
. "\tfor(i=0; i<document.forms.length; i++)\n"
. "\t{\n"
. "\t\tvar el = document.createElement('input');\n"
. "\t\tel.type = 'hidden';\n"
. "\t\tel.name = 'checksessionbypost';\n"
. "\t\tel.value = '".$_SESSION['checksessionpost']."';\n"
. "\t\tdocument.forms[i].appendChild(el);\n"
. "var el = document.createElement('input');\n"
. "el.type = 'hidden';\n"
. "el.name = 'checksessionbypost';\n"
. "el.value = '".$_SESSION['checksessionpost']."';\n"
. "document.forms[i].appendChild(el);\n"
. "\t}\n"
. "\n"
. "\tfunction addHiddenElement(theform,thename,thevalue)\n"
. "\t{\n"
. "\t\tvar myel = document.createElement('input');\n"
. "\t\tmyel.type = 'hidden';\n"
. "\t\tmyel.name = thename;\n"
. "\t\ttheform.appendChild(myel);\n"
. "\t\tmyel.value = thevalue;\n"
. "\t\treturn myel;\n"
. "var myel = document.createElement('input');\n"
. "myel.type = 'hidden';\n"
. "myel.name = thename;\n"
. "theform.appendChild(myel);\n"
. "myel.value = thevalue;\n"
. "return myel;\n"
. "\t}\n"
. "\n"
. "\tfunction sendPost(myaction,checkcode,arrayparam,arrayval)\n"
. "\t{\n"
. "\t\tvar myform = document.createElement('form');\n"
. "\t\tdocument.body.appendChild(myform);\n"
. "\t\tmyform.action =myaction;\n"
. "\t\tmyform.method = 'POST';\n"
. "\t\tfor (i=0;i<arrayparam.length;i++)\n"
. "\t\t{\n"
. "\t\t\taddHiddenElement(myform,arrayparam[i],arrayval[i])\n"
. "\t\t}\n"
. "\t\taddHiddenElement(myform,'checksessionbypost',checkcode)\n"
. "\t\tmyform.submit();\n"
. "var myform = document.createElement('form');\n"
. "document.body.appendChild(myform);\n"
. "myform.action =myaction;\n"
. "myform.method = 'POST';\n"
. "for (i=0;i<arrayparam.length;i++)\n"
. "{\n"
. "\taddHiddenElement(myform,arrayparam[i],arrayval[i])\n"
. "}\n"
. "addHiddenElement(myform,'checksessionbypost',checkcode)\n"
. "myform.submit();\n"
. "\t}\n"
. "\n"
. "//-->\n"
. "</script>\n";
$adminoutput .= "".getAdminFooter("http://docs.limesurvey.org", $clang->gT("LimeSurvey Online Manual"));
$adminoutput .= getAdminFooter("http://docs.limesurvey.org", $clang->gT("LimeSurvey online manual"));
}
}
else
{ //not logged in
sendcacheheaders();
if (!isset($_SESSION['metaHeader'])) {$_SESSION['metaHeader']='';}
$adminoutput = getAdminHeader($_SESSION['metaHeader']).$adminoutput; // All future output is written into this and then outputted at the end of file
$adminoutput = getAdminHeader($_SESSION['metaHeader']).$adminoutput.$loginsummary; // All future output is written into this and then outputted at the end of file
unset($_SESSION['metaHeader']);
$adminoutput.= "\t\t</td>\n".helpscreen()
. "\t</tr>\n"
. "</table>\n"
. getAdminFooter("http://docs.limesurvey.org", $clang->gT("LimeSurvey Online Manual"));
$adminoutput.= "</div>\n".getAdminFooter("http://docs.limesurvey.org", $clang->gT("LimeSurvey online manual"));
}
if (($action=='showphpinfo') && ($_SESSION['USER_RIGHT_CONFIGURATOR'] == 1))
{
phpinfo();
@@ -598,120 +689,3 @@ else
echo $adminoutput;
}
function helpscreenscript()
// returns the script part for online help to be included outside a table
{
$helpoutput= "<script type='text/javascript'>\n"
."\tfunction showhelp(action)\n"
."\t\t{\n"
."\t\tvar name='help';\n"
."\t\tif (action == \"hide\")\n"
."\t\t\t{\n"
."\t\t\tdocument.getElementById(name).style.display='none';\n"
."\t\t\t}\n"
."\t\telse if (action == \"show\")\n"
."\t\t\t{\n"
."\t\t\tdocument.getElementById(name).style.display='';\n"
."\t\t\t}\n"
."\t\t}\n"
."</script>\n";
return $helpoutput;
}
function helpscreen()
// This functions loads the nescessary helpscreens for each action and hides the help window
//
{
global $homeurl, $langdir, $imagefiles;
global $surveyid, $gid, $qid, $action, $clang;
$helpoutput="\t\t<td id='help' width='200' valign='top' style='display: none' bgcolor='#F8F8FF'>\n"
."\t\t\t<table width='100%'><tr><td>"
."<table width='100%' align='center' cellspacing='0'>\n"
."\t\t\t\t<tr>\n"
."\t\t\t\t\t<td bgcolor='#D2E0F2' height='8'>\n"
."\t\t\t\t\t\t<font size='1'><strong>"
.$clang->gT("Help")."</strong>\n"
."\t\t\t\t\t</font></td>\n"
."\t\t\t\t</tr>\n"
."\t\t\t\t<tr>\n"
."\t\t\t\t\t<td align='center' bgcolor='#EEF6FF' style='border-style: solid; border-width: 1px; border-color: #D2E0F2'>\n"
."\t\t\t\t\t\t<img src='$imagefiles/blank.gif' alt='' width='20' hspace='0' border='0' align='left' />\n"
."\t\t\t\t\t\t<input type='image' src='$imagefiles/close.gif' name='CloseHelp' align='right' onclick=\"showhelp('hide')\" />\n"
."\t\t\t\t\t</td>\n"
."\t\t\t\t</tr>\n"
."\t\t\t\t<tr>\n"
."\t\t\t\t\t<td bgcolor='#EEF6FF' height='100%' style='border-width: 0px;'>\n";
//determine which help document to show
if (!$surveyid && $action != "editusers")
{
$helpdoc = "$langdir/admin.html";
}
elseif (!$surveyid && $action=="editusers")
{
$helpdoc = "$langdir/users.html";
}
elseif ($surveyid && !$gid)
{
$helpdoc = "$langdir/survey.html";
}
elseif ($surveyid && $gid && !$qid)
{
$helpdoc = "$langdir/group.html";
}
elseif ($surveyid && $gid && $qid && !returnglobal('viewanswer'))
{
$helpdoc = "$langdir/question.html";
}
elseif ($surveyid && $gid && $qid && (returnglobal('viewanswer')))
{
$helpdoc = "$langdir/answer.html";
}
$helpoutput.= "\t\t\t\t\t\t<iframe width='200' height='400' src='$helpdoc' marginwidth='2' marginheight='2'>\n"
."\t\t\t\t\t\t</iframe>\n"
."\t\t\t\t\t</td>"
."\t\t\t\t</tr>\n"
."\t\t\t</table></td></tr></table>\n"
."\t\t</td>\n";
return $helpoutput;
}
function convertToArray($stringtoconvert, $seperator, $start, $end)
// this function is still used to read SQL files from version 1.0 or older
{
$begin=strpos($stringtoconvert, $start)+strlen($start);
$len=strpos($stringtoconvert, $end)-$begin;
$stringtoconvert=substr($stringtoconvert, $begin, $len);
$stringtoconvert=str_replace('\n',"\n",$stringtoconvert); //removes masking
$stringtoconvert=stripslashes($stringtoconvert);
$resultarray=explode($seperator, $stringtoconvert);
return $resultarray;
}
function get2post($url)
{
$url = preg_replace('/&amp;/i','&',$url);
list($calledscript,$query) = explode('?',$url);
$aqueryitems = explode('&',$query);
$arrayParam = Array();
$arrayVal = Array();
foreach ($aqueryitems as $queryitem)
{
list($paramname, $value) = explode ('=', $queryitem);
$arrayParam[] = "'".$paramname."'";
$arrayVal[] = "'".$value."'";
}
// $Paramlist = "[" . implode(",",$arrayParam) . "]";
// $Valuelist = "[" . implode(",",$arrayVal) . "]";
$Paramlist = "new Array(" . implode(",",$arrayParam) . ")";
$Valuelist = "new Array(" . implode(",",$arrayVal) . ")";
$callscript = "sendPost('$calledscript','".$_SESSION['checksessionpost']."',$Paramlist,$Valuelist);";
return $callscript;
}
?>

View File

@@ -0,0 +1,406 @@
<?php
/*
* LimeSurvey
* Copyright (C) 2007 The LimeSurvey Project Team / Carsten Schmitz
* All rights reserved.
* License: GNU/GPL License v2 or later, see LICENSE.php
* LimeSurvey is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*
* $Id: admin_functions.php 9586 2010-12-06 03:08:07Z c_schmitz $
* Files Purpose:
*/
function get2post($url)
{
$url = preg_replace('/&amp;/i','&',$url);
list($calledscript,$query) = explode('?',$url);
$aqueryitems = explode('&',$query);
$arrayParam = Array();
$arrayVal = Array();
foreach ($aqueryitems as $queryitem)
{
list($paramname, $value) = explode ('=', $queryitem);
$arrayParam[] = "'".$paramname."'";
$arrayVal[] = substr($value, 0, 9) != "document." ? "'".$value."'" : $value;
}
// $Paramlist = "[" . implode(",",$arrayParam) . "]";
// $Valuelist = "[" . implode(",",$arrayVal) . "]";
$Paramlist = "new Array(" . implode(",",$arrayParam) . ")";
$Valuelist = "new Array(" . implode(",",$arrayVal) . ")";
$callscript = "sendPost('$calledscript','".$_SESSION['checksessionpost']."',$Paramlist,$Valuelist);";
return $callscript;
}
/**
* This function switches identity insert on/off for the MSSQL database
*
* @param string $table table name (without prefix)
* @param mixed $state Set to true to activate ID insert, or false to deactivate
*/
function db_switchIDInsert($table,$state)
{
global $databasetype, $connect;
if ($databasetype=='odbc_mssql' || $databasetype=='odbtp' || $databasetype=='mssql_n' || $databasetype=='mssqlnative')
{
if ($state==true)
{
$connect->Execute('SET IDENTITY_INSERT '.db_table_name($table).' ON');
}
else
{
$connect->Execute('SET IDENTITY_INSERT '.db_table_name($table).' OFF');
}
}
}
/**
* Returns true if a user has permissions in the particular survey
*
* @param $iSID The survey ID
* @param $sPermission
* @param $sCRUD
* @param $iUID User ID - if not given the one of the current user is used
* @return bool
*/
function bHasSurveyPermission($iSID, $sPermission, $sCRUD, $iUID=null)
{
global $dbprefix, $connect;
if (!in_array($sCRUD,array('create','read','update','delete','import','export'))) return false;
$sCRUD=$sCRUD.'_p';
$iSID = (int)$iSID;
global $aSurveyPermissionCache;
if (is_null($iUID))
{
if (isset($_SESSION['loginID'])) $iUID = $_SESSION['loginID'];
else return false;
if ($_SESSION['USER_RIGHT_SUPERADMIN']==1) return true; //Superadmin has access to all
}
if (!isset($aSurveyPermissionCache[$iSID][$iUID][$sPermission][$sCRUD]))
{
$sSQL = "SELECT {$sCRUD} FROM " . db_table_name('survey_permissions') . "
WHERE sid={$iSID} AND uid = {$iUID}
and permission=".db_quoteall($sPermission); //Getting rights for this survey
$bPermission = $connect->GetOne($sSQL);
if ($bPermission==0 || is_null($bPermission)) $bPermission=false;
if ($bPermission==1) $bPermission=true;
$aSurveyPermissionCache[$iSID][$iUID][$sPermission][$sCRUD]=$bPermission;
}
return $aSurveyPermissionCache[$iSID][$iUID][$sPermission][$sCRUD];
}
/**
* Returns true if the given survey has a File Upload Question Type
* @param $surveyid The survey ID
* @return bool
*/
function bHasFileUploadQuestion($surveyid) {
$fieldmap = createFieldMap($surveyid);
foreach ($fieldmap as $field) {
if (isset($field['type']) && $field['type'] === '|') return true;
}
}
/**
* Returns true if a user has global permission for a certain action. Available permissions are
*
* USER_RIGHT_CREATE_SURVEY
* USER_RIGHT_CONFIGURATOR
* USER_RIGHT_CREATE_USER
* USER_RIGHT_DELETE_USER
* USER_RIGHT_SUPERADMIN
* USER_RIGHT_MANAGE_TEMPLATE
* USER_RIGHT_MANAGE_LABEL
*
* @param $sPermission
* @return bool
*/
function bHasGlobalPermission($sPermission)
{
global $dbprefix, $connect;
global $aSurveyGlobalPermissionCache;
if (isset($_SESSION['loginID'])) $iUID = $_SESSION['loginID'];
else return false;
if ($_SESSION['USER_RIGHT_SUPERADMIN']==1) return true; //Superadmin has access to all
if ($_SESSION[$sPermission]==1)
{
return true;
}
else
{
return false;
}
}
/**
* Set the survey permissions for a user. Beware that all survey permissions for the particual survey are removed before the new ones are written.
*
* @param int $iUserID The User ID
* @param int $iSurveyID The Survey ID
* @param array $aPermissions Array with permissions in format <permissionname>=>array('create'=>0/1,'read'=>0/1,'update'=>0/1,'delete'=>0/1)
*/
function SetSurveyPermissions($iUserID, $iSurveyID, $aPermissions)
{
global $connect, $surveyid;
$iUserID=sanitize_int($iUserID);
$sQuery = "delete from ".db_table_name('survey_permissions')." WHERE sid = {$iSurveyID} AND uid = {$iUserID}";
$connect->Execute($sQuery);
$bResult=true;
foreach($aPermissions as $sPermissionname=>$aPermissions)
{
if (!isset($aPermissions['create'])) {$aPermissions['create']=0;}
if (!isset($aPermissions['read'])) {$aPermissions['read']=0;}
if (!isset($aPermissions['update'])) {$aPermissions['update']=0;}
if (!isset($aPermissions['delete'])) {$aPermissions['delete']=0;}
if (!isset($aPermissions['import'])) {$aPermissions['import']=0;}
if (!isset($aPermissions['export'])) {$aPermissions['export']=0;}
if ($aPermissions['create']==1 || $aPermissions['read']==1 ||$aPermissions['update']==1 || $aPermissions['delete']==1 || $aPermissions['import']==1 || $aPermissions['export']==1)
{
$sQuery = "INSERT INTO ".db_table_name('survey_permissions')." (sid, uid, permission, create_p, read_p, update_p, delete_p, import_p, export_p)
VALUES ({$iSurveyID},{$iUserID},'{$sPermissionname}',{$aPermissions['create']},{$aPermissions['read']},{$aPermissions['update']},{$aPermissions['delete']},{$aPermissions['import']},{$aPermissions['export']})";
$bResult=$connect->Execute($sQuery);
}
}
return $bResult;
}
/**
* Gives all available survey permissions for a certain survey to a user
*
* @param mixed $iUserID The User ID
* @param mixed $iSurveyID The Survey ID
*/
function GiveAllSurveyPermissions($iUserID, $iSurveyID)
{
$aPermissions=aGetBaseSurveyPermissions();
$aPermissionsToSet=array();
foreach ($aPermissions as $sPermissionName=>$aPermissionDetails)
{
foreach ($aPermissionDetails as $sPermissionDetailKey=>$sPermissionDetailValue)
{
if (in_array($sPermissionDetailKey,array('create','read','update','delete','import','export')) && $sPermissionDetailValue==true)
{
$aPermissionsToSet[$sPermissionName][$sPermissionDetailKey]=1;
}
}
}
SetSurveyPermissions($iUserID, $iSurveyID, $aPermissionsToSet);
}
function gettemplatelist()
{
global $usertemplaterootdir, $standardtemplates,$standardtemplaterootdir;
if (!$usertemplaterootdir) {die("gettemplatelist() no template directory");}
if ($handle = opendir($standardtemplaterootdir))
{
while (false !== ($file = readdir($handle)))
{
if (!is_file("$standardtemplaterootdir/$file") && $file != "." && $file != ".." && $file!=".svn" && isStandardTemplate($file))
{
$list_of_files[$file] = $standardtemplaterootdir.DIRECTORY_SEPARATOR.$file;
}
}
closedir($handle);
}
if ($handle = opendir($usertemplaterootdir))
{
while (false !== ($file = readdir($handle)))
{
if (!is_file("$usertemplaterootdir/$file") && $file != "." && $file != ".." && $file!=".svn")
{
$list_of_files[$file] = $usertemplaterootdir.DIRECTORY_SEPARATOR.$file;
}
}
closedir($handle);
}
ksort($list_of_files);
return $list_of_files;
}
/**
* This function set a question attribute to a certain value
*
* @param mixed $qid
* @param mixed $sAttributeName
* @param mixed $sAttributeValue
*/
function setQuestionAttribute($qid,$sAttributeName,$sAttributeValue)
{
global $dbprefix,$connect;
$tablename=$dbprefix.'question_attributes';
$aInsertArray=array('qid'=>$qid,
'attribute'=>$sAttributeName,
'value'=>$sAttributeValue);
$sQuery=$connect->GetInsertSQL($tablename,$aInsertArray);
$connect->Execute('delete from '.db_table_name('question_attributes')." where qid={$qid} and attribute=".db_quoteall($sAttributeName));
$connect->Execute($sQuery);
}
/**
* Returns the default email template texts as array
*
* @param mixed $oLanguage Required language translationb object
* @param string $mode Escape mode for the translation function
* @return array
*/
function aTemplateDefaultTexts($oLanguage, $mode='html'){
return array(
'admin_detailed_notification_subject'=>$oLanguage->gT("Response submission for survey {SURVEYNAME} with results",$mode),
'admin_detailed_notification'=>$oLanguage->gT("Hello,\n\nA new response was submitted for your survey '{SURVEYNAME}'.\n\nClick the following link to reload the survey:\n{RELOADURL}\n\nClick the following link to see the individual response:\n{VIEWRESPONSEURL}\n\nClick the following link to edit the individual response:\n{EDITRESPONSEURL}\n\nView statistics by clicking here:\n{STATISTICSURL}\n\n\nThe following answers were given by the participant:\n{ANSWERTABLE}",$mode),
'admin_detailed_notification_css'=>'<style type="text/css">
.printouttable {
margin:1em auto;
}
.printouttable th {
text-align: center;
}
.printouttable td {
border-color: #ddf #ddf #ddf #ddf;
border-style: solid;
border-width: 1px;
padding:0.1em 1em 0.1em 0.5em;
}
.printouttable td:first-child {
font-weight: 700;
text-align: right;
padding-right: 5px;
padding-left: 5px;
}
.printouttable .printanswersquestion td{
background-color:#F7F8FF;
}
.printouttable .printanswersquestionhead td{
text-align: left;
background-color:#ddf;
}
.printouttable .printanswersgroup td{
text-align: center;
font-weight:bold;
padding-top:1em;
}
</style>',
'admin_notification_subject'=>$oLanguage->gT("Response submission for survey {SURVEYNAME}",$mode),
'admin_notification'=>$oLanguage->gT("Hello,\n\nA new response was submitted for your survey '{SURVEYNAME}'.\n\nClick the following link to reload the survey:\n{RELOADURL}\n\nClick the following link to see the individual response:\n{VIEWRESPONSEURL}\n\nClick the following link to edit the individual response:\n{EDITRESPONSEURL}\n\nView statistics by clicking here:\n{STATISTICSURL}",$mode),
'confirmation_subject'=>$oLanguage->gT("Confirmation of your participation in our survey"),
'confirmation'=>$oLanguage->gT("Dear {FIRSTNAME},\n\nthis email is to confirm that you have completed the survey titled {SURVEYNAME} and your response has been saved. Thank you for participating.\n\nIf you have any further questions about this email, please contact {ADMINNAME} on {ADMINEMAIL}.\n\nSincerely,\n\n{ADMINNAME}",$mode),
'invitation_subject'=>$oLanguage->gT("Invitation to participate in a survey",$mode),
'invitation'=>$oLanguage->gT("Dear {FIRSTNAME},\n\nyou have been invited to participate in a survey.\n\nThe survey is titled:\n\"{SURVEYNAME}\"\n\n\"{SURVEYDESCRIPTION}\"\n\nTo participate, please click on the link below.\n\nSincerely,\n\n{ADMINNAME} ({ADMINEMAIL})\n\n----------------------------------------------\nClick here to do the survey:\n{SURVEYURL}",$mode)."\n\n".$oLanguage->gT("If you do not want to participate in this survey and don't want to receive any more invitations please click the following link:\n{OPTOUTURL}",$mode),
'reminder_subject'=>$oLanguage->gT("Reminder to participate in a survey",$mode),
'reminder'=>$oLanguage->gT("Dear {FIRSTNAME},\n\nRecently we invited you to participate in a survey.\n\nWe note that you have not yet completed the survey, and wish to remind you that the survey is still available should you wish to take part.\n\nThe survey is titled:\n\"{SURVEYNAME}\"\n\n\"{SURVEYDESCRIPTION}\"\n\nTo participate, please click on the link below.\n\nSincerely,\n\n{ADMINNAME} ({ADMINEMAIL})\n\n----------------------------------------------\nClick here to do the survey:\n{SURVEYURL}",$mode)."\n\n".$oLanguage->gT("If you do not want to participate in this survey and don't want to receive any more invitations please click the following link:\n{OPTOUTURL}",$mode),
'registration_subject'=>$oLanguage->gT("Survey registration confirmation",$mode),
'registration'=>$oLanguage->gT("Dear {FIRSTNAME},\n\nYou, or someone using your email address, have registered to participate in an online survey titled {SURVEYNAME}.\n\nTo complete this survey, click on the following URL:\n\n{SURVEYURL}\n\nIf you have any questions about this survey, or if you did not register to participate and believe this email is in error, please contact {ADMINNAME} at {ADMINEMAIL}.",$mode)
);
}
// Closing PHP tag intentionally left out - yes, it is okay
function doAdminHeader()
{
echo getAdminHeader();
}
function getAdminHeader($meta=false)
{
global $sitename, $admintheme, $rooturl, $defaultlang, $css_admin_includes, $homeurl;
if (!isset($_SESSION['adminlang']) || $_SESSION['adminlang']=='') {$_SESSION['adminlang']=$defaultlang;}
$strAdminHeader="<?xml version=\"1.0\"?><!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n"
."<html ";
if (getLanguageRTL($_SESSION['adminlang']))
{
$strAdminHeader.=" dir=\"rtl\" ";
}
$strAdminHeader.=">\n<head>\n";
if ($meta)
{
$strAdminHeader.=$meta;
}
$strAdminHeader.="<meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\" />\n"
. "<script type=\"text/javascript\" src=\"{$rooturl}/scripts/jquery/jquery.js\"></script>\n"
. "<script type=\"text/javascript\" src=\"{$rooturl}/scripts/jquery/jquery-ui.js\"></script>\n"
. "<script type=\"text/javascript\" src=\"{$rooturl}/scripts/jquery/jquery.qtip.js\"></script>\n"
. "<script type=\"text/javascript\" src=\"{$rooturl}/scripts/jquery/jquery.notify.js\"></script>\n"
. "<script type=\"text/javascript\" src=\"{$homeurl}/scripts/admin_core.js\"></script>\n";
if ($_SESSION['adminlang']!='en')
{
$strAdminHeader.= "<script type=\"text/javascript\" src=\"{$rooturl}/scripts/jquery/locale/jquery.ui.datepicker-{$_SESSION['adminlang']}.js\"></script>\n";
}
$strAdminHeader.= "<title>$sitename</title>\n";
$strAdminHeader.= "<link rel=\"stylesheet\" type=\"text/css\" media=\"all\" href=\"{$homeurl}//styles/$admintheme/tab.webfx.css \" />\n"
. "<link rel=\"stylesheet\" type=\"text/css\" media=\"all\" href=\"{$rooturl}/scripts/jquery/css/start/jquery-ui.css\" />\n"
. "<link rel=\"stylesheet\" type=\"text/css\" href=\"{$homeurl}/styles/$admintheme/printablestyle.css\" media=\"print\" />\n"
. "<link rel=\"stylesheet\" type=\"text/css\" href=\"{$homeurl}/styles/$admintheme/adminstyle.css\" />\n"
. "<link rel=\"shortcut icon\" href=\"{$homeurl}/favicon.ico\" type=\"image/x-icon\" />\n"
. "<link rel=\"icon\" href=\"{$homeurl}/favicon.ico\" type=\"image/x-icon\" />\n";
if (getLanguageRTL($_SESSION['adminlang']))
{
$strAdminHeader.="<link rel=\"stylesheet\" type=\"text/css\" href=\"styles/$admintheme/adminstyle-rtl.css\" />\n";
}
$css_admin_includes = array_unique($css_admin_includes);
foreach ($css_admin_includes as $cssinclude)
{
$strAdminHeader .= "<link rel=\"stylesheet\" type=\"text/css\" media=\"all\" href=\"$cssinclude\" />\n";
}
$strAdminHeader.= use_firebug()
. "</head>\n<body>\n";
if (isset($_SESSION['dateformat']))
{
$formatdata=getDateFormatData($_SESSION['dateformat']);
$strAdminHeader .= "<script type='text/javascript'>
var userdateformat='".$formatdata['jsdate']."';
var userlanguage='".$_SESSION['adminlang']."';
</script>";
}
// Prepare flashmessage
if (isset($_SESSION['flashmessage']) && $_SESSION['flashmessage']!='')
{
$strAdminHeader .='<div id="flashmessage" style="display:none;">
<div id="themeroller" class="ui-state-highlight ui-corner-all">
<!-- close link -->
<a class="ui-notify-close" href="#">
<span class="ui-icon ui-icon-close" style="float:right"></span>
</a>
<!-- alert icon -->
<span style="float:left; margin:2px 5px 0 0;" class="ui-icon ui-icon-info"></span>
<h1></h1>
<p>'.$_SESSION['flashmessage'].'</p>
</div>
<!-- other templates here, maybe.. -->
</div>';
unset($_SESSION['flashmessage']);
}
// Standard header
$strAdminHeader .="<div class='maintitle'>{$sitename}</div>\n";
return $strAdminHeader;
}

View File

@@ -10,7 +10,7 @@
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*
* $Id: assessments.php 7428 2009-08-10 10:26:46Z c_schmitz $
* $Id: assessments.php 10925 2011-09-02 14:12:02Z c_schmitz $
*/
@@ -20,24 +20,24 @@ if (!isset($action)) {$action=returnglobal('action');}
$surveyinfo=getSurveyInfo($surveyid);
$js_adminheader_includes[]= $homeurl.'/scripts/assessments.js';
$js_adminheader_includes[]= $rooturl.'/scripts/jquery/jquery-ui.js';
$js_admin_includes[]= $homeurl.'/scripts/assessments.js';
$js_admin_includes[]='../scripts/jquery/jquery.tablesorter.min.js';
// . "<link rel=\"stylesheet\" type=\"text/css\" media=\"all\" href=\"styles/default/jquery-ui.css\" />\n";
$actsurquery = "SELECT edit_survey_property FROM {$dbprefix}surveys_rights WHERE sid=$surveyid AND uid = ".$_SESSION['loginID']; //Getting rights for this survey
$actsurresult = $connect->Execute($actsurquery) or safe_die($connect->ErrorMsg());
$actsurrows = $actsurresult->FetchRow();
$assessmentlangs = GetAdditionalLanguagesFromSurveyID($surveyid);
$baselang = GetBaseLanguageFromSurveyID($surveyid);
array_unshift($assessmentlangs,$baselang); // makes an array with ALL the languages supported by the survey -> $assessmentlangs
if (!bHasSurveyPermission($surveyid, 'assessments','read'))
{
$action = "assessment";
include("access_denied.php");
include("admin.php");
exit;
}
if($_SESSION['USER_RIGHT_SUPERADMIN'] == 1 || $actsurrows['edit_survey_property']){
if ($action == "assessmentadd") {
if ($action == "assessmentadd" && bHasSurveyPermission($surveyid, 'assessments','create')) {
$inserttable=$dbprefix."assessments";
$first=true;
foreach ($assessmentlangs as $assessmentlang)
@@ -67,7 +67,7 @@ if($_SESSION['USER_RIGHT_SUPERADMIN'] == 1 || $actsurrows['edit_survey_property'
$aid=$connect->Insert_ID(db_table_name_nq('assessments'),"id");
}
}
} elseif ($action == "assessmentupdate") {
} elseif ($action == "assessmentupdate" && bHasSurveyPermission($surveyid, 'assessments','update')) {
if ($filterxsshtml)
{
@@ -85,7 +85,7 @@ if($_SESSION['USER_RIGHT_SUPERADMIN'] == 1 || $actsurrows['edit_survey_property'
$_POST['assessmentmessage_'.$assessmentlang]=$myFilter->process($_POST['assessmentmessage_'.$assessmentlang]);
}
$query = "UPDATE {$dbprefix}assessments
SET scope='".db_quote($_POST['scope'])."',
SET scope='".db_quote($_POST['scope'],true)."',
gid=".sanitize_int($_POST['gid']).",
minimum='".sanitize_signedint($_POST['minimum'])."',
maximum='".sanitize_signedint($_POST['maximum'])."',
@@ -94,37 +94,37 @@ if($_SESSION['USER_RIGHT_SUPERADMIN'] == 1 || $actsurrows['edit_survey_property'
WHERE language='$assessmentlang' and id=".sanitize_int($_POST['id']);
$result = $connect->Execute($query) or safe_die("Error updating<br />$query<br />".$connect->ErrorMsg());
}
} elseif ($action == "assessmentdelete") {
} elseif ($action == "assessmentdelete" && bHasSurveyPermission($surveyid, 'assessments','delete')) {
$query = "DELETE FROM {$dbprefix}assessments
WHERE id=".sanitize_int($_POST['id']);
$result=$connect->Execute($query);
}
if (bHasSurveyPermission($surveyid, 'assessments','read'))
{
$assessmentsoutput=PrepareEditorScript();
$assessmentsoutput.="<script type=\"text/javascript\">
<!--
var strnogroup='".$clang->gT("There are no groups available.", "js")."';
--></script>";
$assessmentsoutput.="<table width='100%' border='0' >\n"
. "\t<tr>\n"
. "\t\t<td>\n"
. "<div class='menubar'>\n"
. "\t<div class='menubar-title'>\n"
. "\t\t<strong>".$clang->gT("Assessments")."</strong>\n";
--></script>\n";
$assessmentsoutput.="<div class='menubar'>\n"
. "\t<div class='menubar-title ui-widget-header'>\n"
. "<strong>".$clang->gT("Assessments")."</strong>\n";
$assessmentsoutput.= "\t</div>\n"
. "\t<div class='menubar-main'>\n"
. "\t\t<div class='menubar-left'>\n"
. "\t\t\t<a href=\"#\" onclick=\"window.open('$scriptname?sid=$surveyid', '_self')\" onmouseout=\"hideTooltip()\" onmouseover=\"showTooltip(event,'".$clang->gT("Return to Survey Administration", "js")."');return false\">" .
"<img name='Administration' src='$imagefiles/home.png' title='' alt='' /></a>\n"
. "\t\t\t<img src='$imagefiles/blank.gif' alt='' width='11' />\n"
. "\t\t\t<img src='$imagefiles/seperator.gif' alt='' />\n";
. "<div class='menubar-left'>\n"
. "\t<a href=\"#\" onclick=\"window.open('$scriptname?sid=$surveyid', '_self')\" title='".$clang->gTview("Return to survey administration")."'>"
. "<img name='Administration' src='$imageurl/home.png' alt='".$clang->gT("Return to survey administration")."' /></a>\n"
. "\t<img src='$imageurl/blank.gif' alt='' width='11' />\n"
. "\t<img src='$imageurl/seperator.gif' alt='' />\n";
if ($surveyinfo['assessments']!='Y')
{
$assessmentsoutput.='<span style="font-size:11px;">'.sprintf($clang->gT("Notice: Assessment mode for this survey is not activated. You can activate it in the %s survey settings %s (tab 'Notification & data management')."),'<a href="admin.php?action=editsurvey&sid='.$surveyid.'">','</a>').'</span>';
$assessmentsoutput.='<span style="font-size:11px;">'.sprintf($clang->gT("Notice: Assessment mode for this survey is not activated. You can activate it in the %s survey settings %s (tab 'Notification & data management')."),'<a href="admin.php?action=editsurvey&amp;sid='.$surveyid.'">','</a>').'</span>';
}
$assessmentsoutput.= "\t\t</div>\n"
$assessmentsoutput.= "</div>\n"
. "\t</div>\n"
. "</div>\n";
$assessmentsoutput .= "<p style='margin:0;font-size:1px;line-height:1px;height:1px;'>&nbsp;</p>"; //CSS Firefox 2 transition fix
@@ -137,39 +137,23 @@ if($_SESSION['USER_RIGHT_SUPERADMIN'] == 1 || $actsurrows['edit_survey_property'
$assessments=getAssessments($surveyid);
//$assessmentsoutput.= "<pre>";print_r($assessments);echo "</pre>";
$groups=getGroups($surveyid);
$groupselect="<select name='gid' id='newgroupselect'>\n";
$groupselect="<select name='gid' id='gid'>\n";
foreach($groups as $group) {
$groupselect.="<option value='".$group['gid']."'>".$group['group_name']."</option>\n";
}
$groupselect .="</select>\n";
$headings=array($clang->gT("Scope"), $clang->gT("Question group"), $clang->gT("Minimum"), $clang->gT("Maximum"));
$inputs=array("<input type='radio' id='radiototal' name='scope' value='T' checked='checked'>".$clang->gT("Total")."</input><input type='radio' id='radiogroup' name='scope' value='G'>".$clang->gT("Group")."</input>",
$groupselect,
"<input type='text' name='minimum' class='numbersonly' />",
"<input type='text' name='maximum' class='numbersonly' />");
$actiontitle=$clang->gT("Add");
$actionvalue="assessmentadd";
$thisid="";
if ($action == "assessmentedit") {
if ($action == "assessmentedit" && bHasSurveyPermission($surveyid, 'assessments','update')) {
$query = "SELECT * FROM {$dbprefix}assessments WHERE id=".sanitize_int($_POST['id'])." and language='$baselang'";
$results = db_execute_assoc($query);
while($row=$results->FetchRow()) {
$editdata=$row;
}
$scopeselect = "<input type='radio' id='radiototal' name='scope' ";
if ($editdata['scope'] == "T") {$scopeselect .= "checked='checked' ";}
$scopeselect .= "value='T'>".$clang->gT("Total")."</input>";
$scopeselect .= "<input type='radio' name='scope' id='radiogroup' value='G'";
if ($editdata['scope'] == "G") {$scopeselect .= " checked='checked'";}
$scopeselect .= ">".$clang->gT("Question group")."</input>";
$groupselect=str_replace("'".$editdata['gid']."'", "'".$editdata['gid']."' selected", $groupselect);
$inputs=array($scopeselect,
$groupselect,
"<input type='text' name='minimum' value='".$editdata['minimum']."' class='numbersonly' />",
"<input type='text' name='maximum' value='".$editdata['maximum']."' class='numbersonly' />",
"<input type='text' name='name' size='80' value='".htmlentities(stripslashes($editdata['name']), ENT_QUOTES,'UTF-8')."'/>",
"<textarea name='message' id='assessmentmessage' rows='10' cols='80'>".htmlentities(stripslashes($editdata['message']), ENT_QUOTES,'UTF-8')."</textarea>");
$actiontitle=$clang->gT("Edit");
$actionvalue="assessmentupdate";
$thisid=$editdata['id'];
@@ -178,21 +162,41 @@ if($_SESSION['USER_RIGHT_SUPERADMIN'] == 1 || $actsurrows['edit_survey_property'
//PRESENT THE PAGE
$assessmentsoutput.= "<br /><table align='center' width='90%'>
<tr><th colspan='12'>".$clang->gT("Assessment rules")."</th></tr>"
."<tr><th>".$clang->gT("ID")."</th><th>".$clang->gT("SID")."</th>\n";
$assessmentsoutput.= "<div class='header ui-widget-header'>".$clang->gT("Assessment rules")."</div>"
."<table class='assessmentlist'><thead>"
."<tr><th>".$clang->gT("ID")."</th><th>".$clang->gT("Actions")."</th><th>".$clang->gT("SID")."</th>\n";
foreach ($headings as $head) {
$assessmentsoutput.= "<th>$head</th>\n";
}
$assessmentsoutput.= "<th>".$clang->gT("Title")."</th><th>".$clang->gT("Message")."</th><th>".$clang->gT("Actions")."</th>";
$assessmentsoutput.= "</tr>\n";
$assessmentsoutput.= "<th>".$clang->gT("Title")."</th><th>".$clang->gT("Message")."</th>";
$assessmentsoutput.= "</tr></thead>\n<tbody>\n";
$flipflop=true;
foreach($assessments as $assess) {
$flipflop=!$flipflop;
if ($flipflop==true){$assessmentsoutput.= "<tr class='oddrow'>\n";}
else {$assessmentsoutput.= "<tr class='evenrow'>\n";}
$assessmentsoutput.= "<td>".$assess['id']."</td>\n";
$assessmentsoutput.= "<td>".$assess['sid']."</td>\n";
$assessmentsoutput.= "<td>";
if (bHasSurveyPermission($surveyid, 'assessments','update'))
{
$assessmentsoutput.="<form method='post' action='$scriptname?sid=$surveyid'>
<input type='image' src='$imageurl/token_edit.png' alt='".$clang->gT("Edit")."' />
<input type='hidden' name='action' value='assessmentedit' />
<input type='hidden' name='id' value='".$assess['id']."' />
</form>";
}
if (bHasSurveyPermission($surveyid, 'assessments','delete'))
{
$assessmentsoutput.="<form method='post' action='$scriptname?sid=$surveyid'>
<input type='image' src='$imageurl/token_delete.png' alt='".$clang->gT("Delete")."' onclick='return confirm(\"".$clang->gT("Are you sure you want to delete this entry?","js")."\")' />
<input type='hidden' name='action' value='assessmentdelete' />
<input type='hidden' name='id' value='".$assess['id']."' />
</form>";
}
$assessmentsoutput.= "</td><td>".$assess['sid']."</td>\n";
if ($assess['scope'] == "T")
{
@@ -211,37 +215,30 @@ if($_SESSION['USER_RIGHT_SUPERADMIN'] == 1 || $actsurrows['edit_survey_property'
$assessmentsoutput.= "<td>".stripslashes($assess['name'])."</td>\n";
$assessmentsoutput.= "<td>".strip_tags(strip_javascript($assess['message']))."</td>\n";
$assessmentsoutput.= "<td>
<table width='100%'>
<tr><td align='center'><form method='post' action='$scriptname?sid=$surveyid'>
<input type='submit' value='".$clang->gT("Edit")."' />
<input type='hidden' name='action' value='assessmentedit' />
<input type='hidden' name='id' value='".$assess['id']."' />
</form></td>
<td align='center'><form method='post' action='$scriptname?sid=$surveyid'>
<input type='submit' value='".$clang->gT("Delete")."' onclick='return confirm(\"".$clang->gT("Are you sure you want to delete this entry?","js")."\")' />
<input type='hidden' name='action' value='assessmentdelete' />
<input type='hidden' name='id' value='".$assess['id']."' />
</form>
</td>
</tr>
</table>
</td>\n";
$assessmentsoutput.= "</tr>\n";
$assessmentsoutput.= "</tr></tbody>\n";
}
$assessmentsoutput.= "</table>";
if ((bHasSurveyPermission($surveyid, 'assessments','update') && $actionvalue=="assessmentupdate") || (bHasSurveyPermission($surveyid, 'assessments','create')&& $actionvalue=="assessmentadd"))
{
//now present edit/insert form
$assessmentsoutput.= "<br /><form method='post' name='assessmentsform' action='$scriptname?sid=$surveyid'><table align='center' cellspacing='0' border='0' class='form2columns'>\n";
$assessmentsoutput.= "<tr><th colspan='2'>$actiontitle</th></tr>\n";
$i=0;
foreach ($headings as $head) {
$assessmentsoutput.= "<tr><td>$head</td><td>".$inputs[$i]."<br /></td></tr>\n";
$i++;
}
$assessmentsoutput.= "<br /><form method='post' class='form30' id='assessmentsform' name='assessmentsform' action='$scriptname?sid=$surveyid'><div class='header ui-widget-header'>\n";
$assessmentsoutput.= "$actiontitle</div>\n";
$assessmentsoutput.="<ul><li><label>".$clang->gT("Scope")."</label><input type='radio' id='radiototal' name='scope' value='T' ";
if (!isset($editdata) || $editdata['scope'] == "T") {$assessmentsoutput .= " checked='checked' ";}
$assessmentsoutput.=" /><label for='radiototal'>".$clang->gT("Total")."</label>
<input type='radio' id='radiogroup' name='scope' value='G'";
if (isset($editdata) && $editdata['scope'] == "G") {$assessmentsoutput .= " checked='checked' ";}
$assessmentsoutput.="/><label for='radiogroup'>".$clang->gT("Group")."</label></li>";
$assessmentsoutput.="<li><label for='gid'>".$clang->gT("Question group")."</label>$groupselect</li>"
."<li><label for='minimum'>".$clang->gT("Minimum")."</label><input type='text' id='minimum' name='minimum' class='numbersonly'";
if (isset($editdata)) {$assessmentsoutput .= " value='{$editdata['minimum']}' ";}
$assessmentsoutput.="/></li>"
."<li><label for='maximum'>".$clang->gT("Maximum")."</label><input type='text' id='maximum' name='maximum' class='numbersonly'";
if (isset($editdata)) {$assessmentsoutput .= " value='{$editdata['maximum']}' ";}
$assessmentsoutput.="/></li>";
// start tabs
$assessmentsoutput.= "<tr><td>&nbsp;</td><td>&nbsp;</td></tr>\n";
@@ -251,7 +248,7 @@ if($_SESSION['USER_RIGHT_SUPERADMIN'] == 1 || $actsurrows['edit_survey_property'
{
$position=0;
$assessmentsoutput .= '<li><a href="#tablang'.$assessmentlang.'"><span>'.getLanguageNameFromCode($assessmentlang, false);
if ($assessmentlang==$baselang) {$assessmentsoutput .= ' ('.$clang->gT("Base Language").')';}
if ($assessmentlang==$baselang) {$assessmentsoutput .= ' ('.$clang->gT("Base language").')';}
$assessmentsoutput .='</span></a></li>';
}
$assessmentsoutput.= '</ul>';
@@ -265,8 +262,8 @@ if($_SESSION['USER_RIGHT_SUPERADMIN'] == 1 || $actsurrows['edit_survey_property'
while($row=$results->FetchRow()) {
$editdata=$row;
}
$heading=$editdata['name'];
$message=$editdata['message'];
$heading=htmlspecialchars($editdata['name'],ENT_QUOTES);
$message=htmlspecialchars($editdata['message']);
}
$assessmentsoutput .= '<div id="tablang'.$assessmentlang.'">';
$assessmentsoutput .= $clang->gT("Heading")."<br/>"
@@ -279,24 +276,18 @@ if($_SESSION['USER_RIGHT_SUPERADMIN'] == 1 || $actsurrows['edit_survey_property'
$assessmentsoutput .='</div>';
$assessmentsoutput.= "<div style='width:200px;margin:5px auto;'><input type='submit' value='".$clang->gT("Save")."' />\n";
$assessmentsoutput.= "<p><input type='submit' value='".$clang->gT("Save")."' />\n";
if ($action == "assessmentedit") $assessmentsoutput.= "&nbsp;&nbsp;&nbsp;&nbsp;<input type='submit' value='".$clang->gT("Cancel")."' onclick=\"document.assessmentsform.action.value='assessments'\" />\n";
$assessmentsoutput.= "<input type='hidden' name='sid' value='$surveyid' />\n"
."<input type='hidden' name='action' value='$actionvalue' />\n"
."<input type='hidden' name='id' value='$thisid' />\n"
."<div>\n"
."</div>\n"
."</form>\n";
foreach ($assessmentlangs as $assessmentlang)
{
$assessmentsoutput.=getEditor("assessment-text","assessmentmessage_$assessmentlang", "[".$clang->gT("Message:", "js")."]",$surveyid,$gid,$qid,$action);
}
}
else
{
$action = "assessment";
include("access_denied.php");
include("admin.php");
}
function getAssessments($surveyid) {

View File

@@ -0,0 +1,163 @@
<?php
include_once('globalsettings.php');
include_once('database.php');
if($subaction=='bounceprocessing')
{
if(empty($cron))
{
$surveyidoriginal = $_GET['sid'];
}
$settings=getSurveyInfo($surveyidoriginal);
if ($settings['bounceprocessing']=='N')
{
}
else
{
$bouncetotal=0;
$checktotal=0;
if($settings['bounceprocessing']=='G')
{
$accounttype=getGlobalSetting('bounceaccounttype');
$hostname=getGlobalSetting('bounceaccounthost');
$username=getGlobalSetting('bounceaccountuser');
$pass=getGlobalSetting('bounceaccountpass');
$hostencryption=getGlobalSetting('bounceencryption');
}
else
{
$accounttype=$settings['bounceaccounttype'];
$hostname=$settings['bounceaccounthost'];
$username=$settings['bounceaccountuser'];
$pass=$settings['bounceaccountpass'];
$hostencryption=$settings['bounceaccountencryption'];
}
if($accounttype=='IMAP')
{
if($hostencryption=='SSL')
{
$finalhostname='{'.$hostname.'/imap/ssl}INBOX';
}
elseif($hostencryption=='TLS')
{
$finalhostname='{'.$hostname.'/imap/tls}INBOX';
}
else
{
$finalhostname='{'.$hostname.'/imap}INBOX';
}
if(@$mbox=imap_open($finalhostname,$username,$pass))
{
@$count=imap_num_msg($mbox);
$lasthinfo=imap_headerinfo($mbox,$count);
$datelc=$lasthinfo->date;
$datelcu = strtotime($datelc);
$gettimestamp = "select bouncetime from ".db_table_name("surveys")." where sid='$surveyidoriginal';";
$datelcufiles = $connect->Execute($gettimestamp);
$datelcufile = substr($datelcufiles,11);
while($datelcu > $datelcufile)
{
$lasthinfo=imap_headerinfo($mbox,$count);
$datelc=$lasthinfo->date;
$datelcu = strtotime($datelc);
$header = explode("\r\n", imap_body($mbox,$count));
foreach ($header as $item)
{
if (preg_match('/^X-surveyid/',$item))
{
$surveyid=explode(": ",$item);
}
if (preg_match('/^X-tokenid/',$item))
{
$token=explode(": ",$item);
if($surveyidoriginal == $surveyid[1])
{
$bouncequery = "UPDATE ".db_table_name("tokens_$surveyidoriginal")." set emailstatus='bounced', usesleft=0 where token='".db_quote($token[1])."';";
$anish=$connect->Execute($bouncequery);
$bouncetotal++;
}
}
}
$count--;
$lasthinfo=imap_headerinfo($mbox,$count);
$datelc=$lasthinfo->date;
$datelcu = strtotime($datelc);
$checktotal++;
}
@$count=imap_num_msg($mbox);
@$lastcheckedinfo=imap_headerinfo($mbox,$count);
$datelcfinal=$lastcheckedinfo->date;
$datelcfinalu = strtotime($datelcfinal);
$entertimestamp = "update ".db_table_name("surveys")." set bouncetime='$datelcfinalu' where sid='$surveyidoriginal';";
$executetimestamp = $connect->Execute($entertimestamp);
}
else
{
echo "Please check your settings";
}
}
elseif($accounttype='POP')
{
if($hostencryption=='SSL')
{
$finalhostname='{'.$hostname.'/pop3/ssl/novalidate-cert}INBOX';
}
elseif($hostencryption=='TLS')
{
$finalhostname='{'.$hostname.'/pop3/tls/novalidate-cert}INBOX';
}
else
{
$finalhostname='{'.$hostname.'/pop3/novalidate-cert}INBOX';
}
if(@$mbox=imap_open($finalhostname,$username,$pass))
{
@$count=imap_num_msg($mbox);
while($count>0)
{ @$header = explode("\r\n", imap_body($mbox,$count));
foreach ($header as $item)
{
if (preg_match('/^X-surveyid/',$item))
{
$surveyid=explode(": ",$item);
}
if (preg_match('/^X-tokenid/',$item))
{
$token=explode(": ",$item);
if($surveyidoriginal == $surveyid[1])
{
$bouncequery = "UPDATE ".db_table_name("tokens_$surveyidoriginal")." set emailstatus='bounced', usesleft=0 where token='".db_quote($token[1])."';";
$anish=$connect->Execute($bouncequery) or safe_die ("Couldn't update sent field<br />$query<br />".$connect->ErrorMsg());
$bouncetotal++;
}
}
}
$count--;
$checktotal++;
}
imap_errors();
imap_close($mbox);
}
else
{
echo "Please check your settings";
}
}
if($bouncetotal>0)
{
echo "<div id='dialog-modal'>$checktotal messages were scanned out of which $bouncetotal were marked as bounce by the system. <br><br><br>Please reload the browse table to view results</div>";
}
else
{
echo "<div id ='dialog-modal'>$checktotal messages were scanned out of which $bouncetotal were marked as bounce by the system.</div>";
}
}
}
?>

File diff suppressed because it is too large Load Diff

View File

@@ -255,7 +255,15 @@ class ProgressBar
if ($align!='') {$this->label[$name]['align'] = $align;}
if ($this->status!='new') {
echo '<script type="text/JavaScript">document.getElementById("plbl'.$name.$this->code.'").style.top="'.$this->label[$name]['top'].'px";document.getElementById("plbl'.$name.$this->code.'").style.left="'.$this->label[$name]['left'].'px";document.getElementById("plbl'.$name.$this->code.'").style.width="'.$this->label[$name]['width'].'px";document.getElementById("plbl'.$name.$this->code.'").style.height="'.$this->label[$name]['height'].'px";document.getElementById("plbl'.$name.$this->code.'").style.align="'.$this->label[$name]['align'].'";</script>'."\n";
echo '<script type="text/JavaScript">
/* <![CDATA[ */
document.getElementById("plbl'.$name.$this->code.'").style.top="'.$this->label[$name]['top'].'px";
document.getElementById("plbl'.$name.$this->code.'").style.left="'.$this->label[$name]['left'].'px";
document.getElementById("plbl'.$name.$this->code.'").style.width="'.$this->label[$name]['width'].'px";
document.getElementById("plbl'.$name.$this->code.'").style.height="'.$this->label[$name]['height'].'px";
document.getElementById("plbl'.$name.$this->code.'").style.align="'.$this->label[$name]['align'].'";
/* ]]> */
</script>'."\n";
flush();
}
}
@@ -264,7 +272,11 @@ class ProgressBar
{
$this->label[$name]['color'] = $color;
if ($this->status!='new') {
echo '<script type="text/JavaScript">document.getElementById("plbl'.$name.$this->code.'").style.color="'.$color.'";</script>'."\n";
echo '<script type="text/JavaScript">
/* <![CDATA[ */
document.getElementById("plbl'.$name.$this->code.'").style.color="'.$color.'";
/* ]]> */
</script>'."\n";
flush();
}
}
@@ -273,7 +285,11 @@ class ProgressBar
{
$this->label[$name]['bgr_color'] = $color;
if ($this->status!='new') {
echo '<script type="text/JavaScript">document.getElementById("plbl'.$name.$this->code.'").style.background="'.$color.'";</script>'."\n";
echo '<script type="text/JavaScript">
/* <![CDATA[ */
document.getElementById("plbl'.$name.$this->code.'").style.background="'.$color.'";
/* ]]> */
</script>'."\n";
flush();
}
}
@@ -285,7 +301,13 @@ class ProgressBar
if ($weight!='') {$this->label[$name]['font-weight'] = $weight;}
if ($this->status!='new') {
echo '<script type="text/JavaScript">document.getElementById("plbl'.$name.$this->code.'").style.font-size="'.$this->label[$name]['font-size'].'px";document.getElementById("plbl'.$name.$this->code.'").style.font-family="'.$this->label[$name]['font-family'].'";document.getElementById("plbl'.$name.$this->code.'").style.font-weight="'.$this->label[$name]['font-weight'].'";</script>'."\n";
echo '<script type="text/JavaScript">
/* <![CDATA[ */
document.getElementById("plbl'.$name.$this->code.'").style.font-size="'.$this->label[$name]['font-size'].'px";
document.getElementById("plbl'.$name.$this->code.'").style.font-family="'.$this->label[$name]['font-family'].'";
document.getElementById("plbl'.$name.$this->code.'").style.font-weight="'.$this->label[$name]['font-weight'].'";
/* ]]> */
</script>'."\n";
flush();
}
}
@@ -294,7 +316,11 @@ class ProgressBar
{
$this->label[$name]['value'] = $value;
if ($this->status!='new') {
echo '<script type="text/JavaScript">PBlabelText'.$this->code.'("'.$name.'","'.$this->label[$name]['value'].'");</script>'."\n";
echo '<script type="text/JavaScript">
/* <![CDATA[ */
PBlabelText'.$this->code.'("'.$name.'","'.$this->label[$name]['value'].'");
/* ]]> */
</script>'."\n";
flush();
}
}
@@ -303,7 +329,11 @@ class ProgressBar
{
$this->color = $color;
if ($this->status!='new') {
echo '<script type="text/JavaScript">document.getElementById("pbar'.$this->code.'").style.background="'.$color.'";</script>'."\n";
echo '<script type="text/JavaScript">
/* <![CDATA[ */
document.getElementById("pbar'.$this->code.'").style.background="'.$color.'";
/* ]]> */
</script>'."\n";
flush();
}
}
@@ -312,7 +342,11 @@ class ProgressBar
{
$this->bgr_color = $color;
if ($this->status!='new') {
echo '<script type="text/JavaScript">document.getElementById("pbrd'.$this->code.'").style.background="'.$color.'";</script>'."\n";
echo '<script type="text/JavaScript">
/* <![CDATA[ */
document.getElementById("pbrd'.$this->code.'").style.background="'.$color.'";
/* ]]> */
</script>'."\n";
flush();
}
}
@@ -325,10 +359,12 @@ class ProgressBar
$this->position = $this->_calculatePosition($this->step);
echo '<script type="text/JavaScript">';
echo '/* <![CDATA[ */';
echo 'PBposition'.$this->code.'("left",'.$this->position['left'].');';
echo 'PBposition'.$this->code.'("top",'.$this->position['top'].');';
echo 'PBposition'.$this->code.'("width",'.$this->position['width'].');';
echo 'PBposition'.$this->code.'("height",'.$this->position['height'].');';
echo '/* ]]> */';
echo '</script>'."\n";
flush();
}
@@ -420,7 +456,9 @@ class ProgressBar
}
$html .= '<script type="text/JavaScript">'."\n";
$html .= '/* <![CDATA[ */';
$html .= $js;
$html .= '/* ]]> */';
$html .= '</script>'."\n";
return $html;
@@ -476,7 +514,11 @@ class ProgressBar
}
}
if ($js!='') {
echo '<script type="text/JavaScript">'.$js.'</script>'."\n";
echo '<script type="text/JavaScript">'."\n"
.'/* <![CDATA[ */'."\n"
. $js."\n"
. '/* ]]> */'."\n"
.'</script>'."\n";
flush ();
}
}

View File

@@ -0,0 +1,54 @@
<?php
final class SettingsStorage extends ArrayObject
{
protected static $_instance = null;
public function __construct($array = array(), $flags = parent::ARRAY_AS_PROPS)
{
parent::__construct($array, $flags);
}
public static function getInstance()
{
if( self::$_instance === NULL ) {
self::$_instance = new self();
}
return self::$_instance;
}
public static function get($index)
{
$instance = self::getInstance();
if (!$instance->offsetExists($index)) {
throw new Exception("No entry is registered for key '$index'");
}
return $instance->offsetGet($index);
}
public static function set($index, $value)
{
$instance = self::getInstance();
$instance->offsetSet($index, $value);
}
public static function isRegistered($index)
{
if (self::$_instance === null) {
return false;
}
return self::$_instance->offsetExists($index);
}
/**
* Workaround for http://bugs.php.net/bug.php?id=40442 (ZF-960).
*/
public function offsetExists($index)
{
return array_key_exists($index, $this);
}
}
?>

View File

@@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

View File

@@ -0,0 +1,325 @@
<?php
/**
* GTranslate - A class to comunicate with Google Translate(TM) Service
* Google Translate(TM) API Wrapper
* More info about Google(TM) service can be found on http://code.google.com/apis/ajaxlanguage/documentation/reference.html
* This code has o affiliation with Google (TM) , its a PHP Library that allows to comunicate with public a API
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @author Jose da Silva <jose@josedasilva.net>
* @since 2009/11/18
* @version 0.7.4
* @licence LGPL v3
*
* <code>
* <?
* require_once("GTranslate.php");
* try{
* $gt = new Gtranslate;
* echo $gt->english_to_german("hello world");
* } catch (GTranslateException $ge)
* {
* echo $ge->getMessage();
* }
* ?>
* </code>
*/
/**
* Exception class for GTranslated Exceptions
*/
class GTranslateException extends Exception
{
public function __construct($string) {
parent::__construct($string, 0);
}
public function __toString() {
return __CLASS__ . ": [{$this->code}]: {$this->message}\n";
}
}
class GTranslate
{
/**
* Google Translate(TM) Api endpoint
* @access private
* @var String
*/
private $url = "http://ajax.googleapis.com/ajax/services/language/translate";
/**
* Google Translate (TM) Api Version
* @access private
* @var String
*/
private $api_version = "1.0";
/**
* Comunication Transport Method
* Available: http / curl
* @access private
* @var String
*/
private $request_type = "http";
/**
* Path to available languages file
* @access private
* @var String
*/
private $available_languages_file = "languages.ini";
/**
* Holder to the parse of the ini file
* @access private
* @var Array
*/
private $available_languages = array();
/**
* Google Translate api key
* @access private
* @var string
*/
private $api_key = null;
/**
* Google request User IP
* @access private
* @var string
*/
private $user_ip = null;
/**
* Constructor sets up {@link $available_languages}
*/
public function __construct()
{
$this->available_languages = parse_ini_file("languages.ini");
}
/**
* URL Formater to use on request
* @access private
* @param array $lang_pair
* @param array $string
* "returns String $url
*/
private function urlFormat($lang_pair,$string)
{
$parameters = array(
"v" => $this->api_version,
"q" => $string,
"langpair"=> implode("|",$lang_pair)
);
if(!empty($this->api_key))
{
$parameters["key"] = $this->api_key;
}
if( empty($this->user_ip) )
{
if( !empty($_SERVER["REMOTE_ADDR"]) )
{
$parameters["userip"] = $_SERVER["REMOTE_ADDR"];
}
} else
{
$parameters["userip"] = $this->user_ip;
}
$url = "";
foreach($parameters as $k=>$p)
{
$url .= $k."=".urlencode($p)."&";
}
return $url;
}
/**
* Define the request type
* @access public
* @param string $request_type
* return boolean
*/
public function setRequestType($request_type = 'http') {
if (!empty($request_type)) {
$this->request_type = $request_type;
return true;
}
return false;
}
/**
* Define the Google Translate Api Key
* @access public
* @param string $api_key
* return boolean
*/
public function setApiKey($api_key) {
if (!empty($api_key)) {
$this->api_key = $api_key;
return true;
}
return false;
}
/**
* Define the User Ip for the query
* @access public
* @param string $ip
* return boolean
*/
public function setUserIp($ip) {
if (!empty($ip)) {
$this->user_ip = $ip;
return true;
}
return false;
}
/**
* Query the Google(TM) endpoint
* @access private
* @param array $lang_pair
* @param array $string
* returns String $response
*/
public function query($lang_pair,$string)
{
$query_url = $this->urlFormat($lang_pair,$string);
$response = $this->{"request".ucwords($this->request_type)}($query_url);
return $response;
}
/**
* Query Wrapper for Http Transport
* @access private
* @param String $url
* returns String $response
*/
private function requestHttp($url)
{
return GTranslate::evalResponse(json_decode(file_get_contents($this->url."?".$url)));
}
/**
* Query Wrapper for Curl Transport
* @access private
* @param String $url
* returns String $response
*/
private function requestCurl($url)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $this->url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_REFERER, !empty($_SERVER["HTTP_REFERER"]) ? $_SERVER["HTTP_REFERER"] : "");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $url);
$body = curl_exec($ch);
curl_close($ch);
return GTranslate::evalResponse(json_decode($body));
}
/**
* Response Evaluator, validates the response
* Throws an exception on error
* @access private
* @param String $json_response
* returns String $response
*/
private function evalResponse($json_response)
{
switch($json_response->responseStatus)
{
case 200:
return $json_response->responseData->translatedText;
break;
default:
throw new GTranslateException("Unable to perform Translation:".$json_response->responseDetails);
break;
}
}
/**
* Validates if the language pair is valid
* Throws an exception on error
* @access private
* @param Array $languages
* returns Array $response Array with formated languages pair
*/
private function isValidLanguage($languages)
{
$language_list = $this->available_languages;
$languages = array_map( "strtolower", $languages );
$language_list_v = array_map( "strtolower", array_values($language_list) );
$language_list_k = array_map( "strtolower", array_keys($language_list) );
$valid_languages = false;
if( TRUE == in_array($languages[0],$language_list_v) AND TRUE == in_array($languages[1],$language_list_v) )
{
$valid_languages = true;
}
if( FALSE === $valid_languages AND TRUE == in_array($languages[0],$language_list_k) AND TRUE == in_array($languages[1],$language_list_k) )
{
$languages = array($language_list[strtoupper($languages[0])],$language_list[strtoupper($languages[1])]);
$valid_languages = true;
}
if( FALSE === $valid_languages )
{
throw new GTranslateException("Unsupported languages");
}
return $languages;
}
/**
* Magic method to understande translation comman
* Evaluates methods like language_to_language
* @access public
* @param String $name
* @param Array $args
* returns String $response Translated Text
*/
public function __call($name,$args)
{
$languages_list = explode("_to_",strtolower($name));
$languages = $this->isValidLanguage($languages_list);
$string = $args[0];
return $this->query($languages,$string);
}
}
?>

View File

@@ -0,0 +1,110 @@
AFRIKAANS = af
ALBANIAN = sq
AMHARIC = am
ARABIC = ar
ARMENIAN = hy
AZERBAIJANI = az
BASQUE = eu
BELARUSIAN = be
BENGALI = bn
BIHARI = bh
BRETON = br
BULGARIAN = bg
BURMESE = my
CATALAN = ca
CHEROKEE = chr
CHINESE = zh
CHINESE_SIMPLIFIED = zh-Hans
CHINESE_TRADITIONAL = zh-Hant
CORSICAN = co
CROATIAN = hr
CZECH = cs
DANISH = da
DHIVEHI = dv
DUTCH = nl
ENGLISH = en
ESPERANTO = eo
ESTONIAN = et
FAROESE = fo
FILIPINO = tl
FINNISH = fi
FRENCH = fr
FRISIAN = fy
GALICIAN = gl
GEORGIAN = ka
GERMAN = de
GERMAN INFORMAL= de-informal
GREEK = el
GUJARATI = gu
HAITIAN_CREOLE = ht
HEBREW = iw
HINDI = hi
HUNGARIAN = hu
ICELANDIC = is
INDONESIAN = id
INUKTITUT = iu
IRISH = ga
ITALIAN = it
JAPANESE = ja
JAVANESE = jw
KANNADA = kn
KAZAKH = kk
KHMER = km
KOREAN = ko
KURDISH = ku
KYRGYZ = ky
LAO = lo
LATIN = la
LATVIAN = lv
LITHUANIAN = lt
LUXEMBOURGISH = lb
MACEDONIAN = mk
MALAY = ms
MALAYALAM = ml
MALTESE = mt
MAORI = mi
MARATHI = mr
MONGOLIAN = mn
NEPALI = ne
NORWEGIAN = no
NORWEGIAN NYNORSK = nn
NORWEGIAN BOKMAL = nb
OCCITAN = oc
ORIYA = or
PASHTO = ps
PERSIAN = fa
POLISH = pl
PORTUGUESE = pt
PORTUGUESE_PORTUGAL = pt-PT
PUNJABI = pa
QUECHUA = qu
ROMANIAN = ro
RUSSIAN = ru
SANSKRIT = sa
SCOTS_GAELIC = gd
SERBIAN = sr
SINDHI = sd
SINHALESE = si
SLOVAK = sk
SLOVENIAN = sl
SPANISH = es
SUNDANESE = su
SWAHILI = sw
SWEDISH = sv
SYRIAC = syr
TAJIK = tg
TAMIL = ta
TATAR = tt
TELUGU = te
THAI = th
TIBETAN = bo
TONGA = to
TURKISH = tr
UKRAINIAN = uk
URDU = ur
UZBEK = uz
UIGHUR = ug
VIETNAMESE = vi
WELSH = cy
YIDDISH = yi
YORUBA = yo

View File

@@ -0,0 +1,36 @@
HTTP client PHP class
This LICENSE is in the BSD license style.
License Version Control:
@(#) $Id: LICENSE.txt,v 1.1 2006/04/17 19:44:04 mlemos Exp $
Copyright (c) 1999 - 2006, Manuel Lemos
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
Neither the name of Manuel Lemos nor the names of his contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@@ -0,0 +1,806 @@
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* Converts to and from JSON format.
*
* JSON (JavaScript Object Notation) is a lightweight data-interchange
* format. It is easy for humans to read and write. It is easy for machines
* to parse and generate. It is based on a subset of the JavaScript
* Programming Language, Standard ECMA-262 3rd Edition - December 1999.
* This feature can also be found in Python. JSON is a text format that is
* completely language independent but uses conventions that are familiar
* to programmers of the C-family of languages, including C, C++, C#, Java,
* JavaScript, Perl, TCL, and many others. These properties make JSON an
* ideal data-interchange language.
*
* This package provides a simple encoder and decoder for JSON notation. It
* is intended for use with client-side Javascript applications that make
* use of HTTPRequest to perform server communication functions - data can
* be encoded into JSON notation for use in a client-side javascript, or
* decoded from incoming Javascript requests. JSON format is native to
* Javascript, and can be directly eval()'ed with no further parsing
* overhead
*
* All strings should be in ASCII or UTF-8 format!
*
* LICENSE: Redistribution and use in source and binary forms, with or
* without modification, are permitted provided that the following
* conditions are met: Redistributions of source code must retain the
* above copyright notice, this list of conditions and the following
* disclaimer. Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
* NO EVENT SHALL CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
*
* @category
* @package Services_JSON
* @author Michal Migurski <mike-json@teczno.com>
* @author Matt Knapp <mdknapp[at]gmail[dot]com>
* @author Brett Stimmerman <brettstimmerman[at]gmail[dot]com>
* @copyright 2005 Michal Migurski
* @version CVS: $Id: JSON.php,v 1.31 2006/06/28 05:54:17 migurski Exp $
* @license http://www.opensource.org/licenses/bsd-license.php
* @link http://pear.php.net/pepr/pepr-proposal-show.php?id=198
*/
/**
* Marker constant for Services_JSON::decode(), used to flag stack state
*/
define('SERVICES_JSON_SLICE', 1);
/**
* Marker constant for Services_JSON::decode(), used to flag stack state
*/
define('SERVICES_JSON_IN_STR', 2);
/**
* Marker constant for Services_JSON::decode(), used to flag stack state
*/
define('SERVICES_JSON_IN_ARR', 3);
/**
* Marker constant for Services_JSON::decode(), used to flag stack state
*/
define('SERVICES_JSON_IN_OBJ', 4);
/**
* Marker constant for Services_JSON::decode(), used to flag stack state
*/
define('SERVICES_JSON_IN_CMT', 5);
/**
* Behavior switch for Services_JSON::decode()
*/
define('SERVICES_JSON_LOOSE_TYPE', 16);
/**
* Behavior switch for Services_JSON::decode()
*/
define('SERVICES_JSON_SUPPRESS_ERRORS', 32);
/**
* Converts to and from JSON format.
*
* Brief example of use:
*
* <code>
* // create a new instance of Services_JSON
* $json = new Services_JSON();
*
* // convert a complexe value to JSON notation, and send it to the browser
* $value = array('foo', 'bar', array(1, 2, 'baz'), array(3, array(4)));
* $output = $json->encode($value);
*
* print($output);
* // prints: ["foo","bar",[1,2,"baz"],[3,[4]]]
*
* // accept incoming POST data, assumed to be in JSON notation
* $input = file_get_contents('php://input', 1000000);
* $value = $json->decode($input);
* </code>
*/
class Services_JSON
{
/**
* constructs a new JSON instance
*
* @param int $use object behavior flags; combine with boolean-OR
*
* possible values:
* - SERVICES_JSON_LOOSE_TYPE: loose typing.
* "{...}" syntax creates associative arrays
* instead of objects in decode().
* - SERVICES_JSON_SUPPRESS_ERRORS: error suppression.
* Values which can't be encoded (e.g. resources)
* appear as NULL instead of throwing errors.
* By default, a deeply-nested resource will
* bubble up with an error, so all return values
* from encode() should be checked with isError()
*/
function Services_JSON($use = 0)
{
$this->use = $use;
}
/**
* convert a string from one UTF-16 char to one UTF-8 char
*
* Normally should be handled by mb_convert_encoding, but
* provides a slower PHP-only method for installations
* that lack the multibye string extension.
*
* @param string $utf16 UTF-16 character
* @return string UTF-8 character
* @access private
*/
function utf162utf8($utf16)
{
// oh please oh please oh please oh please oh please
if(function_exists('mb_convert_encoding')) {
return mb_convert_encoding($utf16, 'UTF-8', 'UTF-16');
}
$bytes = (ord($utf16{0}) << 8) | ord($utf16{1});
switch(true) {
case ((0x7F & $bytes) == $bytes):
// this case should never be reached, because we are in ASCII range
// see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
return chr(0x7F & $bytes);
case (0x07FF & $bytes) == $bytes:
// return a 2-byte UTF-8 character
// see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
return chr(0xC0 | (($bytes >> 6) & 0x1F))
. chr(0x80 | ($bytes & 0x3F));
case (0xFFFF & $bytes) == $bytes:
// return a 3-byte UTF-8 character
// see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
return chr(0xE0 | (($bytes >> 12) & 0x0F))
. chr(0x80 | (($bytes >> 6) & 0x3F))
. chr(0x80 | ($bytes & 0x3F));
}
// ignoring UTF-32 for now, sorry
return '';
}
/**
* convert a string from one UTF-8 char to one UTF-16 char
*
* Normally should be handled by mb_convert_encoding, but
* provides a slower PHP-only method for installations
* that lack the multibye string extension.
*
* @param string $utf8 UTF-8 character
* @return string UTF-16 character
* @access private
*/
function utf82utf16($utf8)
{
// oh please oh please oh please oh please oh please
if(function_exists('mb_convert_encoding')) {
return mb_convert_encoding($utf8, 'UTF-16', 'UTF-8');
}
switch(strlen($utf8)) {
case 1:
// this case should never be reached, because we are in ASCII range
// see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
return $utf8;
case 2:
// return a UTF-16 character from a 2-byte UTF-8 char
// see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
return chr(0x07 & (ord($utf8{0}) >> 2))
. chr((0xC0 & (ord($utf8{0}) << 6))
| (0x3F & ord($utf8{1})));
case 3:
// return a UTF-16 character from a 3-byte UTF-8 char
// see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
return chr((0xF0 & (ord($utf8{0}) << 4))
| (0x0F & (ord($utf8{1}) >> 2)))
. chr((0xC0 & (ord($utf8{1}) << 6))
| (0x7F & ord($utf8{2})));
}
// ignoring UTF-32 for now, sorry
return '';
}
/**
* encodes an arbitrary variable into JSON format
*
* @param mixed $var any number, boolean, string, array, or object to be encoded.
* see argument 1 to Services_JSON() above for array-parsing behavior.
* if var is a strng, note that encode() always expects it
* to be in ASCII or UTF-8 format!
*
* @return mixed JSON string representation of input var or an error if a problem occurs
* @access public
*/
function encode($var)
{
switch (gettype($var)) {
case 'boolean':
return $var ? 'true' : 'false';
case 'NULL':
return 'null';
case 'integer':
return (int) $var;
case 'double':
case 'float':
return (float) $var;
case 'string':
// STRINGS ARE EXPECTED TO BE IN ASCII OR UTF-8 FORMAT
$ascii = '';
$strlen_var = strlen($var);
/*
* Iterate over every character in the string,
* escaping with a slash or encoding to UTF-8 where necessary
*/
for ($c = 0; $c < $strlen_var; ++$c) {
$ord_var_c = ord($var{$c});
switch (true) {
case $ord_var_c == 0x08:
$ascii .= '\b';
break;
case $ord_var_c == 0x09:
$ascii .= '\t';
break;
case $ord_var_c == 0x0A:
$ascii .= '\n';
break;
case $ord_var_c == 0x0C:
$ascii .= '\f';
break;
case $ord_var_c == 0x0D:
$ascii .= '\r';
break;
case $ord_var_c == 0x22:
case $ord_var_c == 0x2F:
case $ord_var_c == 0x5C:
// double quote, slash, slosh
$ascii .= '\\'.$var{$c};
break;
case (($ord_var_c >= 0x20) && ($ord_var_c <= 0x7F)):
// characters U-00000000 - U-0000007F (same as ASCII)
$ascii .= $var{$c};
break;
case (($ord_var_c & 0xE0) == 0xC0):
// characters U-00000080 - U-000007FF, mask 110XXXXX
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
$char = pack('C*', $ord_var_c, ord($var{$c + 1}));
$c += 1;
$utf16 = $this->utf82utf16($char);
$ascii .= sprintf('\u%04s', bin2hex($utf16));
break;
case (($ord_var_c & 0xF0) == 0xE0):
// characters U-00000800 - U-0000FFFF, mask 1110XXXX
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
$char = pack('C*', $ord_var_c,
ord($var{$c + 1}),
ord($var{$c + 2}));
$c += 2;
$utf16 = $this->utf82utf16($char);
$ascii .= sprintf('\u%04s', bin2hex($utf16));
break;
case (($ord_var_c & 0xF8) == 0xF0):
// characters U-00010000 - U-001FFFFF, mask 11110XXX
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
$char = pack('C*', $ord_var_c,
ord($var{$c + 1}),
ord($var{$c + 2}),
ord($var{$c + 3}));
$c += 3;
$utf16 = $this->utf82utf16($char);
$ascii .= sprintf('\u%04s', bin2hex($utf16));
break;
case (($ord_var_c & 0xFC) == 0xF8):
// characters U-00200000 - U-03FFFFFF, mask 111110XX
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
$char = pack('C*', $ord_var_c,
ord($var{$c + 1}),
ord($var{$c + 2}),
ord($var{$c + 3}),
ord($var{$c + 4}));
$c += 4;
$utf16 = $this->utf82utf16($char);
$ascii .= sprintf('\u%04s', bin2hex($utf16));
break;
case (($ord_var_c & 0xFE) == 0xFC):
// characters U-04000000 - U-7FFFFFFF, mask 1111110X
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
$char = pack('C*', $ord_var_c,
ord($var{$c + 1}),
ord($var{$c + 2}),
ord($var{$c + 3}),
ord($var{$c + 4}),
ord($var{$c + 5}));
$c += 5;
$utf16 = $this->utf82utf16($char);
$ascii .= sprintf('\u%04s', bin2hex($utf16));
break;
}
}
return '"'.$ascii.'"';
case 'array':
/*
* As per JSON spec if any array key is not an integer
* we must treat the the whole array as an object. We
* also try to catch a sparsely populated associative
* array with numeric keys here because some JS engines
* will create an array with empty indexes up to
* max_index which can cause memory issues and because
* the keys, which may be relevant, will be remapped
* otherwise.
*
* As per the ECMA and JSON specification an object may
* have any string as a property. Unfortunately due to
* a hole in the ECMA specification if the key is a
* ECMA reserved word or starts with a digit the
* parameter is only accessible using ECMAScript's
* bracket notation.
*/
// treat as a JSON object
if (is_array($var) && count($var) && (array_keys($var) !== range(0, sizeof($var) - 1))) {
$properties = array_map(array($this, 'name_value'),
array_keys($var),
array_values($var));
foreach($properties as $property) {
if(Services_JSON::isError($property)) {
return $property;
}
}
return '{' . join(',', $properties) . '}';
}
// treat it like a regular array
$elements = array_map(array($this, 'encode'), $var);
foreach($elements as $element) {
if(Services_JSON::isError($element)) {
return $element;
}
}
return '[' . join(',', $elements) . ']';
case 'object':
$vars = get_object_vars($var);
$properties = array_map(array($this, 'name_value'),
array_keys($vars),
array_values($vars));
foreach($properties as $property) {
if(Services_JSON::isError($property)) {
return $property;
}
}
return '{' . join(',', $properties) . '}';
default:
return ($this->use & SERVICES_JSON_SUPPRESS_ERRORS)
? 'null'
: new Services_JSON_Error(gettype($var)." can not be encoded as JSON string");
}
}
/**
* array-walking function for use in generating JSON-formatted name-value pairs
*
* @param string $name name of key to use
* @param mixed $value reference to an array element to be encoded
*
* @return string JSON-formatted name-value pair, like '"name":value'
* @access private
*/
function name_value($name, $value)
{
$encoded_value = $this->encode($value);
if(Services_JSON::isError($encoded_value)) {
return $encoded_value;
}
return $this->encode(strval($name)) . ':' . $encoded_value;
}
/**
* reduce a string by removing leading and trailing comments and whitespace
*
* @param $str string string value to strip of comments and whitespace
*
* @return string string value stripped of comments and whitespace
* @access private
*/
function reduce_string($str)
{
$str = preg_replace(array(
// eliminate single line comments in '// ...' form
'#^\s*//(.+)$#m',
// eliminate multi-line comments in '/* ... */' form, at start of string
'#^\s*/\*(.+)\*/#Us',
// eliminate multi-line comments in '/* ... */' form, at end of string
'#/\*(.+)\*/\s*$#Us'
), '', $str);
// eliminate extraneous space
return trim($str);
}
/**
* decodes a JSON string into appropriate variable
*
* @param string $str JSON-formatted string
*
* @return mixed number, boolean, string, array, or object
* corresponding to given JSON input string.
* See argument 1 to Services_JSON() above for object-output behavior.
* Note that decode() always returns strings
* in ASCII or UTF-8 format!
* @access public
*/
function decode($str)
{
$str = $this->reduce_string($str);
switch (strtolower($str)) {
case 'true':
return true;
case 'false':
return false;
case 'null':
return null;
default:
$m = array();
if (is_numeric($str)) {
// Lookie-loo, it's a number
// This would work on its own, but I'm trying to be
// good about returning integers where appropriate:
// return (float)$str;
// Return float or int, as appropriate
return ((float)$str == (integer)$str)
? (integer)$str
: (float)$str;
} elseif (preg_match('/^("|\').*(\1)$/s', $str, $m) && $m[1] == $m[2]) {
// STRINGS RETURNED IN UTF-8 FORMAT
$delim = substr($str, 0, 1);
$chrs = substr($str, 1, -1);
$utf8 = '';
$strlen_chrs = strlen($chrs);
for ($c = 0; $c < $strlen_chrs; ++$c) {
$substr_chrs_c_2 = substr($chrs, $c, 2);
$ord_chrs_c = ord($chrs{$c});
switch (true) {
case $substr_chrs_c_2 == '\b':
$utf8 .= chr(0x08);
++$c;
break;
case $substr_chrs_c_2 == '\t':
$utf8 .= chr(0x09);
++$c;
break;
case $substr_chrs_c_2 == '\n':
$utf8 .= chr(0x0A);
++$c;
break;
case $substr_chrs_c_2 == '\f':
$utf8 .= chr(0x0C);
++$c;
break;
case $substr_chrs_c_2 == '\r':
$utf8 .= chr(0x0D);
++$c;
break;
case $substr_chrs_c_2 == '\\"':
case $substr_chrs_c_2 == '\\\'':
case $substr_chrs_c_2 == '\\\\':
case $substr_chrs_c_2 == '\\/':
if (($delim == '"' && $substr_chrs_c_2 != '\\\'') ||
($delim == "'" && $substr_chrs_c_2 != '\\"')) {
$utf8 .= $chrs{++$c};
}
break;
case preg_match('/\\\u[0-9A-F]{4}/i', substr($chrs, $c, 6)):
// single, escaped unicode character
$utf16 = chr(hexdec(substr($chrs, ($c + 2), 2)))
. chr(hexdec(substr($chrs, ($c + 4), 2)));
$utf8 .= $this->utf162utf8($utf16);
$c += 5;
break;
case ($ord_chrs_c >= 0x20) && ($ord_chrs_c <= 0x7F):
$utf8 .= $chrs{$c};
break;
case ($ord_chrs_c & 0xE0) == 0xC0:
// characters U-00000080 - U-000007FF, mask 110XXXXX
//see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
$utf8 .= substr($chrs, $c, 2);
++$c;
break;
case ($ord_chrs_c & 0xF0) == 0xE0:
// characters U-00000800 - U-0000FFFF, mask 1110XXXX
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
$utf8 .= substr($chrs, $c, 3);
$c += 2;
break;
case ($ord_chrs_c & 0xF8) == 0xF0:
// characters U-00010000 - U-001FFFFF, mask 11110XXX
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
$utf8 .= substr($chrs, $c, 4);
$c += 3;
break;
case ($ord_chrs_c & 0xFC) == 0xF8:
// characters U-00200000 - U-03FFFFFF, mask 111110XX
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
$utf8 .= substr($chrs, $c, 5);
$c += 4;
break;
case ($ord_chrs_c & 0xFE) == 0xFC:
// characters U-04000000 - U-7FFFFFFF, mask 1111110X
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
$utf8 .= substr($chrs, $c, 6);
$c += 5;
break;
}
}
return $utf8;
} elseif (preg_match('/^\[.*\]$/s', $str) || preg_match('/^\{.*\}$/s', $str)) {
// array, or object notation
if ($str{0} == '[') {
$stk = array(SERVICES_JSON_IN_ARR);
$arr = array();
} else {
if ($this->use & SERVICES_JSON_LOOSE_TYPE) {
$stk = array(SERVICES_JSON_IN_OBJ);
$obj = array();
} else {
$stk = array(SERVICES_JSON_IN_OBJ);
$obj = new stdClass();
}
}
array_push($stk, array('what' => SERVICES_JSON_SLICE,
'where' => 0,
'delim' => false));
$chrs = substr($str, 1, -1);
$chrs = $this->reduce_string($chrs);
if ($chrs == '') {
if (reset($stk) == SERVICES_JSON_IN_ARR) {
return $arr;
} else {
return $obj;
}
}
//print("\nparsing {$chrs}\n");
$strlen_chrs = strlen($chrs);
for ($c = 0; $c <= $strlen_chrs; ++$c) {
$top = end($stk);
$substr_chrs_c_2 = substr($chrs, $c, 2);
if (($c == $strlen_chrs) || (($chrs{$c} == ',') && ($top['what'] == SERVICES_JSON_SLICE))) {
// found a comma that is not inside a string, array, etc.,
// OR we've reached the end of the character list
$slice = substr($chrs, $top['where'], ($c - $top['where']));
array_push($stk, array('what' => SERVICES_JSON_SLICE, 'where' => ($c + 1), 'delim' => false));
//print("Found split at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n");
if (reset($stk) == SERVICES_JSON_IN_ARR) {
// we are in an array, so just push an element onto the stack
array_push($arr, $this->decode($slice));
} elseif (reset($stk) == SERVICES_JSON_IN_OBJ) {
// we are in an object, so figure
// out the property name and set an
// element in an associative array,
// for now
$parts = array();
if (preg_match('/^\s*(["\'].*[^\\\]["\'])\s*:\s*(\S.*),?$/Uis', $slice, $parts)) {
// "name":value pair
$key = $this->decode($parts[1]);
$val = $this->decode($parts[2]);
if ($this->use & SERVICES_JSON_LOOSE_TYPE) {
$obj[$key] = $val;
} else {
$obj->$key = $val;
}
} elseif (preg_match('/^\s*(\w+)\s*:\s*(\S.*),?$/Uis', $slice, $parts)) {
// name:value pair, where name is unquoted
$key = $parts[1];
$val = $this->decode($parts[2]);
if ($this->use & SERVICES_JSON_LOOSE_TYPE) {
$obj[$key] = $val;
} else {
$obj->$key = $val;
}
}
}
} elseif ((($chrs{$c} == '"') || ($chrs{$c} == "'")) && ($top['what'] != SERVICES_JSON_IN_STR)) {
// found a quote, and we are not inside a string
array_push($stk, array('what' => SERVICES_JSON_IN_STR, 'where' => $c, 'delim' => $chrs{$c}));
//print("Found start of string at {$c}\n");
} elseif (($chrs{$c} == $top['delim']) &&
($top['what'] == SERVICES_JSON_IN_STR) &&
((strlen(substr($chrs, 0, $c)) - strlen(rtrim(substr($chrs, 0, $c), '\\'))) % 2 != 1)) {
// found a quote, we're in a string, and it's not escaped
// we know that it's not escaped becase there is _not_ an
// odd number of backslashes at the end of the string so far
array_pop($stk);
//print("Found end of string at {$c}: ".substr($chrs, $top['where'], (1 + 1 + $c - $top['where']))."\n");
} elseif (($chrs{$c} == '[') &&
in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) {
// found a left-bracket, and we are in an array, object, or slice
array_push($stk, array('what' => SERVICES_JSON_IN_ARR, 'where' => $c, 'delim' => false));
//print("Found start of array at {$c}\n");
} elseif (($chrs{$c} == ']') && ($top['what'] == SERVICES_JSON_IN_ARR)) {
// found a right-bracket, and we're in an array
array_pop($stk);
//print("Found end of array at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n");
} elseif (($chrs{$c} == '{') &&
in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) {
// found a left-brace, and we are in an array, object, or slice
array_push($stk, array('what' => SERVICES_JSON_IN_OBJ, 'where' => $c, 'delim' => false));
//print("Found start of object at {$c}\n");
} elseif (($chrs{$c} == '}') && ($top['what'] == SERVICES_JSON_IN_OBJ)) {
// found a right-brace, and we're in an object
array_pop($stk);
//print("Found end of object at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n");
} elseif (($substr_chrs_c_2 == '/*') &&
in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) {
// found a comment start, and we are in an array, object, or slice
array_push($stk, array('what' => SERVICES_JSON_IN_CMT, 'where' => $c, 'delim' => false));
$c++;
//print("Found start of comment at {$c}\n");
} elseif (($substr_chrs_c_2 == '*/') && ($top['what'] == SERVICES_JSON_IN_CMT)) {
// found a comment end, and we're in one now
array_pop($stk);
$c++;
for ($i = $top['where']; $i <= $c; ++$i)
$chrs = substr_replace($chrs, ' ', $i, 1);
//print("Found end of comment at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n");
}
}
if (reset($stk) == SERVICES_JSON_IN_ARR) {
return $arr;
} elseif (reset($stk) == SERVICES_JSON_IN_OBJ) {
return $obj;
}
}
}
}
/**
* @todo Ultimately, this should just call PEAR::isError()
*/
function isError($data, $code = null)
{
if (class_exists('pear')) {
return PEAR::isError($data, $code);
} elseif (is_object($data) && (get_class($data) == 'services_json_error' ||
is_subclass_of($data, 'services_json_error'))) {
return true;
}
return false;
}
}
if (class_exists('PEAR_Error')) {
class Services_JSON_Error extends PEAR_Error
{
function Services_JSON_Error($message = 'unknown error', $code = null,
$mode = null, $options = null, $userinfo = null)
{
parent::PEAR_Error($message, $code, $mode, $options, $userinfo);
}
}
} else {
/**
* @todo Ultimately, this class shall be descended from PEAR_Error
*/
class Services_JSON_Error
{
function Services_JSON_Error($message = 'unknown error', $code = null,
$mode = null, $options = null, $userinfo = null)
{
}
}
}
?>

View File

@@ -0,0 +1,504 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
<one line to give the library's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
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
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
<signature of Ty Coon>, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!

View File

@@ -0,0 +1,132 @@
<?
// --------------------------------------------------------------------------------
// PhpConcept Library (PCL) Error 1.0
// --------------------------------------------------------------------------------
// License GNU/GPL - Vincent Blavet - Mars 2001
// http://www.phpconcept.net & http://phpconcept.free.fr
// --------------------------------------------------------------------------------
// Fran<61>ais :
// La description de l'usage de la librairie PCL Error 1.0 n'est pas encore
// disponible. Celle-ci n'est pour le moment distribu<62>e qu'avec les
// d<>veloppements applicatifs de PhpConcept.
// Une version ind<6E>pendante sera bientot disponible sur http://www.phpconcept.net
//
// English :
// The PCL Error 1.0 library description is not available yet. This library is
// released only with PhpConcept application and libraries.
// An independant release will be soon available on http://www.phpconcept.net
//
// --------------------------------------------------------------------------------
//
// * Avertissement :
//
// Cette librairie a <20>t<EFBFBD> cr<63><72>e de fa<66>on non professionnelle.
// Son usage est au risque et p<>ril de celui qui l'utilise, en aucun cas l'auteur
// de ce code ne pourra <20>tre tenu pour responsable des <20>ventuels d<>gats qu'il pourrait
// engendrer.
// Il est entendu cependant que l'auteur a r<>alis<69> ce code par plaisir et n'y a
// cach<63> aucun virus, ni malveillance.
// Cette libairie est distribu<62>e sous la license GNU/GPL (http://www.gnu.org)
//
// * Auteur :
//
// Ce code a <20>t<EFBFBD> <20>crit par Vincent Blavet (vincent@blavet.net) sur son temps
// de loisir.
//
// --------------------------------------------------------------------------------
// ----- Look for double include
if (!defined("PCLERROR_LIB"))
{
define( "PCLERROR_LIB", 1 );
// ----- Version
$g_pcl_error_version = "1.0";
// ----- Internal variables
// These values must only be change by PclError library functions
$g_pcl_error_string = "";
$g_pcl_error_code = 1;
// --------------------------------------------------------------------------------
// Function : PclErrorLog()
// Description :
// Parameters :
// --------------------------------------------------------------------------------
function PclErrorLog($p_error_code=0, $p_error_string="")
{
global $g_pcl_error_string;
global $g_pcl_error_code;
$g_pcl_error_code = $p_error_code;
$g_pcl_error_string = $p_error_string;
}
// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
// Function : PclErrorFatal()
// Description :
// Parameters :
// --------------------------------------------------------------------------------
function PclErrorFatal($p_file, $p_line, $p_error_string="")
{
global $g_pcl_error_string;
global $g_pcl_error_code;
$v_message = "<html><body>";
$v_message .= "<p align=center><font color=red bgcolor=white><b>PclError Library has detected a fatal error on file '$p_file', line $p_line</b></font></p>";
$v_message .= "<p align=center><font color=red bgcolor=white><b>$p_error_string</b></font></p>";
$v_message .= "</body></html>";
die($v_message);
}
// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
// Function : PclErrorReset()
// Description :
// Parameters :
// --------------------------------------------------------------------------------
function PclErrorReset()
{
global $g_pcl_error_string;
global $g_pcl_error_code;
$g_pcl_error_code = 1;
$g_pcl_error_string = "";
}
// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
// Function : PclErrorCode()
// Description :
// Parameters :
// --------------------------------------------------------------------------------
function PclErrorCode()
{
global $g_pcl_error_string;
global $g_pcl_error_code;
return($g_pcl_error_code);
}
// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
// Function : PclErrorString()
// Description :
// Parameters :
// --------------------------------------------------------------------------------
function PclErrorString()
{
global $g_pcl_error_string;
global $g_pcl_error_code;
return($g_pcl_error_string." [code $g_pcl_error_code]");
}
// --------------------------------------------------------------------------------
// ----- End of double include look
}
?>

View File

@@ -0,0 +1,737 @@
<?php
// --------------------------------------------------------------------------------
// PhpConcept Library (PCL) Trace 2.0-beta1
// --------------------------------------------------------------------------------
// License GNU/GPL - Vincent Blavet - August 2003
// http://www.phpconcept.net
// --------------------------------------------------------------------------------
//
// The PCL Trace library description is not available yet.
// This library was first released only with PclZip library.
// An independant release will be soon available on http://www.phpconcept.net
//
// --------------------------------------------------------------------------------
//
// Warning :
// This library and the associated files are non commercial, non professional
// work.
// It should not have unexpected results. However if any damage is caused by
// this software the author can not be responsible.
// The use of this software is at the risk of the user.
//
// --------------------------------------------------------------------------------
// ----- Version
$g_pcltrace_version = "2.0-beta1";
// ----- Internal variables
// These values must be change by PclTrace library functions
$g_pcl_trace_mode = "memory";
$g_pcl_trace_filename = "trace.txt";
$g_pcl_trace_name = array();
$g_pcl_trace_index = 0;
$g_pcl_trace_level = 0;
$g_pcl_trace_suspend = false;
//$g_pcl_trace_entries = array();
// ----- For compatibility reason
define ('PCLTRACE_LIB', 1);
// --------------------------------------------------------------------------------
// Function : TrOn($p_level, $p_mode, $p_filename)
// Description :
// Parameters :
// $p_level : Trace level
// $p_mode : Mode of trace displaying :
// 'normal' : messages are displayed at function call
// 'memory' : messages are memorized in a table and can be display by
// TrDisplay() function. (default)
// 'log' : messages are writed in the file $p_filename
// --------------------------------------------------------------------------------
function PclTraceOn($p_level=1, $p_mode="memory", $p_filename="trace.txt")
{
TrOn($p_level, $p_mode, $p_filename);
}
function TrOn($p_level=1, $p_mode="memory", $p_filename="trace.txt")
{
global $g_pcl_trace_level;
global $g_pcl_trace_mode;
global $g_pcl_trace_filename;
global $g_pcl_trace_name;
global $g_pcl_trace_index;
global $g_pcl_trace_entries;
global $g_pcl_trace_suspend;
// ----- Enable trace mode
$g_pcl_trace_level = $p_level;
// ----- Memorize mode and filename
switch ($p_mode) {
case "normal" :
case "memory" :
case "log" :
$g_pcl_trace_mode = $p_mode;
break;
default :
$g_pcl_trace_mode = "logged";
}
// ----- Memorize filename
$g_pcl_trace_filename = $p_filename;
$g_pcl_trace_suspend = false;
}
// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
// Function : IsTrOn()
// Description :
// Return value :
// The trace level (0 for disable).
// --------------------------------------------------------------------------------
function PclTraceIsOn()
{
return IsTrOn();
}
function IsTrOn()
{
global $g_pcl_trace_level;
return($g_pcl_trace_level);
}
// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
// Function : TrOff()
// Description :
// Parameters :
// --------------------------------------------------------------------------------
function PclTraceOff()
{
TrOff();
}
function TrOff()
{
global $g_pcl_trace_level;
global $g_pcl_trace_mode;
global $g_pcl_trace_filename;
global $g_pcl_trace_name;
global $g_pcl_trace_index;
// ----- Clean
$g_pcl_trace_mode = "memory";
unset($g_pcl_trace_entries);
unset($g_pcl_trace_name);
unset($g_pcl_trace_index);
// ----- Switch off trace
$g_pcl_trace_level = 0;
}
// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
// Function : PclTraceSuspend()
// Description :
// Parameters :
// --------------------------------------------------------------------------------
function PclTraceSuspend()
{
global $g_pcl_trace_suspend;
$g_pcl_trace_suspend = true;
}
// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
// Function : PclTraceResume()
// Description :
// Parameters :
// --------------------------------------------------------------------------------
function PclTraceResume()
{
global $g_pcl_trace_suspend;
$g_pcl_trace_suspend = false;
}
// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
// Function : TrFctStart()
// Description :
// Just a trace function for debbugging purpose before I use a better tool !!!!
// Start and stop of this function is by $g_pcl_trace_level global variable.
// Parameters :
// $p_level : Level of trace required.
// --------------------------------------------------------------------------------
function PclTraceFctStart($p_file, $p_line, $p_name, $p_param="", $p_message="")
{
TrFctStart($p_file, $p_line, $p_name, $p_param, $p_message);
}
function TrFctStart($p_file, $p_line, $p_name, $p_param="", $p_message="")
{
global $g_pcl_trace_level;
global $g_pcl_trace_mode;
global $g_pcl_trace_filename;
global $g_pcl_trace_name;
global $g_pcl_trace_index;
global $g_pcl_trace_entries;
global $g_pcl_trace_suspend;
// ----- Look for disabled trace
if (($g_pcl_trace_level < 1) || ($g_pcl_trace_suspend))
return;
// ----- Add the function name in the list
if (!isset($g_pcl_trace_name))
$g_pcl_trace_name = $p_name;
else
$g_pcl_trace_name .= ",".$p_name;
// ----- Update the function entry
$i = sizeof($g_pcl_trace_entries);
$g_pcl_trace_entries[$i]['name'] = $p_name;
$g_pcl_trace_entries[$i]['param'] = $p_param;
$g_pcl_trace_entries[$i]['message'] = "";
$g_pcl_trace_entries[$i]['file'] = $p_file;
$g_pcl_trace_entries[$i]['line'] = $p_line;
$g_pcl_trace_entries[$i]['index'] = $g_pcl_trace_index;
$g_pcl_trace_entries[$i]['type'] = "1"; // means start of function
// ----- Update the message entry
if ($p_message != "")
{
$i = sizeof($g_pcl_trace_entries);
$g_pcl_trace_entries[$i]['name'] = "";
$g_pcl_trace_entries[$i]['param'] = "";
$g_pcl_trace_entries[$i]['message'] = $p_message;
$g_pcl_trace_entries[$i]['file'] = $p_file;
$g_pcl_trace_entries[$i]['line'] = $p_line;
$g_pcl_trace_entries[$i]['index'] = $g_pcl_trace_index;
$g_pcl_trace_entries[$i]['type'] = "3"; // means message
}
// ----- Action depending on mode
PclTraceAction($g_pcl_trace_entries[$i]);
// ----- Increment the index
$g_pcl_trace_index++;
}
// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
// Function : TrFctEnd()
// Description :
// Just a trace function for debbugging purpose before I use a better tool !!!!
// Start and stop of this function is by $g_pcl_trace_level global variable.
// Parameters :
// $p_level : Level of trace required.
// --------------------------------------------------------------------------------
function PclTraceFctEnd($p_file, $p_line, $p_return=1, $p_message="")
{
TrFctEnd($p_file, $p_line, $p_return, $p_message);
}
function TrFctEnd($p_file, $p_line, $p_return=1, $p_message="")
{
global $g_pcl_trace_level;
global $g_pcl_trace_mode;
global $g_pcl_trace_filename;
global $g_pcl_trace_name;
global $g_pcl_trace_index;
global $g_pcl_trace_entries;
global $g_pcl_trace_suspend;
// ----- Look for disabled trace
if (($g_pcl_trace_level < 1) || ($g_pcl_trace_suspend))
return;
// ----- Extract the function name in the list
// ----- Remove the function name in the list
if (!($v_name = strrchr($g_pcl_trace_name, ",")))
{
$v_name = $g_pcl_trace_name;
$g_pcl_trace_name = "";
}
else
{
$g_pcl_trace_name = substr($g_pcl_trace_name, 0, strlen($g_pcl_trace_name)-strlen($v_name));
$v_name = substr($v_name, -strlen($v_name)+1);
}
// ----- Decrement the index
$g_pcl_trace_index--;
// ----- Update the message entry
if ($p_message != "")
{
$i = sizeof($g_pcl_trace_entries);
$g_pcl_trace_entries[$i]['name'] = "";
$g_pcl_trace_entries[$i]['param'] = "";
$g_pcl_trace_entries[$i]['message'] = $p_message;
$g_pcl_trace_entries[$i]['file'] = $p_file;
$g_pcl_trace_entries[$i]['line'] = $p_line;
$g_pcl_trace_entries[$i]['index'] = $g_pcl_trace_index;
$g_pcl_trace_entries[$i]['type'] = "3"; // means message
}
// ----- Update the function entry
$i = sizeof($g_pcl_trace_entries);
$g_pcl_trace_entries[$i]['name'] = $v_name;
$g_pcl_trace_entries[$i]['param'] = $p_return;
$g_pcl_trace_entries[$i]['message'] = "";
$g_pcl_trace_entries[$i]['file'] = $p_file;
$g_pcl_trace_entries[$i]['line'] = $p_line;
$g_pcl_trace_entries[$i]['index'] = $g_pcl_trace_index;
$g_pcl_trace_entries[$i]['type'] = "2"; // means end of function
// ----- Action depending on mode
PclTraceAction($g_pcl_trace_entries[$i]);
}
// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
// Function : TrFctMessage()
// Description :
// Parameters :
// --------------------------------------------------------------------------------
function PclTraceFctMessage($p_file, $p_line, $p_level, $p_message="")
{
TrFctMessage($p_file, $p_line, $p_level, $p_message);
}
function TrFctMessage($p_file, $p_line, $p_level, $p_message="")
{
global $g_pcl_trace_level;
global $g_pcl_trace_mode;
global $g_pcl_trace_filename;
global $g_pcl_trace_name;
global $g_pcl_trace_index;
global $g_pcl_trace_entries;
global $g_pcl_trace_suspend;
// ----- Look for disabled trace
if (($g_pcl_trace_level < $p_level) || ($g_pcl_trace_suspend))
return;
// ----- Update the entry
$i = sizeof($g_pcl_trace_entries);
$g_pcl_trace_entries[$i]['name'] = "";
$g_pcl_trace_entries[$i]['param'] = "";
$g_pcl_trace_entries[$i]['message'] = $p_message;
$g_pcl_trace_entries[$i]['file'] = $p_file;
$g_pcl_trace_entries[$i]['line'] = $p_line;
$g_pcl_trace_entries[$i]['index'] = $g_pcl_trace_index;
$g_pcl_trace_entries[$i]['type'] = "3"; // means message of function
// ----- Action depending on mode
PclTraceAction($g_pcl_trace_entries[$i]);
}
// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
// Function : TrMessage()
// Description :
// Parameters :
// --------------------------------------------------------------------------------
function PclTraceMessage($p_file, $p_line, $p_level, $p_message="")
{
TrMessage($p_file, $p_line, $p_level, $p_message);
}
function TrMessage($p_file, $p_line, $p_level, $p_message="")
{
global $g_pcl_trace_level;
global $g_pcl_trace_mode;
global $g_pcl_trace_filename;
global $g_pcl_trace_name;
global $g_pcl_trace_index;
global $g_pcl_trace_entries;
global $g_pcl_trace_suspend;
// ----- Look for disabled trace
if (($g_pcl_trace_level < $p_level) || ($g_pcl_trace_suspend))
return;
// ----- Update the entry
$i = sizeof($g_pcl_trace_entries);
$g_pcl_trace_entries[$i]['name'] = "";
$g_pcl_trace_entries[$i]['param'] = "";
$g_pcl_trace_entries[$i]['message'] = $p_message;
$g_pcl_trace_entries[$i]['file'] = $p_file;
$g_pcl_trace_entries[$i]['line'] = $p_line;
$g_pcl_trace_entries[$i]['index'] = $g_pcl_trace_index;
$g_pcl_trace_entries[$i]['type'] = "4"; // means simple message
// ----- Action depending on mode
PclTraceAction($g_pcl_trace_entries[$i]);
}
// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
// Function : TrDisplay()
// Description :
// Parameters :
// --------------------------------------------------------------------------------
function PclTraceDisplay()
{
TrDisplay();
}
function TrDisplay()
{
global $g_pcl_trace_level;
global $g_pcl_trace_mode;
global $g_pcl_trace_filename;
global $g_pcl_trace_name;
global $g_pcl_trace_index;
global $g_pcl_trace_entries;
global $g_pcl_trace_suspend;
// ----- Look for disabled trace
if (($g_pcl_trace_level <= 0) || ($g_pcl_trace_mode != "memory") || ($g_pcl_trace_suspend))
return;
$v_font = "\"Verdana, Arial, Helvetica, sans-serif\"";
// ----- Trace Header
echo "<table width=100% border=0 cellspacing=0 cellpadding=0>";
echo "<tr bgcolor=#0000CC>";
echo "<td bgcolor=#0000CC width=1>";
echo "</td>";
echo "<td><div align=center><font size=3 color=#FFFFFF face=$v_font>Trace</font></div></td>";
echo "</tr>";
echo "<tr>";
echo "<td bgcolor=#0000CC width=1>";
echo "</td>";
echo "<td>";
// ----- Content header
echo "<table width=100% border=0 cellspacing=0 cellpadding=0>";
// ----- Display
$v_again=0;
for ($i=0; $i<sizeof($g_pcl_trace_entries); $i++)
{
// ---- Row header
echo "<tr>";
echo "<td><table width=100% border=0 cellspacing=0 cellpadding=0><tr>";
$n = ($g_pcl_trace_entries[$i]['index']+1)*10;
echo "<td width=".$n."><table width=100% border=0 cellspacing=0 cellpadding=0><tr>";
for ($j=0; $j<=$g_pcl_trace_entries[$i]['index']; $j++)
{
if ($j==$g_pcl_trace_entries[$i]['index'])
{
if (($g_pcl_trace_entries[$i]['type'] == 1) || ($g_pcl_trace_entries[$i]['type'] == 2))
echo "<td width=10><div align=center><font size=2 face=$v_font>+</font></div></td>";
}
else
echo "<td width=10><div align=center><font size=2 face=$v_font>|</font></div></td>";
}
//echo "<td>&nbsp</td>";
echo "</tr></table></td>";
echo "<td width=2></td>";
switch ($g_pcl_trace_entries[$i]['type']) {
case 1:
echo "<td><font size=2 face=$v_font>".$g_pcl_trace_entries[$i]['name']."(".$g_pcl_trace_entries[$i]['param'].")</font></td>";
break;
case 2:
echo "<td><font size=2 face=$v_font>".$g_pcl_trace_entries[$i]['name']."()=".$g_pcl_trace_entries[$i]['param']."</font></td>";
break;
case 3:
case 4:
echo "<td><table width=100% border=0 cellspacing=0 cellpadding=0><td width=20></td><td>";
echo "<font size=2 face=$v_font>".$g_pcl_trace_entries[$i]['message']."</font>";
echo "</td></table></td>";
break;
default:
echo "<td><font size=2 face=$v_font>".$g_pcl_trace_entries[$i]['name']."(".$g_pcl_trace_entries[$i]['param'].")</font></td>";
}
echo "</tr></table></td>";
echo "<td width=5></td>";
echo "<td><font size=1 face=$v_font>".basename($g_pcl_trace_entries[$i]['file'])."</font></td>";
echo "<td width=5></td>";
echo "<td><font size=1 face=$v_font>".$g_pcl_trace_entries[$i]['line']."</font></td>";
echo "</tr>";
}
// ----- Content footer
echo "</table>";
// ----- Trace footer
echo "</td>";
echo "<td bgcolor=#0000CC width=1>";
echo "</td>";
echo "</tr>";
echo "<tr bgcolor=#0000CC>";
echo "<td bgcolor=#0000CC width=1>";
echo "</td>";
echo "<td><div align=center><font color=#FFFFFF face=$v_font>&nbsp</font></div></td>";
echo "</tr>";
echo "</table>";
}
// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
// Function : TrDisplayNew()
// Description :
// Parameters :
// --------------------------------------------------------------------------------
function PclTraceDisplayNew()
{
global $g_pcl_trace_level;
global $g_pcl_trace_mode;
global $g_pcl_trace_filename;
global $g_pcl_trace_name;
global $g_pcl_trace_index;
global $g_pcl_trace_entries;
global $g_pcl_trace_suspend;
// ----- Look for disabled trace
if (($g_pcl_trace_level <= 0) || ($g_pcl_trace_mode != "memory") || ($g_pcl_trace_suspend))
return;
?>
<script language="javascript">
function PclTraceToggleView(element) {
if (element.style.visibility == 'visible') {
PclTraceHide(element);
} else {
PclTraceShow(element);
}
}
function PclTraceShow(element) {
element.style.visibility = 'visible';
element.style.position='relative';
}
function PclTraceHide(element) {
element.style.visibility = 'hidden';
element.style.position='absolute';
}
</script>
<table width="100%" border="0" cellspacing="0" cellpadding="0"
bordercolor="#0000CC">
<tr>
<td bgcolor="#0000CC">
<div align="center"><font face="Verdana, Arial, Helvetica, sans-serif"
color="#FFFFFF"><b>Trace</b></font></div>
</td>
</tr>
<tr>
<td><?php
$v_font = "\"Verdana, Arial, Helvetica, sans-serif\"";
// ----- Trace Header
// ----- Display the items
$v_again=0;
for ($i=0; $i<sizeof($g_pcl_trace_entries); $i++)
{
switch ($g_pcl_trace_entries[$i]['type']) {
case 1: // fct start
PclTraceDisplayItemStart($i);
break;
case 2: // fct stop
PclTraceDisplayItemStop($i);
break;
case 3: // fct msg
case 4: // msg
PclTraceDisplayItemMsg($i);
break;
default:
}
/*
echo "</tr></table></td>";
echo "<td width=5></td>";
echo "<td><font size=1 face=$v_font>".basename($g_pcl_trace_entries[$i]['file'])."</font></td>";
echo "<td width=5></td>";
echo "<td><font size=1 face=$v_font>".$g_pcl_trace_entries[$i]['line']."</font></td>";
echo "</tr>";
*/
}
// ----- Trace footer
?></td>
</tr>
<tr>
<td bgcolor="#0000CC">&nbsp;</td>
</tr>
</table>
<script language="javascript">
function PclTraceShowAll() {
<?php
for ($i=0; $i<sizeof($g_pcl_trace_entries); $i++) {
if ($g_pcl_trace_entries[$i]['type'] == 1) {
echo "PclTraceShow(document.getElementById('fct-".$i."'));";
}
}
?>
}
function PclTraceHideAll() {
<?php
for ($i=0; $i<sizeof($g_pcl_trace_entries); $i++) {
if ($g_pcl_trace_entries[$i]['type'] == 1) {
echo "PclTraceHide(document.getElementById('fct-".$i."'));";
}
}
?>
}
</script>
<form id="formulaire" action="POST">
<p><input type='button' value='Show All' onclick="PclTraceShowAll();"></input>
<input type='button' value='Hide All' onclick="PclTraceHideAll();"></input>
</p>
</form>
<?php
}
// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
// Function : TrDisplayNew()
// Description :
// Parameters :
// --------------------------------------------------------------------------------
function PclTraceDisplayItemStart($p_id)
{
global $g_pcl_trace_level;
global $g_pcl_trace_mode;
global $g_pcl_trace_filename;
global $g_pcl_trace_name;
global $g_pcl_trace_index;
global $g_pcl_trace_entries;
global $g_pcl_trace_suspend;
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="10"><font face="Verdana, Arial, Helvetica, sans-serif"
color="#FFFFFF"><b><font color="#000000" size="2">+</font></b></font></td>
<td style="width: 2px;"></td>
<td><font face="Verdana, Arial, Helvetica, sans-serif" color="#FFFFFF"><b><font
color="#000000" size="2"> <a href="javascript:null();"
title="<?php echo 'File:'.basename($g_pcl_trace_entries[$p_id]['file'])." Line: ".$g_pcl_trace_entries[$p_id]['line'];?>"
onClick="PclTraceToggleView(document.getElementById('<?php echo 'fct-'.$p_id; ?>'));">
<?php echo $g_pcl_trace_entries[$p_id]['name']."(".$g_pcl_trace_entries[$p_id]['param'].")" ?>
</a></font></b></font></td>
</tr>
<tr id="<?php echo 'fct-'.$p_id; ?>"
style="visibility: hidden; position: absolute;">
<td width="10">&nbsp;</td>
<td style="width: 2px;" bgcolor="#0000CC"></td>
<td><?php
}
// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
// Function : TrDisplayNew()
// Description :
// Parameters :
// --------------------------------------------------------------------------------
function PclTraceDisplayItemStop($p_id)
{
global $g_pcl_trace_level;
global $g_pcl_trace_mode;
global $g_pcl_trace_filename;
global $g_pcl_trace_name;
global $g_pcl_trace_index;
global $g_pcl_trace_entries;
global $g_pcl_trace_suspend;
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><font face="Verdana, Arial, Helvetica, sans-serif"
color="#FFFFFF"><b><font color="#000000" size="2"> <?php echo $g_pcl_trace_entries[$p_id]['name']."()=".$g_pcl_trace_entries[$p_id]['param']; ?>
</font></b></font></td>
</tr>
</table>
</td>
</tr>
</table>
<?php
}
// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
// Function : TrDisplayNew()
// Description :
// Parameters :
// --------------------------------------------------------------------------------
function PclTraceDisplayItemMsg($p_id)
{
global $g_pcl_trace_level;
global $g_pcl_trace_mode;
global $g_pcl_trace_filename;
global $g_pcl_trace_name;
global $g_pcl_trace_index;
global $g_pcl_trace_entries;
global $g_pcl_trace_suspend;
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="10"><font face="Verdana, Arial, Helvetica, sans-serif"
color="#FFFFFF"><b><font color="#000000" size="2">
<center>.</center>
</font></b></font></td>
<td style="width: 2px;"></td>
<td><font face="Verdana, Arial, Helvetica, sans-serif" color="#FFFFFF"><b><font
color="#000000" size="2"> <?php echo $g_pcl_trace_entries[$p_id]['message'] ?>
</font></b></font></td>
<td width=5></td>
<td><font size=1 face="Verdana, Arial, Helvetica, sans-serif"><?php echo basename($g_pcl_trace_entries[$p_id]['file']); ?></font></td>
<td width=5></td>
<td><font size=1 face="Verdana, Arial, Helvetica, sans-serif"><?php echo $g_pcl_trace_entries[$p_id]['line']; ?></font></td>
</tr>
</table>
<?php
}
// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
// Function : PclTraceAction()
// Description :
// Parameters :
// --------------------------------------------------------------------------------
function PclTraceAction($p_entry)
{
global $g_pcl_trace_level;
global $g_pcl_trace_mode;
global $g_pcl_trace_filename;
global $g_pcl_trace_name;
global $g_pcl_trace_index;
global $g_pcl_trace_entries;
if ($g_pcl_trace_mode == "normal")
{
for ($i=0; $i<$p_entry['index']; $i++)
echo "---";
if ($p_entry['type'] == 1)
echo "<b>".$p_entry['name']."</b>(".$p_entry['param'].") : ".$p_entry['message']." [".$p_entry[file].", ".$p_entry[line]."]<br>";
else if ($p_entry['type'] == 2)
echo "<b>".$p_entry['name']."</b>()=".$p_entry['param']." : ".$p_entry['message']." [".$p_entry[file].", ".$p_entry[line]."]<br>";
else
echo $p_entry['message']." [".$p_entry['file'].", ".$p_entry['line']."]<br>";
}
}
// --------------------------------------------------------------------------------
?>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,412 @@
// --------------------------------------------------------------------------------
// PclZip 2.8.1 - readme.txt
// --------------------------------------------------------------------------------
// License GNU/LGPL - August 2009
// Vincent Blavet - vincent@phpconcept.net
// http://www.phpconcept.net
// --------------------------------------------------------------------------------
// $Id: readme.txt,v 1.58 2009/08/11 14:58:12 vblavet Exp $
// --------------------------------------------------------------------------------
0 - Sommaire
============
1 - Introduction
2 - What's new
3 - Corrected bugs
4 - Known bugs or limitations
5 - License
6 - Warning
7 - Documentation
8 - Author
9 - Contribute
1 - Introduction
================
PclZip is a library that allow you to manage a Zip archive.
Full documentation about PclZip can be found here : http://www.phpconcept.net/pclzip
2 - What's new
==============
Version 2.8.1 :
- Move option PCLZIP_OPT_BY_EREG to PCLZIP_OPT_BY_PREG because ereg() is
deprecated in PHP 5.3. When using option PCLZIP_OPT_BY_EREG, PclZip will
automatically replace it by PCLZIP_OPT_BY_PREG.
Version 2.8 :
- Improve extraction of zip archive for large files by using temporary files
This feature is working like the one defined in r2.7.
Options are renamed : PCLZIP_OPT_TEMP_FILE_ON, PCLZIP_OPT_TEMP_FILE_OFF,
PCLZIP_OPT_TEMP_FILE_THRESHOLD
- Add a ratio constant PCLZIP_TEMPORARY_FILE_RATIO to configure the auto
sense of temporary file use.
- Bug correction : Reduce filepath in returned file list to remove ennoying
'.//' preambule in file path.
Version 2.7 :
- Improve creation of zip archive for large files :
PclZip will now autosense the configured memory and use temporary files
when large file is suspected.
This feature can also ne triggered by manual options in create() and add()
methods. 'PCLZIP_OPT_ADD_TEMP_FILE_ON' force the use of temporary files,
'PCLZIP_OPT_ADD_TEMP_FILE_OFF' disable the autosense technic,
'PCLZIP_OPT_ADD_TEMP_FILE_THRESHOLD' allow for configuration of a size
threshold to use temporary files.
Using "temporary files" rather than "memory" might take more time, but
might give the ability to zip very large files :
Tested on my win laptop with a 88Mo file :
Zip "in-memory" : 18sec (max_execution_time=30, memory_limit=180Mo)
Zip "tmporary-files" : 23sec (max_execution_time=30, memory_limit=30Mo)
- Replace use of mktime() by time() to limit the E_STRICT error messages.
- Bug correction : When adding files with full windows path (drive letter)
PclZip is now working. Before, if the drive letter is not the default
path, PclZip was not able to add the file.
Version 2.6 :
- Code optimisation
- New attributes PCLZIP_ATT_FILE_COMMENT gives the ability to
add a comment for a specific file. (Don't really know if this is usefull)
- New attribute PCLZIP_ATT_FILE_CONTENT gives the ability to add a string
as a file.
- New attribute PCLZIP_ATT_FILE_MTIME modify the timestamp associated with
a file.
- Correct a bug. Files archived with a timestamp with 0h0m0s were extracted
with current time
- Add CRC value in the informations returned back for each file after an
action.
- Add missing closedir() statement.
- When adding a folder, and removing the path of this folder, files were
incorrectly added with a '/' at the beginning. Which means files are
related to root in unix systems. Corrected.
- Add conditional if before constant definition. This will allow users
to redefine constants without changing the file, and then improve
upgrade of pclzip code for new versions.
Version 2.5 :
- Introduce the ability to add file/folder with individual properties (file descriptor).
This gives for example the ability to change the filename of a zipped file.
. Able to add files individually
. Able to change full name
. Able to change short name
. Compatible with global options
- New attributes : PCLZIP_ATT_FILE_NAME, PCLZIP_ATT_FILE_NEW_SHORT_NAME, PCLZIP_ATT_FILE_NEW_FULL_NAME
- New error code : PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE
- Add a security control feature. PclZip can extract any file in any folder
of a system. People may use this to upload a zip file and try to override
a system file. The PCLZIP_OPT_EXTRACT_DIR_RESTRICTION will give the
ability to forgive any directory transversal behavior.
- New PCLZIP_OPT_EXTRACT_DIR_RESTRICTION : check extraction path
- New error code : PCLZIP_ERR_DIRECTORY_RESTRICTION
- Modification in PclZipUtilPathInclusion() : dir and path beginning with ./ will be prepend
by current path (getcwd())
Version 2.4 :
- Code improvment : try to speed up the code by removing unusefull call to pack()
- Correct bug in delete() : delete() should be called with no argument. This was not
the case in 2.3. This is corrected in 2.4.
- Correct a bug in path_inclusion function. When the path has several '../../', the
result was bad.
- Add a check for magic_quotes_runtime configuration. If enabled, PclZip will
disable it while working and det it back to its original value.
This resolve a lots of bad formated archive errors.
- Bug correction : PclZip now correctly unzip file in some specific situation,
when compressed content has same size as uncompressed content.
- Bug correction : When selecting option 'PCLZIP_OPT_REMOVE_ALL_PATH',
directories are not any more created.
- Code improvment : correct unclosed opendir(), better handling of . and .. in
loops.
Version 2.3 :
- Correct a bug with PHP5 : affecting the value 0xFE49FFE0 to a variable does not
give the same result in PHP4 and PHP5 ....
Version 2.2 :
- Try development of PCLZIP_OPT_CRYPT .....
However this becomes to a stop. To crypt/decrypt I need to multiply 2 long integers,
the result (greater than a long) is not supported by PHP. Even the use of bcmath
functions does not help. I did not find yet a solution ...;
- Add missing '/' at end of directory entries
- Check is a file is encrypted or not. Returns status 'unsupported_encryption' and/or
error code PCLZIP_ERR_UNSUPPORTED_ENCRYPTION.
- Corrected : Bad "version need to extract" field in local file header
- Add private method privCheckFileHeaders() in order to check local and central
file headers. PclZip is now supporting purpose bit flag bit 3. Purpose bit flag bit 3 gives
the ability to have a local file header without size, compressed size and crc filled.
- Add a generic status 'error' for file status
- Add control of compression type. PclZip only support deflate compression method.
Before v2.2, PclZip does not check the compression method used in an archive while
extracting. With v2.2 PclZip returns a new error status for a file using an unsupported
compression method. New status is "unsupported_compression". New error code is
PCLZIP_ERR_UNSUPPORTED_COMPRESSION.
- Add optional attribute PCLZIP_OPT_STOP_ON_ERROR. This will stop the extract of files
when errors like 'a folder with same name exists' or 'a newer file exists' or
'a write protected file' exists, rather than set a status for the concerning file
and resume the extract of the zip.
- Add optional attribute PCLZIP_OPT_REPLACE_NEWER. This will force, during an extract' the
replacement of the file, even if a newer version of the file exists.
Note that today if a file with the same name already exists but is older it will be
replaced by the extracted one.
- Improve PclZipUtilOption()
- Support of zip archive with trailing bytes. Before 2.2, PclZip checks that the central
directory structure is the last data in the archive. Crypt encryption/decryption of
zip archive put trailing 0 bytes after decryption. PclZip is now supporting this.
Version 2.1 :
- Add the ability to abort the extraction by using a user callback function.
The user can now return the value '2' in its callback which indicates to stop the
extraction. For a pre call-back extract is stopped before the extration of the current
file. For a post call back, the extraction is stopped after.
- Add the ability to extract a file (or several files) directly in the standard output.
This is done by the new parameter PCLZIP_OPT_EXTRACT_IN_OUTPUT with method extract().
- Add support for parameters PCLZIP_OPT_COMMENT, PCLZIP_OPT_ADD_COMMENT,
PCLZIP_OPT_PREPEND_COMMENT. This will create, replace, add, or prepend comments
in the zip archive.
- When merging two archives, the comments are not any more lost, but merged, with a
blank space separator.
- Corrected bug : Files are not deleted when all files are asked to be deleted.
- Corrected bug : Folders with name '0' made PclZip to abort the create or add feature.
Version 2.0 :
***** Warning : Some new features may break the backward compatibility for your scripts.
Please carefully read the readme file.
- Add the ability to delete by Index, name and regular expression. This feature is
performed by the method delete(), which uses the optional parameters
PCLZIP_OPT_BY_INDEX, PCLZIP_OPT_BY_NAME, PCLZIP_OPT_BY_EREG or PCLZIP_OPT_BY_PREG.
- Add the ability to extract by regular expression. To extract by regexp you must use the method
extract(), with the option PCLZIP_OPT_BY_EREG or PCLZIP_OPT_BY_PREG
(depending if you want to use ereg() or preg_match() syntax) followed by the
regular expression pattern.
- Add the ability to extract by index, directly with the extract() method. This is a
code improvment of the extractByIndex() method.
- Add the ability to extract by name. To extract by name you must use the method
extract(), with the option PCLZIP_OPT_BY_NAME followed by the filename to
extract or an array of filenames to extract. To extract all a folder, use the folder
name rather than the filename with a '/' at the end.
- Add the ability to add files without compression. This is done with a new attribute
which is PCLZIP_OPT_NO_COMPRESSION.
- Add the attribute PCLZIP_OPT_EXTRACT_AS_STRING, which allow to extract a file directly
in a string without using any file (or temporary file).
- Add constant PCLZIP_SEPARATOR for static configuration of filename separators in a single string.
The default separator is now a comma (,) and not any more a blank space.
THIS BREAK THE BACKWARD COMPATIBILITY : Please check if this may have an impact with
your script.
- Improve algorythm performance by removing the use of temporary files when adding or
extracting files in an archive.
- Add (correct) detection of empty filename zipping. This can occurs when the removed
path is the same
as a zipped dir. The dir is not zipped (['status'] = filtered), only its content.
- Add better support for windows paths (thanks for help from manus@manusfreedom.com).
- Corrected bug : When the archive file already exists with size=0, the add() method
fails. Corrected in 2.0.
- Remove the use of OS_WINDOWS constant. Use php_uname() function rather.
- Control the order of index ranges in extract by index feature.
- Change the internal management of folders (better handling of internal flag).
Version 1.3 :
- Removing the double include check. This is now done by include_once() and require_once()
PHP directives.
- Changing the error handling mecanism : Remove the use of an external error library.
The former PclError...() functions are replaced by internal equivalent methods.
By changing the environment variable PCLZIP_ERROR_EXTERNAL you can still use the former library.
Introducing the use of constants for error codes rather than integer values. This will help
in futur improvment.
Introduction of error handling functions like errorCode(), errorName() and errorInfo().
- Remove the deprecated use of calling function with arguments passed by reference.
- Add the calling of extract(), extractByIndex(), create() and add() functions
with variable options rather than fixed arguments.
- Add the ability to remove all the file path while extracting or adding,
without any need to specify the path to remove.
This is available for extract(), extractByIndex(), create() and add() functionS by using
the new variable options parameters :
- PCLZIP_OPT_REMOVE_ALL_PATH : by indicating this option while calling the fct.
- Ability to change the mode of a file after the extraction (chmod()).
This is available for extract() and extractByIndex() functionS by using
the new variable options parameters.
- PCLZIP_OPT_SET_CHMOD : by setting the value of this option.
- Ability to definition call-back options. These call-back will be called during the adding,
or the extracting of file (extract(), extractByIndex(), create() and add() functions) :
- PCLZIP_CB_PRE_EXTRACT : will be called before each extraction of a file. The user
can trigerred the change the filename of the extracted file. The user can triggered the
skip of the extraction. This is adding a 'skipped' status in the file list result value.
- PCLZIP_CB_POST_EXTRACT : will be called after each extraction of a file.
Nothing can be triggered from that point.
- PCLZIP_CB_PRE_ADD : will be called before each add of a file. The user
can trigerred the change the stored filename of the added file. The user can triggered the
skip of the add. This is adding a 'skipped' status in the file list result value.
- PCLZIP_CB_POST_ADD : will be called after each add of a file.
Nothing can be triggered from that point.
- Two status are added in the file list returned as function result : skipped & filename_too_long
'skipped' is used when a call-back function ask for skipping the file.
'filename_too_long' is used while adding a file with a too long filename to archive (the file is
not added)
- Adding the function PclZipUtilPathInclusion(), that check the inclusion of a path into
a directory.
- Add a check of the presence of the archive file before some actions (like list, ...)
- Add the initialisation of field "index" in header array. This means that by
default index will be -1 when not explicitly set by the methods.
Version 1.2 :
- Adding a duplicate function.
- Adding a merge function. The merge function is a "quick merge" function,
it just append the content of an archive at the end of the first one. There
is no check for duplicate files or more recent files.
- Improve the search of the central directory end.
Version 1.1.2 :
- Changing the license of PclZip. PclZip is now released under the GNU / LGPL license
(see License section).
- Adding the optional support of a static temporary directory. You will need to configure
the constant PCLZIP_TEMPORARY_DIR if you want to use this feature.
- Improving the rename() function. In some cases rename() does not work (different
Filesystems), so it will be replaced by a copy() + unlink() functions.
Version 1.1.1 :
- Maintenance release, no new feature.
Version 1.1 :
- New method Add() : adding files in the archive
- New method ExtractByIndex() : partial extract of the archive, files are identified by
their index in the archive
- New method DeleteByIndex() : delete some files/folder entries from the archive,
files are identified by their index in the archive.
- Adding a test of the zlib extension presence. If not present abort the script.
Version 1.0.1 :
- No new feature
3 - Corrected bugs
==================
Corrected in Version 2.0 :
- Corrected : During an extraction, if a call-back fucntion is used and try to skip
a file, all the extraction process is stopped.
Corrected in Version 1.3 :
- Corrected : Support of static synopsis for method extract() is broken.
- Corrected : invalid size of archive content field (0xFF) should be (0xFFFF).
- Corrected : When an extract is done with a remove_path parameter, the entry for
the directory with exactly the same path is not skipped/filtered.
- Corrected : extractByIndex() and deleteByIndex() were not managing index in the
right way. For example indexes '1,3-5,11' will only extract files 1 and 11. This
is due to a sort of the index resulting table that puts 11 before 3-5 (sort on
string and not interger). The sort is temporarilly removed, this means that
you must provide a sorted list of index ranges.
Corrected in Version 1.2 :
- Nothing.
Corrected in Version 1.1.2 :
- Corrected : Winzip is unable to delete or add new files in a PclZip created archives.
Corrected in Version 1.1.1 :
- Corrected : When archived file is not compressed (0% compression), the
extract method fails.
Corrected in Version 1.1 :
- Corrected : Adding a complete tree of folder may result in a bad archive
creation.
Corrected in Version 1.0.1 :
- Corrected : Error while compressing files greater than PCLZIP_READ_BLOCK_SIZE (default=1024).
4 - Known bugs or limitations
=============================
Please publish bugs reports in SourceForge :
http://sourceforge.net/tracker/?group_id=40254&atid=427564
In Version 2.x :
- PclZip does only support file uncompressed or compressed with deflate (compression method 8)
- PclZip does not support password protected zip archive
- Some concern were seen when changing mtime of a file while archiving.
Seems to be linked to Daylight Saving Time (PclTest_changing_mtime).
In Version 1.2 :
- merge() methods does not check for duplicate files or last date of modifications.
In Version 1.1 :
- Limitation : Using 'extract' fields in the file header in the zip archive is not supported.
- WinZip is unable to delete a single file in a PclZip created archive. It is also unable to
add a file in a PclZip created archive. (Corrected in v.1.2)
In Version 1.0.1 :
- Adding a complete tree of folder may result in a bad archive
creation. (Corrected in V.1.1).
- Path given to methods must be in the unix format (/) and not the Windows format (\).
Workaround : Use only / directory separators.
- PclZip is using temporary files that are sometime the name of the file with a .tmp or .gz
added suffix. Files with these names may already exist and may be overwritten.
Workaround : none.
- PclZip does not check if the zlib extension is present. If it is absent, the zip
file is not created and the lib abort without warning.
Workaround : enable the zlib extension on the php install
In Version 1.0 :
- Error while compressing files greater than PCLZIP_READ_BLOCK_SIZE (default=1024).
(Corrected in v.1.0.1)
- Limitation : Multi-disk zip archive are not supported.
5 - License
===========
Since version 1.1.2, PclZip Library is released under GNU/LGPL license.
This library is free, so you can use it at no cost.
HOWEVER, if you release a script, an application, a library or any kind of
code using PclZip library (or a part of it), YOU MUST :
- Indicate in the documentation (or a readme file), that your work
uses PclZip Library, and make a reference to the author and the web site
http://www.phpconcept.net
- Gives the ability to the final user to update the PclZip libary.
I will also appreciate that you send me a mail (vincent@phpconcept.net), just to
be aware that someone is using PclZip.
For more information about GNU/LGPL license : http://www.gnu.org
6 - Warning
=================
This library and the associated files are non commercial, non professional work.
It should not have unexpected results. However if any damage is caused by this software
the author can not be responsible.
The use of this software is at the risk of the user.
7 - Documentation
=================
PclZip User Manuel is available in English on PhpConcept : http://www.phpconcept.net/pclzip/man/en/index.php
A Russian translation was done by Feskov Kuzma : http://php.russofile.ru/ru/authors/unsort/zip/
8 - Author
==========
This software was written by Vincent Blavet (vincent@phpconcept.net) on its leasure time.
9 - Contribute
==============
If you want to contribute to the development of PclZip, please contact vincent@phpconcept.net.
If you can help in financing PhpConcept hosting service, please go to
http://www.phpconcept.net/soutien.php

View File

@@ -1585,7 +1585,7 @@ class CASClient
}
// create the storage object
$this->_pgt_storage = &new PGTStorageFile($this,$format,$path);
$this->_pgt_storage = new PGTStorageFile($this,$format,$path);
}
/**
@@ -1622,7 +1622,7 @@ class CASClient
trigger_error('PGT storage into database is an experimental feature, use at your own risk',E_USER_WARNING);
// create the storage object
$this->_pgt_storage = & new PGTStorageDB($this,$user,$password,$database_type,$hostname,$port,$database,$table);
$this->_pgt_storage = new PGTStorageDB($this,$user,$password,$database_type,$hostname,$port,$database,$table);
}
// ########################################################################

View File

@@ -2,7 +2,7 @@
/**
* @file languages/spanish.php
* @author Iván-Benjamín García Torà <ivaniclixx AT gmail DOT com>
* @author Iván-Benjamín García Torà <ivaniclixx AT gmail DOT com
* @sa @link internalLang Internationalization @endlink
* @ingroup internalLang
*/

View File

@@ -11,15 +11,15 @@ $this->_strings = array(
CAS_STR_USING_SERVER
=> 'utilisant le serveur',
CAS_STR_AUTHENTICATION_WANTED
=> 'Authentication CAS nécessaire&nbsp;!',
=> 'Authentication CAS n<EFBFBD>cessaire&nbsp;!',
CAS_STR_LOGOUT
=> 'Déconnexion demandée&nbsp;!',
=> 'D<EFBFBD>connexion demand<EFBFBD>e&nbsp;!',
CAS_STR_SHOULD_HAVE_BEEN_REDIRECTED
=> 'Vous auriez du etre redirigé(e) vers le serveur CAS. Cliquez <a href="%s">ici</a> pour continuer.',
=> 'Vous auriez du etre redirig<EFBFBD>(e) vers le serveur CAS. Cliquez <a href="%s">ici</a> pour continuer.',
CAS_STR_AUTHENTICATION_FAILED
=> 'Authentification CAS infructueuse&nbsp;!',
CAS_STR_YOU_WERE_NOT_AUTHENTICATED
=> '<p>Vous n\'avez pas été authentifié(e).</p><p>Vous pouvez soumettre votre requete à nouveau en cliquant <a href="%s">ici</a>.</p><p>Si le problème persiste, vous pouvez contacter <a href="mailto:%s">l\'administrateur de ce site</a>.</p>',
=> '<p>Vous n\'avez pas <EFBFBD>t<EFBFBD> authentifi<EFBFBD>(e).</p><p>Vous pouvez soumettre votre requete <EFBFBD> nouveau en cliquant <a href="%s">ici</a>.</p><p>Si le probl<EFBFBD>me persiste, vous pouvez contacter <a href="mailto:%s">l\'administrateur de ce site</a>.</p>',
CAS_STR_SERVICE_UNAVAILABLE
=> 'Le service `<b>%s</b>\' est indisponible (<b>%s</b>)'

View File

@@ -9,19 +9,19 @@
$this->_strings = array(
CAS_STR_USING_SERVER
=> '÷ñçóéìïðïéåßôáé ï åîõðçñåôçôÞò',
=> '<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',
CAS_STR_AUTHENTICATION_WANTED
=> 'Áðáéôåßôáé ç ôáõôïðïßçóç CAS!',
=> '<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> CAS!',
CAS_STR_LOGOUT
=> 'Áðáéôåßôáé ç áðïóýíäåóç áðü CAS!',
=> '<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> CAS!',
CAS_STR_SHOULD_HAVE_BEEN_REDIRECTED
=> 'Èá Ýðñåðå íá åß÷áôå áíáêáôåõèõíèåß óôïí åîõðçñåôçôÞ CAS. ÊÜíôå êëßê <a href="%s">åäþ</a> ãéá íá óõíå÷ßóåôå.',
=> '<EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> CAS. <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <a href="%s"><EFBFBD><EFBFBD><EFBFBD></a> <EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.',
CAS_STR_AUTHENTICATION_FAILED
=> 'Ç ôáõôïðïßçóç CAS áðÝôõ÷å!',
=> '<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> CAS <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!',
CAS_STR_YOU_WERE_NOT_AUTHENTICATED
=> '<p>Äåí ôáõôïðïéçèÞêáôå.</p><p>Ìðïñåßôå íá îáíáðñïóðáèÞóåôå, êÜíïíôáò êëßê <a href="%s">åäþ</a>.</p><p>Åáí ôï ðñüâëçìá åðéìåßíåé, åëÜôå óå åðáöÞ ìå ôïí <a href="mailto:%s">äéá÷åéñéóôÞ</a>.</p>',
=> '<p><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.</p><p><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <a href="%s"><EFBFBD><EFBFBD><EFBFBD></a>.</p><p><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD> <a href="mailto:%s"><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD></a>.</p>',
CAS_STR_SERVICE_UNAVAILABLE
=> 'Ç õðçñåóßá `<b>%s</b>\' äåí åßíáé äéáèÝóéìç (<b>%s</b>).'
=> '<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> `<b>%s</b>\' <EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (<b>%s</b>).'
);
?>

View File

@@ -11,17 +11,17 @@ $this->_strings = array(
CAS_STR_USING_SERVER
=> 'using server',
CAS_STR_AUTHENTICATION_WANTED
=> 'CASによる認証を行います',
=> 'CAS<EFBFBD>ˤ<EFBFBD><EFBFBD>ǧ<EFBFBD>ڤ<EFBFBD>Ԥ<EFBFBD><EFBFBD>ޤ<EFBFBD>',
CAS_STR_LOGOUT
=> 'CASからログアウトします!',
=> 'CAS<EFBFBD><EFBFBD><EFBFBD><EFBFBD>?<3F><><EFBFBD><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4>ޤ<EFBFBD>!',
CAS_STR_SHOULD_HAVE_BEEN_REDIRECTED
=> 'CASサーバに行く必要があります。自動的に転送されない場合は <a href="%s">こちら</a> をクリックして続行します。',
=> 'CAS<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ф˹Ԥ<EFBFBD>ɬ<EFBFBD>פ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ưŪ<EFBFBD><EFBFBD>ž<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʤ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <a href="%s"><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD></a> <20>򥯥<EFBFBD>å<EFBFBD><C3A5><EFBFBD><EFBFBD><EFBFBD>³<EFBFBD>Ԥ<EFBFBD><D4A4>ޤ<EFBFBD><DEA4><EFBFBD>',
CAS_STR_AUTHENTICATION_FAILED
=> 'CASによる認証に失敗しました',
=> 'CAS<EFBFBD>ˤ<EFBFBD><EFBFBD>ǧ<EFBFBD>ڤ˼<EFBFBD><EFBFBD>Ԥ<EFBFBD><EFBFBD>ޤ<EFBFBD><EFBFBD><EFBFBD>',
CAS_STR_YOU_WERE_NOT_AUTHENTICATED
=> '<p>認証できませんでした.</p><p>もう一度リクエストを送信する場合は<a href="%s">こちら</a>をクリック.</p><p>問題が解決しない場合は <a href="mailto:%s">このサイトの管理者</a>に問い合わせてください.</p>',
=> '<p>ǧ<EFBFBD>ڤǤ<EFBFBD><EFBFBD>ޤ<EFBFBD><EFBFBD><EFBFBD>Ǥ<EFBFBD><EFBFBD><EFBFBD>.</p><p><3E><EFBFBD><E2A4A6><EFBFBD>٥<D9A5><EAA5AF><EFBFBD><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><a href="%s"><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD></a><3E>򥯥<EFBFBD>å<EFBFBD>.</p><p><3E><><EFBFBD><EFBFBD><EAA4AC><EFBFBD>ʤ<EFBFBD><CAA4><EFBFBD><EFBFBD><EFBFBD> <a href="mailto:%s"><3E><><EFBFBD>Υ<EFBFBD><CEA5><EFBFBD><EFBFBD>Ȥδ<C8A4><CEB4><EFBFBD><EFBFBD></a><3E><><EFBFBD><EFBFBD><E4A4A4><EFBFBD>Ƥ<EFBFBD><C6A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.</p>',
CAS_STR_SERVICE_UNAVAILABLE
=> 'サービス `<b>%s</b>\' は利用できません (<b>%s</b>).'
=> '<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӥ<EFBFBD> `<b>%s</b>\' <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѤǤ<EFBFBD><EFBFBD>ޤ<EFBFBD><EFBFBD><EFBFBD> (<b>%s</b>).'
);
?>

View File

@@ -2,7 +2,7 @@
/**
* @file languages/spanish.php
* @author Iván-Benjamín García Torà <ivaniclixx AT gmail DOT com>
* @author Iván-Benjamín García Torà <ivaniclixx AT gmail DOT com
* @sa @link internalLang Internationalization @endlink
* @ingroup internalLang
*/

View File

@@ -33,7 +33,7 @@ class PHPZip
{
foreach($filelist as $filename)
{
if (is_file($filename))
if (is_file($filename) && basename($filename)!='.htaccess')
{
$fd = fopen ($filename, "r");
$content = @fread ($fd, filesize ($filename));

View File

@@ -173,6 +173,7 @@ class queXMLPDF extends TCPDF {
protected $style = "<style>
td.questionTitle {font-weight:bold; font-size:12pt;}
td.questionText {font-weight:bold; font-size:12pt;}
td.vasLabel {font-weright:bold; font-size:10pt; text-align:center;}
td.questionHelp {font-weight:normal; text-align:right; font-style:italic; font-size:8pt;}
td.questionHelpAfter {text-align:center; font-weight:bold; font-size:10pt;}
td.responseAboveText {font-weight:normal; font-style:normal; text-align:left; font-size:12pt;}
@@ -1021,21 +1022,17 @@ class queXMLPDF extends TCPDF {
$stmp = array();
$sl = $this->numberToLetter($scount);
$stmp['title'] = "Section " . $sl;
$stmp['info'] = "";
$stmp['text'] = "";
foreach ($s->sectionInfo as $sitmp)
{
if ($sitmp->position == 'title')
{
if (!isset($stmp['text']))
$stmp['text'] = "";
$stmp['text'] .= $sitmp->text;
}
if ($sitmp->position == 'before' || $sitmp->position == 'during')
{
if (!isset($stmp['info']))
$stmp['info'] = "";
$stmp['info'] .= $sitmp->text . "<br/>";
}
}
@@ -1047,12 +1044,10 @@ class queXMLPDF extends TCPDF {
$rstmp = array();
$qtmp['title'] = $sl . $qcount . ".";
$qtmp['text'] = "";
foreach ($qu->text as $ttmp)
{
if (!isset($qtmp['text']))
$qtmp['text'] = "";
//Add a new line if we aren't at the end
if ($ttmp != end($qu->text)){ $qtmp['text'] .= "<br/>"; }
@@ -1080,11 +1075,9 @@ class queXMLPDF extends TCPDF {
foreach ($qu->subQuestion as $sq)
{
$sqtmp = array();
$sqtmp['text'] = "";
foreach ($sq->text as $ttmp)
{
if (!isset($sqtmp['text']))
$sqtmp['text'] = "";
$sqtmp['text'] .= $ttmp;
}
$sqtmp['varname'] = $sq['varName'];
@@ -1136,8 +1129,9 @@ class queXMLPDF extends TCPDF {
else if (isset($r->vas))
{
$rtmp['type'] = 'vas';
$rtmp['width'] = current($r->vas->length);
$rtmp['text'] = current($r->vas->label);
$rtmp['width'] = 100;
$rtmp['labelleft'] = current($r->vas->labelleft);
$rtmp['labelright'] = current($r->vas->labelright);
}
$rstmp['response'] = $rtmp;
$qtmp['responses'][] = $rstmp;
@@ -1299,7 +1293,7 @@ class queXMLPDF extends TCPDF {
$this->drawMatrixTextVertical($subquestions,$response['width'],$text,$bgtype);
break;
case 'vas':
$this->drawMatrixVas($subquestions,$text);
$this->drawMatrixVas($subquestions,$text,$response['labelleft'],$response['labelright']);
break;
}
@@ -1340,7 +1334,7 @@ class queXMLPDF extends TCPDF {
break;
case 'vas':
$this->addBoxGroup(1,$varname,$rtext,strlen($this->vasIncrements));
$this->drawVas($response['text']);
$this->drawVas("",$response['labelleft'],$response['labelright']);
break;
}
@@ -1403,16 +1397,19 @@ class queXMLPDF extends TCPDF {
*
* @param array $subquestions The subquestions containing text and varname
* @param string|bool $parenttext The question text of the parent or false if not specified
* @param string $labelleft The left hand side label
* @param string $labelright The right hand side label
*
* @author Adam Zammit <adam.zammit@acspri.org.au>
* @since 2010-09-20
*/
protected function drawMatrixVas($subquestions,$parenttext = false)
protected function drawMatrixVas($subquestions,$parenttext = false,$labelleft,$labelright)
{
$c = count($subquestions);
$width = strlen($this->vasIncrements);
$heading = true;
for ($i = 0; $i < $c; $i++)
{
$s = $subquestions[$i];
@@ -1425,7 +1422,7 @@ class queXMLPDF extends TCPDF {
$this->drawVas($s['text']);
$this->drawVas($s['text'],$labelleft,$labelright,$heading);
$currentY = $this->GetY();
@@ -1433,6 +1430,8 @@ class queXMLPDF extends TCPDF {
$this->Rect($this->getMainPageX(),$this->GetY(),$this->getMainPageWidth(),$this->subQuestionLineSpacing,'F',array(),$this->backgroundColourQuestion);
$this->SetY($currentY + $this->subQuestionLineSpacing,false);
$heading = false;
}
}
@@ -1459,7 +1458,7 @@ class queXMLPDF extends TCPDF {
//Align to skip column on right
$this->SetX(($this->getPageWidth() - $this->getMainPageX() - $this->skipColumnWidth - $this->longTextResponseWidth),false);
//Add to pay layout
$this->addBox($this->GetX(),$this->GetY(),$this->GetX() + $this->longTextResponseWidth, $this->GetX() + $height);
$this->addBox($this->GetX(),$this->GetY(),$this->GetX() + $this->longTextResponseWidth, $this->GetY() + $height);
$this->SetDrawColor($this->lineColour[0],$this->lineColour[1],$this->lineColour[2]);
$this->Cell($this->longTextResponseWidth,$height,'',$border,0,'',true,'',0,false,'T','C');
$currentY = $currentY + $height;
@@ -1470,22 +1469,40 @@ class queXMLPDF extends TCPDF {
/**
* Draw a VAS
*
* @param mixed $text The label for the VAS if any
* @param string $text The text of this item
* @param string $labelleft The left hand side label
* @param string $labelright The right hand side label
* @param bool $heading Whether to draw a heading or not
*
* @author Adam Zammit <adam.zammit@acspri.org.au>
* @since 2010-09-20
*/
protected function drawVas($text)
protected function drawVas($text, $labelleft,$labelright,$heading = true)
{
$textwidth = $this->getMainPageWidth() - $this->skipColumnWidth - ($this->vasLength + ($this->vasLineWidth * 2.0)) - 2;
$this->setBackground('question');
if ($heading)
{
//draw heading
$lwidth = 20;
$slwidth = $textwidth - ($lwidth / 2);
$gapwidth = ($this->vasLength + ($this->vasLineWidth * 2.0)) - $lwidth;
$html = "<table><tr><td width=\"{$slwidth}mm\"></td><td width=\"{$lwidth}mm\" class=\"vasLabel\">$labelleft</td><td width=\"{$gapwidth}mm\"></td><td width=\"{$lwidth}mm\" class=\"vasLabel\">$labelright</td></tr></table>";
$this->writeHTMLCell($this->getMainPageWidth(), 0, $this->getMainPageX(), $this->GetY(), $this->style . $html,0,1,true,false);
}
$currentY = $this->GetY();
$textwidth = $this->getMainPageWidth() - $this->skipColumnWidth - ($this->vasLength + ($this->vasLineWidth * 2.0)) - 2;
$html = "<table><tr><td width=\"{$textwidth}mm\" class=\"responseText\">$text</td><td></td></tr></table>";
$textwidth += 2;
$this->setBackground('question');
$this->writeHTMLCell($this->getMainPageWidth(), $this->vasAreaHeight, $this->getMainPageX(), $this->GetY(), $this->style . $html,0,1,true,false);
@@ -1979,7 +1996,7 @@ class queXMLPDF extends TCPDF {
$html = "<span class=\"sectionTitle\">$title:</span>&nbsp;<span class=\"sectionDescription\">$desc</span>";
if ($info)
if ($info && !empty($info))
$html .= "<div class=\"sectionInfo\">$info</div>";
$this->setBackground('section');

View File

@@ -1,3 +1,57 @@
5.9.011 (2010-11-02)
- Bug item #3101486 "Bug Fix for image loading" was fixed.
5.9.010 (2010-10-27)
- Support for CSS properties 'border-spacing' and 'padding' for tables were added.
- Several language files were added.
5.9.009 (2010-10-21)
- HTML text alignment was improved to include the case of RTL text on LTR direction and LTR text on RTL direction.
5.9.008 (2010-10-21)
- Bug item #3091502 "Bookmark oddity" was fixed.
- HTML internal links now accepts page number and Y position.
- The method write1DBarcode() was improved to accept separate horizontal and vertical padding (see example n. 27).
5.9.007 (2010-10-20)
- Method adjustCellPadding() was fixed to handle bad input.
5.9.006 (2010-10-19)
- Support for AES 256 bit encryption was added (see example n. 16).
- Method getNumLines() was fixed for the empty string case.
5.9.005 (2010-10-18)
- Method addPageRegion() was changed to accept regions starting exactly from the top of the page.
5.9.004 (2010-10-18)
- A bug related to annotations was fixed.
- The file unicode_data.php was canged to encapsulate all data in a class.
- The file htmlcolors.php was changed to remove the global variable.
5.9.003 (2010-10-15)
- Support for no-write page regions was added. Check the example n. 64 and new methods setPageRegions(), addPageRegion(), getPageRegions(), removePageRegion().
- A bug on Right-To-Left alignment was fixed.
5.9.002 (2010-10-08)
- Cell method was improved to preserve the font stretching and spacing values when using the $stretch parameter (see example n. 4).
5.9.001 (2010-10-07)
- The problem of blank page for nobr table higher than a single page was fixed.
5.9.000 (2010-10-06)
- Support for text stretching and spacing (kerning) was added, see example n. 63 and methods setFontStretching(), getFontStretching(), setFontSpacing(), getFontSpacing().
- Support for CSS properties 'font-stretch' and 'letter-spacing' was added (see example n. 63).
- The cMargin state was replaced by cell_padding array that can be set/get using setCellPadding() and getCellPadding() methods.
- Methods getCellPaddings() and setCellPaddings() were added to fine tune cell paddings (see example n. 5).
- Methods getCellMargins() and setCellMargins() were added to fine tune cell margins (see example n. 5).
- Method write1DBarcode() was improved to permit custom labels (see example n. 27).
- Method ImagePngAlpha() now includes support for ImageMagick to improve performances.
- XObject Template support was extended to support Multicell(), writeHTML() and writeHTMLCell() methods.
- The signature of getNumLines() and getStringHeight() methods is changed.
- Example n. 57 was updated.
// -------------------------------------------------------------------
5.8.034 (2010-09-27)
- A bug related to SetFont on XObject templates was fixed.

View File

@@ -8,8 +8,8 @@ http://sourceforge.net/donate/index.php?group_id=128076
------------------------------------------------------------
Name: TCPDF
Version: 5.8.034
Release date: 2010-09-27
Version: 5.9.011
Release date: 2010-11-02
Author: Nicola Asuni
Copyright (c) 2002-2010:
@@ -39,20 +39,21 @@ Main Features:
* 1D and 2D barcodes: CODE 39, ANSI MH10.8M-1983, USD-3, 3 of 9, CODE 93, USS-93, Standard 2 of 5, Interleaved 2 of 5, CODE 128 A/B/C, 2 and 5 Digits UPC-Based Extention, EAN 8, EAN 13, UPC-A, UPC-E, MSI, POSTNET, PLANET, RMS4CC (Royal Mail 4-state Customer Code), CBC (Customer Bar Code), KIX (Klant index - Customer index), Intelligent Mail Barcode, Onecode, USPS-B-3200, CODABAR, CODE 11, PHARMACODE, PHARMACODE TWO-TRACKS, QR-Code, PDF417;
* Grayscale, RGB, CMYK, Spot Colors and Transparencies;
* automatic page header and footer management;
* document encryption and digital signature certifications;
* document encryption up to 256 bit and digital signature certifications;
* transactions to UNDO commands;
* PDF annotations, including links, text and file attachments;
* text rendering modes (fill, stroke and clipping);
* multiple columns mode;
* no-write page regions;
* bookmarks and table of content;
* text hyphenation;
* text stretching and spacing (tracking/kerning);
* automatic page break, line break and text alignments including justification;
* automatic page numbering and page groups;
* move and delete pages;
* page compression (requires php-zlib extension);
* XOBject Templates;
Installation (full instructions on http: www.tcpdf.org):
1. copy the folder on your Web server
2. set your installation path and other parameters on the config/tcpdf_config.php

View File

@@ -94,9 +94,11 @@ Hebrew (iw)
Polish (pl)
-----------
Pchnąć w tę łódź jeża lub ośm skrzyń fig
Pchnąć w tę łódź jeża lub osiem skrzyń fig
(= To push a hedgehog or eight bins of figs in this boat)
Zażółć gęślą jaźń
Russian (ru)
------------

View File

@@ -0,0 +1,50 @@
<?php
//============================================================+
// File name : afr.php
// Begin : 2010-10-26
// Last Update : 2010-10-26
//
// Description : Language module for TCPDF
// (contains translated texts)
// Afrikaans
//
// Author: Nicola Asuni
//
// (c) Copyright:
// Nicola Asuni
// Tecnick.com s.r.l.
// Via Della Pace, 11
// 09044 Quartucciu (CA)
// ITALY
// www.tecnick.com
// info@tecnick.com
//============================================================+
/**
* TCPDF language file (contains translated texts).
* @package com.tecnick.tcpdf
* @abstract TCPDF language file: Afrikaans
* @author Nicola Asuni
* @copyright 2004-2010 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com
* @link http://tcpdf.sourceforge.net
* @license http://www.gnu.org/copyleft/lesser.html LGPL
* @since 2010-10-26
*/
// Afrikaans
global $l;
$l = Array();
// PAGE META DESCRIPTORS --------------------------------------
$l['a_meta_charset'] = 'UTF-8';
$l['a_meta_dir'] = 'ltr';
$l['a_meta_language'] = 'af';
// TRANSLATIONS --------------------------------------
$l['w_page'] = 'bladsy';
//============================================================+
// END OF FILE
//============================================================+

View File

@@ -0,0 +1,50 @@
<?php
//============================================================+
// File name : ara.php
// Begin : 2010-10-26
// Last Update : 2010-10-26
//
// Description : Language module for TCPDF
// (contains translated texts)
// Arabic
//
// Author: Nicola Asuni
//
// (c) Copyright:
// Nicola Asuni
// Tecnick.com s.r.l.
// Via Della Pace, 11
// 09044 Quartucciu (CA)
// ITALY
// www.tecnick.com
// info@tecnick.com
//============================================================+
/**
* TCPDF language file (contains translated texts).
* @package com.tecnick.tcpdf
* @abstract TCPDF language file: Arabic
* @author Nicola Asuni
* @copyright 2004-2010 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com
* @link http://tcpdf.sourceforge.net
* @license http://www.gnu.org/copyleft/lesser.html LGPL
* @since 2010-10-26
*/
// Arabic
global $l;
$l = Array();
// PAGE META DESCRIPTORS --------------------------------------
$l['a_meta_charset'] = 'UTF-8';
$l['a_meta_dir'] = 'rtl';
$l['a_meta_language'] = 'ar';
// TRANSLATIONS --------------------------------------
$l['w_page'] = 'صفحة';
//============================================================+
// END OF FILE
//============================================================+

View File

@@ -0,0 +1,50 @@
<?php
//============================================================+
// File name : aze.php
// Begin : 2010-10-26
// Last Update : 2010-10-26
//
// Description : Language module for TCPDF
// (contains translated texts)
// Azerbaijani
//
// Author: Nicola Asuni
//
// (c) Copyright:
// Nicola Asuni
// Tecnick.com s.r.l.
// Via Della Pace, 11
// 09044 Quartucciu (CA)
// ITALY
// www.tecnick.com
// info@tecnick.com
//============================================================+
/**
* TCPDF language file (contains translated texts).
* @package com.tecnick.tcpdf
* @abstract TCPDF language file: Azerbaijani
* @author Nicola Asuni
* @copyright 2004-2010 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com
* @link http://tcpdf.sourceforge.net
* @license http://www.gnu.org/copyleft/lesser.html LGPL
* @since 2010-10-26
*/
// Azerbaijani
global $l;
$l = Array();
// PAGE META DESCRIPTORS --------------------------------------
$l['a_meta_charset'] = 'UTF-8';
$l['a_meta_dir'] = 'ltr';
$l['a_meta_language'] = 'az';
// TRANSLATIONS --------------------------------------
$l['w_page'] = 'səhifə';
//============================================================+
// END OF FILE
//============================================================+

View File

@@ -0,0 +1,50 @@
<?php
//============================================================+
// File name : bel.php
// Begin : 2010-10-26
// Last Update : 2010-10-26
//
// Description : Language module for TCPDF
// (contains translated texts)
// Basque
//
// Author: Nicola Asuni
//
// (c) Copyright:
// Nicola Asuni
// Tecnick.com s.r.l.
// Via Della Pace, 11
// 09044 Quartucciu (CA)
// ITALY
// www.tecnick.com
// info@tecnick.com
//============================================================+
/**
* TCPDF language file (contains translated texts).
* @package com.tecnick.tcpdf
* @abstract TCPDF language file: Basque
* @author Nicola Asuni
* @copyright 2004-2010 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com
* @link http://tcpdf.sourceforge.net
* @license http://www.gnu.org/copyleft/lesser.html LGPL
* @since 2010-10-26
*/
// Basque
global $l;
$l = Array();
// PAGE META DESCRIPTORS --------------------------------------
$l['a_meta_charset'] = 'UTF-8';
$l['a_meta_dir'] = 'ltr';
$l['a_meta_language'] = 'be';
// TRANSLATIONS --------------------------------------
$l['w_page'] = 'старонкі';
//============================================================+
// END OF FILE
//============================================================+

View File

@@ -2,10 +2,11 @@
//============================================================+
// File name : eng.php
// Begin : 2004-03-03
// Last Update : 2010-08-08
// Last Update : 2010-10-26
//
// Description : Language module for TCPDF
// (contains translated texts)
// Brazilian
//
// Author: Nicola Asuni
//
@@ -22,15 +23,15 @@
/**
* TCPDF language file (contains translated texts).
* @package com.tecnick.tcpdf
* @abstract TCPDF language file.
* @abstract TCPDF language file: Brazilian
* @author Nicola Asuni
* @copyright 2004-2009 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com
* @copyright 2004-2010 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com
* @link http://tcpdf.sourceforge.net
* @license http://www.gnu.org/copyleft/lesser.html LGPL
* @since 2004-03-03
*/
// ENGLISH
// Brazilian
global $l;
$l = Array();

View File

@@ -0,0 +1,50 @@
<?php
//============================================================+
// File name : cat.php
// Begin : 2010-10-26
// Last Update : 2010-10-26
//
// Description : Language module for TCPDF
// (contains translated texts)
// Catalan
//
// Author: Nicola Asuni
//
// (c) Copyright:
// Nicola Asuni
// Tecnick.com s.r.l.
// Via Della Pace, 11
// 09044 Quartucciu (CA)
// ITALY
// www.tecnick.com
// info@tecnick.com
//============================================================+
/**
* TCPDF language file (contains translated texts).
* @package com.tecnick.tcpdf
* @abstract TCPDF language file: Catalan
* @author Nicola Asuni
* @copyright 2004-2010 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com
* @link http://tcpdf.sourceforge.net
* @license http://www.gnu.org/copyleft/lesser.html LGPL
* @since 2010-10-26
*/
// Catalan
global $l;
$l = Array();
// PAGE META DESCRIPTORS --------------------------------------
$l['a_meta_charset'] = 'UTF-8';
$l['a_meta_dir'] = 'ltr';
$l['a_meta_language'] = 'ca';
// TRANSLATIONS --------------------------------------
$l['w_page'] = 'pàgina';
//============================================================+
// END OF FILE
//============================================================+

View File

@@ -0,0 +1,50 @@
<?php
//============================================================+
// File name : ces.php
// Begin : 2010-10-26
// Last Update : 2010-10-26
//
// Description : Language module for TCPDF
// (contains translated texts)
// Czech
//
// Author: Nicola Asuni
//
// (c) Copyright:
// Nicola Asuni
// Tecnick.com s.r.l.
// Via Della Pace, 11
// 09044 Quartucciu (CA)
// ITALY
// www.tecnick.com
// info@tecnick.com
//============================================================+
/**
* TCPDF language file (contains translated texts).
* @package com.tecnick.tcpdf
* @abstract TCPDF language file: Czech
* @author Nicola Asuni
* @copyright 2004-2010 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com
* @link http://tcpdf.sourceforge.net
* @license http://www.gnu.org/copyleft/lesser.html LGPL
* @since 2010-10-26
*/
// Czech
global $l;
$l = Array();
// PAGE META DESCRIPTORS --------------------------------------
$l['a_meta_charset'] = 'UTF-8';
$l['a_meta_dir'] = 'ltr';
$l['a_meta_language'] = 'cs';
// TRANSLATIONS --------------------------------------
$l['w_page'] = 'stránky';
//============================================================+
// END OF FILE
//============================================================+

View File

@@ -0,0 +1,50 @@
<?php
//============================================================+
// File name : chi.php
// Begin : 2010-10-26
// Last Update : 2010-10-26
//
// Description : Language module for TCPDF
// (contains translated texts)
// Chinese (Simplified)
//
// Author: Nicola Asuni
//
// (c) Copyright:
// Nicola Asuni
// Tecnick.com s.r.l.
// Via Della Pace, 11
// 09044 Quartucciu (CA)
// ITALY
// www.tecnick.com
// info@tecnick.com
//============================================================+
/**
* TCPDF language file (contains translated texts).
* @package com.tecnick.tcpdf
* @abstract TCPDF language file: Chinese (Simplified)
* @author Nicola Asuni
* @copyright 2004-2010 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com
* @link http://tcpdf.sourceforge.net
* @license http://www.gnu.org/copyleft/lesser.html LGPL
* @since 2010-10-26
*/
// Chinese (Simplified)
global $l;
$l = Array();
// PAGE META DESCRIPTORS --------------------------------------
$l['a_meta_charset'] = 'UTF-8';
$l['a_meta_dir'] = 'ltr';
$l['a_meta_language'] = 'cn';
// TRANSLATIONS --------------------------------------
$l['w_page'] = '页面';
//============================================================+
// END OF FILE
//============================================================+

View File

@@ -0,0 +1,50 @@
<?php
//============================================================+
// File name : urd.php
// Begin : 2004-03-03
// Last Update : 2010-10-26
//
// Description : Language module for TCPDF
// (contains translated texts)
// Welsh
//
// Author: Nicola Asuni
//
// (c) Copyright:
// Nicola Asuni
// Tecnick.com s.r.l.
// Via Della Pace, 11
// 09044 Quartucciu (CA)
// ITALY
// www.tecnick.com
// info@tecnick.com
//============================================================+
/**
* TCPDF language file (contains translated texts).
* @package com.tecnick.tcpdf
* @abstract TCPDF language file: Welsh
* @author Nicola Asuni
* @copyright 2004-2010 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com
* @link http://tcpdf.sourceforge.net
* @license http://www.gnu.org/copyleft/lesser.html LGPL
* @since 2004-03-03
*/
// Welsh
global $l;
$l = Array();
// PAGE META DESCRIPTORS --------------------------------------
$l['a_meta_charset'] = 'UTF-8';
$l['a_meta_dir'] = 'ltr';
$l['a_meta_language'] = 'cy';
// TRANSLATIONS --------------------------------------
$l['w_page'] = 'tudalen';
//============================================================+
// END OF FILE
//============================================================+

View File

@@ -0,0 +1,50 @@
<?php
//============================================================+
// File name : dan.php
// Begin : 2010-10-26
// Last Update : 2010-10-26
//
// Description : Language module for TCPDF
// (contains translated texts)
// Danish
//
// Author: Nicola Asuni
//
// (c) Copyright:
// Nicola Asuni
// Tecnick.com s.r.l.
// Via Della Pace, 11
// 09044 Quartucciu (CA)
// ITALY
// www.tecnick.com
// info@tecnick.com
//============================================================+
/**
* TCPDF language file (contains translated texts).
* @package com.tecnick.tcpdf
* @abstract TCPDF language file: Danish
* @author Nicola Asuni
* @copyright 2004-2010 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com
* @link http://tcpdf.sourceforge.net
* @license http://www.gnu.org/copyleft/lesser.html LGPL
* @since 2010-10-26
*/
// Danish
global $l;
$l = Array();
// PAGE META DESCRIPTORS --------------------------------------
$l['a_meta_charset'] = 'UTF-8';
$l['a_meta_dir'] = 'ltr';
$l['a_meta_language'] = 'da';
// TRANSLATIONS --------------------------------------
$l['w_page'] = 'side';
//============================================================+
// END OF FILE
//============================================================+

View File

@@ -2,10 +2,11 @@
//============================================================+
// File name : eng.php
// Begin : 2004-03-03
// Last Update : 2010-08-08
// Last Update : 2010-10-26
//
// Description : Language module for TCPDF
// (contains translated texts)
// English
//
// Author: Nicola Asuni
//
@@ -22,15 +23,15 @@
/**
* TCPDF language file (contains translated texts).
* @package com.tecnick.tcpdf
* @abstract TCPDF language file.
* @abstract TCPDF language file: English
* @author Nicola Asuni
* @copyright 2004-2009 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com
* @copyright 2004-2010 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com
* @link http://tcpdf.sourceforge.net
* @license http://www.gnu.org/copyleft/lesser.html LGPL
* @since 2004-03-03
*/
// ENGLISH
// English
global $l;
$l = Array();

View File

@@ -0,0 +1,50 @@
<?php
//============================================================+
// File name : est.php
// Begin : 2010-10-26
// Last Update : 2010-10-26
//
// Description : Language module for TCPDF
// (contains translated texts)
// Estonian
//
// Author: Nicola Asuni
//
// (c) Copyright:
// Nicola Asuni
// Tecnick.com s.r.l.
// Via Della Pace, 11
// 09044 Quartucciu (CA)
// ITALY
// www.tecnick.com
// info@tecnick.com
//============================================================+
/**
* TCPDF language file (contains translated texts).
* @package com.tecnick.tcpdf
* @abstract TCPDF language file: Estonian
* @author Nicola Asuni
* @copyright 2004-2010 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com
* @link http://tcpdf.sourceforge.net
* @license http://www.gnu.org/copyleft/lesser.html LGPL
* @since 2010-10-26
*/
// Estonian
global $l;
$l = Array();
// PAGE META DESCRIPTORS --------------------------------------
$l['a_meta_charset'] = 'UTF-8';
$l['a_meta_dir'] = 'ltr';
$l['a_meta_language'] = 'et';
// TRANSLATIONS --------------------------------------
$l['w_page'] = 'lehekülg';
//============================================================+
// END OF FILE
//============================================================+

View File

@@ -0,0 +1,50 @@
<?php
//============================================================+
// File name : eus.php
// Begin : 2010-10-26
// Last Update : 2010-10-26
//
// Description : Language module for TCPDF
// (contains translated texts)
// Basque
//
// Author: Nicola Asuni
//
// (c) Copyright:
// Nicola Asuni
// Tecnick.com s.r.l.
// Via Della Pace, 11
// 09044 Quartucciu (CA)
// ITALY
// www.tecnick.com
// info@tecnick.com
//============================================================+
/**
* TCPDF language file (contains translated texts).
* @package com.tecnick.tcpdf
* @abstract TCPDF language file: Basque
* @author Nicola Asuni
* @copyright 2004-2010 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com
* @link http://tcpdf.sourceforge.net
* @license http://www.gnu.org/copyleft/lesser.html LGPL
* @since 2010-10-26
*/
// Basque
global $l;
$l = Array();
// PAGE META DESCRIPTORS --------------------------------------
$l['a_meta_charset'] = 'UTF-8';
$l['a_meta_dir'] = 'ltr';
$l['a_meta_language'] = 'eu';
// TRANSLATIONS --------------------------------------
$l['w_page'] = 'Orrialdearen';
//============================================================+
// END OF FILE
//============================================================+

View File

@@ -0,0 +1,50 @@
<?php
//============================================================+
// File name : fra.php
// Begin : 2010-10-26
// Last Update : 2010-10-26
//
// Description : Language module for TCPDF
// (contains translated texts)
// French
//
// Author: Nicola Asuni
//
// (c) Copyright:
// Nicola Asuni
// Tecnick.com s.r.l.
// Via Della Pace, 11
// 09044 Quartucciu (CA)
// ITALY
// www.tecnick.com
// info@tecnick.com
//============================================================+
/**
* TCPDF language file (contains translated texts).
* @package com.tecnick.tcpdf
* @abstract TCPDF language file: French
* @author Nicola Asuni
* @copyright 2004-2010 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com
* @link http://tcpdf.sourceforge.net
* @license http://www.gnu.org/copyleft/lesser.html LGPL
* @since 2010-10-26
*/
// French
global $l;
$l = Array();
// PAGE META DESCRIPTORS --------------------------------------
$l['a_meta_charset'] = 'UTF-8';
$l['a_meta_dir'] = 'ltr';
$l['a_meta_language'] = 'fr';
// TRANSLATIONS --------------------------------------
$l['w_page'] = 'page';
//============================================================+
// END OF FILE
//============================================================+

View File

@@ -2,10 +2,11 @@
//============================================================+
// File name : eng.php
// Begin : 2004-03-03
// Last Update : 2010-08-08
// Last Update : 2010-10-26
//
// Description : Language module for TCPDF
// (contains translated texts)
// German
//
// Author: Nicola Asuni
//
@@ -22,15 +23,15 @@
/**
* TCPDF language file (contains translated texts).
* @package com.tecnick.tcpdf
* @abstract TCPDF language file.
* @abstract TCPDF language file: German
* @author Nicola Asuni
* @copyright 2004-2009 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com
* @copyright 2004-2010 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com
* @link http://tcpdf.sourceforge.net
* @license http://www.gnu.org/copyleft/lesser.html LGPL
* @since 2004-03-03
*/
// ENGLISH
// German
global $l;
$l = Array();

View File

@@ -0,0 +1,50 @@
<?php
//============================================================+
// File name : ind.php
// Begin : 2004-03-03
// Last Update : 2010-10-26
//
// Description : Language module for TCPDF
// (contains translated texts)
// Irish
//
// Author: Nicola Asuni
//
// (c) Copyright:
// Nicola Asuni
// Tecnick.com s.r.l.
// Via Della Pace, 11
// 09044 Quartucciu (CA)
// ITALY
// www.tecnick.com
// info@tecnick.com
//============================================================+
/**
* TCPDF language file (contains translated texts).
* @package com.tecnick.tcpdf
* @abstract TCPDF language file: Irish
* @author Nicola Asuni
* @copyright 2004-2010 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com
* @link http://tcpdf.sourceforge.net
* @license http://www.gnu.org/copyleft/lesser.html LGPL
* @since 2004-03-03
*/
// Irish
global $l;
$l = Array();
// PAGE META DESCRIPTORS --------------------------------------
$l['a_meta_charset'] = 'UTF-8';
$l['a_meta_dir'] = 'ltr';
$l['a_meta_language'] = 'ga';
// TRANSLATIONS --------------------------------------
$l['w_page'] = 'leathanach';
//============================================================+
// END OF FILE
//============================================================+

View File

@@ -0,0 +1,50 @@
<?php
//============================================================+
// File name : glg.php
// Begin : 2010-10-26
// Last Update : 2010-10-26
//
// Description : Language module for TCPDF
// (contains translated texts)
// Galician
//
// Author: Nicola Asuni
//
// (c) Copyright:
// Nicola Asuni
// Tecnick.com s.r.l.
// Via Della Pace, 11
// 09044 Quartucciu (CA)
// ITALY
// www.tecnick.com
// info@tecnick.com
//============================================================+
/**
* TCPDF language file (contains translated texts).
* @package com.tecnick.tcpdf
* @abstract TCPDF language file: Galician
* @author Nicola Asuni
* @copyright 2004-2010 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com
* @link http://tcpdf.sourceforge.net
* @license http://www.gnu.org/copyleft/lesser.html LGPL
* @since 2010-10-26
*/
// Galician
global $l;
$l = Array();
// PAGE META DESCRIPTORS --------------------------------------
$l['a_meta_charset'] = 'UTF-8';
$l['a_meta_dir'] = 'ltr';
$l['a_meta_language'] = 'gl';
// TRANSLATIONS --------------------------------------
$l['w_page'] = 'Páxina';
//============================================================+
// END OF FILE
//============================================================+

View File

@@ -0,0 +1,50 @@
<?php
//============================================================+
// File name : hat.php
// Begin : 2004-03-03
// Last Update : 2010-10-26
//
// Description : Language module for TCPDF
// (contains translated texts)
// Haitian Creole
//
// Author: Nicola Asuni
//
// (c) Copyright:
// Nicola Asuni
// Tecnick.com s.r.l.
// Via Della Pace, 11
// 09044 Quartucciu (CA)
// ITALY
// www.tecnick.com
// info@tecnick.com
//============================================================+
/**
* TCPDF language file (contains translated texts).
* @package com.tecnick.tcpdf
* @abstract TCPDF language file: Haitian Creole
* @author Nicola Asuni
* @copyright 2004-2010 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com
* @link http://tcpdf.sourceforge.net
* @license http://www.gnu.org/copyleft/lesser.html LGPL
* @since 2004-03-03
*/
// Haitian Creole
global $l;
$l = Array();
// PAGE META DESCRIPTORS --------------------------------------
$l['a_meta_charset'] = 'UTF-8';
$l['a_meta_dir'] = 'ltr';
$l['a_meta_language'] = 'ht';
// TRANSLATIONS --------------------------------------
$l['w_page'] = 'paj';
//============================================================+
// END OF FILE
//============================================================+

View File

@@ -0,0 +1,50 @@
<?php
//============================================================+
// File name : heb.php
// Begin : 2004-03-03
// Last Update : 2010-10-26
//
// Description : Language module for TCPDF
// (contains translated texts)
// Hebrew
//
// Author: Nicola Asuni
//
// (c) Copyright:
// Nicola Asuni
// Tecnick.com s.r.l.
// Via Della Pace, 11
// 09044 Quartucciu (CA)
// ITALY
// www.tecnick.com
// info@tecnick.com
//============================================================+
/**
* TCPDF language file (contains translated texts).
* @package com.tecnick.tcpdf
* @abstract TCPDF language file: Hebrew
* @author Nicola Asuni
* @copyright 2004-2010 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com
* @link http://tcpdf.sourceforge.net
* @license http://www.gnu.org/copyleft/lesser.html LGPL
* @since 2004-03-03
*/
// Hebrew
global $l;
$l = Array();
// PAGE META DESCRIPTORS --------------------------------------
$l['a_meta_charset'] = 'UTF-8';
$l['a_meta_dir'] = 'rtl';
$l['a_meta_language'] = 'he';
// TRANSLATIONS --------------------------------------
$l['w_page'] = 'מקור:';
//============================================================+
// END OF FILE
//============================================================+

View File

@@ -0,0 +1,50 @@
<?php
//============================================================+
// File name : hrv.php
// Begin : 2010-10-26
// Last Update : 2010-10-26
//
// Description : Language module for TCPDF
// (contains translated texts)
// Croatian
//
// Author: Nicola Asuni
//
// (c) Copyright:
// Nicola Asuni
// Tecnick.com s.r.l.
// Via Della Pace, 11
// 09044 Quartucciu (CA)
// ITALY
// www.tecnick.com
// info@tecnick.com
//============================================================+
/**
* TCPDF language file (contains translated texts).
* @package com.tecnick.tcpdf
* @abstract TCPDF language file: Croatian
* @author Nicola Asuni
* @copyright 2004-2010 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com
* @link http://tcpdf.sourceforge.net
* @license http://www.gnu.org/copyleft/lesser.html LGPL
* @since 2010-10-26
*/
// Croatian
global $l;
$l = Array();
// PAGE META DESCRIPTORS --------------------------------------
$l['a_meta_charset'] = 'UTF-8';
$l['a_meta_dir'] = 'ltr';
$l['a_meta_language'] = 'hr';
// TRANSLATIONS --------------------------------------
$l['w_page'] = 'stranica';
//============================================================+
// END OF FILE
//============================================================+

View File

@@ -0,0 +1,50 @@
<?php
//============================================================+
// File name : hun.php
// Begin : 2004-03-03
// Last Update : 2010-10-26
//
// Description : Language module for TCPDF
// (contains translated texts)
// Hungarian
//
// Author: Nicola Asuni
//
// (c) Copyright:
// Nicola Asuni
// Tecnick.com s.r.l.
// Via Della Pace, 11
// 09044 Quartucciu (CA)
// ITALY
// www.tecnick.com
// info@tecnick.com
//============================================================+
/**
* TCPDF language file (contains translated texts).
* @package com.tecnick.tcpdf
* @abstract TCPDF language file: Hungarian
* @author Nicola Asuni
* @copyright 2004-2010 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com
* @link http://tcpdf.sourceforge.net
* @license http://www.gnu.org/copyleft/lesser.html LGPL
* @since 2004-03-03
*/
// Hungarian
global $l;
$l = Array();
// PAGE META DESCRIPTORS --------------------------------------
$l['a_meta_charset'] = 'UTF-8';
$l['a_meta_dir'] = 'ltr';
$l['a_meta_language'] = 'hu';
// TRANSLATIONS --------------------------------------
$l['w_page'] = 'oldal';
//============================================================+
// END OF FILE
//============================================================+

View File

@@ -0,0 +1,50 @@
<?php
//============================================================+
// File name : hye.php
// Begin : 2010-10-26
// Last Update : 2010-10-26
//
// Description : Language module for TCPDF
// (contains translated texts)
// Armenian
//
// Author: Nicola Asuni
//
// (c) Copyright:
// Nicola Asuni
// Tecnick.com s.r.l.
// Via Della Pace, 11
// 09044 Quartucciu (CA)
// ITALY
// www.tecnick.com
// info@tecnick.com
//============================================================+
/**
* TCPDF language file (contains translated texts).
* @package com.tecnick.tcpdf
* @abstract TCPDF language file: Armenian
* @author Nicola Asuni
* @copyright 2004-2010 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com
* @link http://tcpdf.sourceforge.net
* @license http://www.gnu.org/copyleft/lesser.html LGPL
* @since 2010-10-26
*/
// Armenian
global $l;
$l = Array();
// PAGE META DESCRIPTORS --------------------------------------
$l['a_meta_charset'] = 'UTF-8';
$l['a_meta_dir'] = 'ltr';
$l['a_meta_language'] = 'hy';
// TRANSLATIONS --------------------------------------
$l['w_page'] = 'էջ';
//============================================================+
// END OF FILE
//============================================================+

View File

@@ -0,0 +1,50 @@
<?php
//============================================================+
// File name : ind.php
// Begin : 2004-03-03
// Last Update : 2010-10-26
//
// Description : Language module for TCPDF
// (contains translated texts)
// Indonesian
//
// Author: Nicola Asuni
//
// (c) Copyright:
// Nicola Asuni
// Tecnick.com s.r.l.
// Via Della Pace, 11
// 09044 Quartucciu (CA)
// ITALY
// www.tecnick.com
// info@tecnick.com
//============================================================+
/**
* TCPDF language file (contains translated texts).
* @package com.tecnick.tcpdf
* @abstract TCPDF language file: Indonesian
* @author Nicola Asuni
* @copyright 2004-2010 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com
* @link http://tcpdf.sourceforge.net
* @license http://www.gnu.org/copyleft/lesser.html LGPL
* @since 2004-03-03
*/
// Indonesian
global $l;
$l = Array();
// PAGE META DESCRIPTORS --------------------------------------
$l['a_meta_charset'] = 'UTF-8';
$l['a_meta_dir'] = 'ltr';
$l['a_meta_language'] = 'id';
// TRANSLATIONS --------------------------------------
$l['w_page'] = 'halaman';
//============================================================+
// END OF FILE
//============================================================+

View File

@@ -2,10 +2,11 @@
//============================================================+
// File name : ita.php
// Begin : 2004-03-03
// Last Update : 2010-08-08
// Last Update : 2010-10-26
//
// Description : Language module for TCPDF
// (contains translated texts)
// Italian
//
// Author: Nicola Asuni
//
@@ -22,15 +23,15 @@
/**
* TCPDF language file (contains translated texts).
* @package com.tecnick.tcpdf
* @abstract TCPDF language file.
* @abstract TCPDF language file: Italian
* @author Nicola Asuni
* @copyright 2004-2009 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com
* @copyright 2004-2010 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com
* @link http://tcpdf.sourceforge.net
* @license http://www.gnu.org/copyleft/lesser.html LGPL
* @since 2004-03-03
*/
// ENGLISH
// Italian
global $l;
$l = Array();

View File

@@ -0,0 +1,50 @@
<?php
//============================================================+
// File name : kat.php
// Begin : 2010-10-26
// Last Update : 2010-10-26
//
// Description : Language module for TCPDF
// (contains translated texts)
// Georgian
//
// Author: Nicola Asuni
//
// (c) Copyright:
// Nicola Asuni
// Tecnick.com s.r.l.
// Via Della Pace, 11
// 09044 Quartucciu (CA)
// ITALY
// www.tecnick.com
// info@tecnick.com
//============================================================+
/**
* TCPDF language file (contains translated texts).
* @package com.tecnick.tcpdf
* @abstract TCPDF language file: Georgian
* @author Nicola Asuni
* @copyright 2004-2010 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com
* @link http://tcpdf.sourceforge.net
* @license http://www.gnu.org/copyleft/lesser.html LGPL
* @since 2010-10-26
*/
// Georgian
global $l;
$l = Array();
// PAGE META DESCRIPTORS --------------------------------------
$l['a_meta_charset'] = 'UTF-8';
$l['a_meta_dir'] = 'ltr';
$l['a_meta_language'] = 'ka';
// TRANSLATIONS --------------------------------------
$l['w_page'] = 'გვერდი';
//============================================================+
// END OF FILE
//============================================================+

View File

@@ -0,0 +1,50 @@
<?php
//============================================================+
// File name : kor.php
// Begin : 2004-03-03
// Last Update : 2010-10-26
//
// Description : Language module for TCPDF
// (contains translated texts)
// Korean
//
// Author: Nicola Asuni
//
// (c) Copyright:
// Nicola Asuni
// Tecnick.com s.r.l.
// Via Della Pace, 11
// 09044 Quartucciu (CA)
// ITALY
// www.tecnick.com
// info@tecnick.com
//============================================================+
/**
* TCPDF language file (contains translated texts).
* @package com.tecnick.tcpdf
* @abstract TCPDF language file: Korean
* @author Nicola Asuni
* @copyright 2004-2010 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com
* @link http://tcpdf.sourceforge.net
* @license http://www.gnu.org/copyleft/lesser.html LGPL
* @since 2004-03-03
*/
// Korean
global $l;
$l = Array();
// PAGE META DESCRIPTORS --------------------------------------
$l['a_meta_charset'] = 'UTF-8';
$l['a_meta_dir'] = 'ltr';
$l['a_meta_language'] = 'ko';
// TRANSLATIONS --------------------------------------
$l['w_page'] = '페이지';
//============================================================+
// END OF FILE
//============================================================+

View File

@@ -0,0 +1,50 @@
<?php
//============================================================+
// File name : mkd.php
// Begin : 2004-03-03
// Last Update : 2010-10-26
//
// Description : Language module for TCPDF
// (contains translated texts)
// Macedonian
//
// Author: Nicola Asuni
//
// (c) Copyright:
// Nicola Asuni
// Tecnick.com s.r.l.
// Via Della Pace, 11
// 09044 Quartucciu (CA)
// ITALY
// www.tecnick.com
// info@tecnick.com
//============================================================+
/**
* TCPDF language file (contains translated texts).
* @package com.tecnick.tcpdf
* @abstract TCPDF language file: Macedonian
* @author Nicola Asuni
* @copyright 2004-2010 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com
* @link http://tcpdf.sourceforge.net
* @license http://www.gnu.org/copyleft/lesser.html LGPL
* @since 2004-03-03
*/
// Macedonian
global $l;
$l = Array();
// PAGE META DESCRIPTORS --------------------------------------
$l['a_meta_charset'] = 'UTF-8';
$l['a_meta_dir'] = 'ltr';
$l['a_meta_language'] = 'mk';
// TRANSLATIONS --------------------------------------
$l['w_page'] = 'страница';
//============================================================+
// END OF FILE
//============================================================+

View File

@@ -0,0 +1,50 @@
<?php
//============================================================+
// File name : mlt.php
// Begin : 2004-03-03
// Last Update : 2010-10-26
//
// Description : Language module for TCPDF
// (contains translated texts)
// Maltese
//
// Author: Nicola Asuni
//
// (c) Copyright:
// Nicola Asuni
// Tecnick.com s.r.l.
// Via Della Pace, 11
// 09044 Quartucciu (CA)
// ITALY
// www.tecnick.com
// info@tecnick.com
//============================================================+
/**
* TCPDF language file (contains translated texts).
* @package com.tecnick.tcpdf
* @abstract TCPDF language file: Maltese
* @author Nicola Asuni
* @copyright 2004-2010 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com
* @link http://tcpdf.sourceforge.net
* @license http://www.gnu.org/copyleft/lesser.html LGPL
* @since 2004-03-03
*/
// Maltese
global $l;
$l = Array();
// PAGE META DESCRIPTORS --------------------------------------
$l['a_meta_charset'] = 'UTF-8';
$l['a_meta_dir'] = 'ltr';
$l['a_meta_language'] = 'mt';
// TRANSLATIONS --------------------------------------
$l['w_page'] = 'paġna';
//============================================================+
// END OF FILE
//============================================================+

View File

@@ -0,0 +1,50 @@
<?php
//============================================================+
// File name : msa.php
// Begin : 2004-03-03
// Last Update : 2010-10-26
//
// Description : Language module for TCPDF
// (contains translated texts)
// Malay
//
// Author: Nicola Asuni
//
// (c) Copyright:
// Nicola Asuni
// Tecnick.com s.r.l.
// Via Della Pace, 11
// 09044 Quartucciu (CA)
// ITALY
// www.tecnick.com
// info@tecnick.com
//============================================================+
/**
* TCPDF language file (contains translated texts).
* @package com.tecnick.tcpdf
* @abstract TCPDF language file: Malay
* @author Nicola Asuni
* @copyright 2004-2010 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com
* @link http://tcpdf.sourceforge.net
* @license http://www.gnu.org/copyleft/lesser.html LGPL
* @since 2004-03-03
*/
// Malay
global $l;
$l = Array();
// PAGE META DESCRIPTORS --------------------------------------
$l['a_meta_charset'] = 'UTF-8';
$l['a_meta_dir'] = 'ltr';
$l['a_meta_language'] = 'ms';
// TRANSLATIONS --------------------------------------
$l['w_page'] = 'laman';
//============================================================+
// END OF FILE
//============================================================+

View File

@@ -0,0 +1,50 @@
<?php
//============================================================+
// File name : dan.php
// Begin : 2010-10-26
// Last Update : 2010-10-26
//
// Description : Language module for TCPDF
// (contains translated texts)
// Dutch
//
// Author: Nicola Asuni
//
// (c) Copyright:
// Nicola Asuni
// Tecnick.com s.r.l.
// Via Della Pace, 11
// 09044 Quartucciu (CA)
// ITALY
// www.tecnick.com
// info@tecnick.com
//============================================================+
/**
* TCPDF language file (contains translated texts).
* @package com.tecnick.tcpdf
* @abstract TCPDF language file: Dutch
* @author Nicola Asuni
* @copyright 2004-2010 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com
* @link http://tcpdf.sourceforge.net
* @license http://www.gnu.org/copyleft/lesser.html LGPL
* @since 2010-10-26
*/
// Dutch
global $l;
$l = Array();
// PAGE META DESCRIPTORS --------------------------------------
$l['a_meta_charset'] = 'UTF-8';
$l['a_meta_dir'] = 'ltr';
$l['a_meta_language'] = 'nl';
// TRANSLATIONS --------------------------------------
$l['w_page'] = 'pagina';
//============================================================+
// END OF FILE
//============================================================+

View File

@@ -0,0 +1,50 @@
<?php
//============================================================+
// File name : nob.php
// Begin : 2004-03-03
// Last Update : 2010-10-26
//
// Description : Language module for TCPDF
// (contains translated texts)
// Norwegian Bokmål
//
// Author: Nicola Asuni
//
// (c) Copyright:
// Nicola Asuni
// Tecnick.com s.r.l.
// Via Della Pace, 11
// 09044 Quartucciu (CA)
// ITALY
// www.tecnick.com
// info@tecnick.com
//============================================================+
/**
* TCPDF language file (contains translated texts).
* @package com.tecnick.tcpdf
* @abstract TCPDF language file: Norwegian Bokmål
* @author Nicola Asuni
* @copyright 2004-2010 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com
* @link http://tcpdf.sourceforge.net
* @license http://www.gnu.org/copyleft/lesser.html LGPL
* @since 2004-03-03
*/
// Norwegian Bokmål
global $l;
$l = Array();
// PAGE META DESCRIPTORS --------------------------------------
$l['a_meta_charset'] = 'UTF-8';
$l['a_meta_dir'] = 'ltr';
$l['a_meta_language'] = 'nb';
// TRANSLATIONS --------------------------------------
$l['w_page'] = 'side';
//============================================================+
// END OF FILE
//============================================================+

View File

@@ -0,0 +1,50 @@
<?php
//============================================================+
// File name : pol.php
// Begin : 2010-10-26
// Last Update : 2010-10-26
//
// Description : Language module for TCPDF
// (contains translated texts)
// Polish
//
// Author: Nicola Asuni
//
// (c) Copyright:
// Nicola Asuni
// Tecnick.com s.r.l.
// Via Della Pace, 11
// 09044 Quartucciu (CA)
// ITALY
// www.tecnick.com
// info@tecnick.com
//============================================================+
/**
* TCPDF language file (contains translated texts).
* @package com.tecnick.tcpdf
* @abstract TCPDF language file: Polish
* @author Nicola Asuni
* @copyright 2004-2010 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com
* @link http://tcpdf.sourceforge.net
* @license http://www.gnu.org/copyleft/lesser.html LGPL
* @since 2010-10-26
*/
// Polish
global $l;
$l = Array();
// PAGE META DESCRIPTORS --------------------------------------
$l['a_meta_charset'] = 'UTF-8';
$l['a_meta_dir'] = 'ltr';
$l['a_meta_language'] = 'pl';
// TRANSLATIONS --------------------------------------
$l['w_page'] = 'strona';
//============================================================+
// END OF FILE
//============================================================+

View File

@@ -0,0 +1,50 @@
<?php
//============================================================+
// File name : por.php
// Begin : 2004-03-03
// Last Update : 2010-10-26
//
// Description : Language module for TCPDF
// (contains translated texts)
// Portuguese
//
// Author: Nicola Asuni
//
// (c) Copyright:
// Nicola Asuni
// Tecnick.com s.r.l.
// Via Della Pace, 11
// 09044 Quartucciu (CA)
// ITALY
// www.tecnick.com
// info@tecnick.com
//============================================================+
/**
* TCPDF language file (contains translated texts).
* @package com.tecnick.tcpdf
* @abstract TCPDF language file: Portuguese
* @author Nicola Asuni
* @copyright 2004-2010 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com
* @link http://tcpdf.sourceforge.net
* @license http://www.gnu.org/copyleft/lesser.html LGPL
* @since 2004-03-03
*/
// Portuguese
global $l;
$l = Array();
// PAGE META DESCRIPTORS --------------------------------------
$l['a_meta_charset'] = 'UTF-8';
$l['a_meta_dir'] = 'ltr';
$l['a_meta_language'] = 'pt';
// TRANSLATIONS --------------------------------------
$l['w_page'] = 'página';
//============================================================+
// END OF FILE
//============================================================+

View File

@@ -0,0 +1,50 @@
<?php
//============================================================+
// File name : ron.php
// Begin : 2004-03-03
// Last Update : 2010-10-26
//
// Description : Language module for TCPDF
// (contains translated texts)
// Romanian, Moldavian, Moldovan
//
// Author: Nicola Asuni
//
// (c) Copyright:
// Nicola Asuni
// Tecnick.com s.r.l.
// Via Della Pace, 11
// 09044 Quartucciu (CA)
// ITALY
// www.tecnick.com
// info@tecnick.com
//============================================================+
/**
* TCPDF language file (contains translated texts).
* @package com.tecnick.tcpdf
* @abstract TCPDF language file: Romanian, Moldavian, Moldovan
* @author Nicola Asuni
* @copyright 2004-2010 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com
* @link http://tcpdf.sourceforge.net
* @license http://www.gnu.org/copyleft/lesser.html LGPL
* @since 2004-03-03
*/
// Romanian, Moldavian, Moldovan
global $l;
$l = Array();
// PAGE META DESCRIPTORS --------------------------------------
$l['a_meta_charset'] = 'UTF-8';
$l['a_meta_dir'] = 'ltr';
$l['a_meta_language'] = 'ro';
// TRANSLATIONS --------------------------------------
$l['w_page'] = 'pagina';
//============================================================+
// END OF FILE
//============================================================+

View File

@@ -0,0 +1,50 @@
<?php
//============================================================+
// File name : rus.php
// Begin : 2004-03-03
// Last Update : 2010-10-26
//
// Description : Language module for TCPDF
// (contains translated texts)
// Russian
//
// Author: Nicola Asuni
//
// (c) Copyright:
// Nicola Asuni
// Tecnick.com s.r.l.
// Via Della Pace, 11
// 09044 Quartucciu (CA)
// ITALY
// www.tecnick.com
// info@tecnick.com
//============================================================+
/**
* TCPDF language file (contains translated texts).
* @package com.tecnick.tcpdf
* @abstract TCPDF language file: Russian
* @author Nicola Asuni
* @copyright 2004-2010 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com
* @link http://tcpdf.sourceforge.net
* @license http://www.gnu.org/copyleft/lesser.html LGPL
* @since 2004-03-03
*/
// Russian
global $l;
$l = Array();
// PAGE META DESCRIPTORS --------------------------------------
$l['a_meta_charset'] = 'UTF-8';
$l['a_meta_dir'] = 'ltr';
$l['a_meta_language'] = 'ru';
// TRANSLATIONS --------------------------------------
$l['w_page'] = 'страницы';
//============================================================+
// END OF FILE
//============================================================+

View File

@@ -0,0 +1,50 @@
<?php
//============================================================+
// File name : slv.php
// Begin : 2004-03-03
// Last Update : 2010-10-26
//
// Description : Language module for TCPDF
// (contains translated texts)
// Slovene
//
// Author: Nicola Asuni
//
// (c) Copyright:
// Nicola Asuni
// Tecnick.com s.r.l.
// Via Della Pace, 11
// 09044 Quartucciu (CA)
// ITALY
// www.tecnick.com
// info@tecnick.com
//============================================================+
/**
* TCPDF language file (contains translated texts).
* @package com.tecnick.tcpdf
* @abstract TCPDF language file: Slovene
* @author Nicola Asuni
* @copyright 2004-2010 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com
* @link http://tcpdf.sourceforge.net
* @license http://www.gnu.org/copyleft/lesser.html LGPL
* @since 2004-03-03
*/
// Slovene
global $l;
$l = Array();
// PAGE META DESCRIPTORS --------------------------------------
$l['a_meta_charset'] = 'UTF-8';
$l['a_meta_dir'] = 'ltr';
$l['a_meta_language'] = 'sl';
// TRANSLATIONS --------------------------------------
$l['w_page'] = 'stran';
//============================================================+
// END OF FILE
//============================================================+

View File

@@ -0,0 +1,50 @@
<?php
//============================================================+
// File name : spa.php
// Begin : 2004-03-03
// Last Update : 2010-10-26
//
// Description : Language module for TCPDF
// (contains translated texts)
// Spanish; Castilian
//
// Author: Nicola Asuni
//
// (c) Copyright:
// Nicola Asuni
// Tecnick.com s.r.l.
// Via Della Pace, 11
// 09044 Quartucciu (CA)
// ITALY
// www.tecnick.com
// info@tecnick.com
//============================================================+
/**
* TCPDF language file (contains translated texts).
* @package com.tecnick.tcpdf
* @abstract TCPDF language file: Spanish; Castilian
* @author Nicola Asuni
* @copyright 2004-2010 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com
* @link http://tcpdf.sourceforge.net
* @license http://www.gnu.org/copyleft/lesser.html LGPL
* @since 2004-03-03
*/
// Spanish; Castilian
global $l;
$l = Array();
// PAGE META DESCRIPTORS --------------------------------------
$l['a_meta_charset'] = 'UTF-8';
$l['a_meta_dir'] = 'ltr';
$l['a_meta_language'] = 'es';
// TRANSLATIONS --------------------------------------
$l['w_page'] = 'página';
//============================================================+
// END OF FILE
//============================================================+

View File

@@ -0,0 +1,50 @@
<?php
//============================================================+
// File name : sqi.php
// Begin : 2010-10-26
// Last Update : 2010-10-26
//
// Description : Language module for TCPDF
// (contains translated texts)
// Albanian
//
// Author: Nicola Asuni
//
// (c) Copyright:
// Nicola Asuni
// Tecnick.com s.r.l.
// Via Della Pace, 11
// 09044 Quartucciu (CA)
// ITALY
// www.tecnick.com
// info@tecnick.com
//============================================================+
/**
* TCPDF language file (contains translated texts).
* @package com.tecnick.tcpdf
* @abstract TCPDF language file: Albanian
* @author Nicola Asuni
* @copyright 2004-2010 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com
* @link http://tcpdf.sourceforge.net
* @license http://www.gnu.org/copyleft/lesser.html LGPL
* @since 2010-10-26
*/
// Albanian
global $l;
$l = Array();
// PAGE META DESCRIPTORS --------------------------------------
$l['a_meta_charset'] = 'UTF-8';
$l['a_meta_dir'] = 'ltr';
$l['a_meta_language'] = 'sq';
// TRANSLATIONS --------------------------------------
$l['w_page'] = 'faqe';
//============================================================+
// END OF FILE
//============================================================+

View File

@@ -0,0 +1,50 @@
<?php
//============================================================+
// File name : srp.php
// Begin : 2004-03-03
// Last Update : 2010-10-26
//
// Description : Language module for TCPDF
// (contains translated texts)
// Serbian
//
// Author: Nicola Asuni
//
// (c) Copyright:
// Nicola Asuni
// Tecnick.com s.r.l.
// Via Della Pace, 11
// 09044 Quartucciu (CA)
// ITALY
// www.tecnick.com
// info@tecnick.com
//============================================================+
/**
* TCPDF language file (contains translated texts).
* @package com.tecnick.tcpdf
* @abstract TCPDF language file: Serbian
* @author Nicola Asuni
* @copyright 2004-2010 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com
* @link http://tcpdf.sourceforge.net
* @license http://www.gnu.org/copyleft/lesser.html LGPL
* @since 2004-03-03
*/
// Serbian
global $l;
$l = Array();
// PAGE META DESCRIPTORS --------------------------------------
$l['a_meta_charset'] = 'UTF-8';
$l['a_meta_dir'] = 'ltr';
$l['a_meta_language'] = 'sr';
// TRANSLATIONS --------------------------------------
$l['w_page'] = 'страна';
//============================================================+
// END OF FILE
//============================================================+

View File

@@ -0,0 +1,50 @@
<?php
//============================================================+
// File name : swa.php
// Begin : 2004-03-03
// Last Update : 2010-10-26
//
// Description : Language module for TCPDF
// (contains translated texts)
// Swahili
//
// Author: Nicola Asuni
//
// (c) Copyright:
// Nicola Asuni
// Tecnick.com s.r.l.
// Via Della Pace, 11
// 09044 Quartucciu (CA)
// ITALY
// www.tecnick.com
// info@tecnick.com
//============================================================+
/**
* TCPDF language file (contains translated texts).
* @package com.tecnick.tcpdf
* @abstract TCPDF language file: Swahili
* @author Nicola Asuni
* @copyright 2004-2010 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com
* @link http://tcpdf.sourceforge.net
* @license http://www.gnu.org/copyleft/lesser.html LGPL
* @since 2004-03-03
*/
// Swahili
global $l;
$l = Array();
// PAGE META DESCRIPTORS --------------------------------------
$l['a_meta_charset'] = 'UTF-8';
$l['a_meta_dir'] = 'ltr';
$l['a_meta_language'] = 'sw';
// TRANSLATIONS --------------------------------------
$l['w_page'] = 'ukurasa';
//============================================================+
// END OF FILE
//============================================================+

View File

@@ -0,0 +1,50 @@
<?php
//============================================================+
// File name : swe.php
// Begin : 2004-03-03
// Last Update : 2010-10-26
//
// Description : Language module for TCPDF
// (contains translated texts)
// Swedish
//
// Author: Nicola Asuni
//
// (c) Copyright:
// Nicola Asuni
// Tecnick.com s.r.l.
// Via Della Pace, 11
// 09044 Quartucciu (CA)
// ITALY
// www.tecnick.com
// info@tecnick.com
//============================================================+
/**
* TCPDF language file (contains translated texts).
* @package com.tecnick.tcpdf
* @abstract TCPDF language file: Swedish
* @author Nicola Asuni
* @copyright 2004-2010 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com
* @link http://tcpdf.sourceforge.net
* @license http://www.gnu.org/copyleft/lesser.html LGPL
* @since 2004-03-03
*/
// Swedish
global $l;
$l = Array();
// PAGE META DESCRIPTORS --------------------------------------
$l['a_meta_charset'] = 'UTF-8';
$l['a_meta_dir'] = 'ltr';
$l['a_meta_language'] = 'sv';
// TRANSLATIONS --------------------------------------
$l['w_page'] = 'sida';
//============================================================+
// END OF FILE
//============================================================+

View File

@@ -0,0 +1,50 @@
<?php
//============================================================+
// File name : urd.php
// Begin : 2004-03-03
// Last Update : 2010-10-26
//
// Description : Language module for TCPDF
// (contains translated texts)
// Urdu
//
// Author: Nicola Asuni
//
// (c) Copyright:
// Nicola Asuni
// Tecnick.com s.r.l.
// Via Della Pace, 11
// 09044 Quartucciu (CA)
// ITALY
// www.tecnick.com
// info@tecnick.com
//============================================================+
/**
* TCPDF language file (contains translated texts).
* @package com.tecnick.tcpdf
* @abstract TCPDF language file: Urdu
* @author Nicola Asuni
* @copyright 2004-2010 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com
* @link http://tcpdf.sourceforge.net
* @license http://www.gnu.org/copyleft/lesser.html LGPL
* @since 2004-03-03
*/
// Urdu
global $l;
$l = Array();
// PAGE META DESCRIPTORS --------------------------------------
$l['a_meta_charset'] = 'UTF-8';
$l['a_meta_dir'] = 'rtl';
$l['a_meta_language'] = 'ur';
// TRANSLATIONS --------------------------------------
$l['w_page'] = 'صفحہ';
//============================================================+
// END OF FILE
//============================================================+

View File

@@ -0,0 +1,50 @@
<?php
//============================================================+
// File name : yid.php
// Begin : 2004-03-03
// Last Update : 2010-10-26
//
// Description : Language module for TCPDF
// (contains translated texts)
// Welsh
//
// Author: Nicola Asuni
//
// (c) Copyright:
// Nicola Asuni
// Tecnick.com s.r.l.
// Via Della Pace, 11
// 09044 Quartucciu (CA)
// ITALY
// www.tecnick.com
// info@tecnick.com
//============================================================+
/**
* TCPDF language file (contains translated texts).
* @package com.tecnick.tcpdf
* @abstract TCPDF language file: Welsh
* @author Nicola Asuni
* @copyright 2004-2010 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com
* @link http://tcpdf.sourceforge.net
* @license http://www.gnu.org/copyleft/lesser.html LGPL
* @since 2004-03-03
*/
// Welsh
global $l;
$l = Array();
// PAGE META DESCRIPTORS --------------------------------------
$l['a_meta_charset'] = 'UTF-8';
$l['a_meta_dir'] = 'rtl';
$l['a_meta_language'] = 'yi';
// TRANSLATIONS --------------------------------------
$l['w_page'] = 'זייַט';
//============================================================+
// END OF FILE
//============================================================+

View File

@@ -0,0 +1,50 @@
<?php
//============================================================+
// File name : zho.php
// Begin : 2010-10-26
// Last Update : 2010-10-26
//
// Description : Language module for TCPDF
// (contains translated texts)
// Chinese
//
// Author: Nicola Asuni
//
// (c) Copyright:
// Nicola Asuni
// Tecnick.com s.r.l.
// Via Della Pace, 11
// 09044 Quartucciu (CA)
// ITALY
// www.tecnick.com
// info@tecnick.com
//============================================================+
/**
* TCPDF language file (contains translated texts).
* @package com.tecnick.tcpdf
* @abstract TCPDF language file: Chinese
* @author Nicola Asuni
* @copyright 2004-2010 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com
* @link http://tcpdf.sourceforge.net
* @license http://www.gnu.org/copyleft/lesser.html LGPL
* @since 2010-10-26
*/
// Chinese
global $l;
$l = Array();
// PAGE META DESCRIPTORS --------------------------------------
$l['a_meta_charset'] = 'UTF-8';
$l['a_meta_dir'] = 'ltr';
$l['a_meta_language'] = 'zh';
// TRANSLATIONS --------------------------------------
$l['w_page'] = '頁面';
//============================================================+
// END OF FILE
//============================================================+

View File

@@ -94,7 +94,7 @@ if (!defined('K_TCPDF_EXTERNAL_CONFIG')) {
/**
*images directory
*/
define ('K_PATH_IMAGES', K_PATH_MAIN.'images/');
define ('K_PATH_IMAGES', $imagedir.DIRECTORY_SEPARATOR);
/**
* blank image

View File

@@ -12,9 +12,12 @@ class PDF extends TCPDF
}
function intopdf($text,$format='')
function intopdf($text,$format='',$bStripHTML=true)
{
if ($bStripHTML)
{
$text = $this->delete_html($text);
}
$oldformat = $this->FontStyle;
$this->SetFont('',$format,$this->FontSizePt);
$this->Write(5,$text);

View File

@@ -0,0 +1,44 @@
Adrian Schroeter
Andrey Valentinovich Panov
Ben Laenen
Besarion Gugushvili
Bhikkhu Pesala
Clayborne Arevalo
Dafydd Harries
Danilo Segan
Davide Viti
David Jez
David Lawrence Ramsey
Denis Jacquerye
Dwayne Bailey
Eugeniy Meshcheryakov
Gee Fung Sit
Heikki Lindroos
James Cloos
James Crippen
John Karp
Keenan Pepper
Lars Naesbye Christensen
Mashrab Kuvatov
Max Berger
Mederic Boquien
Michael Everson
Misu Moldovan
Nguyen Thai Ngoc Duy
Nicolas Mailhot
Ognyan Kulev
Ondrej Koala Vacha
Peter Cernak
Remy Oudompheng
Roozbeh Pournader
Sahak Petrosyan
Sander Vesik
Stepan Roh
Stephen Hartke
Tavmjong Bah
Tim May
Valentin Stoykov
Vasek Stodulka
Wesley Transue
$Id: AUTHORS 2162 2007-12-27 12:39:07Z ben_laenen $

View File

@@ -0,0 +1,3 @@
See http://dejavu.sourceforge.net/wiki/index.php/Bugs
$Id: BUGS 80 2004-11-13 13:12:02Z src $

View File

@@ -0,0 +1,99 @@
Fonts are (c) Bitstream (see below). DejaVu changes are in public domain.
Glyphs imported from Arev fonts are (c) Tavmjong Bah (see below)
Bitstream Vera Fonts Copyright
------------------------------
Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream Vera is
a trademark of Bitstream, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of the fonts accompanying this license ("Fonts") and associated
documentation files (the "Font Software"), to reproduce and distribute the
Font Software, including without limitation the rights to use, copy, merge,
publish, distribute, and/or sell copies of the Font Software, and to permit
persons to whom the Font Software is furnished to do so, subject to the
following conditions:
The above copyright and trademark notices and this permission notice shall
be included in all copies of one or more of the Font Software typefaces.
The Font Software may be modified, altered, or added to, and in particular
the designs of glyphs or characters in the Fonts may be modified and
additional glyphs or characters may be added to the Fonts, only if the fonts
are renamed to names not containing either the words "Bitstream" or the word
"Vera".
This License becomes null and void to the extent applicable to Fonts or Font
Software that has been modified and is distributed under the "Bitstream
Vera" names.
The Font Software may be sold as part of a larger software package but no
copy of one or more of the Font Software typefaces may be sold by itself.
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT,
TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL BITSTREAM OR THE GNOME
FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING
ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE
FONT SOFTWARE.
Except as contained in this notice, the names of Gnome, the Gnome
Foundation, and Bitstream Inc., shall not be used in advertising or
otherwise to promote the sale, use or other dealings in this Font Software
without prior written authorization from the Gnome Foundation or Bitstream
Inc., respectively. For further information, contact: fonts at gnome dot
org.
Arev Fonts Copyright
------------------------------
Copyright (c) 2006 by Tavmjong Bah. All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining
a copy of the fonts accompanying this license ("Fonts") and
associated documentation files (the "Font Software"), to reproduce
and distribute the modifications to the Bitstream Vera Font Software,
including without limitation the rights to use, copy, merge, publish,
distribute, and/or sell copies of the Font Software, and to permit
persons to whom the Font Software is furnished to do so, subject to
the following conditions:
The above copyright and trademark notices and this permission notice
shall be included in all copies of one or more of the Font Software
typefaces.
The Font Software may be modified, altered, or added to, and in
particular the designs of glyphs or characters in the Fonts may be
modified and additional glyphs or characters may be added to the
Fonts, only if the fonts are renamed to names not containing either
the words "Tavmjong Bah" or the word "Arev".
This License becomes null and void to the extent applicable to Fonts
or Font Software that has been modified and is distributed under the
"Tavmjong Bah Arev" names.
The Font Software may be sold as part of a larger software package but
no copy of one or more of the Font Software typefaces may be sold by
itself.
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL
TAVMJONG BAH BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
Except as contained in this notice, the name of Tavmjong Bah shall not
be used in advertising or otherwise to promote the sale, use or other
dealings in this Font Software without prior written authorization
from Tavmjong Bah. For further information, contact: tavmjong @ free
. fr.
$Id: LICENSE 2133 2007-11-28 02:46:28Z lechimp $

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,59 @@
DejaVu fonts 2.27 (c)2004-2008 DejaVu fonts team
------------------------------------------------
The DejaVu fonts are a font family based on the Bitstream Vera Fonts
(http://gnome.org/fonts/). Its purpose is to provide a wider range of
characters (see status.txt for more information) while maintaining the
original look and feel.
DejaVu fonts are based on Bitstream Vera fonts version 1.10.
Available fonts (Sans = sans serif, Mono = monospaced):
DejaVu Sans Mono
DejaVu Sans Mono Bold
DejaVu Sans Mono Bold Oblique
DejaVu Sans Mono Oblique
DejaVu Sans
DejaVu Sans Bold
DejaVu Sans Bold Oblique
DejaVu Sans Oblique
DejaVu Sans ExtraLight (experimental)
DejaVu Serif
DejaVu Serif Bold
DejaVu Serif Bold Italic (experimental)
DejaVu Serif Italic (experimental)
DejaVu Sans Condensed (experimental)
DejaVu Sans Condensed Bold (experimental)
DejaVu Sans Condensed Bold Oblique (experimental)
DejaVu Sans Condensed Oblique (experimental)
DejaVu Serif Condensed (experimental)
DejaVu Serif Condensed Bold (experimental)
DejaVu Serif Condensed Bold Italic (experimental)
DejaVu Serif Condensed Italic (experimental)
All fonts are also available as derivative called DejaVu LGC with support
only for Latin, Greek and Cyrillic scripts.
For license information see LICENSE. What's new is described in NEWS. Known
bugs are in BUGS. All authors are mentioned in AUTHORS.
Fonts are published in source form as SFD files (Spline Font Database from
FontForge - http://fontforge.sf.net/) and in compiled form as TTF files
(TrueType fonts).
For more information go to http://dejavu.sourceforge.net/.
Characters from Arev fonts, Copyright (c) 2006 by Tavmjong Bah:
---------------------------
U+01BA, U+01BF, U+01F7, U+021C-U+021D, U+0220, U+0222-U+0223,
U+02B9, U+02BA, U+02BD, U+02C2-U+02C5, U+02d4-U+02D5,
U+02D7, U+02EC-U+02EE, U+0346-U+034E, U+0360, U+0362,
U+03E2-03EF, U+0460-0463, U+0466-U+0486, U+0488-U+0489, U+04A8-U+04A9,
U+0500-U+050F, U+2055-205E, U+20B0, U+20B2-U+20B3, U+2102, U+210D, U+210F,
U+2111, U+2113, U+2115, U+2118-U+211A, U+211C-U+211D, U+2124, U+2135,
U+213C-U+2140, U+2295-U+2298, U+2308-U+230B, U+26A2-U+26B1, U+2701-U+2704,
U+2706-U+2709, U+270C-U+274B, U+2758-U+275A, U+2761-U+2775, U+2780-U+2794,
U+2798-U+27AF, U+27B1-U+27BE, U+FB05-U+FB06
$Id: README 2296 2008-09-27 17:30:03Z ben_laenen $

Some files were not shown because too many files have changed in this diff Show More