Commit 8571833f authored by Petr Skoda's avatar Petr Skoda
Browse files

MDL-23069 moving version and cron info into standard version.php - finally, yay!

parent 411b8c23
...@@ -126,7 +126,16 @@ ...@@ -126,7 +126,16 @@
if (!file_exists("$CFG->dirroot/blocks/$blockname/block_$blockname.php")) { if (!file_exists("$CFG->dirroot/blocks/$blockname/block_$blockname.php")) {
$blockobject = false; $blockobject = false;
$strblockname = '<span class="notifyproblem">'.$blockname.' ('.get_string('missingfromdisk').')</span>'; $strblockname = '<span class="notifyproblem">'.$blockname.' ('.get_string('missingfromdisk').')</span>';
$plugin = new object();
$plugin->version = $block->version;
} else { } 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)) { if (!$blockobject = block_instance($block->name)) {
$incompatible[] = $block; $incompatible[] = $block;
continue; continue;
...@@ -172,14 +181,17 @@ ...@@ -172,14 +181,17 @@
$class = ' class="dimmed_text"'; // Leading space required! $class = ' class="dimmed_text"'; // Leading space required!
} }
if ($block->version == $plugin->version) {
if ($blockobject) { $version = $block->version;
$blockobject->get_version(); } else {
$version = "$block->version ($plugin->version)";
} }
$table->add_data(array( $table->add_data(array(
'<span'.$class.'>'.$strblockname.'</span>', '<span'.$class.'>'.$strblockname.'</span>',
$blocklist, $blocklist,
'<span'.$class.'>'.$block->version.'</span>', '<span'.$class.'>'.$version.'</span>',
$visible, $visible,
$delete, $delete,
$settings $settings
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
class block_activity_modules extends block_list { class block_activity_modules extends block_list {
function init() { function init() {
$this->title = get_string('pluginname', 'block_activity_modules'); $this->title = get_string('pluginname', 'block_activity_modules');
$this->version = 2007101509;
} }
function get_content() { function get_content() {
......
<?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;
...@@ -8,7 +8,6 @@ class block_admin_bookmarks extends block_base { ...@@ -8,7 +8,6 @@ class block_admin_bookmarks extends block_base {
function init() { function init() {
$this->title = get_string('pluginname', 'block_admin_bookmarks'); $this->title = get_string('pluginname', 'block_admin_bookmarks');
$this->version = 2007101509;
} }
function applicable_formats() { function applicable_formats() {
......
<?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;
...@@ -37,7 +37,6 @@ class block_blog_menu extends block_base { ...@@ -37,7 +37,6 @@ class block_blog_menu extends block_base {
function init() { function init() {
$this->title = get_string('pluginname', 'block_blog_menu'); $this->title = get_string('pluginname', 'block_blog_menu');
$this->version = 2009071700;
} }
function instance_allow_multiple() { function instance_allow_multiple() {
...@@ -57,7 +56,7 @@ class block_blog_menu extends block_base { ...@@ -57,7 +56,7 @@ class block_blog_menu extends block_base {
} }
function get_content() { function get_content() {
// Check if we've already generated content // Check if we've already generated content
if (!empty($this->content)) { if (!empty($this->content)) {
return $this->content; return $this->content;
...@@ -79,7 +78,7 @@ class block_blog_menu extends block_base { ...@@ -79,7 +78,7 @@ class block_blog_menu extends block_base {
} }
return $this->content; return $this->content;
} }
// Iterate the option types // Iterate the option types
$menulist = array(); $menulist = array();
foreach ($options as $types) { foreach ($options as $types) {
......
<?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;
...@@ -37,7 +37,6 @@ class block_blog_recent extends block_base { ...@@ -37,7 +37,6 @@ class block_blog_recent extends block_base {
function init() { function init() {
$this->title = get_string('pluginname', 'block_blog_recent'); $this->title = get_string('pluginname', 'block_blog_recent');
$this->content_type = BLOCK_TYPE_TEXT; $this->content_type = BLOCK_TYPE_TEXT;
$this->version = 2009070900;
} }
function applicable_formats() { function applicable_formats() {
......
<?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;
<?php <?php
//TODO: fix these sloppy constant names or move them elsewhere!
define('BLOGDEFAULTTIMEWITHIN', 90); define('BLOGDEFAULTTIMEWITHIN', 90);
define('BLOGDEFAULTNUMBEROFTAGS', 20); define('BLOGDEFAULTNUMBEROFTAGS', 20);
define('BLOGDEFAULTSORT', 'name'); define('BLOGDEFAULTSORT', 'name');
...@@ -8,7 +10,6 @@ require_once($CFG->dirroot .'/blog/lib.php'); ...@@ -8,7 +10,6 @@ require_once($CFG->dirroot .'/blog/lib.php');
class block_blog_tags extends block_base { class block_blog_tags extends block_base {
function init() { function init() {
$this->version = 2007101509;
$this->title = get_string('pluginname', 'block_blog_tags'); $this->title = get_string('pluginname', 'block_blog_tags');
} }
......
<?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;
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
class block_calendar_month extends block_base { class block_calendar_month extends block_base {
function init() { function init() {
$this->title = get_string('pluginname', 'block_calendar_month'); $this->title = get_string('pluginname', 'block_calendar_month');
$this->version = 2007101509;
} }
function preferred_width() { function preferred_width() {
......
<?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;
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
class block_calendar_upcoming extends block_base { class block_calendar_upcoming extends block_base {
function init() { function init() {
$this->title = get_string('pluginname', 'block_calendar_upcoming'); $this->title = get_string('pluginname', 'block_calendar_upcoming');
$this->version = 2007101509;
} }
function get_content() { function get_content() {
......
<?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;
...@@ -6,7 +6,6 @@ class block_comments extends block_base { ...@@ -6,7 +6,6 @@ class block_comments extends block_base {
function init() { function init() {
$this->title = get_string('pluginname', 'block_comments'); $this->title = get_string('pluginname', 'block_comments');
$this->version = 2009072000;
} }
function specialization() { function specialization() {
......
<?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;
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
class block_community extends block_list { class block_community extends block_list {
function init() { function init() {
$this->title = get_string('pluginname', 'block_community'); $this->title = get_string('pluginname', 'block_community');
$this->version = 2010042701;
} }
function user_can_addto($page) { function user_can_addto($page) {
...@@ -80,8 +79,8 @@ class block_community extends block_list { ...@@ -80,8 +79,8 @@ class block_community extends block_list {
$this->content->icons[] = ''; $this->content->icons[] = '';
foreach ($courses as $course) { foreach ($courses as $course) {
//delete link //delete link
$deleteicon = html_writer::empty_tag('img', $deleteicon = html_writer::empty_tag('img',
array('src' => $OUTPUT->pix_url('i/cross_red_small'), array('src' => $OUTPUT->pix_url('i/cross_red_small'),
'alt' => get_string('removecommunitycourse', 'block_community'))); 'alt' => get_string('removecommunitycourse', 'block_community')));
$deleteurl = new moodle_url($CFG->wwwroot.'/blocks/community/communitycourse.php', $deleteurl = new moodle_url($CFG->wwwroot.'/blocks/community/communitycourse.php',
array('remove'=>true, 'communityid'=> $course->id, 'sesskey' => sesskey())); array('remove'=>true, 'communityid'=> $course->id, 'sesskey' => sesskey()));
......
<?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;
...@@ -34,7 +34,6 @@ class block_completionstatus extends block_base { ...@@ -34,7 +34,6 @@ class block_completionstatus extends block_base {
public function init() { public function init() {
$this->title = get_string('completionstatus', 'block_completionstatus'); $this->title = get_string('completionstatus', 'block_completionstatus');
$this->version = 2009072800;
} }
public function get_content() { public function get_content() {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment