Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-19118 Comments 2.0
  3. MDL-21946

get_comments() should have $renderer parameter

    Details

    • Type: Sub-task
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0.10
    • Component/s: Comments
    • Labels:
      None
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE

      Description

      The problem is that the get_comments() is called from an ajax script, but the result is supposed to be rendered in html page - so in the ajax script we should do:

      $renderer = $PAGE->get_renderer('core', null, RENDERER_TARGET_GENERAL) and then pass it to the get_comments() as parameter.

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            dongsheng Dongsheng Cai added a comment -

            Petr,

            get_commens only return a list of comments, the javascript did the rendering work.
            Comments api is developed before we have render engine, so I use callback to customize the look of comment entry, it is named modname_comment_template, it will return a template used by javaScript and php to render a comment entry.

            I will made some changes to give the ocntrol to theme engine.

            Show
            dongsheng Dongsheng Cai added a comment - Petr, get_commens only return a list of comments, the javascript did the rendering work. Comments api is developed before we have render engine, so I use callback to customize the look of comment entry, it is named modname_comment_template, it will return a template used by javaScript and php to render a comment entry. I will made some changes to give the ocntrol to theme engine.
            Hide
            dougiamas Martin Dougiamas added a comment -

            Is this done?

            Show
            dougiamas Martin Dougiamas added a comment - Is this done?
            Hide
            dongsheng Dongsheng Cai added a comment -

            not yet, will work on it after finish wiki 2.

            Show
            dongsheng Dongsheng Cai added a comment - not yet, will work on it after finish wiki 2.
            Hide
            dongsheng Dongsheng Cai added a comment -

            This issue was assigned to me automatically, however I will not be able to work on this issue in the immediate future. In order to create a truer sense of the state of this issue and to allow other developers to have chance to become involved, I am removing myself as the assignee of this issue.
            For more information, see http://docs.moodle.org/dev/Changes_to_issue_assignment

            Show
            dongsheng Dongsheng Cai added a comment - This issue was assigned to me automatically, however I will not be able to work on this issue in the immediate future. In order to create a truer sense of the state of this issue and to allow other developers to have chance to become involved, I am removing myself as the assignee of this issue. For more information, see http://docs.moodle.org/dev/Changes_to_issue_assignment

              People

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

                Dates

                • Created:
                  Updated:
                  Fix Release Date:
                  9/Jul/12