Skip to content

Commit

Permalink
MDL-32095 some more E_STRICT fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
skodak committed Mar 26, 2012
1 parent c856a1f commit 68a7c9a
Show file tree
Hide file tree
Showing 20 changed files with 45 additions and 45 deletions.
20 changes: 10 additions & 10 deletions filter/activitynames/filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ function filter($text, array $options = array()) {
}

// 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;
Expand All @@ -68,7 +68,7 @@ function filter($text, array $options = array()) {

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');
Expand All @@ -82,18 +82,18 @@ function filter($text, array $options = array()) {
/// 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 (&amp; &quot; &lt; &gt;) 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);
}
}
}
}
}
}

if ($this->activitylist) {
return $text = filter_phrases ($text, $this->activitylist);
if (self::$activitylist) {
return $text = filter_phrases ($text, self::$activitylist);
} else {
return $text;
}
Expand Down
6 changes: 3 additions & 3 deletions lib/pear/HTML/QuickForm/Rule.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions lib/pear/HTML/QuickForm/Rule/Range.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -48,13 +48,13 @@ function validate($value, $options)
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}");
Expand Down
2 changes: 1 addition & 1 deletion repository/alfresco/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ public function print_search() {
* @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);
Expand Down
4 changes: 2 additions & 2 deletions repository/boxnet/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public function get_option($config = '') {
* @param string $search_text
* @return mixed
*/
public function search($search_text) {
public function search($search_text, $page = 0) {
global $OUTPUT;
$list = array();
$ret = array();
Expand Down Expand Up @@ -206,7 +206,7 @@ public function callback() {
* 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');
Expand Down
2 changes: 1 addition & 1 deletion repository/dropbox/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ public function get_file($filepath, $saveas = '') {
* 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');
Expand Down
2 changes: 1 addition & 1 deletion repository/dropbox/locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function get_listing($path='/', $token='', $secret='') {
/**
* Download a file
*/
public function get_file($filepath, $saveas) {
public function get_file($filepath, $saveas = '') {
$info = pathinfo($filepath);
$dirname = $info['dirname'];
$basename = $info['basename'];
Expand Down
4 changes: 2 additions & 2 deletions repository/flickr/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ private function build_list($photos, $page = 1) {
* @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,
Expand Down Expand Up @@ -274,7 +274,7 @@ public function get_file($photo_id, $file = '') {
* 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');
Expand Down
4 changes: 2 additions & 2 deletions repository/flickr_public/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ public function license4moodle ($license_id) {
* @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)) {
Expand Down Expand Up @@ -471,7 +471,7 @@ public static function get_instance_option_names() {
* 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 = '';
Expand Down
6 changes: 3 additions & 3 deletions repository/googledocs/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,12 @@ public function get_listing($path='', $page = '') {
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;
}

Expand All @@ -108,7 +108,7 @@ public function logout(){
return parent::logout();
}

public function get_file($url, $file) {
public function get_file($url, $file = '') {
global $CFG;
$path = $this->prepare_file($file);

Expand Down
4 changes: 2 additions & 2 deletions repository/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1672,7 +1672,7 @@ public function get_listing($path = '', $page = '') {
*
* @return mixed, see get_listing()
*/
public function search($search_text) {
public function search($search_text, $page = 0) {
$list = array();
$list['list'] = array();
return false;
Expand Down Expand Up @@ -1754,7 +1754,7 @@ public static function plugin_init() {
* @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
Expand Down
4 changes: 2 additions & 2 deletions repository/merlot/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function global_search() {
* @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);
Expand Down Expand Up @@ -132,7 +132,7 @@ public static function get_type_option_names() {
*
* @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)) {
Expand Down
4 changes: 2 additions & 2 deletions repository/picasa/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@ public function get_listing($path='', $page = '') {
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;
}

Expand Down
2 changes: 1 addition & 1 deletion repository/recent/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public static function get_type_option_names() {
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)) {
Expand Down
4 changes: 2 additions & 2 deletions repository/s3/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public function get_listing($path = '', $page = '') {
* @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];
Expand Down Expand Up @@ -136,7 +136,7 @@ public static function get_type_option_names() {
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'));
Expand Down
2 changes: 1 addition & 1 deletion repository/webdav/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function __construct($repositoryid, $context = SYSCONTEXTID, $options = a
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);
Expand Down
2 changes: 1 addition & 1 deletion repository/wikimedia/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public function print_login() {
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);
Expand Down
4 changes: 2 additions & 2 deletions repository/wikimedia/wikimedia.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,11 @@ public function get_thumb_url($image_url, $orig_width, $orig_height, $thumb_widt
* @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;
Expand Down
2 changes: 1 addition & 1 deletion repository/youtube/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function check_login() {
* @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';
Expand Down
4 changes: 2 additions & 2 deletions theme/anomaly/renderers.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand All @@ -35,7 +35,7 @@ function block($bc, $region) {
}

$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');
Expand Down

0 comments on commit 68a7c9a

Please sign in to comment.