Move sub_language.class.php inside inc/lib

Removing require_once
1.10.x
Julio Montoya 11 years ago
parent 03b8dcb633
commit 4a18a2e34f
  1. 1
      main/admin/languages.php
  2. 1
      main/admin/sub_language.php
  3. 2
      main/admin/sub_language_add.php
  4. 6
      main/admin/sub_language_ajax.inc.php
  5. 1
      main/cron/import_csv.php
  6. 1
      main/cron/lang/check_parse_lang.php
  7. 302
      main/cron/lang/langstats.class.php
  8. 3
      main/cron/lang/list_undefined_langvars.php
  9. 11
      main/cron/lang/list_unused_langvars.php
  10. 6
      main/exercice/exercise_history.php
  11. 2
      main/exercice/overview.php
  12. 1
      main/inc/ajax/forum.ajax.php
  13. 4
      main/inc/ajax/timeline.ajax.php
  14. 6
      main/inc/global.inc.php
  15. 4
      main/inc/lib/api.lib.php
  16. 4
      main/inc/lib/database.lib.php
  17. 4
      main/inc/lib/formvalidator/FormValidator.class.php
  18. 1
      main/inc/lib/internationalization.lib.php
  19. 61
      main/inc/lib/pear/HTML/QuickForm/Action/Back.php
  20. 59
      main/inc/lib/pear/HTML/QuickForm/Action/Direct.php
  21. 67
      main/inc/lib/pear/HTML/QuickForm/Action/Jump.php
  22. 61
      main/inc/lib/pear/HTML/QuickForm/Action/Next.php
  23. 63
      main/inc/lib/pear/HTML/QuickForm/Action/Submit.php
  24. 13
      main/inc/lib/pear/HTML/QuickForm/CAPTCHA.php
  25. 8
      main/inc/lib/pear/HTML/QuickForm/CAPTCHA/Equation.php
  26. 8
      main/inc/lib/pear/HTML/QuickForm/CAPTCHA/Figlet.php
  27. 6
      main/inc/lib/pear/HTML/QuickForm/CAPTCHA/Image.php
  28. 8
      main/inc/lib/pear/HTML/QuickForm/CAPTCHA/Word.php
  29. 102
      main/inc/lib/pear/HTML/QuickForm/Controller.php
  30. 115
      main/inc/lib/pear/HTML/QuickForm/Page.php
  31. 95
      main/inc/lib/pear/HTML/QuickForm/Renderer/Array.php
  32. 111
      main/inc/lib/pear/HTML/QuickForm/Renderer/ArraySmarty.php
  33. 17
      main/inc/lib/pear/HTML/QuickForm/Renderer/Default.php
  34. 69
      main/inc/lib/pear/HTML/QuickForm/Renderer/ITDynamic.php
  35. 93
      main/inc/lib/pear/HTML/QuickForm/Renderer/ITStatic.php
  36. 105
      main/inc/lib/pear/HTML/QuickForm/Renderer/Object.php
  37. 105
      main/inc/lib/pear/HTML/QuickForm/Renderer/ObjectFlexy.php
  38. 2
      main/inc/lib/pear/HTML/QuickForm/Rule/CAPTCHA.php
  39. 63
      main/inc/lib/pear/HTML/QuickForm/Rule/Callback.php
  40. 5
      main/inc/lib/pear/HTML/QuickForm/Rule/Compare.php
  41. 10
      main/inc/lib/pear/HTML/QuickForm/Rule/Date.php
  42. 67
      main/inc/lib/pear/HTML/QuickForm/Rule/Email.php
  43. 63
      main/inc/lib/pear/HTML/QuickForm/Rule/Range.php
  44. 81
      main/inc/lib/pear/HTML/QuickForm/Rule/Regex.php
  45. 5
      main/inc/lib/pear/HTML/QuickForm/Rule/Required.php
  46. 9
      main/inc/lib/pear/HTML/QuickForm/advanced_settings.php
  47. 61
      main/inc/lib/pear/HTML/QuickForm/advcheckbox.php
  48. 79
      main/inc/lib/pear/HTML/QuickForm/autocomplete.php
  49. 61
      main/inc/lib/pear/HTML/QuickForm/button.php
  50. 4
      main/inc/lib/pear/HTML/QuickForm/checkbox.php
  51. 6
      main/inc/lib/pear/HTML/QuickForm/email.php
  52. 5
      main/inc/lib/pear/HTML/QuickForm/file.php
  53. 7
      main/inc/lib/pear/HTML/QuickForm/header.php
  54. 5
      main/inc/lib/pear/HTML/QuickForm/hidden.php
  55. 59
      main/inc/lib/pear/HTML/QuickForm/hiddenselect.php
  56. 159
      main/inc/lib/pear/HTML/QuickForm/hierselect.php
  57. 63
      main/inc/lib/pear/HTML/QuickForm/image.php
  58. 1
      main/inc/lib/pear/HTML/QuickForm/label.php
  59. 61
      main/inc/lib/pear/HTML/QuickForm/link.php
  60. 59
      main/inc/lib/pear/HTML/QuickForm/password.php
  61. 59
      main/inc/lib/pear/HTML/QuickForm/reset.php
  62. 59
      main/inc/lib/pear/HTML/QuickForm/submit.php
  63. 57
      main/inc/lib/pear/HTML/QuickForm/xbutton.php
  64. 1
      main/inc/lib/pear/Image/Text.php
  65. 3
      main/inc/lib/pear/Image/Text/Exception.php
  66. 0
      main/inc/lib/sub_language.class.php
  67. 27
      main/inc/lib/timeline.lib.php
  68. 1
      main/inc/lib/upload.xajax.php
  69. 2
      main/install/index.php
  70. 12
      tests/main/admin/sub_language.class.test.php

@ -24,7 +24,6 @@ $cidReset = true;
// include global script
require_once '../inc/global.inc.php';
require_once 'sub_language.class.php';
$this_section = SECTION_PLATFORM_ADMIN;
api_protect_admin_script();

@ -10,7 +10,6 @@ $language_file = 'admin';
$cidReset = true;
$this_script = 'sub_language';
require_once '../inc/global.inc.php';
require_once 'sub_language.class.php';
$this_section = SECTION_PLATFORM_ADMIN;
api_protect_admin_script();

@ -10,7 +10,7 @@
$language_file = 'admin';
$cidReset = true;
require_once '../inc/global.inc.php';
require_once 'sub_language.class.php';
$this_section = SECTION_PLATFORM_ADMIN;
api_protect_admin_script();

@ -4,13 +4,9 @@
* Sub language AJAX script to update variables
* @package chamilo.admin.sub_language
*/
/**
* Init
*/
$language_file = 'admin';
$this_script = 'sub_language';
require_once '../inc/global.inc.php';
require_once 'sub_language.class.php';
api_protect_admin_script();
@ -53,6 +49,6 @@ if (isset($new_language) && isset($language_variable) && isset($file_id)) {
echo $path_folder.' '.get_lang('IsNotWritable').'<br /> '.api_ucwords(get_lang('ErrorsFound')).': <br />'.$variables_with_problems;
} else {
echo get_lang('Saved');
}
}
}

@ -10,7 +10,6 @@ if (file_exists('multiple_url_fix.php')) {
}
require_once __DIR__.'/../inc/global.inc.php';
require_once api_get_path(LIBRARY_PATH).'log.class.php';
ini_set('memory_limit', -1);
ini_set('max_execution_time', 0);

@ -8,7 +8,6 @@
*/
//die();
require_once '../../inc/global.inc.php';
require_once api_get_path(SYS_CODE_PATH).'admin/sub_language.class.php';
$path = api_get_path(SYS_LANG_PATH).'english';
ini_set('memory_limit','128M');
/**

@ -1,11 +1,13 @@
<?php
<?php
/* For licensing terms, see /license.txt */
/**
* This class takes the creation and querying of an SQLite DB in charge. The
* goal of this DB is to get stats on the usage of language vars for a common
* user.
* @package chamilo.cron.lang
*/
/**
* This class takes the creation and querying of an SQLite DB in charge. The
* goal of this DB is to get stats on the usage of language vars for a common
@ -13,146 +15,180 @@
* check for the availability of sqlite_open() should be made before calling
* the constructor (preferrably)
*/
class langstats {
class langstats
{
public $db; //database connector
public $error; //errores almacenados
public $db_type = 'sqlite';
public $db; //database connector
public $error; //errores almacenados
public $db_type = 'sqlite';
public function __construct($file='') {
switch ($this->db_type) {
case 'sqlite':
if (!class_exists('SQLite3')) {
$this->error = 'SQLiteNotAvailable';
return false; //cannot use if sqlite not installed
public function __construct($file = '')
{
switch ($this->db_type) {
case 'sqlite':
if (!class_exists('SQLite3')) {
$this->error = 'SQLiteNotAvailable';
return false; //cannot use if sqlite not installed
}
if (empty($file)) {
$file = api_get_path(SYS_ARCHIVE_PATH) . '/langstasdb';
}
if (is_file($file) && is_writeable($file)) {
$this->db = new SQLite3($file, SQLITE3_OPEN_READWRITE);
} else {
try {
$this->db = new SQLite3($file);
} catch (Exception $e) {
$this->error = 'DatabaseCreateError';
error_log('Exception: ' . $e->getMessage());
return false;
}
$err = $this->db->exec(
'CREATE TABLE lang_freq ('
. ' id integer PRIMARY KEY AUTOINCREMENT, '
. ' term_name text, term_file text, term_count integer default 0)'
);
if ($err === false) {
$this->error = 'CouldNotCreateTable';
return false;
}
$err = $this->db->exec(
'CREATE INDEX lang_freq_terms_idx ON lang_freq(term_name, term_file)'
);
if ($err === false) {
$this->error = 'CouldNotCreateIndex';
return false;
}
// Table and index created, move on.
}
break;
case 'mysql': //implementation not finished
if (!function_exists('mysql_connect')) {
$this->error = 'SQLiteNotAvailable';
return false; //cannot use if sqlite not installed
}
$err = Database::query('SELECT * FROM lang_freq');
if ($err === false) { //the database probably does not exist, create it
$err = Database::query(
'CREATE TABLE lang_freq ('
. ' id int PRIMARY KEY AUTO_INCREMENT, '
. ' term_name text, term_file text default \'\', term_count int default 0)'
);
if ($err === false) {
$this->error = 'CouldNotCreateTable';
return false;
}
} // if no error, we assume the table exists
break;
}
if (empty($file)) {
$file = api_get_path(SYS_ARCHIVE_PATH).'/langstasdb';
}
if (is_file($file) && is_writeable($file)) {
$this->db = new SQLite3($file,SQLITE3_OPEN_READWRITE);
} else {
try {
$this->db = new SQLite3($file);
} catch (Exception $e) {
$this->error = 'DatabaseCreateError';
error_log('Exception: '. $e->getMessage());
return $this->db;
}
/**
* Add a count for a specific term
* @param string The language term used
* @param string The file from which the language term came from
* @return boolean true
*/
public function add_use($term, $term_file = '')
{
$term = $this->db->escapeString($term);
$term_file = $this->db->escapeString($term_file);
$sql = "SELECT id, term_name, term_file, term_count FROM lang_freq WHERE term_name='$term' and term_file='$term_file'";
$ress = $this->db->query($sql);
if ($ress === false) {
$this->error = 'CouldNotQueryTermFromTable';
return false;
}
$err = $this->db->exec('CREATE TABLE lang_freq ('
.' id integer PRIMARY KEY AUTOINCREMENT, '
.' term_name text, term_file text, term_count integer default 0)');
if ($err === false) { $this->error = 'CouldNotCreateTable'; return false;}
$err = $this->db->exec('CREATE INDEX lang_freq_terms_idx ON lang_freq(term_name, term_file)');
if ($err === false) { $this->error = 'CouldNotCreateIndex'; return false; }
// Table and index created, move on.
}
break;
case 'mysql': //implementation not finished
if (!function_exists('mysql_connect')) {
$this->error = 'SQLiteNotAvailable';
return false; //cannot use if sqlite not installed
$i = 0;
while ($row = $ress->fetchArray(SQLITE3_BOTH)) {
$num = $row[3];
$num++;
$res = $this->db->query(
'UPDATE lang_freq SET term_count = ' . $num . ' WHERE id = ' . $row[0]
);
if ($res === false) {
$this->error = 'CouldNotUpdateTerm';
return false;
} else {
return $row[0];
}
$i++;
}
if ($i == 0) {
//No term found in the table, register as new term
$resi = $this->db->query(
"INSERT INTO lang_freq(term_name, term_file, term_count) VALUES ('$term', '$term_file', 1)"
);
if ($resi === false) {
$this->error = 'CouldNotInsertRow';
return false;
} else {
return $this->db->lastInsertRowID();
}
}
$err = Database::query('SELECT * FROM lang_freq');
if ($err === false) { //the database probably does not exist, create it
$err = Database::query('CREATE TABLE lang_freq ('
.' id int PRIMARY KEY AUTO_INCREMENT, '
.' term_name text, term_file text default \'\', term_count int default 0)');
if ($err === false) { $this->error = 'CouldNotCreateTable'; return false;}
} // if no error, we assume the table exists
break;
}
return $this->db;
}
/**
* Add a count for a specific term
* @param string The language term used
* @param string The file from which the language term came from
* @return boolean true
*/
public function add_use($term, $term_file='') {
$term = $this->db->escapeString($term);
$term_file = $this->db->escapeString($term_file);
$sql = "SELECT id, term_name, term_file, term_count FROM lang_freq WHERE term_name='$term' and term_file='$term_file'";
$ress = $this->db->query($sql);
if ($ress === false) {
$this->error = 'CouldNotQueryTermFromTable';
return false;
}
$i = 0;
while ($row = $ress->fetchArray(SQLITE3_BOTH)) {
$num = $row[3];
$num++;
$res = $this->db->query('UPDATE lang_freq SET term_count = '.$num.' WHERE id = '.$row[0]);
if ($res === false) {
$this->error = 'CouldNotUpdateTerm';
return false;
} else {
return $row[0];
}
$i++;
/**
* Function to get a list of the X most-requested terms
* @param integer Limit of terms to show
* @return array List of most requested terms
*/
public function get_popular_terms($num = 1000)
{
$res = $this->db->query(
'SELECT * FROM lang_freq ORDER BY term_count DESC LIMIT ' . $num
);
$list = array();
while ($row = $res->fetchArray()) {
$list[] = $row;
}
return $list;
}
if ($i == 0) {
//No term found in the table, register as new term
$resi = $this->db->query("INSERT INTO lang_freq(term_name, term_file, term_count) VALUES ('$term', '$term_file', 1)");
if ($resi === false) {
$this->error = 'CouldNotInsertRow';
return false;
} else {
return $this->db->lastInsertRowID();
}
}
}
/**
* Function to get a list of the X most-requested terms
* @param integer Limit of terms to show
* @return array List of most requested terms
*/
public function get_popular_terms($num=1000) {
$res = $this->db->query('SELECT * FROM lang_freq ORDER BY term_count DESC LIMIT '.$num);
$list = array();
while ($row = $res->fetchArray()) {
$list[] = $row;
}
return $list;
}
/**
* Clear all records in lang_freq
* @return boolean true
*/
public function clear_all() {
$res = sqlite_query($this->db, 'DELETE FROM lang_freq WHERE 1=1');
return $list;
}
/**
* Returns an array of all the language variables with their corresponding
* file of origin. This function tolerates a certain rate of error due to
* the duplication of variables in language files.
* @return array variable => origin file
*/
public function get_variables_origin() {
require_once '../../admin/sub_language.class.php';
$path = api_get_path(SYS_LANG_PATH).'english/';
$vars = array();
$priority = array('trad4all', 'notification', 'accessibility');
foreach ($priority as $file) {
$list = SubLanguageManager::get_all_language_variable_in_file($path.$file.'.inc.php', true);
foreach ($list as $var => $trad) {
$vars[$var] = $file.'.inc.php';
}
/**
* Clear all records in lang_freq
* @return boolean true
*/
public function clear_all()
{
$res = sqlite_query($this->db, 'DELETE FROM lang_freq WHERE 1=1');
return $list;
}
$files = scandir($path);
foreach ($files as $file) {
if (substr($file,0,1) == '.' or in_array($file,$priority)) {
continue;
}
$list = SubLanguageManager::get_all_language_variable_in_file($path.$file, true);
foreach ($list as $var => $trad) {
$vars[$var] = $file;
}
/**
* Returns an array of all the language variables with their corresponding
* file of origin. This function tolerates a certain rate of error due to
* the duplication of variables in language files.
* @return array variable => origin file
*/
public function get_variables_origin()
{
$path = api_get_path(SYS_LANG_PATH) . 'english/';
$vars = array();
$priority = array('trad4all', 'notification', 'accessibility');
foreach ($priority as $file) {
$list = SubLanguageManager::get_all_language_variable_in_file(
$path . $file . '.inc.php',
true
);
foreach ($list as $var => $trad) {
$vars[$var] = $file . '.inc.php';
}
}
$files = scandir($path);
foreach ($files as $file) {
if (substr($file, 0, 1) == '.' or in_array($file, $priority)) {
continue;
}
$list = SubLanguageManager::get_all_language_variable_in_file(
$path . $file,
true
);
foreach ($list as $var => $trad) {
$vars[$var] = $file;
}
}
return $vars;
}
return $vars;
}
}
}

@ -8,7 +8,6 @@
*/
die();
require_once '../../inc/global.inc.php';
require_once api_get_path(SYS_CODE_PATH).'admin/sub_language.class.php';
$path = api_get_path(SYS_LANG_PATH).'english';
ini_set('memory_limit','128M');
/**
@ -85,7 +84,7 @@ function get_all_php_files($base_path) {
if ($sub == '.php' or $sub == '.tpl') {
$files[] = $base_path.$item;
}
}
}
}
$list = null;
return $files;

@ -8,7 +8,6 @@
*/
die();
require_once '../../inc/global.inc.php';
require_once api_get_path(SYS_CODE_PATH).'admin/sub_language.class.php';
$path = api_get_path(SYS_LANG_PATH).'english';
ini_set('memory_limit','128M');
/**
@ -27,7 +26,7 @@ $defined_terms = array_flip(array_keys($terms));
$terms = null;
echo count($defined_terms)." terms were found in language files<br />";
// now get all terms found in all PHP files of Chamilo (this takes some
// now get all terms found in all PHP files of Chamilo (this takes some
// time and memory)
$used_terms = array();
$l = strlen(api_get_path(SYS_PATH));
@ -64,10 +63,10 @@ foreach ($files as $file) {
// Compare defined terms VS used terms. Used terms should be smaller than
// defined terms, and this should prove the concept that there are much
// more variables than what we really use
if (count($used_terms)<1) {
die("No used terms<br />\n");
if (count($used_terms)<1) {
die("No used terms<br />\n");
} else {
echo "The following terms were defined but never used: <br />\n<table>";
echo "The following terms were defined but never used: <br />\n<table>";
}
$i = 1;
foreach ($defined_terms as $term => $file) {
@ -96,7 +95,7 @@ function get_all_php_files($base_path) {
if ($sub == '.php' or $sub == '.tpl') {
$files[] = $base_path.$item;
}
}
}
}
$list = null;
return $files;

@ -21,12 +21,6 @@ api_protect_course_script(true);
$show=(isset($_GET['show']) && $_GET['show'] == 'result')?'result':'test'; // moved down to fix bug: http://www.dokeos.com/forum/viewtopic.php?p=18609#18609
/**
* Libraries
*/
require_once api_get_path(LIBRARY_PATH).'document.lib.php';
/* Constants and variables */
$is_allowedToEdit = api_is_allowed_to_edit(null,true);
$is_tutor = api_is_allowed_to_edit(true);

@ -146,7 +146,7 @@ $table_content = '';
/* Make a special case for IE, which doesn't seem to be able to handle the
* results popup -> send it to the full results page */
require_once api_get_path(LIBRARY_PATH).'browser/Browser.php';
$browser = new Browser();
$current_browser = $browser->getBrowser();
$url_suffix = '';

@ -8,7 +8,6 @@
*/
require_once '../global.inc.php';
require_once api_get_path(LIBRARY_PATH).'document.lib.php';
require_once api_get_path(SYS_CODE_PATH) . 'forum/forumfunction.inc.php';
// First, protect this script

@ -1,7 +1,7 @@
<?php
/* For licensing terms, see /license.txt */
require_once '../global.inc.php';
require_once api_get_path(LIBRARY_PATH).'timeline.lib.php';
$timeline = new Timeline();
@ -16,4 +16,4 @@ switch ($action) {
echo '</pre>';
var_dump($items);*/
break;
}
}

@ -99,7 +99,8 @@ require_once __DIR__.'/../../vendor/autoload.php';
$libraryPath = api_get_path(LIBRARY_PATH);
// @todo convert this libs in classes
require_once $libraryPath.'database.lib.php';
require_once $libraryPath.'database.constants.inc.php';
require_once $libraryPath.'text.lib.php';
require_once $libraryPath.'array.lib.php';
require_once $libraryPath.'online.inc.php';
@ -365,7 +366,6 @@ if (!empty($_POST['language_list'])) {
}
if (empty($user_language) && !empty($_SERVER['HTTP_ACCEPT_LANGUAGE']) && !isset($_SESSION['_user'])) {
require_once __DIR__.'/../admin/sub_language.class.php';
$l = subLanguageManager::getLanguageFromBrowserPreference($_SERVER['HTTP_ACCEPT_LANGUAGE']);
if (!empty($l)) {
$user_language = $browser_language = $l;
@ -378,7 +378,6 @@ $langpath = api_get_path(SYS_LANG_PATH);
/* This will only work if we are in the page to edit a sub_language */
if (isset($this_script) && $this_script == 'sub_language') {
require_once '../admin/sub_language.class.php';
// getting the arrays of files i.e notification, trad4all, etc
$language_files_to_load = SubLanguageManager:: get_lang_folder_files_list(api_get_path(SYS_LANG_PATH).'english', true);
//getting parent info
@ -515,7 +514,6 @@ if (isset($language_file)) {
if (is_array($language_files)) {
// if the sub-language feature is on
if (api_get_setting('allow_use_sub_language') == 'true') {
require_once api_get_path(SYS_CODE_PATH).'admin/sub_language.class.php';
$parent_path = SubLanguageManager::get_parent_language_path($language_interface);
foreach ($language_files as $index => $language_file) {
// include English

@ -512,6 +512,10 @@ define('TEACHER_HTML', 3);
define('STUDENT_HTML_FULLPAGE', 4);
define('TEACHER_HTML_FULLPAGE', 5);
// Timeline
define('TIMELINE_STATUS_ACTIVE', '1');
define('TIMELINE_STATUS_INACTIVE', '2');
/**
* Inclusion of internationalization libraries
*/

@ -1,9 +1,5 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Constants definition
*/
require_once 'database.constants.inc.php';
/**
* Class Database

@ -445,10 +445,6 @@ EOT;
return;
}
if (!class_exists('xajax')) {
require_once api_get_path(LIBRARY_PATH) . 'xajax/xajax.inc.php';
}
$xajax_upload = new xajax(api_get_path(WEB_LIBRARY_PATH) . 'upload.xajax.php');
$xajax_upload->registerFunction('updateProgress');

@ -190,7 +190,6 @@ function get_lang($variable, $reserved = null, $language = null) {
if (isset($language_files)) {
$parent_language = null;
if (api_get_setting('allow_use_sub_language') == 'true') {
require_once api_get_path(SYS_CODE_PATH).'admin/sub_language.class.php';
$parent_language = SubLanguageManager::get_parent_language_path($language);
}
if (!is_array($language_files)) {

@ -1,38 +1,33 @@
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* The action for a 'back' button of wizard-type multipage form.
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category HTML
* @package HTML_QuickForm_Controller
* @author Alexey Borzov <avb@php.net>
* @copyright 2003-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version SVN: $Id: Back.php 289084 2009-10-02 06:53:09Z avb $
* @link http://pear.php.net/package/HTML_QuickForm_Controller
*/
/**
* Class representing an action to perform on HTTP request.
*/
require_once 'HTML/QuickForm/Action.php';
/**
* The action for a 'back' button of wizard-type multipage form.
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category HTML
* @package HTML_QuickForm_Controller
* @author Alexey Borzov <avb@php.net>
* @copyright 2003-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version SVN: $Id: Back.php 289084 2009-10-02 06:53:09Z avb $
* @link http://pear.php.net/package/HTML_QuickForm_Controller
*/
/**
* The action for a 'back' button of wizard-type multipage form.
*
* @category HTML
* @package HTML_QuickForm_Controller
* @author Alexey Borzov <avb@php.net>
* @version Release: 1.0.10
* @category HTML
* @package HTML_QuickForm_Controller
* @author Alexey Borzov <avb@php.net>
* @version Release: 1.0.10
*/
class HTML_QuickForm_Action_Back extends HTML_QuickForm_Action
{
@ -44,10 +39,10 @@ class HTML_QuickForm_Action_Back extends HTML_QuickForm_Action
$data =& $page->controller->container();
$data['values'][$pageName] = $page->exportValues();
if (!$page->controller->isModal()) {
if (PEAR::isError($valid = $page->validate())) {
return $valid;
}
$data['valid'][$pageName] = $valid;
if (PEAR::isError($valid = $page->validate())) {
return $valid;
}
$data['valid'][$pageName] = $valid;
}
// get the previous page and go to it

@ -1,6 +1,6 @@
<?php
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* This action allows to go to a specific page of a multipage form.
*
@ -22,41 +22,36 @@
*/
/**
* Class representing an action to perform on HTTP request.
*/
require_once 'HTML/QuickForm/Action.php';
/**
* This action allows to go to a specific page of a multipage form.
*
* Please note that the name for this action in addAction() should NOT be
* 'direct', but the name of the page you wish to go to.
*
* This action allows to go to a specific page of a multipage form.
*
* Please note that the name for this action in addAction() should NOT be
* 'direct', but the name of the page you wish to go to.
*
* @category HTML
* @package HTML_QuickForm_Controller
* @author Alexey Borzov <avb@php.net>
* @version Release: 1.0.10
*/
class HTML_QuickForm_Action_Direct extends HTML_QuickForm_Action
{
function perform(&$page, $actionName)
{
// save the form values and validation status to the session
$page->isFormBuilt() or $page->buildForm();
$pageName = $page->getAttribute('id');
$data =& $page->controller->container();
$data['values'][$pageName] = $page->exportValues();
*/
class HTML_QuickForm_Action_Direct extends HTML_QuickForm_Action
{
function perform(&$page, $actionName)
{
// save the form values and validation status to the session
$page->isFormBuilt() or $page->buildForm();
$pageName = $page->getAttribute('id');
$data =& $page->controller->container();
$data['values'][$pageName] = $page->exportValues();
if (PEAR::isError($valid = $page->validate())) {
return $valid;
}
$data['valid'][$pageName] = $valid;
$target =& $page->controller->getPage($actionName);
if (PEAR::isError($target)) {
return $target;
} else {
return $target->handle('jump');
}
}
}
?>
$target =& $page->controller->getPage($actionName);
if (PEAR::isError($target)) {
return $target;
} else {
return $target->handle('jump');
}
}
}
?>

@ -1,6 +1,6 @@
<?php
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* This action performs HTTP redirect to a specific page.
*
@ -22,20 +22,15 @@
*/
/**
* Class representing an action to perform on HTTP request.
*/
require_once 'HTML/QuickForm/Action.php';
/**
* This action performs HTTP redirect to a specific page.
*
*
* @category HTML
* @package HTML_QuickForm_Controller
* @author Alexey Borzov <avb@php.net>
* @version Release: 1.0.10
*/
class HTML_QuickForm_Action_Jump extends HTML_QuickForm_Action
{
*/
class HTML_QuickForm_Action_Jump extends HTML_QuickForm_Action
{
/**
* Splits (part of) the URI into path and query components
*
@ -130,33 +125,33 @@ class HTML_QuickForm_Action_Jump extends HTML_QuickForm_Action
}
}
function perform(&$page, $actionName)
{
// check whether the page is valid before trying to go to it
if ($page->controller->isModal()) {
// we check whether *all* pages up to current are valid
// if there is an invalid page we go to it, instead of the
// requested one
$pageName = $page->getAttribute('id');
if (!$page->controller->isValid($pageName)) {
$pageName = $page->controller->findInvalid();
}
$current =& $page->controller->getPage($pageName);
} else {
$current =& $page;
}
// generate the URL for the page 'display' event and redirect to it
$action = $current->getAttribute('action');
function perform(&$page, $actionName)
{
// check whether the page is valid before trying to go to it
if ($page->controller->isModal()) {
// we check whether *all* pages up to current are valid
// if there is an invalid page we go to it, instead of the
// requested one
$pageName = $page->getAttribute('id');
if (!$page->controller->isValid($pageName)) {
$pageName = $page->controller->findInvalid();
}
$current =& $page->controller->getPage($pageName);
} else {
$current =& $page;
}
// generate the URL for the page 'display' event and redirect to it
$action = $current->getAttribute('action');
// Bug #13087: RFC 2616 requires an absolute URI in Location header
if (!preg_match('!^https?://!i', $action)) {
$action = $this->_resolveRelativeURL($action);
}
$url = $action . (false === strpos($action, '?')? '?': '&') .
$current->getButtonName('display') . '=true' .
$url = $action . (false === strpos($action, '?')? '?': '&') .
$current->getButtonName('display') . '=true' .
((!defined('SID') || '' == SID || ini_get('session.use_only_cookies'))? '': '&' . SID);
header('Location: ' . $url);
exit;
}
}
?>
header('Location: ' . $url);
exit;
}
}
?>

@ -1,38 +1,33 @@
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* The action for a 'next' button of wizard-type multipage form.
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category HTML
* @package HTML_QuickForm_Controller
* @author Alexey Borzov <avb@php.net>
* @copyright 2003-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version SVN: $Id: Next.php 289084 2009-10-02 06:53:09Z avb $
* @link http://pear.php.net/package/HTML_QuickForm_Controller
*/
/**
* Class representing an action to perform on HTTP request.
*/
require_once 'HTML/QuickForm/Action.php';
/**
* The action for a 'next' button of wizard-type multipage form.
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category HTML
* @package HTML_QuickForm_Controller
* @author Alexey Borzov <avb@php.net>
* @copyright 2003-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version SVN: $Id: Next.php 289084 2009-10-02 06:53:09Z avb $
* @link http://pear.php.net/package/HTML_QuickForm_Controller
*/
/**
* The action for a 'next' button of wizard-type multipage form.
*
* @category HTML
* @package HTML_QuickForm_Controller
* @author Alexey Borzov <avb@php.net>
* @version Release: 1.0.10
* @category HTML
* @package HTML_QuickForm_Controller
* @author Alexey Borzov <avb@php.net>
* @version Release: 1.0.10
*/
class HTML_QuickForm_Action_Next extends HTML_QuickForm_Action
{
@ -43,10 +38,10 @@ class HTML_QuickForm_Action_Next extends HTML_QuickForm_Action
$pageName = $page->getAttribute('id');
$data =& $page->controller->container();
$data['values'][$pageName] = $page->exportValues();
if (PEAR::isError($valid = $page->validate())) {
return $valid;
}
$data['valid'][$pageName] = $valid;
if (PEAR::isError($valid = $page->validate())) {
return $valid;
}
$data['valid'][$pageName] = $valid;
// Modal form and page is invalid: don't go further
if ($page->controller->isModal() && !$data['valid'][$pageName]) {

@ -1,38 +1,33 @@
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* The action for a 'submit' button.
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category HTML
* @package HTML_QuickForm_Controller
* @author Alexey Borzov <avb@php.net>
* @copyright 2003-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version SVN: $Id: Submit.php 289084 2009-10-02 06:53:09Z avb $
* @link http://pear.php.net/package/HTML_QuickForm_Controller
*/
/**
* Class representing an action to perform on HTTP request.
*/
require_once 'HTML/QuickForm/Action.php';
/**
* The action for a 'submit' button.
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category HTML
* @package HTML_QuickForm_Controller
* @author Alexey Borzov <avb@php.net>
* @copyright 2003-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version SVN: $Id: Submit.php 289084 2009-10-02 06:53:09Z avb $
* @link http://pear.php.net/package/HTML_QuickForm_Controller
*/
/**
* The action for a 'submit' button.
*
* @category HTML
* @package HTML_QuickForm_Controller
* @author Alexey Borzov <avb@php.net>
* @version Release: 1.0.10
* @category HTML
* @package HTML_QuickForm_Controller
* @author Alexey Borzov <avb@php.net>
* @version Release: 1.0.10
*/
class HTML_QuickForm_Action_Submit extends HTML_QuickForm_Action
{
@ -43,10 +38,10 @@ class HTML_QuickForm_Action_Submit extends HTML_QuickForm_Action
$pageName = $page->getAttribute('id');
$data =& $page->controller->container();
$data['values'][$pageName] = $page->exportValues();
if (PEAR::isError($valid = $page->validate())) {
return $valid;
}
$data['valid'][$pageName] = $valid;
if (PEAR::isError($valid = $page->validate())) {
return $valid;
}
$data['valid'][$pageName] = $valid;
// All pages are valid, process
if ($page->controller->isValid()) {
@ -73,4 +68,4 @@ class HTML_QuickForm_Action_Submit extends HTML_QuickForm_Action
}
}
?>
?>

@ -51,12 +51,6 @@
* @link http://pear.php.net/package/HTML_QuickForm_CAPTCHA
*/
/**
* Required packages
*/
require_once 'HTML/QuickForm/input.php';
require_once 'Text/CAPTCHA.php';
/**
* Common class for HTML_QuickForm elements to display a CAPTCHA
*
@ -259,10 +253,3 @@ class HTML_QuickForm_CAPTCHA extends HTML_QuickForm_input
return $html;
}
}
/**
* Register the rule with QuickForm
*/
require_once 'HTML/QuickForm/Rule/CAPTCHA.php';
?>

@ -21,12 +21,6 @@
* @link http://pear.php.net/package/HTML_QuickForm_CAPTCHA
*/
/**
* Required packages
*/
require_once 'HTML/QuickForm/CAPTCHA.php';
require_once 'Text/CAPTCHA/Driver/Equation.php';
/**
* Element for HTML_QuickForm to display a CAPTCHA equation question
*
@ -90,4 +84,4 @@ if (class_exists('HTML_QuickForm')) {
'HTML_QuickForm_CAPTCHA_Equation');
}
?>
?>

@ -21,12 +21,6 @@
* @link http://pear.php.net/package/HTML_QuickForm_CAPTCHA
*/
/**
* Required packages
*/
require_once 'HTML/QuickForm/CAPTCHA.php';
require_once 'Text/CAPTCHA/Driver/Figlet.php';
/**
* Element for HTML_QuickForm to display a CAPTCHA figlet
*
@ -123,4 +117,4 @@ if (class_exists('HTML_QuickForm')) {
'HTML_QuickForm_CAPTCHA_Figlet');
}
?>
?>

@ -21,12 +21,6 @@
* @link http://pear.php.net/package/HTML_QuickForm_CAPTCHA
*/
/**
* Required packages
*/
require_once 'HTML/QuickForm/CAPTCHA.php';
require_once 'Text/CAPTCHA/Driver/Image.php';
/**
* Element for HTML_QuickForm to display a CAPTCHA image
*

@ -21,12 +21,6 @@
* @link http://pear.php.net/package/HTML_QuickForm_CAPTCHA
*/
/**
* Required packages
*/
require_once 'HTML/QuickForm/CAPTCHA.php';
require_once 'Text/CAPTCHA/Driver/Word.php';
/**
* Element for HTML_QuickForm to display a CAPTCHA "word" question
*
@ -87,4 +81,4 @@ if (class_exists('HTML_QuickForm')) {
'HTML/QuickForm/CAPTCHA/Word.php', 'HTML_QuickForm_CAPTCHA_Word');
}
?>
?>

@ -1,31 +1,27 @@
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* The class representing a Controller of MVC design pattern.
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category HTML
* @package HTML_QuickForm_Controller
* @author Alexey Borzov <avb@php.net>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @copyright 2003-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version SVN: $Id: Controller.php 289084 2009-10-02 06:53:09Z avb $
* @link http://pear.php.net/package/HTML_QuickForm_Controller
*/
/**
* The class representing a page of a multipage form.
*/
require_once 'HTML/QuickForm/Page.php';
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* The class representing a Controller of MVC design pattern.
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category HTML
* @package HTML_QuickForm_Controller
* @author Alexey Borzov <avb@php.net>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @copyright 2003-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version SVN: $Id: Controller.php 289084 2009-10-02 06:53:09Z avb $
* @link http://pear.php.net/package/HTML_QuickForm_Controller
*/
/**
* The class representing a Controller of MVC design pattern.
@ -36,11 +32,11 @@ require_once 'HTML/QuickForm/Page.php';
*
* Generally you don't need to subclass this.
*
* @category HTML
* @package HTML_QuickForm_Controller
* @author Alexey Borzov <avb@php.net>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @version Release: 1.0.10
* @category HTML
* @package HTML_QuickForm_Controller
* @author Alexey Borzov <avb@php.net>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @version Release: 1.0.10
*/
class HTML_QuickForm_Controller
{
@ -132,7 +128,7 @@ class HTML_QuickForm_Controller
* to the page's handle() method.
*
* @access public
* @throws PEAR_Error
* @throws PEAR_Error
*/
function run()
{
@ -146,8 +142,8 @@ class HTML_QuickForm_Controller
* Registers a handler for a specific action.
*
* @access public
* @param string name of the action
* @param HTML_QuickForm_Action the handler for the action
* @param string name of the action
* @param HTML_QuickForm_Action the handler for the action
*/
function addAction($actionName, &$action)
{
@ -159,7 +155,7 @@ class HTML_QuickForm_Controller
* Adds a new page to the form
*
* @access public
* @param HTML_QuickForm_Page
* @param HTML_QuickForm_Page
*/
function addPage(&$page)
{
@ -172,9 +168,9 @@ class HTML_QuickForm_Controller
* Returns a page
*
* @access public
* @param string Name of a page
* @return HTML_QuickForm_Page A reference to the page
* @throws PEAR_Error
* @param string Name of a page
* @return HTML_QuickForm_Page A reference to the page
* @throws PEAR_Error
*/
function &getPage($pageName)
{
@ -193,9 +189,9 @@ class HTML_QuickForm_Controller
* for common actions, if specific ones were not added.
*
* @access public
* @param HTML_QuickForm_Page The page that failed to handle the action
* @param string Name of the action
* @throws PEAR_Error
* @param HTML_QuickForm_Page The page that failed to handle the action
* @param string Name of the action
* @throws PEAR_Error
*/
function handle(&$page, $actionName)
{
@ -237,7 +233,7 @@ class HTML_QuickForm_Controller
* @access public
* @param string If set, check only the pages before (not including) that page
* @return bool
* @throws PEAR_Error
* @throws PEAR_Error
*/
function isValid($pageName = null)
{
@ -250,11 +246,11 @@ class HTML_QuickForm_Controller
// seen a page of a non-modal multipage form
if (!$this->isModal() && null === $data['valid'][$key]) {
$page =& $this->_pages[$key];
// Fix for bug #8687: the unseen page was considered
// submitted, so defaults for checkboxes and multiselects
// were not used. Shouldn't break anything since this flag
// will be reset right below in loadValues().
$page->_flagSubmitted = false;
// Fix for bug #8687: the unseen page was considered
// submitted, so defaults for checkboxes and multiselects
// were not used. Shouldn't break anything since this flag
// will be reset right below in loadValues().
$page->_flagSubmitted = false;
// Use controller's defaults and constants, if present
$this->applyDefaults($key);
$page->isFormBuilt() or $page->BuildForm();
@ -262,11 +258,11 @@ class HTML_QuickForm_Controller
$data['values'][$key] = $page->exportValues();
$page->loadValues($data['values'][$key]);
// Is the page now valid?
if (PEAR::isError($valid = $page->validate())) {
return $valid;
}
$data['valid'][$key] = $valid;
if (true === $valid) {
if (PEAR::isError($valid = $page->validate())) {
return $valid;
}
$data['valid'][$key] = $valid;
if (true === $valid) {
continue;
}
}

@ -1,44 +1,39 @@
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* Class representing a page of a multipage form.
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category HTML
* @package HTML_QuickForm_Controller
* @author Alexey Borzov <avb@php.net>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @copyright 2003-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version SVN: $Id: Page.php 289084 2009-10-02 06:53:09Z avb $
* @link http://pear.php.net/package/HTML_QuickForm_Controller
*/
/**
* Create, validate and process HTML forms
*/
require_once 'HTML/QuickForm.php';
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* Class representing a page of a multipage form.
* Class representing a page of a multipage form.
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category HTML
* @package HTML_QuickForm_Controller
* @author Alexey Borzov <avb@php.net>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @copyright 2003-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version SVN: $Id: Page.php 289084 2009-10-02 06:53:09Z avb $
* @link http://pear.php.net/package/HTML_QuickForm_Controller
*/
/**
* Class representing a page of a multipage form.
*
* Generally you'll need to subclass this and define your buildForm()
* method that will build the form. While it is also possible to instantiate
* this class and build the form manually, this is not the recommended way.
*
* @category HTML
* @package HTML_QuickForm_Controller
* @author Alexey Borzov <avb@php.net>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @version Release: 1.0.10
* @category HTML
* @package HTML_QuickForm_Controller
* @author Alexey Borzov <avb@php.net>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @version Release: 1.0.10
*/
class HTML_QuickForm_Page extends HTML_QuickForm
{
@ -50,8 +45,8 @@ class HTML_QuickForm_Page extends HTML_QuickForm
/**
* Contains a reference to a Controller object containing this page
* @var HTML_QuickForm_Controller
* @access public
* @var HTML_QuickForm_Controller
* @access public
*/
var $controller = null;
@ -66,7 +61,7 @@ class HTML_QuickForm_Page extends HTML_QuickForm
*
* @access public
*/
function HTML_QuickForm_Page($formName, $method = 'post', $target = '', $attributes = null)
function HTML_QuickForm_Page($formName, $method = 'post', $target = '', $attributes = null)
{
$this->HTML_QuickForm($formName, $method, '', $target, $attributes);
}
@ -76,8 +71,8 @@ class HTML_QuickForm_Page extends HTML_QuickForm
* Registers a handler for a specific action.
*
* @access public
* @param string name of the action
* @param HTML_QuickForm_Action the handler for the action
* @param string name of the action
* @param HTML_QuickForm_Action the handler for the action
*/
function addAction($actionName, &$action)
{
@ -93,7 +88,7 @@ class HTML_QuickForm_Page extends HTML_QuickForm
*
* @access public
* @param string Name of the action
* @throws PEAR_Error
* @throws PEAR_Error
*/
function handle($actionName)
{
@ -128,7 +123,7 @@ class HTML_QuickForm_Page extends HTML_QuickForm
*/
function loadValues($values)
{
$this->_flagSubmitted = true;
$this->_flagSubmitted = true;
$this->_submitValues = $values;
foreach (array_keys($this->_elements) as $key) {
$this->_elements[$key]->onQuickFormEvent('updateValue', null, $this);
@ -185,26 +180,26 @@ class HTML_QuickForm_Page extends HTML_QuickForm
$this->addElement('hidden', '_qf_default', $this->getAttribute('id') . ':' . $actionName);
}
}
/**
* Returns 'safe' elements' values
*
* @param mixed Array/string of element names, whose values we want. If not set then return all elements.
* @param bool Whether to remove internal (_qf_...) values from the resultant array
*/
function exportValues($elementList = null, $filterInternal = false)
{
$values = parent::exportValues($elementList);
if ($filterInternal) {
foreach (array_keys($values) as $key) {
if (0 === strpos($key, '_qf_')) {
unset($values[$key]);
}
}
}
return $values;
}
/**
* Returns 'safe' elements' values
*
* @param mixed Array/string of element names, whose values we want. If not set then return all elements.
* @param bool Whether to remove internal (_qf_...) values from the resultant array
*/
function exportValues($elementList = null, $filterInternal = false)
{
$values = parent::exportValues($elementList);
if ($filterInternal) {
foreach (array_keys($values) as $key) {
if (0 === strpos($key, '_qf_')) {
unset($values[$key]);
}
}
}
return $values;
}
}
?>

@ -1,41 +1,36 @@
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* A concrete renderer for HTML_QuickForm, makes an array of form contents
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category HTML
* @package HTML_QuickForm
* @author Alexey Borzov <avb@php.net>
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @author Thomas Schulz <ths@4bconsult.de>
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id: Array.php,v 1.11 2009/04/04 21:34:04 avb Exp $
* @link http://pear.php.net/package/HTML_QuickForm
*/
/**
* An abstract base class for QuickForm renderers
*/
require_once 'HTML/QuickForm/Renderer.php';
/**
* A concrete renderer for HTML_QuickForm, makes an array of form contents
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category HTML
* @package HTML_QuickForm
* @author Alexey Borzov <avb@php.net>
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @author Thomas Schulz <ths@4bconsult.de>
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id: Array.php,v 1.11 2009/04/04 21:34:04 avb Exp $
* @link http://pear.php.net/package/HTML_QuickForm
*/
/**
* A concrete renderer for HTML_QuickForm, makes an array of form contents
*
* Based on old HTML_QuickForm::toArray() code.
* Based on old HTML_QuickForm::toArray() code.
*
* The form array structure is the following:
* <pre>
* <pre>
* array(
* 'frozen' => 'whether the form is frozen',
* 'javascript' => 'javascript for client-side validation',
@ -78,10 +73,10 @@ require_once 'HTML/QuickForm/Renderer.php';
* )
* )
* );
* </pre>
* </pre>
*
* where element_i is an array of the form:
* <pre>
* <pre>
* array(
* 'name' => 'element name',
* 'value' => 'element value',
@ -101,22 +96,22 @@ require_once 'HTML/QuickForm/Renderer.php';
* element_N
* )
* );
* </pre>
* </pre>
*
* @category HTML
* @package HTML_QuickForm
* @author Alexey Borzov <avb@php.net>
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @author Thomas Schulz <ths@4bconsult.de>
* @version Release: 3.2.11
* @since 3.0
* @category HTML
* @package HTML_QuickForm
* @author Alexey Borzov <avb@php.net>
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @author Thomas Schulz <ths@4bconsult.de>
* @version Release: 3.2.11
* @since 3.0
*/
class HTML_QuickForm_Renderer_Array extends HTML_QuickForm_Renderer
{
/**#@+
* @access private
*/
/**#@+
* @access private
*/
/**
* An array being generated
* @var array
@ -158,8 +153,8 @@ class HTML_QuickForm_Renderer_Array extends HTML_QuickForm_Renderer
* false: leave labels as defined
* @var bool
*/
var $_staticLabels = false;
/**#@-*/
var $_staticLabels = false;
/**#@-*/
/**
* Constructor
@ -256,9 +251,9 @@ class HTML_QuickForm_Renderer_Array extends HTML_QuickForm_Renderer
* Creates an array representing an element
*
* @access private
* @param HTML_QuickForm_element element being processed
* @param bool Whether an element is required
* @param string Error associated with the element
* @param HTML_QuickForm_element element being processed
* @param bool Whether an element is required
* @param string Error associated with the element
* @return array
*/
function _elementToArray(&$element, $required, $error)
@ -337,4 +332,4 @@ class HTML_QuickForm_Renderer_Array extends HTML_QuickForm_Renderer
}
}
}
?>
?>

@ -1,42 +1,37 @@
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* A static renderer for HTML_QuickForm, makes an array of form content
* useful for a Smarty template
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category HTML
* @package HTML_QuickForm
* @author Alexey Borzov <avb@php.net>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @author Thomas Schulz <ths@4bconsult.de>
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id: ArraySmarty.php,v 1.14 2009/04/06 12:02:08 avb Exp $
* @link http://pear.php.net/package/HTML_QuickForm
*/
/**
* A concrete renderer for HTML_QuickForm, makes an array of form contents
*/
require_once 'HTML/QuickForm/Renderer/Array.php';
/**
* A static renderer for HTML_QuickForm, makes an array of form content
* useful for a Smarty template
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category HTML
* @package HTML_QuickForm
* @author Alexey Borzov <avb@php.net>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @author Thomas Schulz <ths@4bconsult.de>
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id: ArraySmarty.php,v 1.14 2009/04/06 12:02:08 avb Exp $
* @link http://pear.php.net/package/HTML_QuickForm
*/
/**
* A static renderer for HTML_QuickForm, makes an array of form content
* useful for a Smarty template
* useful for a Smarty template
*
* Based on old HTML_QuickForm::toArray() code and ITStatic renderer.
* Based on old HTML_QuickForm::toArray() code and ITStatic renderer.
*
* The form array structure is the following:
* <pre>
* <pre>
* Array (
* [frozen] => whether the complete form is frozen'
* [javascript] => javascript for client-side validation
@ -60,10 +55,10 @@ require_once 'HTML/QuickForm/Renderer/Array.php';
* [1st_element_name] => Array for the 1st element
* ...
* [nth_element_name] => Array for the nth element
* </pre>
* </pre>
*
* where an element array has the form:
* <pre>
* where an element array has the form:
* <pre>
* (
* [name] => element name
* [value] => element value,
@ -80,21 +75,21 @@ require_once 'HTML/QuickForm/Renderer/Array.php';
* [nth_gitem_name] => Array for the nth element in group
* )
* )
* </pre>
* </pre>
*
* @category HTML
* @package HTML_QuickForm
* @author Alexey Borzov <avb@php.net>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @author Thomas Schulz <ths@4bconsult.de>
* @version Release: 3.2.11
* @since 3.0
* @category HTML
* @package HTML_QuickForm
* @author Alexey Borzov <avb@php.net>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @author Thomas Schulz <ths@4bconsult.de>
* @version Release: 3.2.11
* @since 3.0
*/
class HTML_QuickForm_Renderer_ArraySmarty extends HTML_QuickForm_Renderer_Array
{
/**#@+
* @access private
*/
/**#@+
* @access private
*/
/**
* The Smarty template engine instance
* @var object
@ -126,26 +121,26 @@ class HTML_QuickForm_Renderer_ArraySmarty extends HTML_QuickForm_Renderer_Array
* @see setErrorTemplate()
*/
var $_error = '';
/**#@-*/
/**#@-*/
/**
* Constructor
*
* @param Smarty reference to the Smarty template engine instance
* @param Smarty reference to the Smarty template engine instance
* @param bool true: render an array of labels to many labels, $key 0 to 'label' and the oterh to "label_$key"
* @param bool true: collect all hidden elements into string; false: process them as usual form elements
* @param bool true: collect all hidden elements into string; false: process them as usual form elements
* @access public
*/
function HTML_QuickForm_Renderer_ArraySmarty(&$tpl, $staticLabels = false, $collectHidden = true)
function HTML_QuickForm_Renderer_ArraySmarty(&$tpl, $staticLabels = false, $collectHidden = true)
{
$this->HTML_QuickForm_Renderer_Array($collectHidden, $staticLabels);
$this->HTML_QuickForm_Renderer_Array($collectHidden, $staticLabels);
$this->_tpl =& $tpl;
} // end constructor
/**
* Called when visiting a header element
*
* @param HTML_QuickForm_header header element being visited
* @param HTML_QuickForm_header header element being visited
* @access public
* @return void
*/
@ -162,9 +157,9 @@ class HTML_QuickForm_Renderer_ArraySmarty extends HTML_QuickForm_Renderer_Array
/**
* Called when visiting a group, before processing any group elements
*
* @param HTML_QuickForm_group group being visited
* @param bool Whether a group is required
* @param string An error message associated with a group
* @param HTML_QuickForm_group group being visited
* @param bool Whether a group is required
* @param string An error message associated with a group
* @access public
* @return void
*/
@ -179,9 +174,9 @@ class HTML_QuickForm_Renderer_ArraySmarty extends HTML_QuickForm_Renderer_Array
* the key for storing this
*
* @access private
* @param HTML_QuickForm_element form element being visited
* @param bool Whether an element is required
* @param string Error associated with the element
* @param HTML_QuickForm_element form element being visited
* @param bool Whether an element is required
* @param string Error associated with the element
* @return array
*/
function _elementToArray(&$element, $required, $error)
@ -400,4 +395,4 @@ class HTML_QuickForm_Renderer_ArraySmarty extends HTML_QuickForm_Renderer_Array
$this->_error = $template;
} // end func setErrorTemplate
}
?>
?>

@ -23,11 +23,6 @@
* @link http://pear.php.net/package/HTML_QuickForm
*/
/**
* An abstract base class for QuickForm renderers
*/
require_once 'HTML/QuickForm/Renderer.php';
/**
* A concrete renderer for HTML_QuickForm, based on QuickForm 2.x built-in one
*
@ -197,9 +192,9 @@ class HTML_QuickForm_Renderer_Default extends HTML_QuickForm_Renderer
if (!empty($form->_required) && !$form->_freezeAll) {
$this->_html .= str_replace('{requiredNote}', $form->getRequiredNote(), $this->_requiredNoteTemplate);
}
// add form attributes and content
$html = str_replace('{attributes}', $form->getAttributes(true), $this->_formTemplate);
// add form attributes and content
$html = str_replace('{attributes}', $form->getAttributes(true), $this->_formTemplate);
if (strpos($this->_formTemplate, '{hidden}')) {
$html = str_replace('{hidden}', $this->_hiddenHtml, $html);
} else {
@ -389,7 +384,7 @@ class HTML_QuickForm_Renderer_Default extends HTML_QuickForm_Renderer
if (!empty($this->_groupWrap)) {
$html = str_replace('{content}', $html, $this->_groupWrap);
}
$this->_html .= str_replace('{element}', $html, $this->_groupTemplate);
$this->_html .= str_replace('{element}', $html, $this->_groupTemplate);
$this->_inGroup = false;
} // end func finishGroup
@ -461,7 +456,7 @@ class HTML_QuickForm_Renderer_Default extends HTML_QuickForm_Renderer
* @return void
*/
function setFormTemplate($html) {
$this->_formTemplate = $html;
$this->_formTemplate = $html;
} // end func setFormTemplate
/**
@ -490,4 +485,4 @@ class HTML_QuickForm_Renderer_Default extends HTML_QuickForm_Renderer
$this->setRequiredNoteTemplate('');
$this->_templates = array();
} // end func clearAllTemplates
} // end class HTML_QuickForm_Renderer_Default
} // end class HTML_QuickForm_Renderer_Default

@ -1,30 +1,25 @@
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* A concrete renderer for HTML_QuickForm, using Integrated Templates.
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category HTML
* @package HTML_QuickForm
* @author Alexey Borzov <avb@php.net>
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id: ITDynamic.php,v 1.7 2009/04/04 21:34:04 avb Exp $
* @link http://pear.php.net/package/HTML_QuickForm
*/
/**
* An abstract base class for QuickForm renderers
*/
require_once 'HTML/QuickForm/Renderer.php';
/**
* A concrete renderer for HTML_QuickForm, using Integrated Templates.
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category HTML
* @package HTML_QuickForm
* @author Alexey Borzov <avb@php.net>
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id: ITDynamic.php,v 1.7 2009/04/04 21:34:04 avb Exp $
* @link http://pear.php.net/package/HTML_QuickForm
*/
/**
* A concrete renderer for HTML_QuickForm, using Integrated Templates.
@ -37,20 +32,20 @@ require_once 'HTML/QuickForm/Renderer.php';
* special block is not set for an element, the renderer falls back to
* a default one.
*
* @category HTML
* @package HTML_QuickForm
* @author Alexey Borzov <avb@php.net>
* @version Release: 3.2.11
* @since 3.0
* @category HTML
* @package HTML_QuickForm
* @author Alexey Borzov <avb@php.net>
* @version Release: 3.2.11
* @since 3.0
*/
class HTML_QuickForm_Renderer_ITDynamic extends HTML_QuickForm_Renderer
{
/**#@+
* @access private
*/
/**#@+
* @access private
*/
/**
* A template class (HTML_Template_ITX or HTML_Template_Sigma) instance
* @var HTML_Template_ITX|HTML_Template_Sigma
* @var HTML_Template_ITX|HTML_Template_Sigma
*/
var $_tpl = null;
@ -89,13 +84,13 @@ class HTML_QuickForm_Renderer_ITDynamic extends HTML_QuickForm_Renderer
* @var string
*/
var $_headerBlock = null;
/**#@-*/
/**#@-*/
/**
* Constructor
*
* @param HTML_Template_ITX|HTML_Template_Sigma Template object to use
* @param HTML_Template_ITX|HTML_Template_Sigma Template object to use
*/
function HTML_QuickForm_Renderer_ITDynamic(&$tpl)
{
@ -239,7 +234,7 @@ class HTML_QuickForm_Renderer_ITDynamic extends HTML_QuickForm_Renderer
* the names '{prefix}_{element type}' and '{prefix}_{element}', where
* prefix is either 'qf' or the name of the current group's block
*
* @param HTML_QuickForm_element form element being rendered
* @param HTML_QuickForm_element form element being rendered
* @access private
* @return string block name
*/

@ -1,31 +1,26 @@
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* A static renderer for HTML_QuickForm compatible
* with HTML_Template_IT and HTML_Template_Sigma.
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category HTML
* @package HTML_QuickForm
* @author Bertrand Mansion <bmansion@mamasam.com>
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id: ITStatic.php,v 1.9 2009/04/04 21:34:04 avb Exp $
* @link http://pear.php.net/package/HTML_QuickForm
*/
/**
* An abstract base class for QuickForm renderers
*/
require_once 'HTML/QuickForm/Renderer.php';
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* A static renderer for HTML_QuickForm compatible
* with HTML_Template_IT and HTML_Template_Sigma.
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category HTML
* @package HTML_QuickForm
* @author Bertrand Mansion <bmansion@mamasam.com>
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id: ITStatic.php,v 1.9 2009/04/04 21:34:04 avb Exp $
* @link http://pear.php.net/package/HTML_QuickForm
*/
/**
* A static renderer for HTML_QuickForm compatible
@ -35,17 +30,17 @@ require_once 'HTML/QuickForm/Renderer.php';
* every elements and labels in the form to be specified by
* placeholders at the position you want them to be displayed.
*
* @category HTML
* @package HTML_QuickForm
* @author Bertrand Mansion <bmansion@mamasam.com>
* @version Release: 3.2.11
* @since 3.0
* @category HTML
* @package HTML_QuickForm
* @author Bertrand Mansion <bmansion@mamasam.com>
* @version Release: 3.2.11
* @since 3.0
*/
class HTML_QuickForm_Renderer_ITStatic extends HTML_QuickForm_Renderer
{
/**#@+
* @access private
*/
/**#@+
* @access private
*/
/**
* An HTML_Template_IT or some other API compatible Template instance
* @var object
@ -105,12 +100,12 @@ class HTML_QuickForm_Renderer_ITStatic extends HTML_QuickForm_Renderer
* @var string
*/
var $_hidden = '';
/**#@-*/
/**#@-*/
/**
* Constructor
*
* @param HTML_Template_IT|HTML_Template_Sigma Template object to use
* @param HTML_Template_IT|HTML_Template_Sigma Template object to use
*/
function HTML_QuickForm_Renderer_ITStatic(&$tpl)
{
@ -121,7 +116,7 @@ class HTML_QuickForm_Renderer_ITStatic extends HTML_QuickForm_Renderer
/**
* Called when visiting a form, before processing any form elements
*
* @param HTML_QuickForm form object being visited
* @param HTML_QuickForm form object being visited
* @access public
* @return void
*/
@ -140,7 +135,7 @@ class HTML_QuickForm_Renderer_ITStatic extends HTML_QuickForm_Renderer
/**
* Called when visiting a form, after processing all form elements
*
* @param HTML_QuickForm form object being visited
* @param HTML_QuickForm form object being visited
* @access public
* @return void
*/
@ -170,7 +165,7 @@ class HTML_QuickForm_Renderer_ITStatic extends HTML_QuickForm_Renderer
/**
* Called when visiting a header element
*
* @param HTML_QuickForm_header header element being visited
* @param HTML_QuickForm_header header element being visited
* @access public
* @return void
*/
@ -189,9 +184,9 @@ class HTML_QuickForm_Renderer_ITStatic extends HTML_QuickForm_Renderer
/**
* Called when visiting an element
*
* @param HTML_QuickForm_element form element being visited
* @param bool Whether an element is required
* @param string An error message associated with an element
* @param HTML_QuickForm_element form element being visited
* @param bool Whether an element is required
* @param string An error message associated with an element
* @access public
* @return void
*/
@ -265,7 +260,7 @@ class HTML_QuickForm_Renderer_ITStatic extends HTML_QuickForm_Renderer
/**
* Called when visiting a hidden element
*
* @param HTML_QuickForm_element hidden element being visited
* @param HTML_QuickForm_element hidden element being visited
* @access public
* @return void
*/
@ -283,9 +278,9 @@ class HTML_QuickForm_Renderer_ITStatic extends HTML_QuickForm_Renderer
/**
* Called when visiting a group, before processing any group elements
*
* @param HTML_QuickForm_group group being visited
* @param bool Whether a group is required
* @param string An error message associated with a group
* @param HTML_QuickForm_group group being visited
* @param bool Whether a group is required
* @param string An error message associated with a group
* @access public
* @return void
*/
@ -336,7 +331,7 @@ class HTML_QuickForm_Renderer_ITStatic extends HTML_QuickForm_Renderer
/**
* Called when visiting a group, after processing all group elements
*
* @param HTML_QuickForm_group group being visited
* @param HTML_QuickForm_group group being visited
* @access public
* @return void
*/
@ -501,4 +496,4 @@ class HTML_QuickForm_Renderer_ITStatic extends HTML_QuickForm_Renderer
return $ret;
}
} // end class HTML_QuickForm_Renderer_ITStatic
?>
?>

@ -1,50 +1,45 @@
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* A concrete renderer for HTML_QuickForm, makes an object from form contents
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category HTML
* @package HTML_QuickForm
* @author Ron McClain <ron@humaniq.com>
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id: Object.php,v 1.6 2009/04/04 21:34:04 avb Exp $
* @link http://pear.php.net/package/HTML_QuickForm
*/
/**
* An abstract base class for QuickForm renderers
*/
require_once 'HTML/QuickForm/Renderer.php';
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* A concrete renderer for HTML_QuickForm, makes an object from form contents
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category HTML
* @package HTML_QuickForm
* @author Ron McClain <ron@humaniq.com>
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id: Object.php,v 1.6 2009/04/04 21:34:04 avb Exp $
* @link http://pear.php.net/package/HTML_QuickForm
*/
/**
* A concrete renderer for HTML_QuickForm, makes an object from form contents
*
* Based on HTML_Quickform_Renderer_Array code
*
* @category HTML
* @package HTML_QuickForm
* @author Ron McClain <ron@humaniq.com>
* @version Release: 3.2.11
* @since 3.1.1
* @category HTML
* @package HTML_QuickForm
* @author Ron McClain <ron@humaniq.com>
* @version Release: 3.2.11
* @since 3.1.1
*/
class HTML_QuickForm_Renderer_Object extends HTML_QuickForm_Renderer
{
/**#@+
* @access private
*/
/**#@+
* @access private
*/
/**
* The object being generated
* @var QuickformForm
* @var QuickformForm
*/
var $_obj= null;
@ -83,13 +78,13 @@ class HTML_QuickForm_Renderer_Object extends HTML_QuickForm_Renderer
* @var bool $_collectHidden
*/
var $_collectHidden = false;
/**#@-*/
/**#@-*/
/**
* Constructor
*
* @param bool true: collect all hidden elements
* @param bool true: collect all hidden elements
* @access public
*/
function HTML_QuickForm_Renderer_Object($collecthidden = false)
@ -110,7 +105,7 @@ class HTML_QuickForm_Renderer_Object extends HTML_QuickForm_Renderer
/**
* Set the class of the form elements. Defaults to QuickformElement.
* @param string Name of element class
* @param string Name of element class
* @access public
*/
function setElementType($type)
@ -180,7 +175,7 @@ class HTML_QuickForm_Renderer_Object extends HTML_QuickForm_Renderer
* Creates an object representing an element
*
* @access private
* @param HTML_QuickForm_element form element being rendered
* @param HTML_QuickForm_element form element being rendered
* @param required bool Whether an element is required
* @param error string Error associated with the element
* @return object
@ -224,7 +219,7 @@ class HTML_QuickForm_Renderer_Object extends HTML_QuickForm_Renderer
* Stores an object representation of an element in the form array
*
* @access private
* @param QuickformElement Object representation of an element
* @param QuickformElement Object representation of an element
* @return void
*/
function _storeObject($elObj)
@ -256,7 +251,7 @@ class HTML_QuickForm_Renderer_Object extends HTML_QuickForm_Renderer
* Convenience class for the form object passed to outputObject()
*
* Eg.
* <pre>
* <pre>
* {form.outputJavaScript():h}
* {form.outputHeader():h}
* <table>
@ -265,13 +260,13 @@ class HTML_QuickForm_Renderer_Object extends HTML_QuickForm_Renderer
* </tr>
* </table>
* </form>
* </pre>
*
* @category HTML
* @package HTML_QuickForm
* @author Ron McClain <ron@humaniq.com>
* @version Release: 3.2.11
* @since 3.1.1
* </pre>
*
* @category HTML
* @package HTML_QuickForm
* @author Ron McClain <ron@humaniq.com>
* @version Release: 3.2.11
* @since 3.1.1
*/
class QuickformForm
{
@ -351,16 +346,16 @@ class QuickformForm
/**
* Convenience class describing a form element.
*
*
* The properties defined here will be available from
* your flexy templates by referencing
* {form.zip.label:h}, {form.zip.html:h}, etc.
*
* @category HTML
* @package HTML_QuickForm
* @author Ron McClain <ron@humaniq.com>
* @version Release: 3.2.11
* @since 3.1.1
*
* @category HTML
* @package HTML_QuickForm
* @author Ron McClain <ron@humaniq.com>
* @version Release: 3.2.11
* @since 3.1.1
*/
class QuickformElement
{

@ -1,30 +1,25 @@
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* QuickForm renderer for Flexy template engine, static version.
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category HTML
* @package HTML_QuickForm
* @author Ron McClain <ron@humaniq.com>
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id: ObjectFlexy.php,v 1.10 2009/04/04 21:34:04 avb Exp $
* @link http://pear.php.net/package/HTML_QuickForm
*/
/**
* A concrete renderer for HTML_QuickForm, makes an object from form contents
*/
require_once 'HTML/QuickForm/Renderer/Object.php';
/**
* QuickForm renderer for Flexy template engine, static version.
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category HTML
* @package HTML_QuickForm
* @author Ron McClain <ron@humaniq.com>
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id: ObjectFlexy.php,v 1.10 2009/04/04 21:34:04 avb Exp $
* @link http://pear.php.net/package/HTML_QuickForm
*/
/**
* QuickForm renderer for Flexy template engine, static version.
@ -33,7 +28,7 @@ require_once 'HTML/QuickForm/Renderer/Object.php';
* from the form content suitable for use with a Flexy template
*
* Usage:
* <code>
* <code>
* $form =& new HTML_QuickForm('form', 'POST');
* $template =& new HTML_Template_Flexy();
* $renderer =& new HTML_QuickForm_Renderer_ObjectFlexy(&$template);
@ -43,21 +38,21 @@ require_once 'HTML/QuickForm/Renderer/Object.php';
* $view = new StdClass;
* $view->form = $renderer->toObject();
* $template->compile("mytemplate.html");
* </code>
* </code>
*
* Based on the code for HTML_QuickForm_Renderer_ArraySmarty
*
* @category HTML
* @package HTML_QuickForm
* @author Ron McClain <ron@humaniq.com>
* @version Release: 3.2.11
* @since 3.1.1
* @category HTML
* @package HTML_QuickForm
* @author Ron McClain <ron@humaniq.com>
* @version Release: 3.2.11
* @since 3.1.1
*/
class HTML_QuickForm_Renderer_ObjectFlexy extends HTML_QuickForm_Renderer_Object
{
/**#@+
* @access private
*/
/**#@+
* @access private
*/
/**
* HTML_Template_Flexy instance
* @var object $_flexy
@ -96,12 +91,12 @@ class HTML_QuickForm_Renderer_ObjectFlexy extends HTML_QuickForm_Renderer_Object
* @var string $_elementType
*/
var $_elementType = 'QuickformFlexyElement';
/**#@-*/
/**#@-*/
/**
* Constructor
*
* @param HTML_Template_Flexy template object to use
* @param HTML_Template_Flexy template object to use
* @public
*/
function HTML_QuickForm_Renderer_ObjectFlexy(&$flexy)
@ -132,9 +127,9 @@ class HTML_QuickForm_Renderer_ObjectFlexy extends HTML_QuickForm_Renderer_Object
* the key for storing this
*
* @access private
* @param HTML_QuickForm_element form element being rendered
* @param bool Whether an element is required
* @param string Error associated with the element
* @param HTML_QuickForm_element form element being rendered
* @param bool Whether an element is required
* @param string Error associated with the element
* @return object
*/
function _elementToObject(&$element, $required, $error)
@ -194,7 +189,7 @@ class HTML_QuickForm_Renderer_ObjectFlexy extends HTML_QuickForm_Renderer_Object
* QuickformFormObject instance
*
* @access private
* @param QuickformElement Object representation of an element
* @param QuickformElement Object representation of an element
* @return void
*/
function _storeObject($elObj)
@ -216,15 +211,15 @@ class HTML_QuickForm_Renderer_ObjectFlexy extends HTML_QuickForm_Renderer_Object
* In your template, {html} is replaced by the unmodified html.
* If the element is required, {required} will be true.
* Eg.
* <pre>
* <pre>
* {if:error}
* <font color="red" size="1">{error:h}</font><br />
* {end:}
* {html:h}
* </pre>
* </pre>
*
* @access public
* @param string Filename of template
* @param string Filename of template
* @return void
*/
function setHtmlTemplate($template)
@ -238,15 +233,15 @@ class HTML_QuickForm_Renderer_ObjectFlexy extends HTML_QuickForm_Renderer_Object
* {error} will be set to the error, if any. {required} will
* be true if this is a required field
* Eg.
* <pre>
* <pre>
* {if:required}
* <font color="orange" size="1">*</font>
* {end:}
* {label:h}
* </pre>
* </pre>
*
* @access public
* @param string Filename of template
* @param string Filename of template
* @return void
*/
function setLabelTemplate($template)
@ -269,10 +264,10 @@ class HTML_QuickForm_Renderer_ObjectFlexy extends HTML_QuickForm_Renderer_Object
/**
* Adds nothing to QuickformForm, left for backwards compatibility
*
* @category HTML
* @package HTML_QuickForm
* @ignore
*
* @category HTML
* @package HTML_QuickForm
* @ignore
*/
class QuickformFlexyForm extends QuickformForm
{
@ -280,10 +275,10 @@ class QuickformFlexyForm extends QuickformForm
/**
* Adds nothing to QuickformElement, left for backwards compatibility
*
* @category HTML
* @package HTML_QuickForm
* @ignore
*
* @category HTML
* @package HTML_QuickForm
* @ignore
*/
class QuickformFlexyElement extends QuickformElement
{

@ -17,8 +17,6 @@
* @link http://pear.php.net/package/HTML_QuickForm_CAPTCHA
*/
require_once 'HTML/QuickForm/Rule.php';
/**
* Rule to compare a field with a CAPTCHA image
*

@ -1,40 +1,35 @@
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* Validates values using callback functions or methods
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category HTML
* @package HTML_QuickForm
* @author Bertrand Mansion <bmansion@mamasam.com>
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id: Callback.php,v 1.9 2009/04/04 21:34:04 avb Exp $
* @link http://pear.php.net/package/HTML_QuickForm
*/
/**
* Abstract base class for QuickForm validation rules
*/
require_once 'HTML/QuickForm/Rule.php';
/**
* Validates values using callback functions or methods
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category HTML
* @package HTML_QuickForm
* @author Bertrand Mansion <bmansion@mamasam.com>
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id: Callback.php,v 1.9 2009/04/04 21:34:04 avb Exp $
* @link http://pear.php.net/package/HTML_QuickForm
*/
/**
* Validates values using callback functions or methods
*
* @category HTML
* @package HTML_QuickForm
* @author Bertrand Mansion <bmansion@mamasam.com>
* @version Release: 3.2.11
* @since 3.2
*/
* Validates values using callback functions or methods
*
* @category HTML
* @package HTML_QuickForm
* @author Bertrand Mansion <bmansion@mamasam.com>
* @version Release: 3.2.11
* @since 3.2
*/
class HTML_QuickForm_Rule_Callback extends HTML_QuickForm_Rule
{
/**
@ -121,4 +116,4 @@ class HTML_QuickForm_Rule_Callback extends HTML_QuickForm_Rule
} // end func getValidationScript
} // end class HTML_QuickForm_Rule_Callback
?>
?>

@ -21,11 +21,6 @@
* @link http://pear.php.net/package/HTML_QuickForm
*/
/**
* Abstract base class for QuickForm validation rules
*/
require_once 'HTML/QuickForm/Rule.php';
/**
* Rule to compare two form fields
*

@ -1,13 +1,5 @@
<?php
/* For licensing terms, see /license.txt */
/**
* QuickForm rule to check a date
* @package chamilo.include
*/
/**
* Code
*/
require_once ('HTML/QuickForm/Rule.php');
/**
* QuickForm rule to check a date
* @package chamilo.include
@ -25,4 +17,4 @@ class Html_Quickform_Rule_Date extends HTML_QuickForm_Rule
$compareDate = create_function('$a', 'return checkdate($a[\'M\'],$a[\'d\'],$a[\'Y\']);');
return $compareDate($date);
}
}
}

@ -1,40 +1,35 @@
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* Email validation rule
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category HTML
* @package HTML_QuickForm
* @author Bertrand Mansion <bmansion@mamasam.com>
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id: Email.php,v 1.7 2009/04/04 21:34:04 avb Exp $
* @link http://pear.php.net/package/HTML_QuickForm
*/
/**
* Abstract base class for QuickForm validation rules
*/
require_once 'HTML/QuickForm/Rule.php';
/**
* Email validation rule
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category HTML
* @package HTML_QuickForm
* @author Bertrand Mansion <bmansion@mamasam.com>
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id: Email.php,v 1.7 2009/04/04 21:34:04 avb Exp $
* @link http://pear.php.net/package/HTML_QuickForm
*/
/**
* Email validation rule
*
* @category HTML
* @package HTML_QuickForm
* @author Bertrand Mansion <bmansion@mamasam.com>
* @version Release: 3.2.11
* @since 3.2
*/
* Email validation rule
*
* @category HTML
* @package HTML_QuickForm
* @author Bertrand Mansion <bmansion@mamasam.com>
* @version Release: 3.2.11
* @since 3.2
*/
class HTML_QuickForm_Rule_Email extends HTML_QuickForm_Rule
{
var $regex = '/^((\"[^\"\f\n\r\t\v\b]+\")|([\w\!\#\$\%\&\'\*\+\-\~\/\^\`\|\{\}]+(\.[\w\!\#\$\%\&\'\*\+\-\~\/\^\`\|\{\}]+)*))@((\[(((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9])))\])|(((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9])))|((([A-Za-z0-9\-])+\.)+[A-Za-z\-]+))$/';
@ -49,8 +44,8 @@ class HTML_QuickForm_Rule_Email extends HTML_QuickForm_Rule
*/
function validate($email, $checkDomain = false)
{
// Fix for bug #10799: add 'D' modifier to regex
if (preg_match($this->regex . 'D', $email)) {
// Fix for bug #10799: add 'D' modifier to regex
if (preg_match($this->regex . 'D', $email)) {
if ($checkDomain && function_exists('checkdnsrr')) {
$tokens = explode('@', $email);
if (checkdnsrr($tokens[1], 'MX') || checkdnsrr($tokens[1], 'A')) {
@ -70,4 +65,4 @@ class HTML_QuickForm_Rule_Email extends HTML_QuickForm_Rule
} // end func getValidationScript
} // end class HTML_QuickForm_Rule_Email
?>
?>

@ -1,40 +1,35 @@
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* Checks that the length of value is within range
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category HTML
* @package HTML_QuickForm
* @author Bertrand Mansion <bmansion@mamasam.com>
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id: Range.php,v 1.8 2009/04/04 21:34:04 avb Exp $
* @link http://pear.php.net/package/HTML_QuickForm
*/
/**
* Abstract base class for QuickForm validation rules
*/
require_once 'HTML/QuickForm/Rule.php';
/**
* Checks that the length of value is within range
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category HTML
* @package HTML_QuickForm
* @author Bertrand Mansion <bmansion@mamasam.com>
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id: Range.php,v 1.8 2009/04/04 21:34:04 avb Exp $
* @link http://pear.php.net/package/HTML_QuickForm
*/
/**
* Checks that the length of value is within range
*
* @category HTML
* @package HTML_QuickForm
* @author Bertrand Mansion <bmansion@mamasam.com>
* @version Release: 3.2.11
* @since 3.2
*/
* Checks that the length of value is within range
*
* @category HTML
* @package HTML_QuickForm
* @author Bertrand Mansion <bmansion@mamasam.com>
* @version Release: 3.2.11
* @since 3.2
*/
class HTML_QuickForm_Rule_Range extends HTML_QuickForm_Rule
{
/**
@ -75,4 +70,4 @@ class HTML_QuickForm_Rule_Range extends HTML_QuickForm_Rule
} // end func getValidationScript
} // end class HTML_QuickForm_Rule_Range
?>
?>

@ -1,40 +1,35 @@
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* Validates values using regular expressions
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category HTML
* @package HTML_QuickForm
* @author Bertrand Mansion <bmansion@mamasam.com>
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id: Regex.php,v 1.6 2009/04/04 21:34:04 avb Exp $
* @link http://pear.php.net/package/HTML_QuickForm
*/
/**
* Abstract base class for QuickForm validation rules
*/
require_once 'HTML/QuickForm/Rule.php';
/**
* Validates values using regular expressions
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category HTML
* @package HTML_QuickForm
* @author Bertrand Mansion <bmansion@mamasam.com>
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id: Regex.php,v 1.6 2009/04/04 21:34:04 avb Exp $
* @link http://pear.php.net/package/HTML_QuickForm
*/
/**
* Validates values using regular expressions
*
* @category HTML
* @package HTML_QuickForm
* @author Bertrand Mansion <bmansion@mamasam.com>
* @version Release: 3.2.11
* @since 3.2
*/
* Validates values using regular expressions
*
* @category HTML
* @package HTML_QuickForm
* @author Bertrand Mansion <bmansion@mamasam.com>
* @version Release: 3.2.11
* @since 3.2
*/
class HTML_QuickForm_Rule_Regex extends HTML_QuickForm_Rule
{
/**
@ -64,13 +59,13 @@ class HTML_QuickForm_Rule_Regex extends HTML_QuickForm_Rule
*/
function validate($value, $regex = null)
{
// Fix for bug #10799: add 'D' modifier to regex
// Fix for bug #10799: add 'D' modifier to regex
if (isset($this->_data[$this->name])) {
if (!preg_match($this->_data[$this->name] . 'D', $value)) {
if (!preg_match($this->_data[$this->name] . 'D', $value)) {
return false;
}
} else {
if (!preg_match($regex . 'D', $value)) {
if (!preg_match($regex . 'D', $value)) {
return false;
}
}
@ -94,14 +89,14 @@ class HTML_QuickForm_Rule_Regex extends HTML_QuickForm_Rule
{
$regex = isset($this->_data[$this->name]) ? $this->_data[$this->name] : $options;
// bug #12376, converting unicode escapes and stripping 'u' modifier
if ($pos = strpos($regex, 'u', strrpos($regex, '/'))) {
$regex = substr($regex, 0, $pos) . substr($regex, $pos + 1);
$regex = preg_replace('/(?<!\\\\)(?>\\\\\\\\)*\\\\x{([a-fA-F0-9]+)}/', '\\u$1', $regex);
}
// bug #12376, converting unicode escapes and stripping 'u' modifier
if ($pos = strpos($regex, 'u', strrpos($regex, '/'))) {
$regex = substr($regex, 0, $pos) . substr($regex, $pos + 1);
$regex = preg_replace('/(?<!\\\\)(?>\\\\\\\\)*\\\\x{([a-fA-F0-9]+)}/', '\\u$1', $regex);
}
return array(" var regex = " . $regex . ";\n", "{jsVar} != '' && !regex.test({jsVar})");
} // end func getValidationScript
} // end class HTML_QuickForm_Rule_Regex
?>
?>

@ -21,11 +21,6 @@
* @link http://pear.php.net/package/HTML_QuickForm
*/
/**
* Abstract base class for QuickForm validation rules
*/
require_once 'HTML/QuickForm/Rule.php';
/**
* Required elements validation
*

@ -3,7 +3,6 @@
* HTML class for static data
* @example $form->addElement('advanced_settings', '<a href="#">advanced settings</a>');
*/
require_once 'HTML/QuickForm/static.php';
/**
* A pseudo-element used for adding raw HTML to form
@ -34,7 +33,7 @@ class HTML_QuickForm_advanced_settings extends HTML_QuickForm_static
$this->HTML_QuickForm_static(null, null, $text);
$this->_type = 'html';
}
/**
* Accepts a renderer
*
@ -46,8 +45,8 @@ class HTML_QuickForm_advanced_settings extends HTML_QuickForm_static
{
$renderer->renderHtml($this);
} // end func accept
function toHtml() {
return '<div class="control-group ">
<label class="control-label"></label>
@ -55,7 +54,7 @@ class HTML_QuickForm_advanced_settings extends HTML_QuickForm_static
'.HTML_QuickForm_static::toHtml().'
</div>
</div>
';
} //end func toHtml
} //end class HTML_QuickForm_html

@ -1,31 +1,26 @@
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* HTML class for an advanced checkbox type field
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category HTML
* @package HTML_QuickForm
* @author Jason Rust <jrust@php.net>
* @author Alexey Borzov <avb@php.net>
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id: advcheckbox.php,v 1.18 2009/04/04 21:34:02 avb Exp $
* @link http://pear.php.net/package/HTML_QuickForm
*/
/**
* HTML class for a checkbox type field
*/
require_once 'HTML/QuickForm/checkbox.php';
/**
* HTML class for an advanced checkbox type field
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category HTML
* @package HTML_QuickForm
* @author Jason Rust <jrust@php.net>
* @author Alexey Borzov <avb@php.net>
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id: advcheckbox.php,v 1.18 2009/04/04 21:34:02 avb Exp $
* @link http://pear.php.net/package/HTML_QuickForm
*/
/**
* HTML class for an advanced checkbox type field
@ -42,12 +37,12 @@ require_once 'HTML/QuickForm/checkbox.php';
* checked, PHP overwrites the value of the hidden field with
* its value.
*
* @category HTML
* @package HTML_QuickForm
* @author Jason Rust <jrust@php.net>
* @author Alexey Borzov <avb@php.net>
* @version Release: 3.2.11
* @since 2.0
* @category HTML
* @package HTML_QuickForm
* @author Jason Rust <jrust@php.net>
* @author Alexey Borzov <avb@php.net>
* @version Release: 3.2.11
* @since 2.0
*/
class HTML_QuickForm_advcheckbox extends HTML_QuickForm_checkbox
{
@ -236,7 +231,7 @@ class HTML_QuickForm_advcheckbox extends HTML_QuickForm_checkbox
*
* @param string $event Name of event
* @param mixed $arg event arguments
* @param object &$caller calling object
* @param object &$caller calling object
* @since 1.0
* @access public
* @return void

@ -1,54 +1,49 @@
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* HTML class for an autocomplete element
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category HTML
* @package HTML_QuickForm
* @author Matteo Di Giovinazzo <matteodg@infinito.it>
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id: autocomplete.php,v 1.8 2009/04/04 21:34:02 avb Exp $
* @link http://pear.php.net/package/HTML_QuickForm
*/
/**
* HTML class for a text field
*/
require_once 'HTML/QuickForm/text.php';
/**
* HTML class for an autocomplete element
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category HTML
* @package HTML_QuickForm
* @author Matteo Di Giovinazzo <matteodg@infinito.it>
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id: autocomplete.php,v 1.8 2009/04/04 21:34:02 avb Exp $
* @link http://pear.php.net/package/HTML_QuickForm
*/
/**
* HTML class for an autocomplete element
*
* Creates an HTML input text element that
* at every keypressed javascript event checks in an array of options
* if there's a match and autocompletes the text in case of match.
* HTML class for an autocomplete element
*
* Creates an HTML input text element that
* at every keypressed javascript event checks in an array of options
* if there's a match and autocompletes the text in case of match.
*
* For the JavaScript code thanks to Martin Honnen and Nicholas C. Zakas
* See {@link http://www.faqts.com/knowledge_base/view.phtml/aid/13562} and
* {@link http://www.sitepoint.com/article/1220}
*
* For the JavaScript code thanks to Martin Honnen and Nicholas C. Zakas
* See {@link http://www.faqts.com/knowledge_base/view.phtml/aid/13562} and
* {@link http://www.sitepoint.com/article/1220}
*
* Example:
* <code>
* Example:
* <code>
* $autocomplete =& $form->addElement('autocomplete', 'fruit', 'Favourite fruit:');
* $options = array("Apple", "Orange", "Pear", "Strawberry");
* $autocomplete->setOptions($options);
* </code>
* </code>
*
* @category HTML
* @package HTML_QuickForm
* @author Matteo Di Giovinazzo <matteodg@infinito.it>
* @version Release: 3.2.11
* @since 3.2
* @category HTML
* @package HTML_QuickForm
* @author Matteo Di Giovinazzo <matteodg@infinito.it>
* @version Release: 3.2.11
* @since 3.2
*/
class HTML_QuickForm_autocomplete extends HTML_QuickForm_text
{

@ -1,41 +1,36 @@
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* HTML class for an <input type="button" /> elements
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category HTML
* @package HTML_QuickForm
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id: button.php,v 1.6 2009/04/04 21:34:02 avb Exp $
* @link http://pear.php.net/package/HTML_QuickForm
*/
/**
* Base class for <input /> form elements
*/
require_once 'HTML/QuickForm/input.php';
/**
* HTML class for an <input type="button" /> elements
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category HTML
* @package HTML_QuickForm
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id: button.php,v 1.6 2009/04/04 21:34:02 avb Exp $
* @link http://pear.php.net/package/HTML_QuickForm
*/
/**
* HTML class for an <input type="button" /> elements
* HTML class for an <input type="button" /> elements
*
* @category HTML
* @package HTML_QuickForm
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @version Release: 3.2.11
* @since 1.0
* @category HTML
* @package HTML_QuickForm
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @version Release: 3.2.11
* @since 1.0
*/
class HTML_QuickForm_button extends HTML_QuickForm_input
{

@ -23,10 +23,6 @@
* @link http://pear.php.net/package/HTML_QuickForm
*/
/**
* Base class for <input /> form elements
*/
require_once 'HTML/QuickForm/input.php';
/**
* HTML class for a checkbox type field

@ -1,8 +1,4 @@
<?php
/**
* Base class for <input /> form elements
*/
require_once 'HTML/QuickForm/input.php';
/**
* HTML class for a password type field
@ -73,4 +69,4 @@ class HTML_QuickForm_email extends HTML_QuickForm_input
// }}}
} //end class HTML_QuickForm_password
} //end class HTML_QuickForm_password

@ -23,11 +23,6 @@
* @link http://pear.php.net/package/HTML_QuickForm
*/
/**
* Base class for <input /> form elements
*/
require_once 'HTML/QuickForm/input.php';
// register file-related rules
if (class_exists('HTML_QuickForm')) {
HTML_QuickForm::registerRule('uploadedfile', 'callback', '_ruleIsUploadedFile', 'HTML_QuickForm_file');

@ -21,11 +21,6 @@
* @link http://pear.php.net/package/HTML_QuickForm
*/
/**
* HTML class for static data
*/
require_once 'HTML/QuickForm/static.php';
/**
* A pseudo-element used for adding headers to form
*
@ -50,7 +45,7 @@ class HTML_QuickForm_header extends HTML_QuickForm_static
function HTML_QuickForm_header($elementName = null, $text = null) {
if (!empty($elementName)) {
$text = $elementName;
}
}
$this->HTML_QuickForm_static($elementName, null, $text);
$this->_type = 'header';
}

@ -22,11 +22,6 @@
* @link http://pear.php.net/package/HTML_QuickForm
*/
/**
* Base class for <input /> form elements
*/
require_once 'HTML/QuickForm/input.php';
/**
* HTML class for a hidden type element
*

@ -1,45 +1,40 @@
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* Hidden select pseudo-element
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category HTML
* @package HTML_QuickForm
* @author Isaac Shepard <ishepard@bsiweb.com>
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id: hiddenselect.php,v 1.7 2009/04/04 21:34:03 avb Exp $
* @link http://pear.php.net/package/HTML_QuickForm
*/
/**
* Hidden select pseudo-element
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category HTML
* @package HTML_QuickForm
* @author Isaac Shepard <ishepard@bsiweb.com>
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id: hiddenselect.php,v 1.7 2009/04/04 21:34:03 avb Exp $
* @link http://pear.php.net/package/HTML_QuickForm
*/
/**
* Class for <select></select> elements
*/
require_once 'HTML/QuickForm/select.php';
/**
* Hidden select pseudo-element
*
* Hidden select pseudo-element
*
* This class takes the same arguments as a select element, but instead
* of creating a select ring it creates hidden elements for all values
* already selected with setDefault or setConstant. This is useful if
* you have a select ring that you don't want visible, but you need all
* selected values to be passed.
*
* @category HTML
* @package HTML_QuickForm
* @author Isaac Shepard <ishepard@bsiweb.com>
* @version Release: 3.2.11
* @since 2.1
* @category HTML
* @package HTML_QuickForm
* @author Isaac Shepard <ishepard@bsiweb.com>
* @version Release: 3.2.11
* @since 2.1
*/
class HTML_QuickForm_hiddenselect extends HTML_QuickForm_select
{

@ -1,52 +1,43 @@
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* Hierarchical select element
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category HTML
* @package HTML_QuickForm
* @author Herim Vasquez <vasquezh@iro.umontreal.ca>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @author Alexey Borzov <avb@php.net>
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id: hierselect.php,v 1.20 2009/04/04 21:34:03 avb Exp $
* @link http://pear.php.net/package/HTML_QuickForm
*/
/**
* Class for a group of form elements
*/
require_once 'HTML/QuickForm/group.php';
/**
* Class for <select></select> elements
*/
require_once 'HTML/QuickForm/select.php';
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* Hierarchical select element
*
* Hierarchical select element
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category HTML
* @package HTML_QuickForm
* @author Herim Vasquez <vasquezh@iro.umontreal.ca>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @author Alexey Borzov <avb@php.net>
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id: hierselect.php,v 1.20 2009/04/04 21:34:03 avb Exp $
* @link http://pear.php.net/package/HTML_QuickForm
*/
/**
* Hierarchical select element
*
* Class to dynamically create two or more HTML Select elements
* The first select changes the content of the second select and so on.
* This element is considered as a group. Selects will be named
* groupName[0], groupName[1], groupName[2]...
*
* @category HTML
* @package HTML_QuickForm
* @author Herim Vasquez <vasquezh@iro.umontreal.ca>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @author Alexey Borzov <avb@php.net>
* @version Release: 3.2.11
* @since 3.1
* @category HTML
* @package HTML_QuickForm
* @author Herim Vasquez <vasquezh@iro.umontreal.ca>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @author Alexey Borzov <avb@php.net>
* @version Release: 3.2.11
* @since 3.1
*/
class HTML_QuickForm_hierselect extends HTML_QuickForm_group
{
@ -55,7 +46,7 @@ class HTML_QuickForm_hierselect extends HTML_QuickForm_group
/**
* Options for all the select elements
*
* @see setOptions()
* @see setOptions()
* @var array
* @access private
*/
@ -110,45 +101,45 @@ class HTML_QuickForm_hierselect extends HTML_QuickForm_group
* Initialize the array structure containing the options for each select element.
* Call the functions that actually do the magic.
*
* Format is a bit more complex than for a simple select as we need to know
* which options are related to the ones in the previous select:
*
* Ex:
* <code>
* // first select
* $select1[0] = 'Pop';
* $select1[1] = 'Classical';
* $select1[2] = 'Funeral doom';
*
* // second select
* $select2[0][0] = 'Red Hot Chil Peppers';
* $select2[0][1] = 'The Pixies';
* $select2[1][0] = 'Wagner';
* $select2[1][1] = 'Strauss';
* $select2[2][0] = 'Pantheist';
* $select2[2][1] = 'Skepticism';
*
* // If only need two selects
* // - and using the deprecated functions
* $sel =& $form->addElement('hierselect', 'cds', 'Choose CD:');
* $sel->setMainOptions($select1);
* $sel->setSecOptions($select2);
*
* // - and using the new setOptions function
* $sel =& $form->addElement('hierselect', 'cds', 'Choose CD:');
* $sel->setOptions(array($select1, $select2));
*
* // If you have a third select with prices for the cds
* $select3[0][0][0] = '15.00$';
* $select3[0][0][1] = '17.00$';
* // etc
*
* // You can now use
* $sel =& $form->addElement('hierselect', 'cds', 'Choose CD:');
* $sel->setOptions(array($select1, $select2, $select3));
* </code>
* Format is a bit more complex than for a simple select as we need to know
* which options are related to the ones in the previous select:
*
* Ex:
* <code>
* // first select
* $select1[0] = 'Pop';
* $select1[1] = 'Classical';
* $select1[2] = 'Funeral doom';
*
* @param array $options Array of options defining each element
* // second select
* $select2[0][0] = 'Red Hot Chil Peppers';
* $select2[0][1] = 'The Pixies';
* $select2[1][0] = 'Wagner';
* $select2[1][1] = 'Strauss';
* $select2[2][0] = 'Pantheist';
* $select2[2][1] = 'Skepticism';
*
* // If only need two selects
* // - and using the deprecated functions
* $sel =& $form->addElement('hierselect', 'cds', 'Choose CD:');
* $sel->setMainOptions($select1);
* $sel->setSecOptions($select2);
*
* // - and using the new setOptions function
* $sel =& $form->addElement('hierselect', 'cds', 'Choose CD:');
* $sel->setOptions(array($select1, $select2));
*
* // If you have a third select with prices for the cds
* $select3[0][0][0] = '15.00$';
* $select3[0][0][1] = '17.00$';
* // etc
*
* // You can now use
* $sel =& $form->addElement('hierselect', 'cds', 'Choose CD:');
* $sel->setOptions(array($select1, $select2, $select3));
* </code>
*
* @param array $options Array of options defining each element
* @access public
* @return void
*/
@ -313,9 +304,9 @@ class HTML_QuickForm_hierselect extends HTML_QuickForm_group
$this->_js .= <<<JAVASCRIPT
function _hs_findOptions(ary, keys)
{
if (ary == undefined) {
return {};
}
if (ary == undefined) {
return {};
}
var key = keys.shift();
if (!key in ary) {
return {};
@ -593,4 +584,4 @@ JAVASCRIPT;
// }}}
} // end class HTML_QuickForm_hierselect
?>
?>

@ -1,41 +1,36 @@
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* HTML class for an <input type="image" /> element
* HTML class for an <input type="image" /> element
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category HTML
* @package HTML_QuickForm
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id: image.php,v 1.6 2009/04/04 21:34:03 avb Exp $
* @link http://pear.php.net/package/HTML_QuickForm
*/
/**
* Base class for <input /> form elements
*/
require_once 'HTML/QuickForm/input.php';
/**
* HTML class for an <input type="image" /> element
*
* @category HTML
* @package HTML_QuickForm
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @version Release: 3.2.11
* @since 1.0
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category HTML
* @package HTML_QuickForm
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id: image.php,v 1.6 2009/04/04 21:34:03 avb Exp $
* @link http://pear.php.net/package/HTML_QuickForm
*/
/**
* HTML class for an <input type="image" /> element
*
* @category HTML
* @package HTML_QuickForm
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @version Release: 3.2.11
* @since 1.0
*/
class HTML_QuickForm_image extends HTML_QuickForm_input
{

@ -3,7 +3,6 @@
* HTML class for static data
* @example $form->addElement('label', 'My label', 'Content');
*/
require_once 'HTML/QuickForm/static.php';
/**
* A pseudo-element used for adding raw HTML to form

@ -1,41 +1,36 @@
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* HTML class for a link type field
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category HTML
* @package HTML_QuickForm
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id: link.php,v 1.4 2009/04/04 21:34:04 avb Exp $
* @link http://pear.php.net/package/HTML_QuickForm
*/
/**
* HTML class for static data
*/
require_once 'HTML/QuickForm/static.php';
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* HTML class for a link type field
*
* @category HTML
* @package HTML_QuickForm
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @version Release: 3.2.11
* @since 2.0
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category HTML
* @package HTML_QuickForm
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id: link.php,v 1.4 2009/04/04 21:34:04 avb Exp $
* @link http://pear.php.net/package/HTML_QuickForm
*/
/**
* HTML class for a link type field
*
* @category HTML
* @package HTML_QuickForm
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @version Release: 3.2.11
* @since 2.0
*/
class HTML_QuickForm_link extends HTML_QuickForm_static
{

@ -1,41 +1,36 @@
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* HTML class for a password type field
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category HTML
* @package HTML_QuickForm
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id: password.php,v 1.8 2009/04/04 21:34:04 avb Exp $
* @link http://pear.php.net/package/HTML_QuickForm
*/
/**
* Base class for <input /> form elements
*/
require_once 'HTML/QuickForm/input.php';
/**
* HTML class for a password type field
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category HTML
* @package HTML_QuickForm
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id: password.php,v 1.8 2009/04/04 21:34:04 avb Exp $
* @link http://pear.php.net/package/HTML_QuickForm
*/
/**
* HTML class for a password type field
*
* @category HTML
* @package HTML_QuickForm
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @version Release: 3.2.11
* @since 1.0
* @category HTML
* @package HTML_QuickForm
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @version Release: 3.2.11
* @since 1.0
*/
class HTML_QuickForm_password extends HTML_QuickForm_input
{

@ -1,41 +1,36 @@
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* HTML class for a reset type element
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category HTML
* @package HTML_QuickForm
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id: reset.php,v 1.6 2009/04/04 21:34:04 avb Exp $
* @link http://pear.php.net/package/HTML_QuickForm
*/
/**
* Base class for <input /> form elements
*/
require_once 'HTML/QuickForm/input.php';
/**
* HTML class for a reset type element
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category HTML
* @package HTML_QuickForm
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id: reset.php,v 1.6 2009/04/04 21:34:04 avb Exp $
* @link http://pear.php.net/package/HTML_QuickForm
*/
/**
* HTML class for a reset type element
*
* @category HTML
* @package HTML_QuickForm
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @version Release: 3.2.11
* @since 1.0
* @category HTML
* @package HTML_QuickForm
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @version Release: 3.2.11
* @since 1.0
*/
class HTML_QuickForm_reset extends HTML_QuickForm_input
{

@ -1,41 +1,36 @@
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* HTML class for a submit type element
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category HTML
* @package HTML_QuickForm
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id: submit.php,v 1.6 2009/04/04 21:34:04 avb Exp $
* @link http://pear.php.net/package/HTML_QuickForm
*/
/**
* Base class for <input /> form elements
*/
require_once 'HTML/QuickForm/input.php';
/**
* HTML class for a submit type element
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category HTML
* @package HTML_QuickForm
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id: submit.php,v 1.6 2009/04/04 21:34:04 avb Exp $
* @link http://pear.php.net/package/HTML_QuickForm
*/
/**
* HTML class for a submit type element
*
* @category HTML
* @package HTML_QuickForm
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @version Release: 3.2.11
* @since 1.0
* @category HTML
* @package HTML_QuickForm
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @version Release: 3.2.11
* @since 1.0
*/
class HTML_QuickForm_submit extends HTML_QuickForm_input
{

@ -1,39 +1,34 @@
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* Class for HTML 4.0 <button> element
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category HTML
* @package HTML_QuickForm
* @author Alexey Borzov <avb@php.net>
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id: xbutton.php,v 1.3 2009/04/04 21:34:04 avb Exp $
* @link http://pear.php.net/package/HTML_QuickForm
*/
/**
* Base class for form elements
*/
require_once 'HTML/QuickForm/element.php';
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* Class for HTML 4.0 <button> element
*
* @category HTML
* @package HTML_QuickForm
* @author Alexey Borzov <avb@php.net>
* @version Release: 3.2.11
* @since 3.2.3
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category HTML
* @package HTML_QuickForm
* @author Alexey Borzov <avb@php.net>
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id: xbutton.php,v 1.3 2009/04/04 21:34:04 avb Exp $
* @link http://pear.php.net/package/HTML_QuickForm
*/
/**
* Class for HTML 4.0 <button> element
*
* @category HTML
* @package HTML_QuickForm
* @author Alexey Borzov <avb@php.net>
* @version Release: 3.2.11
* @since 3.2.3
*/
class HTML_QuickForm_xbutton extends HTML_QuickForm_element
{

@ -18,7 +18,6 @@
* @link http://pear.php.net/package/Image_Text
* @since File available since Release 0.0.1
*/
require_once 'Image/Text/Exception.php';
/**
* Image_Text - Advanced text manipulations in images.
*

@ -10,8 +10,7 @@
* @license http://www.php.net/license/3_01.txt PHP License
* @link http://pear.php.net/package/Image_Text
*/
$lib_path = api_get_path(LIBRARY_PATH);
require_once $lib_path.'/pear/Exception.php';
/**
* Exception for Image_Text
*

@ -1,23 +1,28 @@
<?php
/* For licensing terms, see /license.txt */
/**
* This class provides methods for the timeline management.
* @package chamilo.library
* @package chamilo.timeline
*/
/**
* Init
*/
define('TIMELINE_STATUS_ACTIVE', '1');
define('TIMELINE_STATUS_INACTIVE', '2');
/**
* Class Timeline
* Timeline model class definition
* @package chamilo.library
*/
class Timeline extends Model
{
public $table;
public $columns = array('headline', 'type', 'start_date', 'end_date', 'text', 'media', 'media_credit', 'media_caption', 'title_slide', 'parent_id', 'status','c_id');
public $columns = array(
'headline',
'type',
'start_date',
'end_date',
'text',
'media',
'media_credit',
'media_caption',
'title_slide',
'parent_id',
'status',
'c_id'
);
public $is_course_model = true;
public function __construct()

@ -6,7 +6,6 @@
* Code
*/
include(dirname(__FILE__).'/../global.inc.php');
require_once api_get_path(LIBRARY_PATH).'xajax/xajax.inc.php';
$xajax_upload = new Xajax();
$xajax_upload -> registerFunction ('updateProgress');
$xajax_upload -> processRequests();

@ -40,8 +40,8 @@ ob_implicit_flush(true);
session_start();
require_once api_get_path(SYS_PATH).'vendor/autoload.php';
require_once api_get_path(LIBRARY_PATH).'database.constants.inc.php';
require_once api_get_path(LIBRARY_PATH).'database.lib.php';
require_once api_get_path(LIBRARY_PATH).'log.class.php';
require_once 'install.lib.php';
require_once 'install.class.php';
require_once 'i_database.class.php';

@ -1,9 +1,7 @@
<?php
require_once (api_get_path(SYS_CODE_PATH).'admin/sub_language.class.php');
require_once(api_get_path(LIBRARY_PATH).'course.lib.php');
class TestSubLanguageManager extends UnitTestCase {
class TestSubLanguageManager extends UnitTestCase
{
public $clean = array();
public function __construct() {
@ -52,7 +50,7 @@ class TestSubLanguageManager extends UnitTestCase {
$res = SubLanguageManager::get_all_language_variable_in_file($system_path_file);
$this->assertTrue(is_array($res));
}
/**
* Add directory for sub-language
* @param String The sub-language path directory ( /var/www/my_lms/main/lang/spanish_corporate )
@ -65,7 +63,7 @@ class TestSubLanguageManager extends UnitTestCase {
}
/**
*
*
*/
public function testadd_file_in_language_directory(){
$res = SubLanguageManager :: add_language_directory('test');
@ -124,7 +122,7 @@ class TestSubLanguageManager extends UnitTestCase {
$name ='';
if (Database::num_rows($rs)>0) {
$name = Database::result($rs,0,'original_name');
}
}
$res = SubLanguageManager :: get_name_of_language_by_id($language_id);
$this->assertEqual($res,$name,'The language name from function does not match the database value');
}

Loading…
Cancel
Save