Skip to content

Commit

Permalink
MDL-46716 core_calendar: Replaced iCal image with stylised text
Browse files Browse the repository at this point in the history
  • Loading branch information
marsh0lion committed Aug 21, 2014
1 parent e1eb180 commit 4a222f0
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 5 deletions.
11 changes: 7 additions & 4 deletions calendar/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,13 @@
echo $OUTPUT->single_button(new moodle_url('/calendar/managesubscriptions.php', array('course'=>$courseid)), get_string('managesubscriptions', 'calendar'));
}
if (isloggedin()) {
$authtoken = sha1($USER->id . $DB->get_field('user', 'password', array('id'=>$USER->id)) . $CFG->calendar_exportsalt);
$link = new moodle_url('/calendar/export_execute.php', array('preset_what'=>'all', 'preset_time'=>'recentupcoming', 'userid' => $USER->id, 'authtoken'=>$authtoken));
$icon = html_writer::empty_tag('img', array('src'=>$OUTPUT->pix_url('i/ical'), 'height'=>'14', 'width'=>'36', 'alt'=>get_string('ical', 'calendar'), 'title'=>get_string('quickdownloadcalendar', 'calendar')));
echo html_writer::tag('a', $icon, array('href'=>$link));
$authtoken = sha1($USER->id . $DB->get_field('user', 'password', array('id' => $USER->id)) . $CFG->calendar_exportsalt);
$link = new moodle_url(
'/calendar/export_execute.php',
array('preset_what'=>'all', 'preset_time' => 'recentupcoming', 'userid' => $USER->id, 'authtoken'=>$authtoken)
);
echo html_writer::tag('a', 'iCal',
array('href' => $link, 'title' => get_string('quickdownloadcalendar', 'calendar'), 'class' => 'ical-link'));
}
}

Expand Down
20 changes: 20 additions & 0 deletions theme/base/style/calendar.css
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,23 @@
.block .calendar_filters .eventname { padding-left: .2em;}
.dir-rtl .block .calendar_filters .eventname { padding-right: .2em; padding-left: 0; }
.block .content h3.eventskey {margin-top:0.5em;}

.ical-link {
font-size: 10px;
font-weight: bold;
background-color: #f60;
padding: 0px 5px;
color: #fff;
border-top: 1px solid #f93;
border-left: 1px solid #f93;
border-bottom: 1px solid #013;
border-right: 1px solid #013;
margin: 3px;
text-decoration: none;
}
.ical-link:hover,
.ical-link:active,
.ical-link:focus {
color: #fff;
text-decoration: none;
}
18 changes: 18 additions & 0 deletions theme/bootstrapbase/less/moodle/calendar.less
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,24 @@
}
}

.ical-link {
font-size: 10px;
font-weight: bold;
background-color: #f60;
padding: 0px 5px;
color: #fff;
border-top: 1px solid #f93;
border-left: 1px solid #f93;
border-bottom: 1px solid #013;
border-right: 1px solid #013;
}
.ical-link:hover,
.ical-link:active,
.ical-link:focus {
color: #fff;
text-decoration: none;
}

@media (min-width: 768px) {
#page-calender-view {
.container-fluid {
Expand Down
2 changes: 1 addition & 1 deletion theme/bootstrapbase/style/moodle.css

Large diffs are not rendered by default.

0 comments on commit 4a222f0

Please sign in to comment.