MDL-32094 fix various E_STRICT compatibility problems

This commit is contained in:
Petr Skoda 2012-03-18 18:37:24 +01:00
parent 0ed6f71232
commit f20edd5208
27 changed files with 53 additions and 42 deletions

View file

@ -226,10 +226,13 @@ class block_manager {
$pageformat = $this->page->pagetype;
foreach($allblocks as $block) {
if (!$bi = block_instance($block->name)) {
continue;
}
if ($block->visible &&
(block_method_result($block->name, 'instance_allow_multiple') || !$this->is_block_present($block->name)) &&
($bi->instance_allow_multiple() || !$this->is_block_present($block->name)) &&
blocks_name_allowed_in_format($block->name, $pageformat) &&
block_method_result($block->name, 'user_can_addto', $this->page)) {
$bi->user_can_addto($this->page)) {
$this->addableblocks[$block->name] = $block;
}
}
@ -1850,7 +1853,11 @@ function blocks_remove_inappropriate($course) {
function blocks_name_allowed_in_format($name, $pageformat) {
$accept = NULL;
$maxdepth = -1;
$formats = block_method_result($name, 'applicable_formats');
if (!$bi = block_instance($name)) {
return false;
}
$formats = $bi->applicable_formats();
if (!$formats) {
$formats = array();
}

View file

@ -289,7 +289,7 @@ class csv_import_reader {
* @param string separator name
* @return string encoded delimiter char
*/
function get_encoded_delimiter($delimiter_name) {
static function get_encoded_delimiter($delimiter_name) {
global $CFG;
if ($delimiter_name == 'cfg' and isset($CFG->CSV_ENCODE)) {
return $CFG->CSV_ENCODE;
@ -305,7 +305,7 @@ class csv_import_reader {
* @param string who imports?
* @return int iid
*/
function get_new_iid($type) {
static function get_new_iid($type) {
global $USER;
$filename = make_temp_directory('csvimport/'.$type.'/'.$USER->id);

View file

@ -1733,9 +1733,10 @@ abstract class enrol_plugin {
* Returns true if the plugin has one or more bulk operations that can be performed on
* user enrolments.
*
* @param course_enrolment_manager $manager
* @return bool
*/
public function has_bulk_operations() {
public function has_bulk_operations(course_enrolment_manager $manager) {
return false;
}
@ -1743,9 +1744,10 @@ abstract class enrol_plugin {
* Return an array of enrol_bulk_enrolment_operation objects that define
* the bulk actions that can be performed on user enrolments by the plugin.
*
* @param course_enrolment_manager $manager
* @return array
*/
public function get_bulk_operations() {
public function get_bulk_operations(course_enrolment_manager $manager) {
return array();
}
}

View file

@ -400,7 +400,7 @@ class grade_grade extends grade_object {
* @param array $items array of all grade item ids
* @return void
*/
public function check_locktime_all($items) {
public static function check_locktime_all($items) {
global $CFG, $DB;
$now = time(); // no rounding needed, this is not supposed to be called every 10 seconds

View file

@ -244,7 +244,7 @@ class grade_scale extends grade_object {
*
* @return object
*/
public function fetch_all_global() {
public static function fetch_all_global() {
return grade_scale::fetch_all(array('courseid'=>0));
}

View file

@ -77,8 +77,8 @@ final class portfolio_export_form extends moodleform {
&& $this->_customdata['expectedtime'] != PORTFOLIO_TIME_LOW
&& $this->_customdata['expectedtime'] != PORTFOLIO_TIME_FORCEQUEUE) {
$radioarray = array();
$radioarray[] = &MoodleQuickForm::createElement('radio', 'wait', '', get_string('wait', 'portfolio'), 1);
$radioarray[] = &MoodleQuickForm::createElement('radio', 'wait', '', get_string('dontwait', 'portfolio'), 0);
$radioarray[] = $mform->createElement('radio', 'wait', '', get_string('wait', 'portfolio'), 1);
$radioarray[] = $mform->createElement('radio', 'wait', '', get_string('dontwait', 'portfolio'), 0);
$mform->addGroup($radioarray, 'radioar', get_string('wanttowait_' . $this->_customdata['expectedtime'], 'portfolio') , array(' '), false);
$mform->setDefault('wait', 0);
} else {

View file

@ -1705,7 +1705,8 @@ function upgrade_plugin_mnet_functions($component) {
* @return array
*/
function admin_mnet_method_profile(Zend_Server_Reflection_Function_Abstract $function) {
$proto = array_pop($function->getPrototypes());
$protos = $function->getPrototypes();
$proto = array_pop($protos);
$ret = $proto->getReturnValue();
$profile = array(
'parameters' => array(),