mirror of
https://github.com/moodle/moodle.git
synced 2025-04-13 12:32:08 +02:00
MDL-32095 some more E_STRICT fixes
This commit is contained in:
parent
c856a1f60b
commit
68a7c9a696
@ -43,15 +43,15 @@ class filter_activitynames extends moodle_text_filter {
|
||||
}
|
||||
|
||||
// Initialise/invalidate our trivial cache if dealing with a different course
|
||||
if (!isset($this->cachedcourseid) || $this->cachedcourseid !== (int)$courseid) {
|
||||
$this->activitylist = null;
|
||||
if (!isset(self::$cachedcourseid) || self::$cachedcourseid !== (int)$courseid) {
|
||||
self::$activitylist = null;
|
||||
}
|
||||
$this->cachedcourseid = (int)$courseid;
|
||||
self::$cachedcourseid = (int)$courseid;
|
||||
|
||||
/// It may be cached
|
||||
|
||||
if (is_null($this->activitylist)) {
|
||||
$this->activitylist = array();
|
||||
if (is_null(self::$activitylist)) {
|
||||
self::$activitylist = array();
|
||||
|
||||
if ($COURSE->id == $courseid) {
|
||||
$course = $COURSE;
|
||||
@ -68,7 +68,7 @@ class filter_activitynames extends moodle_text_filter {
|
||||
|
||||
if (!empty($modinfo)) {
|
||||
|
||||
$this->activitylist = array(); /// We will store all the activities here
|
||||
self::$activitylist = array(); /// We will store all the activities here
|
||||
|
||||
//Sort modinfo by name length
|
||||
usort($modinfo, 'filter_activitynames_comparemodulenamesbylength');
|
||||
@ -82,9 +82,9 @@ class filter_activitynames extends moodle_text_filter {
|
||||
/// Avoid empty or unlinkable activity names
|
||||
if (!empty($title)) {
|
||||
$href_tag_begin = "<a class=\"autolink\" title=\"$title\" href=\"$CFG->wwwroot/mod/$activity->mod/view.php?id=$activity->cm\">";
|
||||
$this->activitylist[] = new filterobject($currentname, $href_tag_begin, '</a>', false, true);
|
||||
self::$activitylist[] = new filterobject($currentname, $href_tag_begin, '</a>', false, true);
|
||||
if ($currentname != $entitisedname) { /// If name has some entity (& " < >) add that filter too. MDL-17545
|
||||
$this->activitylist[] = new filterobject($entitisedname, $href_tag_begin, '</a>', false, true);
|
||||
self::$activitylist[] = new filterobject($entitisedname, $href_tag_begin, '</a>', false, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -92,8 +92,8 @@ class filter_activitynames extends moodle_text_filter {
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->activitylist) {
|
||||
return $text = filter_phrases ($text, $this->activitylist);
|
||||
if (self::$activitylist) {
|
||||
return $text = filter_phrases ($text, self::$activitylist);
|
||||
} else {
|
||||
return $text;
|
||||
}
|
||||
|
@ -33,18 +33,18 @@ class HTML_QuickForm_Rule
|
||||
|
||||
/**
|
||||
* Validates a value
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
* @abstract
|
||||
*/
|
||||
function validate($value)
|
||||
function validate($value, $options = null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the rule name
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function setName($ruleName)
|
||||
|
@ -34,7 +34,7 @@ class HTML_QuickForm_Rule_Range extends HTML_QuickForm_Rule
|
||||
* @access public
|
||||
* @return boolean true if value is valid
|
||||
*/
|
||||
function validate($value, $options)
|
||||
function validate($value, $options = null)
|
||||
{
|
||||
$length = strlen($value);
|
||||
switch ($this->name) {
|
||||
@ -48,13 +48,13 @@ class HTML_QuickForm_Rule_Range extends HTML_QuickForm_Rule
|
||||
function getValidationScript($options = null)
|
||||
{
|
||||
switch ($this->name) {
|
||||
case 'minlength':
|
||||
case 'minlength':
|
||||
$test = '{jsVar}.length < '.$options;
|
||||
break;
|
||||
case 'maxlength':
|
||||
case 'maxlength':
|
||||
$test = '{jsVar}.length > '.$options;
|
||||
break;
|
||||
default:
|
||||
default:
|
||||
$test = '({jsVar}.length < '.$options[0].' || {jsVar}.length > '.$options[1].')';
|
||||
}
|
||||
return array('', "{jsVar} != '' && {$test}");
|
||||
|
@ -238,7 +238,7 @@ class repository_alfresco extends repository {
|
||||
* @param string $search_text
|
||||
* @return array
|
||||
*/
|
||||
public function search($search_text) {
|
||||
public function search($search_text, $page = 0) {
|
||||
$space = optional_param('space', 'workspace://SpacesStore', PARAM_RAW);
|
||||
$currentStore = $this->user_session->getStoreFromString($space);
|
||||
$nodes = $this->user_session->query($currentStore, $search_text);
|
||||
|
@ -114,7 +114,7 @@ class repository_boxnet extends repository {
|
||||
* @param string $search_text
|
||||
* @return mixed
|
||||
*/
|
||||
public function search($search_text) {
|
||||
public function search($search_text, $page = 0) {
|
||||
global $OUTPUT;
|
||||
$list = array();
|
||||
$ret = array();
|
||||
@ -206,7 +206,7 @@ class repository_boxnet extends repository {
|
||||
* Add Plugin settings input to Moodle form
|
||||
* @param object $mform
|
||||
*/
|
||||
public function type_config_form($mform) {
|
||||
public static function type_config_form($mform, $classname = 'repository') {
|
||||
global $CFG;
|
||||
parent::type_config_form($mform);
|
||||
$public_account = get_config('boxnet', 'public_account');
|
||||
|
@ -258,7 +258,7 @@ class repository_dropbox extends repository {
|
||||
* Add Plugin settings input to Moodle form
|
||||
* @param object $mform
|
||||
*/
|
||||
public function type_config_form($mform) {
|
||||
public static function type_config_form($mform, $classname = 'repository') {
|
||||
global $CFG;
|
||||
parent::type_config_form($mform);
|
||||
$key = get_config('dropbox', 'dropbox_key');
|
||||
|
@ -55,7 +55,7 @@ class dropbox extends oauth_helper {
|
||||
/**
|
||||
* Download a file
|
||||
*/
|
||||
public function get_file($filepath, $saveas) {
|
||||
public function get_file($filepath, $saveas = '') {
|
||||
$info = pathinfo($filepath);
|
||||
$dirname = $info['dirname'];
|
||||
$basename = $info['basename'];
|
||||
|
@ -200,7 +200,7 @@ class repository_flickr extends repository {
|
||||
* @param string $search_text
|
||||
* @return array
|
||||
*/
|
||||
public function search($search_text) {
|
||||
public function search($search_text, $page = 0) {
|
||||
$photos = $this->flickr->photos_search(array(
|
||||
'user_id'=>$this->nsid,
|
||||
'per_page'=>24,
|
||||
@ -274,7 +274,7 @@ class repository_flickr extends repository {
|
||||
* Add Plugin settings input to Moodle form
|
||||
* @param object $mform
|
||||
*/
|
||||
public function type_config_form($mform) {
|
||||
public static function type_config_form($mform, $classname = 'repository') {
|
||||
global $CFG;
|
||||
$api_key = get_config('flickr', 'api_key');
|
||||
$secret = get_config('flickr', 'secret');
|
||||
|
@ -224,7 +224,7 @@ class repository_flickr_public extends repository {
|
||||
* @param string $search_text
|
||||
* @return array
|
||||
*/
|
||||
public function search($search_text, $page = 1) {
|
||||
public function search($search_text, $page = 0) {
|
||||
global $SESSION;
|
||||
$ret = array();
|
||||
if (empty($page)) {
|
||||
@ -471,7 +471,7 @@ class repository_flickr_public extends repository {
|
||||
* Add Plugin settings input to Moodle form
|
||||
* @param object $mform
|
||||
*/
|
||||
public function type_config_form($mform) {
|
||||
public static function type_config_form($mform, $classname = 'repository') {
|
||||
$api_key = get_config('flickr_public', 'api_key');
|
||||
if (empty($api_key)) {
|
||||
$api_key = '';
|
||||
|
@ -84,12 +84,12 @@ class repository_googledocs extends repository {
|
||||
return $ret;
|
||||
}
|
||||
|
||||
public function search($query){
|
||||
public function search($search_text, $page = 0) {
|
||||
$gdocs = new google_docs(new google_authsub($this->subauthtoken));
|
||||
|
||||
$ret = array();
|
||||
$ret['dynload'] = true;
|
||||
$ret['list'] = $gdocs->get_file_list($query);
|
||||
$ret['list'] = $gdocs->get_file_list($search_text);
|
||||
return $ret;
|
||||
}
|
||||
|
||||
@ -108,7 +108,7 @@ class repository_googledocs extends repository {
|
||||
return parent::logout();
|
||||
}
|
||||
|
||||
public function get_file($url, $file) {
|
||||
public function get_file($url, $file = '') {
|
||||
global $CFG;
|
||||
$path = $this->prepare_file($file);
|
||||
|
||||
|
@ -1672,7 +1672,7 @@ abstract class repository {
|
||||
*
|
||||
* @return mixed, see get_listing()
|
||||
*/
|
||||
public function search($search_text) {
|
||||
public function search($search_text, $page = 0) {
|
||||
$list = array();
|
||||
$list['list'] = array();
|
||||
return false;
|
||||
@ -1754,7 +1754,7 @@ abstract class repository {
|
||||
* @param object $mform Moodle form (passed by reference)
|
||||
* @param string $classname repository class name
|
||||
*/
|
||||
public function type_config_form($mform, $classname = 'repository') {
|
||||
public static function type_config_form($mform, $classname = 'repository') {
|
||||
$instnaceoptions = call_user_func(array($classname, 'get_instance_option_names'), $mform, $classname);
|
||||
if (empty($instnaceoptions)) {
|
||||
// this plugin has only one instance
|
||||
|
@ -57,7 +57,7 @@ class repository_merlot extends repository {
|
||||
* @param string $search_text
|
||||
* @return array
|
||||
*/
|
||||
public function search($search_text) {
|
||||
public function search($search_text, $page = 0) {
|
||||
$ret = array();
|
||||
$ret['nologin'] = true;
|
||||
$ret['list'] = $this->_get_collection($this->keyword, $this->author);
|
||||
@ -132,7 +132,7 @@ class repository_merlot extends repository {
|
||||
*
|
||||
* @param object $mform
|
||||
*/
|
||||
public function type_config_form($mform) {
|
||||
public static function type_config_form($mform, $classname = 'repository') {
|
||||
parent::type_config_form($mform);
|
||||
$licensekey = get_config('merlot', 'licensekey');
|
||||
if (empty($licensekey)) {
|
||||
|
@ -88,11 +88,11 @@ class repository_picasa extends repository {
|
||||
return $ret;
|
||||
}
|
||||
|
||||
public function search($query){
|
||||
public function search($search_text, $page = 0) {
|
||||
$picasa = new google_picasa(new google_authsub($this->subauthtoken));
|
||||
|
||||
$ret = array();
|
||||
$ret['list'] = $picasa->do_photo_search($query);
|
||||
$ret['list'] = $picasa->do_photo_search($search_text);
|
||||
return $ret;
|
||||
}
|
||||
|
||||
|
@ -132,7 +132,7 @@ class repository_recent extends repository {
|
||||
return array('recentfilesnumber', 'pluginname');
|
||||
}
|
||||
|
||||
public function type_config_form($mform, $classname = 'repository') {
|
||||
public static function type_config_form($mform, $classname = 'repository') {
|
||||
parent::type_config_form($mform, $classname);
|
||||
$number = get_config('repository_recent', 'recentfilesnumber');
|
||||
if (empty($number)) {
|
||||
|
@ -104,7 +104,7 @@ class repository_s3 extends repository {
|
||||
* @param string $file The file path in moodle
|
||||
* @return array The local stored path
|
||||
*/
|
||||
public function get_file($filepath, $file) {
|
||||
public function get_file($filepath, $file = '') {
|
||||
global $CFG;
|
||||
$arr = explode('/', $filepath);
|
||||
$bucket = $arr[0];
|
||||
@ -136,7 +136,7 @@ class repository_s3 extends repository {
|
||||
return array('access_key', 'secret_key', 'pluginname');
|
||||
}
|
||||
|
||||
public function type_config_form($mform) {
|
||||
public static function type_config_form($mform, $classname = 'repository') {
|
||||
parent::type_config_form($mform);
|
||||
$strrequired = get_string('required');
|
||||
$mform->addElement('text', 'access_key', get_string('access_key', 'repository_s3'));
|
||||
|
@ -61,7 +61,7 @@ class repository_webdav extends repository {
|
||||
public function check_login() {
|
||||
return true;
|
||||
}
|
||||
public function get_file($url, $title) {
|
||||
public function get_file($url, $title = '') {
|
||||
global $CFG;
|
||||
$url = urldecode($url);
|
||||
$path = $this->prepare_file($title);
|
||||
|
@ -106,7 +106,7 @@ EOD;
|
||||
public function global_search() {
|
||||
return false;
|
||||
}
|
||||
public function search($search_text) {
|
||||
public function search($search_text, $page = 0) {
|
||||
$client = new wikimedia;
|
||||
$search_result = array();
|
||||
$search_result['list'] = $client->search_images($search_text);
|
||||
|
@ -141,11 +141,11 @@ class wikimedia {
|
||||
* @param string $keyword
|
||||
* @return array
|
||||
*/
|
||||
public function search_images($keyword, $page = 0) {
|
||||
public function search($search_text, $page = 0) {
|
||||
$files_array = array();
|
||||
$this->_param['action'] = 'query';
|
||||
$this->_param['generator'] = 'search';
|
||||
$this->_param['gsrsearch'] = $keyword;
|
||||
$this->_param['gsrsearch'] = $search_text;
|
||||
$this->_param['gsrnamespace'] = WIKIMEDIA_FILE_NS;
|
||||
$this->_param['gsrlimit'] = WIKIMEDIA_THUMBS_PER_PAGE;
|
||||
$this->_param['gsroffset'] = $page * WIKIMEDIA_THUMBS_PER_PAGE;
|
||||
|
@ -49,7 +49,7 @@ class repository_youtube extends repository {
|
||||
* @param string $search_text
|
||||
* @return array
|
||||
*/
|
||||
public function search($search_text, $page) {
|
||||
public function search($search_text, $page = 0) {
|
||||
global $SESSION;
|
||||
$sort = optional_param('youtube_sort', '', PARAM_TEXT);
|
||||
$sess_keyword = 'youtube_'.$this->id.'_keyword';
|
||||
|
@ -12,7 +12,7 @@ class theme_anomaly_core_renderer extends core_renderer {
|
||||
* @param string $region the region the block is appearing in.
|
||||
* @return string the HTML to be output.
|
||||
*/
|
||||
function block($bc, $region) {
|
||||
function block(block_contents $bc, $region) {
|
||||
|
||||
$bc = clone($bc); // Avoid messing up the object passed in.
|
||||
if (empty($bc->blockinstanceid) || !strip_tags($bc->title)) {
|
||||
@ -35,7 +35,7 @@ class theme_anomaly_core_renderer extends core_renderer {
|
||||
}
|
||||
|
||||
$output .= html_writer::start_tag('div', $bc->attributes);
|
||||
|
||||
|
||||
/** Rounded corners **/
|
||||
$output .= html_writer::start_tag('div', array('class'=>'corner-box'));
|
||||
$output .= html_writer::start_tag('div', array('class'=>'rounded-corner top-left')).html_writer::end_tag('div');
|
||||
|
Loading…
x
Reference in New Issue
Block a user