Moodle
  1. Moodle
  2. MDL-19077

Implement the theme engines proposal

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0
    • Component/s: Themes
    • Labels:
      None
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE
    • Rank:
      35357
    1. blocks_output.patch
      102 kB
      Tim Hunt
    2. theme_engine_infrastructure.patch
      44 kB
      Tim Hunt
    3. themes_cleanup.patch
      96 kB
      Tim Hunt
    4. work_in_progress.patch
      98 kB
      Tim Hunt

      Issue Links

        Activity

        Hide
        Frank Ralf added a comment -

        Hi Tim,

        I have just stumbled over this website http://realworldstyle.com that provides CSS layouts with 2 or 3 columns, header and footer, which even work with NN4 (I'd call that robust...).

        hth
        Frank

        Show
        Frank Ralf added a comment - Hi Tim, I have just stumbled over this website http://realworldstyle.com that provides CSS layouts with 2 or 3 columns, header and footer, which even work with NN4 (I'd call that robust...). hth Frank
        Hide
        Thomas Hanley added a comment -

        Hi Tim,

        Maxdesign are pretty reliable with regard to web standards and accessibility.

        http://maxdesign.com.au/presentation/page_layouts/

        The CSS-discuss list also has alot of info on this, presented in a table showing solutions that are both fixed and fluid. It also shows browser support:

        http://css-discuss.incutio.com/?page=ThreeColumnLayouts

        ~thomas

        Show
        Thomas Hanley added a comment - Hi Tim, Maxdesign are pretty reliable with regard to web standards and accessibility. http://maxdesign.com.au/presentation/page_layouts/ The CSS-discuss list also has alot of info on this, presented in a table showing solutions that are both fixed and fluid. It also shows browser support: http://css-discuss.incutio.com/?page=ThreeColumnLayouts ~thomas
        Hide
        Tim Hunt added a comment -

        The attached patch (theme_engine_infrastructure.patch) implements most of http://docs.moodle.org/en/Development:Theme_engines_for_Moodle%3F

        It does not yet implement any actual rendering methods to replace the ones in weblib. However it does implement all the renderer_engine infrastructure, and a working template renderer.

        There are unit tests, and PHP doc comments, which hopefully show how it works.

        (Note, while the template renderer does work, it probably does not have very good performance. Consider it an interesting proof-of-concept until it has had extensive testing.)

        Code reviews and comments welcome. I would like to commit this tomorrow, and then move on to re-implementing all the weblib print_... functions as moodle_core_renderer methods.

        Show
        Tim Hunt added a comment - The attached patch (theme_engine_infrastructure.patch) implements most of http://docs.moodle.org/en/Development:Theme_engines_for_Moodle%3F It does not yet implement any actual rendering methods to replace the ones in weblib. However it does implement all the renderer_engine infrastructure, and a working template renderer. There are unit tests, and PHP doc comments, which hopefully show how it works. (Note, while the template renderer does work, it probably does not have very good performance. Consider it an interesting proof-of-concept until it has had extensive testing.) Code reviews and comments welcome. I would like to commit this tomorrow, and then move on to re-implementing all the weblib print_... functions as moodle_core_renderer methods.
        Hide
        Dan Poltawski added a comment -

        Wow, i've reviewed the code and i've learnt bits of php magic I didn't know existed! The only thing I can add is to point out two comment typos:

        taking the frist one
        Render the template for a gives method

        Show
        Dan Poltawski added a comment - Wow, i've reviewed the code and i've learnt bits of php magic I didn't know existed! The only thing I can add is to point out two comment typos: taking the frist one Render the template for a gives method
        Hide
        Tim Hunt added a comment -

        Attach my current work in progress as a backup.

        Show
        Tim Hunt added a comment - Attach my current work in progress as a backup.
        Hide
        Tim Hunt added a comment -

        OK, another big chunk checked in.

        Show
        Tim Hunt added a comment - OK, another big chunk checked in.
        Hide
        Tim Hunt added a comment - - edited

        Another work-in-progress patch (themes_cleanup.patch).

        This one cleans up how themes are initialised, and how the theme CSS is processed.

        The bit I would really like someone to review before tomorrow morning is the change I have made to themes styles.php files. Is this a good idea. (Make sure you also look at the code in deprecated lib to keep old themes working.)

        I plan to test this a bit more tomorrow, then commit it.

        Show
        Tim Hunt added a comment - - edited Another work-in-progress patch (themes_cleanup.patch). This one cleans up how themes are initialised, and how the theme CSS is processed. The bit I would really like someone to review before tomorrow morning is the change I have made to themes styles.php files. Is this a good idea. (Make sure you also look at the code in deprecated lib to keep old themes working.) I plan to test this a bit more tomorrow, then commit it.
        Hide
        Tim Hunt added a comment -

        The work in themes_cleanup.patch is now committed.

        Show
        Tim Hunt added a comment - The work in themes_cleanup.patch is now committed.
        Hide
        Tim Hunt added a comment -

        Another big work-in-progress patch. (blocks_output.patch)

        This moves blocks output into the theme layout.php file, and deletes it from everywhere else.

        Not quite complete. quiz, lesson and resource module need a bit more work. custom_corners_core_rendererer::block also needs to be updated.

        At the moment, the diffstat is about -500 lines of code.

        Show
        Tim Hunt added a comment - Another big work-in-progress patch. (blocks_output.patch) This moves blocks output into the theme layout.php file, and deletes it from everywhere else. Not quite complete. quiz, lesson and resource module need a bit more work. custom_corners_core_rendererer::block also needs to be updated. At the moment, the diffstat is about -500 lines of code.
        Hide
        Tim Hunt added a comment -

        OK, that huge patch committed. By the end it was -900 lines.

        I know blocks editing is broken, and there is a bit to clean up in lesson, quiz and resource.

        Show
        Tim Hunt added a comment - OK, that huge patch committed. By the end it was -900 lines. I know blocks editing is broken, and there is a bit to clean up in lesson, quiz and resource.
        Hide
        Eloy Lafuente (stronk7) added a comment -

        Note: I've changed:

        public function heading($text, $level, $classes = 'main', $id = '')

        to:

        public function heading($text, $level = 2, $classes = 'main', $id = '')

        so, level is now optional and defaults to 2.

        Commented in HQ chat.

        Show
        Eloy Lafuente (stronk7) added a comment - Note: I've changed: public function heading($text, $level, $classes = 'main', $id = '') to: public function heading($text, $level = 2, $classes = 'main', $id = '') so, level is now optional and defaults to 2. Commented in HQ chat.
        Hide
        Tim Hunt added a comment -

        All subtasks done. Closing.

        Show
        Tim Hunt added a comment - All subtasks done. Closing.

          People

          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: