Fix constructors

ofaj
jmontoyaa 9 years ago
parent 7fb947a608
commit c54d18ae76
  1. 5
      main/gradebook/lib/be/result.class.php
  2. 4
      main/gradebook/lib/be/surveylink.class.php
  3. 2
      main/gradebook/lib/fe/catform.class.php
  4. 2
      main/gradebook/lib/fe/dataform.class.php
  5. 2
      main/gradebook/lib/fe/flatviewtable.class.php
  6. 2
      main/gradebook/lib/fe/linkaddeditform.class.php
  7. 2
      main/gradebook/lib/fe/linkform.class.php
  8. 2
      main/gradebook/lib/fe/resulttable.class.php
  9. 2
      main/gradebook/lib/fe/scoredisplayform.class.php
  10. 2
      main/gradebook/lib/fe/userform.class.php
  11. 2
      main/gradebook/lib/fe/usertable.class.php
  12. 2
      main/gradebook/lib/flatview_data_generator.class.php
  13. 2
      main/gradebook/lib/results_data_generator.class.php
  14. 2
      main/gradebook/lib/user_data_generator.class.php
  15. 2
      main/inc/lib/formvalidator/Element/DatePicker.php
  16. 2
      main/inc/lib/formvalidator/Element/DateTimePicker.php
  17. 1
      main/inc/lib/formvalidator/Element/HtmlEditor.php
  18. 2
      main/inc/lib/formvalidator/Element/Number.php
  19. 6
      main/inc/lib/formvalidator/Element/SelectAjax.php
  20. 4
      main/inc/lib/formvalidator/Element/SelectLanguage.php
  21. 5
      main/inc/lib/formvalidator/Element/SelectTheme.php
  22. 5
      main/inc/lib/formvalidator/Element/Url.php
  23. 1
      main/inc/lib/formvalidator/Element/receivers.php
  24. 2
      main/inc/lib/pear/HTML/QuickForm/CAPTCHA.php
  25. 2
      main/inc/lib/pear/HTML/QuickForm/Renderer.php
  26. 4
      main/inc/lib/pear/HTML/QuickForm/advcheckbox.php
  27. 2
      main/inc/lib/pear/HTML/QuickForm/advmultiselect.php
  28. 8
      main/inc/lib/pear/HTML/QuickForm/autocomplete.php
  29. 2
      main/inc/lib/pear/HTML/QuickForm/checkbox.php
  30. 4
      main/inc/lib/pear/HTML/QuickForm/date.php
  31. 2
      main/inc/lib/pear/HTML/QuickForm/email.php
  32. 43
      main/inc/lib/pear/HTML/QuickForm/file.php
  33. 2
      main/inc/lib/pear/HTML/QuickForm/header.php
  34. 2
      main/inc/lib/pear/HTML/QuickForm/hidden.php
  35. 2
      main/inc/lib/pear/HTML/QuickForm/hiddenselect.php
  36. 2
      main/inc/lib/pear/HTML/QuickForm/image.php
  37. 2
      main/inc/lib/pear/HTML/QuickForm/link.php
  38. 6
      main/inc/lib/pear/HTML/Table.php
  39. 10
      main/inc/lib/pear/HTML/Table/Storage.php

@ -14,7 +14,10 @@ class Result
private $created_at;
private $score;
public function Result()
/**
* Result constructor.
*/
public function __construct()
{
$this->created_at = api_get_utc_datetime();
}

@ -19,9 +19,13 @@ class SurveyLink extends AbstractLink
$this->set_type(LINK_SURVEY);
}
/**
* @return string
*/
public function get_name()
{
$this->get_survey_data();
return $this->survey_data['code'].': '.self::html_to_text($this->survey_data['title']);
}

@ -22,7 +22,7 @@ class CatForm extends FormValidator
* @param string form name
* @param method method
*/
public function CatForm(
public function __construct(
$form_type,
$category_object,
$form_name,

@ -21,7 +21,7 @@ class DataForm extends FormValidator
* @param method
* @param action
*/
public function DataForm($form_type, $form_name, $method = 'post', $action = null, $target='', $locked_status)
public function __construct($form_type, $form_name, $method = 'post', $action = null, $target='', $locked_status)
{
parent :: __construct($form_name, $method, $action,$target);
$this->form_type = $form_type;

@ -34,7 +34,7 @@ class FlatViewTable extends SortableTable
* @param null $addparams
* @param Category $mainCourseCategory
*/
public function FlatViewTable(
public function __construct(
$selectcat,
$users = array(),
$evals = array(),

@ -17,7 +17,7 @@ class LinkAddEditForm extends FormValidator
* To add link, define category_object and link_type
* To edit link, define link_object
*/
public function LinkAddEditForm(
public function __construct(
$form_type,
$category_object,
$link_type,

@ -25,7 +25,7 @@ class LinkForm extends FormValidator
* @param method
* @param action
*/
public function LinkForm(
public function __construct(
$form_type,
$category_object,
$link_object,

@ -18,7 +18,7 @@ class ResultTable extends SortableTable
/**
* Constructor
*/
public function ResultTable ($evaluation, $results = array(), $iscourse, $addparams = null,$forprint = false)
public function __construct($evaluation, $results = array(), $iscourse, $addparams = null,$forprint = false)
{
parent :: __construct ('resultlist', null, null, (api_is_western_name_order() xor api_sort_by_first_name()) ? 2 : 1);

@ -14,7 +14,7 @@ class ScoreDisplayForm extends FormValidator
* @param $form_name
* @param null $action
*/
public function ScoreDisplayForm($form_name, $action= null)
public function __construct($form_name, $action= null)
{
parent :: __construct($form_name, 'post', $action);
$displayscore = ScoreDisplay :: instance();

@ -19,7 +19,7 @@ class UserForm extends FormValidator
* @param method
* @param action
*/
public function UserForm($form_type, $user, $form_name, $method= 'post', $action= null)
public function __construct($form_type, $user, $form_name, $method= 'post', $action= null)
{
parent :: __construct($form_name, $method, $action);
$this->form_type= $form_type;

@ -16,7 +16,7 @@ class UserTable extends SortableTable
/**
* Constructor
*/
public function UserTable($userid, $evals = array(), $links = array(), $addparams = null)
public function __construct($userid, $evals = array(), $links = array(), $addparams = null)
{
parent :: __construct ('userlist', null, null, 0);
$this->userid = $userid;

@ -32,7 +32,7 @@ class FlatViewDataGenerator
* @param array $params
* @param null $mainCourseCategory
*/
public function FlatViewDataGenerator(
public function __construct(
$users = array(),
$evals = array(),
$links = array(),

@ -26,7 +26,7 @@ class ResultsDataGenerator
/**
* Constructor
*/
public function ResultsDataGenerator(
public function __construct(
$evaluation,
$results = array(),
$include_edit = false

@ -30,7 +30,7 @@ class UserDataGenerator
private $scorecache;
private $avgcache;
public function UserDataGenerator($userid, $evals = array(), $links = array())
public function __construct($userid, $evals = array(), $links = array())
{
$this->userid = $userid;
$evals_filtered = array();

@ -13,7 +13,7 @@ class DatePicker extends HTML_QuickForm_text
* @param string $elementLabel
* @param array $attributes
*/
public function DatePicker($elementName = null, $elementLabel = null, $attributes = null)
public function __construct($elementName = null, $elementLabel = null, $attributes = null)
{
if (!isset($attributes['id'])) {
$attributes['id'] = $elementName;

@ -9,7 +9,7 @@ class DateTimePicker extends HTML_QuickForm_text
/**
* Constructor
*/
public function DateTimePicker($elementName = null, $elementLabel = null, $attributes = null)
public function __construct($elementName = null, $elementLabel = null, $attributes = null)
{
if (!isset($attributes['id'])) {
$attributes['id'] = $elementName;

@ -31,6 +31,7 @@ class HtmlEditor extends HTML_QuickForm_textarea
$config = array()
) {
if (empty($name)) {
return false;
}

@ -13,7 +13,7 @@ class Number extends HTML_QuickForm_text
* @param string $elementLabel
* @param array $attributes
*/
public function Number($elementName = null, $elementLabel = null, $attributes = null)
public function __construct($elementName = null, $elementLabel = null, $attributes = null)
{
if (!isset($attributes['id'])) {
$attributes['id'] = $elementName;

@ -9,7 +9,7 @@ class SelectAjax extends HTML_QuickForm_select
/**
* Class constructor
*/
function SelectAjax($elementName = null, $elementLabel = null, $options = null, $attributes = null)
public function __construct($elementName = null, $elementLabel = null, $options = null, $attributes = null)
{
parent::__construct($elementName, $elementLabel, $options, $attributes);
}
@ -18,7 +18,7 @@ class SelectAjax extends HTML_QuickForm_select
* The ajax call must contain an array of id and text
* @return string
*/
function toHtml()
public function toHtml()
{
$html = api_get_asset('select2/dist/js/select2.min.js');
@ -120,7 +120,7 @@ JS;
* We check the options and return only the values that _could_ have been
* selected. We also return a scalar value if select is not "multiple"
*/
function exportValue(&$submitValues, $assoc = false)
public function exportValue(&$submitValues, $assoc = false)
{
$value = $this->_findValue($submitValues);

@ -9,7 +9,7 @@ class SelectLanguage extends HTML_QuickForm_select
/**
* Class constructor
*/
function SelectLanguage($elementName=null, $elementLabel=null, $options=null, $attributes=null)
public function __construct($elementName = null, $elementLabel = null, $options = null, $attributes = null)
{
parent::__construct($elementName, $elementLabel, $options, $attributes);
// Get all languages
@ -17,7 +17,7 @@ class SelectLanguage extends HTML_QuickForm_select
$this->_options = array();
$this->_values = array();
foreach ($languages['name'] as $index => $name) {
if($languages['folder'][$index] == api_get_setting('platformLanguage')) {
if ($languages['folder'][$index] == api_get_setting('platformLanguage')) {
$this->addOption($name,$languages['folder'][$index],array('selected'=>'selected'));
} else {
$this->addOption($name,$languages['folder'][$index]);

@ -9,14 +9,15 @@ class SelectTheme extends HTML_QuickForm_select
/**
* Class constructor
*/
function SelectTheme($elementName=null, $elementLabel=null, $options=null, $attributes=null) {
public function __construct($elementName=null, $elementLabel=null, $options=null, $attributes=null)
{
parent::__construct($elementName, $elementLabel, $options, $attributes);
// Get all languages
$themes = api_get_themes();
$this->_options = array();
$this->_values = array();
$this->addOption('--',''); // no theme select
for ($i=0; $i< count($themes[0]);$i++) {
for ($i=0; $i< count($themes[0]); $i++) {
$this->addOption($themes[1][$i],$themes[0][$i]);
}
}

@ -1,5 +1,6 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Url element
*
@ -7,14 +8,13 @@
*/
class Url extends HTML_QuickForm_text
{
/**
* Constructor of Url class
* @param type $elementName
* @param type $elementLabel
* @param type $attributes
*/
public function Url($elementName = null, $elementLabel = null, $attributes = null)
public function __construct($elementName = null, $elementLabel = null, $attributes = null)
{
if (!isset($attributes['id'])) {
$attributes['id'] = $elementName;
@ -27,5 +27,4 @@ class Url extends HTML_QuickForm_text
$this->setType('url');
}
}

@ -18,6 +18,7 @@ class HTML_QuickForm_receivers extends HTML_QuickForm_group
* Array of selected receivers
*/
var $receivers_selected;
/**
* Constructor
* @param string $elementName

@ -112,7 +112,7 @@ class HTML_QuickForm_CAPTCHA extends HTML_QuickForm_input
*
* @access public
*/
function HTML_QuickForm_CAPTCHA($elementName = null, $elementLabel = null,
public function __construct($elementName = null, $elementLabel = null,
$options = null, $attributes = null)
{
parent::__construct($elementName, $elementLabel, $attributes);

@ -40,7 +40,7 @@ class HTML_QuickForm_Renderer
*
* @access public
*/
function HTML_QuickForm_Renderer()
public function __construct()
{
} // end constructor

@ -81,9 +81,9 @@ class HTML_QuickForm_advcheckbox extends HTML_QuickForm_checkbox
* @access public
* @return void
*/
function HTML_QuickForm_advcheckbox($elementName=null, $elementLabel=null, $text=null, $attributes=null, $values=null)
public function __construct($elementName=null, $elementLabel=null, $text=null, $attributes=null, $values=null)
{
$this->HTML_QuickForm_checkbox($elementName, $elementLabel, $text, $attributes);
parent::__construct($elementName, $elementLabel, $text, $attributes);
$this->setValues($values);
} //end constructor

@ -272,7 +272,7 @@ class HTML_QuickForm_advmultiselect extends HTML_QuickForm_select
* @return void
* @since version 0.4.0 (2005-06-25)
*/
public function HTML_QuickForm_advmultiselect(
public function __construct(
$elementName = null,
$elementLabel = null,
$options = null,

@ -55,7 +55,7 @@ class HTML_QuickForm_autocomplete extends HTML_QuickForm_text
* @var array
* @access private
*/
var $_options = array();
public $_options = array();
/**
* "One-time" javascript (containing functions), see bug #4611
@ -63,7 +63,7 @@ class HTML_QuickForm_autocomplete extends HTML_QuickForm_text
* @var string
* @access private
*/
var $_js = '';
public $_js = '';
// }}}
// {{{ constructor
@ -79,9 +79,9 @@ class HTML_QuickForm_autocomplete extends HTML_QuickForm_text
* @access public
* @return void
*/
function HTML_QuickForm_autocomplete($elementName = null, $elementLabel = null, $options = null, $attributes = null)
public function __construct($elementName = null, $elementLabel = null, $options = null, $attributes = null)
{
$this->HTML_QuickForm_text($elementName, $elementLabel, $attributes);
parent::__construct($elementName, $elementLabel, $attributes);
$this->_persistantFreeze = true;
$this->_type = 'autocomplete';
if (isset($options)) {

@ -64,7 +64,7 @@ class HTML_QuickForm_checkbox extends HTML_QuickForm_input
* @access public
* @return void
*/
public function HTML_QuickForm_checkbox(
public function __construct(
$elementName = null,
$elementLabel = null,
$text = '',

@ -269,9 +269,9 @@ class HTML_QuickForm_date extends HTML_QuickForm_group
* @param array Options to control the element's display
* @param mixed Either a typical HTML attribute string or an associative array
*/
function HTML_QuickForm_date($elementName = null, $elementLabel = null, $options = array(), $attributes = null)
public function __construct($elementName = null, $elementLabel = null, $options = array(), $attributes = null)
{
$this->HTML_QuickForm_element($elementName, $elementLabel, $attributes);
parent::__construct($elementName, $elementLabel, $attributes);
$this->_persistantFreeze = true;
$this->_appendName = true;
$this->_type = 'date';

@ -26,7 +26,7 @@ class HTML_QuickForm_email extends HTML_QuickForm_input
* @return void
* @throws
*/
function HTML_QuickForm_email($elementName=null, $elementLabel=null, $attributes=null)
public function __construct($elementName=null, $elementLabel=null, $attributes=null)
{
parent::__construct($elementName, $elementLabel, $attributes);
$this->setType('email');

@ -57,7 +57,7 @@ class HTML_QuickForm_file extends HTML_QuickForm_input
* @since 1.0
* @access public
*/
function HTML_QuickForm_file($elementName=null, $elementLabel=null, $attributes=null)
public function __construct($elementName=null, $elementLabel=null, $attributes=null)
{
parent::__construct($elementName, $elementLabel, $attributes);
$this->setType('file');
@ -138,7 +138,7 @@ class HTML_QuickForm_file extends HTML_QuickForm_input
* @access public
* @return array
*/
function getValue()
public function getValue()
{
return $this->_value;
} // end func getValue
@ -156,7 +156,7 @@ class HTML_QuickForm_file extends HTML_QuickForm_input
* @access public
* @return bool
*/
function onQuickFormEvent($event, $arg, &$caller)
public function onQuickFormEvent($event, $arg, &$caller)
{
switch ($event) {
case 'updateValue':
@ -169,18 +169,17 @@ class HTML_QuickForm_file extends HTML_QuickForm_input
break;
case 'addElement':
$this->onQuickFormEvent('createElement', $arg, $caller);
return $this->onQuickFormEvent('updateValue', null, $caller);
break;
case 'createElement':
$className = get_class($this);
$this->$className($arg[0], $arg[1], $arg[2]);
//$className = get_class($this);
//$this &= new $className($arg[0], $arg[1], $arg[2]);
break;
}
return true;
} // end func onQuickFormEvent
// }}}
// {{{ moveUploadedFile()
}
/**
* Moves an uploaded file into the destination
@ -190,17 +189,14 @@ class HTML_QuickForm_file extends HTML_QuickForm_input
* @access public
* @return bool Whether the file was moved successfully
*/
function moveUploadedFile($dest, $fileName = '')
public function moveUploadedFile($dest, $fileName = '')
{
if ($dest != '' && substr($dest, -1) != '/') {
$dest .= '/';
}
$fileName = ($fileName != '') ? $fileName : basename($this->_value['name']);
return move_uploaded_file($this->_value['tmp_name'], $dest . $fileName);
} // end func moveUploadedFile
// }}}
// {{{ isUploadedFile()
}
/**
* Checks if the element contains an uploaded file
@ -211,11 +207,7 @@ class HTML_QuickForm_file extends HTML_QuickForm_input
public function isUploadedFile()
{
return HTML_QuickForm_file::_ruleIsUploadedFile($this->_value);
} // end func isUploadedFile
// }}}
// {{{ _ruleIsUploadedFile()
}
/**
* Checks if the given element contains an uploaded file
@ -232,10 +224,8 @@ class HTML_QuickForm_file extends HTML_QuickForm_input
} else {
return false;
}
} // end func _ruleIsUploadedFile
}
// }}}
// {{{ _ruleCheckMaxFileSize()
/**
* Tries to find the element value from the values array
@ -243,10 +233,10 @@ class HTML_QuickForm_file extends HTML_QuickForm_input
* Needs to be redefined here as $_FILES is populated differently from
* other arrays when element name is of the form foo[bar]
*
* @access private
* @access public
* @return mixed
*/
function _findValue(&$values = null)
public function _findValue(&$values = null)
{
if (empty($_FILES)) {
return null;
@ -276,7 +266,4 @@ class HTML_QuickForm_file extends HTML_QuickForm_input
return null;
}
}
// }}}
} // end class HTML_QuickForm_file
?>
}

@ -42,7 +42,7 @@ class HTML_QuickForm_header extends HTML_QuickForm_static
* @access public
* @return void
*/
function HTML_QuickForm_header($elementName = null, $text = null)
public function __construct($elementName = null, $text = null)
{
if (!empty($elementName)) {
$text = $elementName;

@ -47,7 +47,7 @@ class HTML_QuickForm_hidden extends HTML_QuickForm_input
* @access public
* @return void
*/
public function HTML_QuickForm_hidden($elementName = null, $value = '', $attributes = null)
public function __construct($elementName = null, $value = '', $attributes = null)
{
parent::__construct($elementName, null, $attributes);
$this->setType('hidden');

@ -51,7 +51,7 @@ class HTML_QuickForm_hiddenselect extends HTML_QuickForm_select
* @access public
* @return void
*/
function HTML_QuickForm_hiddenselect($elementName=null, $elementLabel=null, $options=null, $attributes=null)
public function __construct($elementName=null, $elementLabel=null, $options=null, $attributes=null)
{
parent::__construct($elementName, $elementLabel, $attributes);
$this->_persistantFreeze = true;

@ -47,7 +47,7 @@ class HTML_QuickForm_image extends HTML_QuickForm_input
* @access public
* @return void
*/
function HTML_QuickForm_image($elementName=null, $src='', $attributes=null)
public function __construct($elementName=null, $src='', $attributes=null)
{
parent::__construct($elementName, null, $attributes);
$this->setType('image');

@ -60,7 +60,7 @@ class HTML_QuickForm_link extends HTML_QuickForm_static
* @return void
* @throws
*/
function HTML_QuickForm_link($elementName=null, $elementLabel=null, $href=null, $text=null, $attributes=null)
public function __construct($elementName=null, $elementLabel=null, $href=null, $text=null, $attributes=null)
{
parent::__construct($elementName, $elementLabel, $attributes);
$this->_persistantFreeze = false;

@ -83,8 +83,8 @@
* @version Release: @package_version@
* @link http://pear.php.net/package/HTML_Table
*/
class HTML_Table extends HTML_Common {
class HTML_Table extends HTML_Common
{
/**
* Value to insert into empty cells. This is used as a default for
* newly-created tbodies.
@ -162,7 +162,7 @@ class HTML_Table extends HTML_Common {
* <tbody> or not
* @access public
*/
function HTML_Table($attributes = null, $tabOffset = 0, $useTGroups = false)
public function __construct($attributes = null, $tabOffset = 0, $useTGroups = false)
{
parent::__construct($attributes, (int)$tabOffset);
$this->_useTGroups = (boolean)$useTGroups;

@ -67,8 +67,8 @@
* @version Release: @package_version@
* @link http://pear.php.net/package/HTML_Table
*/
class HTML_Table_Storage extends HTML_Common {
class HTML_Table_Storage extends HTML_Common
{
/**
* Value to insert into empty cells
* @var string
@ -126,7 +126,7 @@ class HTML_Table_Storage extends HTML_Common {
* <tbody> or not
* @access public
*/
function HTML_Table_Storage($tabOffset = 0, $useTGroups = false)
public function __construct($tabOffset = 0, $useTGroups = false)
{
parent::__construct(null, (int)$tabOffset);
$this->_useTGroups = (boolean)$useTGroups;
@ -769,7 +769,7 @@ class HTML_Table_Storage extends HTML_Common {
}
$typeContent = $tabs . $tab . $tab . $extraTab . "<$type" . $this->_getAttrString($attr) . '>';
if ($contents || is_numeric($contents)) {
$typeContent .= $contents;
} elseif (empty($contents)) {
@ -777,7 +777,7 @@ class HTML_Table_Storage extends HTML_Common {
$contents = $this->_autoFill;
}
}
$typeContent .= "</$type>" . $lnEnd;
if (!empty($contents) || is_numeric($contents)) {

Loading…
Cancel
Save