Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-17510

[Patch] Put the text "detailedmonthview" of the calendar inside a label, so i can grab it on theme

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9.3
    • Fix Version/s: 1.9.8
    • Component/s: Accessibility, Calendar, Themes
    • Labels:
      None
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE

      Description

      I am working on a theme for the Federal University of Santa Catarina, in Brazil and the designer ask me to vertical-centralize this text. The better way i found to do this is put the text inside a label, cause it was "flying" inside the div.
      The patch for Moodle 1.9.3 and a slice of the screenshot is attached.
      Hope you like.

        Gliffy Diagrams

          Attachments

          1. detailedmonthview.png
            detailedmonthview.png
            120 kB
          2. mdl17510-195.diff
            0.6 kB
          3. mdl-17510-v2.diff
            8 kB
          4. patch_label.diff
            0.5 kB
          5. screen.png
            screen.png
            35 kB

            Activity

            Hide
            danielneis Daniel Neis Araujo added a comment -

            the patch and the screenshot i have metioned.
            couldn't find them after submit the issue...

            Show
            danielneis Daniel Neis Araujo added a comment - the patch and the screenshot i have metioned. couldn't find them after submit the issue...
            Hide
            danielneis Daniel Neis Araujo added a comment -

            the patch for 1.9.5 version

            Show
            danielneis Daniel Neis Araujo added a comment - the patch for 1.9.5 version
            Hide
            danielneis Daniel Neis Araujo added a comment -

            posting a screenshot with text in english

            Show
            danielneis Daniel Neis Araujo added a comment - posting a screenshot with text in english
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            Hi Daniel,

            I've been looking at this and, in the detailed month view I'm getting that HTML within one label, exactly as your patch does:

            <label for="cal_course_flt_jump">Detailed Month View:</label>

            Curiously, looking a bit more in calendar/lib.php, I've seen that there are three places where That label should be present:

            • calendar_show_day() - that is missing the label.
            • calendar_show_month_detailed() - that already has the label, as showed above.
            • calendar_show_upcoming_events() - that is missing the label.

            Ciao

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - Hi Daniel, I've been looking at this and, in the detailed month view I'm getting that HTML within one label, exactly as your patch does: <label for="cal_course_flt_jump">Detailed Month View:</label> Curiously, looking a bit more in calendar/lib.php, I've seen that there are three places where That label should be present: calendar_show_day() - that is missing the label. calendar_show_month_detailed() - that already has the label, as showed above. calendar_show_upcoming_events() - that is missing the label. Ciao
            Hide
            danielneis Daniel Neis Araujo added a comment -

            Hello, Eloy

            i think someone else have added the label in another commit (http://cvs.moodle.org/moodle/calendar/view.php?r1=1.95&r2=1.95.2.10) some time ago...
            I have a clone of git.moodle.org repo, and did a seach "git log -Scal_course_flt_jump calendar/" and have found the commit:

            daniel@judy:~/public_html/moodle$ git show d4d468ad374e344c90eb278092e6e425232b0b66
            commit d4d468ad374e344c90eb278092e6e425232b0b66
            Author: moodler <moodler>
            Date:   Thu Oct 1 07:02:15 2009 +0000
             
                calendar MDL-19940 Don't require login for site calendar when forcelogin is false
             
            diff --git a/calendar/view.php b/calendar/view.php
            index eeedb32..92abf88 100644
            --- a/calendar/view.php
            +++ b/calendar/view.php
            @@ -54,7 +54,7 @@
                     redirect($CFG->wwwroot.'/'.$CFG->admin.'/index.php');
                 }
             
            -    if ($courseid) {
            +    if ($courseid && $courseid != SITEID) {
                     require_login($courseid);
                 } else if ($CFG->forcelogin) {
                     require_login();
            @@ -390,7 +390,10 @@ function calendar_show_month_detailed($m, $y, $courses, $groups, $users, $course
                     $text.= '</div></form></div>';
                 }
             
            -    $text .= get_string('detailedmonthview', 'calendar').': '.calendar_course_filter_selector($getvars);
            +    $text .= '<label for="cal_course_flt_jump">'.
            +               get_string('detailedmonthview', 'calendar').
            +             ':</label>'.
            +             calendar_course_filter_selector($getvars);
             
                 echo '<div class="header">'.$text.'</div>';

            But i couldn't find this at git.moodle.org

            Also, i have attached a patch (mdl-17510-v2.diff) that adds the labels in the two other functions you saw and also removes some blanks spaces in end of lines and commented code.

            Show
            danielneis Daniel Neis Araujo added a comment - Hello, Eloy i think someone else have added the label in another commit ( http://cvs.moodle.org/moodle/calendar/view.php?r1=1.95&r2=1.95.2.10 ) some time ago... I have a clone of git.moodle.org repo, and did a seach "git log -Scal_course_flt_jump calendar/" and have found the commit: daniel@judy:~/public_html/moodle$ git show d4d468ad374e344c90eb278092e6e425232b0b66 commit d4d468ad374e344c90eb278092e6e425232b0b66 Author: moodler <moodler> Date: Thu Oct 1 07:02:15 2009 +0000   calendar MDL-19940 Don't require login for site calendar when forcelogin is false   diff --git a/calendar/view.php b/calendar/view.php index eeedb32..92abf88 100644 --- a/calendar/view.php +++ b/calendar/view.php @@ -54,7 +54,7 @@ redirect($CFG->wwwroot.'/'.$CFG->admin.'/index.php'); } - if ($courseid) { + if ($courseid && $courseid != SITEID) { require_login($courseid); } else if ($CFG->forcelogin) { require_login(); @@ -390,7 +390,10 @@ function calendar_show_month_detailed($m, $y, $courses, $groups, $users, $course $text.= '</div></form></div>'; } - $text .= get_string('detailedmonthview', 'calendar').': '.calendar_course_filter_selector($getvars); + $text .= '<label for="cal_course_flt_jump">'. + get_string('detailedmonthview', 'calendar'). + ':</label>'. + calendar_course_filter_selector($getvars); echo '<div class="header">'.$text.'</div>'; But i couldn't find this at git.moodle.org Also, i have attached a patch (mdl-17510-v2.diff) that adds the labels in the two other functions you saw and also removes some blanks spaces in end of lines and commented code.
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            Hi Daniel,

            I've aded the two missing labels, both to 19_STABLE and HEAD, will be available in next weekly build.

            About the patch, looked perfect but has some problems inserting some tabs, that are "forbidden" in moodle source code. Just to suggest you to change the settings in your IDE/editor to avoid tabs and use 4cc whites instead.

            Many thanks! Ciao

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - Hi Daniel, I've aded the two missing labels, both to 19_STABLE and HEAD, will be available in next weekly build. About the patch, looked perfect but has some problems inserting some tabs, that are "forbidden" in moodle source code. Just to suggest you to change the settings in your IDE/editor to avoid tabs and use 4cc whites instead. Many thanks! Ciao

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  25/Mar/10