mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 16:32:18 +02:00
Fixed a mistaken checkin (never copy the CVS directory!) :-)
This commit is contained in:
parent
d797e50f78
commit
d726e8c948
@ -1,86 +0,0 @@
|
||||
<?PHP //$Id$
|
||||
|
||||
class block_tags extends block_base {
|
||||
function init() {
|
||||
$this->version = 2007082800;
|
||||
$this->title = get_string('blocktagstitle', 'tag');
|
||||
}
|
||||
|
||||
function instance_allow_multiple() {
|
||||
return true;
|
||||
}
|
||||
|
||||
function has_config() {
|
||||
return false;
|
||||
}
|
||||
|
||||
function applicable_formats() {
|
||||
return array('all' => true, 'my' => false, 'tag' => false);
|
||||
}
|
||||
|
||||
function instance_allow_config() {
|
||||
return true;
|
||||
}
|
||||
|
||||
function specialization() {
|
||||
|
||||
// load userdefined title and make sure it's never empty
|
||||
if (empty($this->config->title)) {
|
||||
$this->title = get_string('blocktagstitle','tag');
|
||||
} else {
|
||||
$this->title = $this->config->title;
|
||||
}
|
||||
}
|
||||
|
||||
function get_content() {
|
||||
|
||||
global $CFG, $SITE, $COURSE, $USER;
|
||||
|
||||
if (empty($CFG->usetags)) {
|
||||
$this->content->text = '';
|
||||
return $this->content;
|
||||
}
|
||||
|
||||
if (empty($this->config->numberoftags)) {
|
||||
$this->config->numberoftags = 80;
|
||||
}
|
||||
|
||||
if ($this->content !== NULL) {
|
||||
return $this->content;
|
||||
}
|
||||
|
||||
if (empty($this->instance)) {
|
||||
$this->content = '';
|
||||
return $this->content;
|
||||
}
|
||||
|
||||
$this->content = new stdClass;
|
||||
$this->content->footer = '';
|
||||
|
||||
/// Get a list of tags
|
||||
|
||||
include($CFG->dirroot.'/tag/lib.php');
|
||||
|
||||
$this->content->text = print_tag_cloud(popular_tags_count($this->config->numberoftags), false, 170,70, true);
|
||||
|
||||
return $this->content;
|
||||
}
|
||||
|
||||
function instance_config_print() {
|
||||
global $CFG;
|
||||
|
||||
/// set up the numberoftags select field
|
||||
$numberoftags = array();
|
||||
for($i=1;$i<=200;$i++) $numberoftags[$i] = $i;
|
||||
|
||||
if (is_file($CFG->dirroot .'/blocks/'. $this->name() .'/config_instance.html')) {
|
||||
print_simple_box_start('center', '', '', 5, 'blockconfigglobal');
|
||||
include($CFG->dirroot .'/blocks/'. $this->name() .'/config_instance.html');
|
||||
print_simple_box_end();
|
||||
} else {
|
||||
notice(get_string('blockconfigbad'), str_replace('blockaction=', 'dummy=', qualified_me()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -1,9 +1,15 @@
|
||||
<?php
|
||||
if (empty($this->config->title)) {
|
||||
$this->config->title = get_string('blocktagstitle', 'tag');
|
||||
$this->config->title = get_string('blogtags', 'blog');
|
||||
}
|
||||
if (empty($this->config->timewithin)) {
|
||||
$this->config->timewithin = BLOGDEFAULTTIMEWITHIN;
|
||||
}
|
||||
if (empty($this->config->numberoftags)) {
|
||||
$this->config->numberoftags = 80;
|
||||
$this->config->numberoftags = BLOGDEFAULTNUMBEROFTAGS;
|
||||
}
|
||||
if (empty($this->config->sort)) {
|
||||
$this->config->sort = BLOGDEFAULTSORT;
|
||||
}
|
||||
?>
|
||||
|
||||
@ -19,6 +25,16 @@
|
||||
<td><?php choose_from_menu($numberoftags,"numberoftags",$this->config->numberoftags) ?></td>
|
||||
</tr>
|
||||
|
||||
<tr valign="top">
|
||||
<td align="right"><?php print_string("timewithin","blog") ?>:</td>
|
||||
<td><?php choose_from_menu($timewithin,"timewithin",$this->config->timewithin) ?></td>
|
||||
</tr>
|
||||
|
||||
<tr valign="top">
|
||||
<td align="right"><?php print_string("tagsort","blog") ?>:</td>
|
||||
<td><?php choose_from_menu($sort,"sort",$this->config->sort) ?></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2" align="center"><input type="submit" value="<?php print_string("savechanges") ?>" /></td>
|
||||
</tr>
|
||||
|
Loading…
x
Reference in New Issue
Block a user