moodle其他搜集

moodle白屏、空白无内容解决办法
删除moodledata的文件(filedir和lang文件夹下的内容不要删,其他都可以删掉)
不行的话在admin目录下index.php文件里有如下代码段:   
if ((isset($_GET['cache']) and $_GET['cache'] === '0')
        or (isset($_POST['cache']) and $_POST['cache'] === '0')
        or (!isset($_POST['cache']) and !isset($_GET['cache']) and empty($_GET['sesskey']) and empty($_POST['sesskey']))) {
    // Prevent caching at all cost when visiting this page directly,
    // we redirect to self once we known no upgrades are necessary.
    // Note: $_GET and $_POST are used here intentionally because our param cleaning is not loaded yet.
    // Note2: the sesskey is present in all block editing hacks, we can not redirect there, so enable caching.
    define('CACHE_DISABLE_ALL', true);

    // Force OPcache reset if used, we do not want any stale caches
    // when detecting if upgrade necessary or when running upgrade.
    if (function_exists('opcache_reset')) {
        opcache_reset();
    }
    $cache = 0;

} else {
    $cache = 1;
}

你可以将这段代码注释或删除掉

或者在空白页url后加上?cache=1  如http://www.moodle.com/my/index.php?cache=1





$fs = get_file_storage();这个函数相当于下面的
require_once("$CFG->libdir/filelib.php");
$fs = new file_storage();

返回用户上传文件的信息的实例

1.将面包屑的符号换成">>",找到皮肤包里的config.php文件,在最后加入

$THEME->rarrow=">&gt";

2.引入自己的js代码:找到皮肤包里的config.php,在后面加入

$THEME->javascripts = array();
$THEME->javascripts_footer = array('jquery-1.7.2.min','custom');

其中,上面一段代码是把js加到页面前面,下面一段代码是将js加到页面后面,然后就可以把js文件放到皮肤包里新建的一个javascript文件夹里了

3.引入自定义样式:找到皮肤包里的config.php,在里面的

$THEME->sheets = array();

里加入自己的样式文件名,不用带后缀,注意用json格式

4.让主页左侧的block默认展开:在自己引入的js里加入这样一段代码

$('#region-pre .block').removeClass('hidden');

最主要的就是要去掉hidden这个类,前面的选择器可以与eq()方法组合,只选中某一个block让其展开

5.更换block区域的收缩展开图标:找到皮肤包里的pix_core/t/文件夹,没有就新建这几个文件夹,再把要换的图片取名为switch_minus和switch_plus放到这个t文件夹里即可

6.使整个block区域都可以点击,而不只是那个小图标才能点击:可以用css方法将小图标的父标签变成绝对定位,尺寸修改为充满整个title,这样整个title区域就可以点击了,再将小图标用大一些的透明图片代替,这个图片尺寸也是title的尺寸,这样就可以实现点击整个title就使block收缩与展开了

7.统一设置侧边block停靠功能(dock):找到皮肤包里的config.php,加入代码

$THEME->enable_dock = true;

 8.模块只对某些角色可见

用管理员登录,点击要编辑的模块,点击右边的人物图标

出现“您不能在此分配任何角色”,不用管这个,直接点设置里的“权限”,会出现一个表格,只用在这个表格下面把一些角色删除,那种角色的账号就不能看到这个模块了。

原文地址:https://www.cnblogs.com/lichihua/p/5863740.html