Disable "My private files" block and "Offline activity" type

Disable "My private files" block and "Offline activity" type

by Johnny America -
Number of replies: 15

Good morning,

After some time editing moodle's code, look and feel I came across with some unsolveable (until now, I hope) issues in Moodle 2.0.

How do I disable "My private files" block to everyone? There's no such option in Administration > Plugins > Blocks > Manage blocks.

How do I disable some activities types such as "Offline activity" and "Advanced uploading of files"? There's only an option to disable ALL types of tasks, but how do I remove only specific types? Will I have to dig into moodle's code or is there any kind of option in the admin panel?

Average of ratings: -
In reply to Johnny America

Re: Disable "My private files" block and "Offline activity" type

by Johnny America -

Ok, I found the option to disable "My private files" block, which is actually not a block, but a repository. Go to Administration > Plugins > Repositories to disable it.

 

Now I still have the issue of how to disable "Offline activity" and "Advanced upload of files"...

 

Thanks!

In reply to Johnny America

Re: Disable "My private files" block and "Offline activity" type

by Davo Smith -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

If you really want to remove some of the assignment sub-types, then you can always go onto your server, open up the folder /mod/assignment/types and delete any that you do not want to use.

Out of curiosity, why is it so important that you remove them?

In reply to Davo Smith

Re: Disable "My private files" block and "Offline activity" type

by Johnny America -

Teachers and pupils at the university are really confused about the usage of the advanced upload. In my opinion, this is a great feature, but we've decide to minimize the amout of options in order to make easier for the teachers and students.

By the way, I deleted the folders of the subtypes and it still shows up on the course page. Am I missing something?

In reply to Johnny America

Re: Disable "My private files" block and "Offline activity" type

by Davo Smith -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

I'd suggest you log in as admin, the click on the 'home' button. I'd also click on 'site admin, development, purge all caches', as that should clear things out a bit.

If that doesn't work, you might have to do some manual fixes to the database to get rid of them properly (I guess new subtypes are set to install properly, but maybe no one added any code to handle the deleting of them?).

In reply to Davo Smith

Re: Disable "My private files" block and "Offline activity" type

by Johnny America -

I tried to purge caches but still it doesn't work. There's something we're missing...

In reply to Johnny America

Re: Disable "My private files" block and "Offline activity" type

by Johnny America -

Another question, I'll be very grateful if someones spends their time helping me!

How do configure which block will be default in new courses? I tried opening a random course, adding blocks in it and then created a new course, however the new one doesn't acquire the settings I've made in the older one.

In reply to Johnny America

Re: Disable "My private files" block and "Offline activity" type

by Davo Smith -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

I'm not sure if there is a better answer, but if you have access to the site code, you can change the default blocks by opening '/course/format/[chosenformat]/config.php' and editing the list of blocks there.

In reply to Davo Smith

Re: Disable "My private files" block and "Offline activity" type

by Erik Ordway -

Take a look in config-dist.php for code to put in you config.

// These variables define DEFAULT block variables for new courses// If this one is set it overrides all others and is the only one used.//      
$CFG->defaultblocks_override = 'participants,activity_modules,search_forums,admin,course_list:news_items,calendar_upcoming,recent_activity';
//// These variables define the specific settings for defined course formats.
// They override any settings defined in the formats own config file.
//      $CFG->defaultblocks_site = 'site_main_menu,admin,course_list:course_summary,calendar_month';
//      $CFG->defaultblocks_social = 'participants,search_forums,calendar_month,calendar_upcoming,social_activities,recent_activity,admin,course_list';
//      $CFG->defaultblocks_topics = 'participants,activity_modules,search_forums,admin,course_list:news_items,calendar_upcoming,recent_activity';
//      $CFG->defaultblocks_weeks = 'participants,activity_modules,search_forums,admin,course_list:news_items,calendar_upcoming,recent_activity';
//

Also I do the following in my customized IMS import to order them to my liking.

function order_default_course_blocks($course) 
{ $contextid = get_context_instance(CONTEXT_COURSE,$course->id)->id;    
global $DB;    
$instances = $DB->get_recordset('block_instances', array('parentcontextid' => $contextid));    
foreach ($instances as $instance) 
{ switch ($instance->blockname) 
{ 
case "fac_help"; $instance->defaultweight = -6; break; 
case "help"; $instance->defaultweight = -6; break; 
case "stu_help"; $instance->defaultweight = -5; break; 
case "participants"; $instance->defaultweight = -4; break; 
case "messages"; $instance->defaultweight = 5; break; 
case "staff"; $instance->defaultweight = 6; break; }
 $DB->update_record('block_instances', $instance);    
}    
$instances->close();
}
In reply to Erik Ordway

Re: Disable "My private files" block and "Offline activity" type

by Johnny America -

Erik, the code for custom order is exactly what I was wondering how to do. Great code, but... where do I put it? Is it in config.php below the $CFG->defaultblocks?

In reply to Johnny America

Re: Disable "My private files" block and "Offline activity" type

by Erik Ordway -

Yes the config info from config-dist.php are examples/defaults for the config.php .

 

For the block ordering code all our courses are generated via the ims enterprise import plugin.  I had to do some work there to make it work for our school.  In doing that I added things like this that as specific to us.  You would need to find the appropriate place in your course creation process for your school.

In reply to Johnny America

Re: Disable "My private files" block and "Offline activity" type

by Ralf Hilgenstock -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Translators

The assignment types are folder in mod/assignment/type.
Default block settings are made in config.php. See conf-dist.php file in root folder for information about the CFG definiton.

In reply to Ralf Hilgenstock

Re: Disable "My private files" block and "Offline activity" type

by Johnny America -

I tried to delete the subtypes (offline, upload) folders but they still appears on the course page.

In reply to Johnny America

Re: Disable "My private files" block and "Offline activity" type

by Sarah Jane -

Hi Johnny

Did you manage to remove these files from your site? I too wish to remove them as we seem to have the same confusion. I have worked through the forum and done as suggested but still see the words even though I have remove the files from the server.

What did you do to remove them totally from the dropdown list? I am using 2.2.7 moodle

Many thanks Sarah x

In reply to Sarah Jane

Re: Disable "My private files" block and "Offline activity" type

by Rahul Sawhney -

For disabling block of "My "Private Files" Go to


Site Administration-->Plugins-->Blocks and from there you can hide or uninstall it completely