Skip to content

Commit

Permalink
MDL-23069 moving version and cron info into standard version.php - fi…
Browse files Browse the repository at this point in the history
…nally, yay!
  • Loading branch information
skodak committed Jul 4, 2010
1 parent 411b8c2 commit 8571833
Show file tree
Hide file tree
Showing 84 changed files with 763 additions and 114 deletions.
20 changes: 16 additions & 4 deletions admin/blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,16 @@
if (!file_exists("$CFG->dirroot/blocks/$blockname/block_$blockname.php")) {
$blockobject = false;
$strblockname = '<span class="notifyproblem">'.$blockname.' ('.get_string('missingfromdisk').')</span>';
$plugin = new object();
$plugin->version = $block->version;

} else {
$plugin = new object();
$plugin->version = '???';
if (file_exists("$CFG->dirroot/blocks/$blockname/version.php")) {
include("$CFG->dirroot/blocks/$blockname/version.php");
}

if (!$blockobject = block_instance($block->name)) {
$incompatible[] = $block;
continue;
Expand Down Expand Up @@ -172,14 +181,17 @@
$class = ' class="dimmed_text"'; // Leading space required!
}


if ($blockobject) {
$blockobject->get_version();
if ($block->version == $plugin->version) {
$version = $block->version;
} else {
$version = "$block->version ($plugin->version)";
}


$table->add_data(array(
'<span'.$class.'>'.$strblockname.'</span>',
$blocklist,
'<span'.$class.'>'.$block->version.'</span>',
'<span'.$class.'>'.$version.'</span>',
$visible,
$delete,
$settings
Expand Down
1 change: 0 additions & 1 deletion blocks/activity_modules/block_activity_modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
class block_activity_modules extends block_list {
function init() {
$this->title = get_string('pluginname', 'block_activity_modules');
$this->version = 2007101509;
}

function get_content() {
Expand Down
18 changes: 18 additions & 0 deletions blocks/activity_modules/version.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

$plugin->version = 2007101509;
1 change: 0 additions & 1 deletion blocks/admin_bookmarks/block_admin_bookmarks.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ class block_admin_bookmarks extends block_base {

function init() {
$this->title = get_string('pluginname', 'block_admin_bookmarks');
$this->version = 2007101509;
}

function applicable_formats() {
Expand Down
18 changes: 18 additions & 0 deletions blocks/admin_bookmarks/version.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

$plugin->version = 2007101509;
5 changes: 2 additions & 3 deletions blocks/blog_menu/block_blog_menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ class block_blog_menu extends block_base {

function init() {
$this->title = get_string('pluginname', 'block_blog_menu');
$this->version = 2009071700;
}

function instance_allow_multiple() {
Expand All @@ -57,7 +56,7 @@ function instance_allow_config() {
}

function get_content() {

// Check if we've already generated content
if (!empty($this->content)) {
return $this->content;
Expand All @@ -79,7 +78,7 @@ function get_content() {
}
return $this->content;
}

// Iterate the option types
$menulist = array();
foreach ($options as $types) {
Expand Down
18 changes: 18 additions & 0 deletions blocks/blog_menu/version.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

$plugin->version = 2009071700;
1 change: 0 additions & 1 deletion blocks/blog_recent/block_blog_recent.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ class block_blog_recent extends block_base {
function init() {
$this->title = get_string('pluginname', 'block_blog_recent');
$this->content_type = BLOCK_TYPE_TEXT;
$this->version = 2009070900;
}

function applicable_formats() {
Expand Down
18 changes: 18 additions & 0 deletions blocks/blog_recent/version.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

$plugin->version = 2009070900;
3 changes: 2 additions & 1 deletion blocks/blog_tags/block_blog_tags.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

//TODO: fix these sloppy constant names or move them elsewhere!

define('BLOGDEFAULTTIMEWITHIN', 90);
define('BLOGDEFAULTNUMBEROFTAGS', 20);
define('BLOGDEFAULTSORT', 'name');
Expand All @@ -8,7 +10,6 @@

class block_blog_tags extends block_base {
function init() {
$this->version = 2007101509;
$this->title = get_string('pluginname', 'block_blog_tags');
}

Expand Down
18 changes: 18 additions & 0 deletions blocks/blog_tags/version.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

$plugin->version = 2007101509;
1 change: 0 additions & 1 deletion blocks/calendar_month/block_calendar_month.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
class block_calendar_month extends block_base {
function init() {
$this->title = get_string('pluginname', 'block_calendar_month');
$this->version = 2007101509;
}

function preferred_width() {
Expand Down
18 changes: 18 additions & 0 deletions blocks/calendar_month/version.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

$plugin->version = 2007101509;
1 change: 0 additions & 1 deletion blocks/calendar_upcoming/block_calendar_upcoming.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
class block_calendar_upcoming extends block_base {
function init() {
$this->title = get_string('pluginname', 'block_calendar_upcoming');
$this->version = 2007101509;
}

function get_content() {
Expand Down
18 changes: 18 additions & 0 deletions blocks/calendar_upcoming/version.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

$plugin->version = 2007101509;
1 change: 0 additions & 1 deletion blocks/comments/block_comments.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ class block_comments extends block_base {

function init() {
$this->title = get_string('pluginname', 'block_comments');
$this->version = 2009072000;
}

function specialization() {
Expand Down
18 changes: 18 additions & 0 deletions blocks/comments/version.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

$plugin->version = 2009072000;
5 changes: 2 additions & 3 deletions blocks/community/block_community.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
class block_community extends block_list {
function init() {
$this->title = get_string('pluginname', 'block_community');
$this->version = 2010042701;
}

function user_can_addto($page) {
Expand Down Expand Up @@ -80,8 +79,8 @@ function get_content() {
$this->content->icons[] = '';
foreach ($courses as $course) {
//delete link
$deleteicon = html_writer::empty_tag('img',
array('src' => $OUTPUT->pix_url('i/cross_red_small'),
$deleteicon = html_writer::empty_tag('img',
array('src' => $OUTPUT->pix_url('i/cross_red_small'),
'alt' => get_string('removecommunitycourse', 'block_community')));
$deleteurl = new moodle_url($CFG->wwwroot.'/blocks/community/communitycourse.php',
array('remove'=>true, 'communityid'=> $course->id, 'sesskey' => sesskey()));
Expand Down
18 changes: 18 additions & 0 deletions blocks/community/version.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

$plugin->version = 2010042701;
1 change: 0 additions & 1 deletion blocks/completionstatus/block_completionstatus.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ class block_completionstatus extends block_base {

public function init() {
$this->title = get_string('completionstatus', 'block_completionstatus');
$this->version = 2009072800;
}

public function get_content() {
Expand Down
18 changes: 18 additions & 0 deletions blocks/completionstatus/version.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

$plugin->version = 2009072800;
1 change: 0 additions & 1 deletion blocks/course_list/block_course_list.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
class block_course_list extends block_list {
function init() {
$this->title = get_string('courses');
$this->version = 2007101509;
}

function has_config() {
Expand Down
18 changes: 18 additions & 0 deletions blocks/course_list/version.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

$plugin->version = 2007101509;
1 change: 0 additions & 1 deletion blocks/course_overview/block_course_overview.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ class block_course_overview extends block_base {
*/
public function init() {
$this->title = get_string('pluginname', 'block_course_overview');
$this->version = 2010021100;
}

/**
Expand Down
18 changes: 18 additions & 0 deletions blocks/course_overview/version.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

$plugin->version = 2010021100;
Loading

0 comments on commit 8571833

Please sign in to comment.