Skip to content

Commit

Permalink
Merge branch 'MDL-42711-master' of git://github.com/nebgor/moodle
Browse files Browse the repository at this point in the history
Conflicts:
	theme/bootstrapbase/style/moodle.css
  • Loading branch information
Damyon Wiese committed Nov 14, 2013
2 parents 529d3ba + fa41a73 commit f2f23af
Show file tree
Hide file tree
Showing 22 changed files with 365 additions and 56 deletions.
6 changes: 3 additions & 3 deletions blocks/rss_client/block_rss_client.php
Expand Up @@ -249,13 +249,13 @@ function get_item_html($item){

if($this->config->display_description && !empty($description)){

$description = break_up_long_words($description, 30);

$formatoptions = new stdClass();
$formatoptions->para = false;

$r.= html_writer::start_tag('div',array('class'=>'description'));
$r.= format_text($description, FORMAT_HTML, $formatoptions, $this->page->course->id);
$description = format_text($description, FORMAT_HTML, $formatoptions, $this->page->course->id);
$description = break_up_long_words($description, 30);
$r.= $description;
$r.= html_writer::end_tag('div');
}
$r.= html_writer::end_tag('li');
Expand Down
1 change: 1 addition & 0 deletions filter/glossary/filter.php
Expand Up @@ -43,6 +43,7 @@ public function setup($page, $context) {
'moodle-filter_glossary-autolinker',
'M.filter_glossary.init_filter_autolinking',
array(array('courseid' => 0)));
$page->requires->strings_for_js(array('ok'), 'moodle');
$jsinitialised = true;
}
}
Expand Down
Expand Up @@ -69,7 +69,8 @@ Y.extend(AUTOLINKER, Y.Base, {

for (key in data.entries) {
definition = data.entries[key].definition + data.entries[key].attachments;
alertpanel = new M.core.alert({title:data.entries[key].concept, message:definition, lightbox:false});
alertpanel = new M.core.alert({title:data.entries[key].concept,
message:definition, lightbox:false, yesLabel: M.util.get_string('ok', 'moodle')});
alertpanel.show();
Y.Node.one('#id_yuialertconfirm-' + alertpanel.get('COUNT')).focus();
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Expand Up @@ -69,7 +69,8 @@ Y.extend(AUTOLINKER, Y.Base, {

for (key in data.entries) {
definition = data.entries[key].definition + data.entries[key].attachments;
alertpanel = new M.core.alert({title:data.entries[key].concept, message:definition, lightbox:false});
alertpanel = new M.core.alert({title:data.entries[key].concept,
message:definition, lightbox:false, yesLabel: M.util.get_string('ok', 'moodle')});
alertpanel.show();
Y.Node.one('#id_yuialertconfirm-' + alertpanel.get('COUNT')).focus();
}
Expand Down
3 changes: 2 additions & 1 deletion filter/glossary/yui/src/autolinker/js/autolinker.js
Expand Up @@ -67,7 +67,8 @@ Y.extend(AUTOLINKER, Y.Base, {

for (key in data.entries) {
definition = data.entries[key].definition + data.entries[key].attachments;
alertpanel = new M.core.alert({title:data.entries[key].concept, message:definition, lightbox:false});
alertpanel = new M.core.alert({title:data.entries[key].concept,
message:definition, lightbox:false, yesLabel: M.util.get_string('ok', 'moodle')});
alertpanel.show();
Y.Node.one('#id_yuialertconfirm-' + alertpanel.get('COUNT')).focus();
}
Expand Down
14 changes: 8 additions & 6 deletions lib/navigationlib.php
Expand Up @@ -1222,12 +1222,14 @@ public function initialise() {
// Load the course sections into the page
$this->load_course_sections($course, $coursenode, null, $cm);
$activity = $coursenode->find($cm->id, navigation_node::TYPE_ACTIVITY);
// Finally load the cm specific navigaton information
$this->load_activity($cm, $course, $activity);
// Check if we have an active ndoe
if (!$activity->contains_active_node() && !$activity->search_for_active_node()) {
// And make the activity node active.
$activity->make_active();
if (!empty($activity)) {
// Finally load the cm specific navigaton information
$this->load_activity($cm, $course, $activity);
// Check if we have an active ndoe
if (!$activity->contains_active_node() && !$activity->search_for_active_node()) {
// And make the activity node active.
$activity->make_active();
}
}
break;
case CONTEXT_USER :
Expand Down
2 changes: 1 addition & 1 deletion mod/chat/chat_ajax.php
Expand Up @@ -22,7 +22,7 @@
$action = optional_param('action', '', PARAM_ALPHANUM);
$beep_id = optional_param('beep', '', PARAM_RAW);
$chat_sid = required_param('chat_sid', PARAM_ALPHANUM);
$theme = required_param('theme', PARAM_ALPHANUM);
$theme = required_param('theme', PARAM_ALPHANUMEXT);
$chat_message = optional_param('chat_message', '', PARAM_RAW);
$chat_lasttime = optional_param('chat_lasttime', 0, PARAM_INT);
$chat_lastrow = optional_param('chat_lastrow', 1, PARAM_INT);
Expand Down
16 changes: 12 additions & 4 deletions mod/chat/gui_ajax/index.php
Expand Up @@ -4,14 +4,15 @@

$id = required_param('id', PARAM_INT);
$groupid = optional_param('groupid', 0, PARAM_INT); //only for teachers
$theme = optional_param('theme', 'compact', PARAM_SAFEDIR);
$theme = optional_param('theme', 'course_theme', PARAM_SAFEDIR); //course_theme to use the current theme.

$url = new moodle_url('/mod/chat/gui_ajax/index.php', array('id'=>$id));
if ($groupid !== 0) {
$url->param('groupid', $groupid);
}
$PAGE->set_url($url);
$PAGE->set_popup_notification_allowed(false); // No popup notifications in the chat window
$PAGE->requires->strings_for_js(array('coursetheme', 'bubble', 'compact'), 'mod_chat');

$chat = $DB->get_record('chat', array('id'=>$id), '*', MUST_EXIST);
$course = $DB->get_record('course', array('id'=>$chat->course), '*', MUST_EXIST);
Expand All @@ -35,9 +36,13 @@
$groupid = 0;
$groupname = '';
}
$showcoursetheme = in_array('bootstrapbase', $PAGE->theme->parents);
if (!$showcoursetheme && $theme === 'course_theme') { //set compact as default for non bootstrapbase based themes
$theme = 'compact';
}

// if requested theme doesn't exist, use default 'bubble' theme
if (!file_exists(dirname(__FILE__) . '/theme/'.$theme.'/chat.css')) {
if ($theme != 'course_theme' and !file_exists(dirname(__FILE__) . '/theme/'.$theme.'/chat.css')) {
$theme = 'compact';
}

Expand All @@ -57,6 +62,7 @@
'home'=>$CFG->httpswwwroot.'/mod/chat/view.php?id='.$cm->id,
'chaturl'=>$CFG->httpswwwroot.'/mod/chat/gui_ajax/index.php?id='.$id,
'theme'=>$theme,
'showcoursetheme'=>$showcoursetheme?1:0,
'userid'=>$USER->id,
'sid'=>$chat_sid,
'timer'=>3000,
Expand All @@ -69,7 +75,9 @@
$PAGE->set_title(get_string('modulename', 'chat').": $courseshortname: ".format_string($chat->name,true)."$groupname");
$PAGE->add_body_class('yui-skin-sam');
$PAGE->set_pagelayout('embedded');
$PAGE->requires->css('/mod/chat/gui_ajax/theme/'.$theme.'/chat.css');
if ( $theme != 'course_theme') {
$PAGE->requires->css('/mod/chat/gui_ajax/theme/'.$theme.'/chat.css');
}

echo $OUTPUT->header();
echo $OUTPUT->box(html_writer::tag('h2', get_string('participants'), array('class' => 'accesshide')) .
Expand All @@ -79,7 +87,7 @@
'<ul id="messages-list"></ul>', '', 'chat-messages');
$table = new html_table();
$table->data = array(
array('<label class="accesshide" for="input-message">' . get_string('entermessage', 'chat') . ' </label><input type="text" disabled="true" id="input-message" value="Loading..." size="50" /> <input type="button" id="button-send" value="'.get_string('send', 'chat').'" /> <a id="choosetheme" href="###">'.get_string('themes').' &raquo; </a>')
array('<label class="accesshide" for="input-message">' . get_string('entermessage', 'chat') . ' </label><input type="text" disabled="true" id="input-message" value="Loading..." /> <input type="button" id="button-send" value="'.get_string('send', 'chat').'" /> <a id="choosetheme" href="###">'.get_string('themes').' &raquo; </a>')
);
echo $OUTPUT->box(html_writer::tag('h2', get_string('composemessage', 'chat'), array('class' => 'accesshide')) .
html_writer::table($table), '', 'chat-input-area');
Expand Down
26 changes: 5 additions & 21 deletions mod/chat/gui_ajax/module.js
Expand Up @@ -116,29 +116,14 @@ M.mod_chat_ajax.init = function(Y, cfg) {
}, this.cfg.timer, this);

// Create and initalise theme changing menu
/*
this.thememenu = new Y.Overlay({
bodyContent : '<div class="menuitem"><a href="'+this.cfg.chaturl+'&theme=bubble">Bubble</a></div><div class="menuitem"><a href="'+this.cfg.chaturl+'&theme=compact">Compact</a></div>',
visible : false,
zIndex : 2,
align : {
node : '#choosetheme',
points : [Y.WidgetPositionExt.BL, Y.WidgetPositionExt.BR]
}
});
this.thememenu.render(document.body);
Y.one('#choosetheme').on('click', function(e){
this.show();
this.get('boundingBox').setStyle('visibility', 'visible');
}, this.thememenu);
return;
*/
this.thememenu = new Y.YUI2.widget.Menu('basicmenu', {xy:[0,0]});
this.thememenu.addItems([
{text: "Bubble", url: this.cfg.chaturl+'&theme=bubble'},
{text: "Compact", url: this.cfg.chaturl+'&theme=compact'}
{text: M.util.get_string('bubble', 'mod_chat'), url: this.cfg.chaturl+'&theme=bubble'},
{text: M.util.get_string('compact', 'mod_chat'), url: this.cfg.chaturl+'&theme=compact'}
]);
if (this.cfg.showcoursetheme == 1) {
this.thememenu.addItem({text: M.util.get_string('coursetheme', 'mod_chat'), url: this.cfg.chaturl+'&theme=course_theme'});
}
this.thememenu.render(document.body);
Y.one('#choosetheme').on('click', function(e){
this.moveTo((e.pageX-20), (e.pageY-20));
Expand All @@ -157,7 +142,6 @@ M.mod_chat_ajax.init = function(Y, cfg) {

send : function(e, beep) {
this.sendbutton.set('value', M.str.chat.sending);

var data = {
chat_message : (!beep)?this.messageinput.get('value'):'',
chat_sid : this.cfg.sid,
Expand Down
2 changes: 1 addition & 1 deletion mod/chat/gui_ajax/theme/bubble/chat.css
Expand Up @@ -28,7 +28,7 @@

#chat-input-area,
#chat-input-area table.generaltable,
#chat-input-area table.generaltable td.cell {background: #92B3E8;border: 0;}
#chat-input-area table.generaltable td.cell {background: #92B3E8;border: 0; height:100%;}
#chat-userlist {background: #E3E8F0;height: 100%;}

/**
Expand Down
1 change: 1 addition & 0 deletions mod/chat/gui_ajax/theme/compact/chat.css
Expand Up @@ -54,6 +54,7 @@
border: 0;
margin: 0;
padding: 2px;
height:100%;
}
#chat-userlist {
background: #E3E8F0;
Expand Down
22 changes: 22 additions & 0 deletions mod/chat/gui_ajax/theme/course_theme/config.php
@@ -0,0 +1,22 @@
<?php
$chattheme_cfg = new stdClass();
$chattheme_cfg->avatar = false;
$chattheme_cfg->align = false;
$chattheme_cfg->event_message = <<<TEMPLATE
<div class="chat-event course-theme">
<span class="time">___time___</span>
<a target='_blank' href="___senderprofile___">___sender___</a>
<span class="event">___event___</span>
</div>
TEMPLATE;
$chattheme_cfg->user_message = <<<TEMPLATE
<div class='chat-message course-theme'>
<div class="chat-message-meta">
<span class="time">___time___</span>
<span class="user"><a href="___senderprofile___" target="_blank">___sender___</a></span>
</div>
<div class="text">
___message___
</div>
</div>
TEMPLATE;
3 changes: 3 additions & 0 deletions mod/chat/lang/en/chat.php
Expand Up @@ -27,6 +27,7 @@
$string['ajax'] = 'Version using Ajax';
$string['autoscroll'] = 'Auto scroll';
$string['beep'] = 'Beep';
$string['bubble'] = 'Bubble';
$string['cantlogin'] = 'Could not log in to chat room!!';
$string['composemessage'] = 'Compose a message';
$string['configmethod'] = 'The ajax chat method provide an ajax based chat interface, it contacts server regularly for update. The normal chat method involves the clients regularly contacting the server for updates. It requires no configuration and works everywhere, but it can create a large load on the server with many chatters. Using a server daemon requires shell access to Unix, but it results in a fast scalable chat environment.';
Expand All @@ -38,6 +39,8 @@
$string['configserverip'] = 'The numerical IP address that matches the above hostname';
$string['configservermax'] = 'Max number of clients allowed';
$string['configserverport'] = 'Port to use on the server for the daemon';
$string['compact'] = 'Compact';
$string['coursetheme'] = 'Course theme';
$string['currentchats'] = 'Active chat sessions';
$string['currentusers'] = 'Current users';
$string['deletesession'] = 'Delete this session';
Expand Down
1 change: 1 addition & 0 deletions theme/bootstrapbase/less/moodle.less
Expand Up @@ -43,6 +43,7 @@ body {
@import "moodle/blocks";
@import "moodle/forms";
@import "moodle/modules";
@import "moodle/chat";
@import "moodle/reports";
@import "moodle/backup-restore";
@import "moodle/tables";
Expand Down
79 changes: 75 additions & 4 deletions theme/bootstrapbase/less/moodle/blocks.less
Expand Up @@ -109,9 +109,21 @@
display: inline;
}

.block_calendar_upcoming .footer {
margin-top: .5em;
.block_calendar_upcoming {
.footer {
margin-top: .5em;
}
.content {
.date {
padding-left: 22px;
}
.footer {
padding-top: 10px;
padding-left: 0px;
}
}
}

#adminsearchquery,
#blogsearchquery,
#searchform_search,
Expand All @@ -124,8 +136,47 @@
#searchform_search {
width: auto;
}
.block_rss_client .list li {
border-top-color: darken(@wellBackground, 7%);
.block_rss_client {
.content li {
margin-bottom: 10px;
padding: 5px;
border: 1px solid #ddd;
.border-radius(@baseBorderRadius);
.link {
font-weight: inherit;
}
}
.list li:first-child {
border-top-width: 1px; // undo the style provided by the block's styles.css
}
}

.block_news_items .content {
.newlink {
padding-bottom: 10px;
}
ul li {
border-top: 1px rgba(0,0,0,0.05) solid;
padding: 2px;
display: table;
width: 100%;
.info {
display: table-header-group;
}
.date {
font-size: @fontSizeSmall;
display: inline;
}
.name {
font-size: @fontSizeSmall;
padding-left: 1ex;
display: inline;
}
}
.footer {
padding-top: 10px;
padding-left: 0px;
}
}

// Overide for RTL layout.
Expand All @@ -140,4 +191,24 @@
.block .header .block_action {
float: left;
}
.block_calendar_upcoming {
.content {
.date {
padding-right: 22px;
}
.footer {
padding-right: 0px;
}
}
}
.block_news_items .content {
ul li {
.name {
padding-right: 1ex;
}
}
.footer {
padding-left: 0px;
}
}
}

0 comments on commit f2f23af

Please sign in to comment.