代码之家  ›  专栏  ›  技术社区  ›  Roberto Aloi

将自定义CSS添加到新的Moodle分配中

  •  2
  • Roberto Aloi  · 技术社区  · 16 年前

    我正在开发一个新的Moodle任务插件。 我正在使用Moodle 1.9.7。

    2 回复  |  直到 16 年前
        1
  •  2
  •   nadavkav    16 年前

    解析文件时,该文件应输出CSS代码。

    当构建页面的CSS布局时,Moodle进入每个模块的文件夹并查找该文件。

    一些主题可以使用主题的config.php文件中的特殊设置忽略这些文件

    $THEME->modsheets = true;
    
    /// When this is enabled, then this theme will search for
    /// files named "styles.php" inside all Activity modules and
    /// include them.   This allows modules to provide some basic
    /// layouts so they work out of the box.
    /// It is HIGHLY recommended to leave this enabled.
    

    styles.php

    /* simple CSS code */ 
    .left { float:left; }
    
    /* php that generate CSS code */
    < ?php if ( right_to_left() ) {echo ".right:text-align:left;"} 
    else {echo ".right:text-align:right;"} ?>
    
        2
  •  0
  •   Dilip Rajkumar    14 年前

    function print_header_simple() 定义于 lib/weblib.php .

    $meta <head>

    在里面 lib/weblib.php :

    function print_header_simple($title='', $heading='', $navigation='', $focus='', $meta='', $cache=true, $button='&nbsp;', $menu='', $usexml=false, $bodytags='', $return=false) {
    

    $extra_css = $CFG->wwwroot.'/theme/SUPA4/supa_report.css';
    $extra_css_meta = '<link rel="stylesheet" type="text/css" href="'.$extra_css.'" />';
    print_header_simple($mytitle, "", $navigation, "", "", true, "", navmenu($course), '', $extra_css_meta);
    
    推荐文章