Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,6 @@ public function ajax_section_move() {
return null;
}

/**
* Returns the list of blocks to be automatically added for the newly created course
*
* @return array of default blocks, must contain two keys BLOCK_POS_LEFT and BLOCK_POS_RIGHT
* each of values is an array of block names (for left and right side columns)
*/
public function get_default_blocks() {
return array(
BLOCK_POS_LEFT => array(),
BLOCK_POS_RIGHT => array()
);
}

/**
* The URL to use for the specified course (with section)
*
Expand Down
10 changes: 7 additions & 3 deletions pages/post_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ protected function definition() {
if ($action == 'updatepost') {
$buttongroup[] = $mform->createElement('cancel');
}
$mform->addGroup($buttongroup);
$group = $mform->addGroup($buttongroup);
$group->setAttributes(array('class' => 'fgroup_id_group_1'));

// ... htmleditor/texarea to post text.
$canposthtml = has_capability('format/socialwall:posthtml', $context);
Expand Down Expand Up @@ -148,7 +149,9 @@ protected function definition() {
}

if (count($postoptions) > 0) {
$mform->addGroup($postoptions);
$group = $mform->addGroup($postoptions);
$group->setAttributes(array('class' => 'fgroup_id_group_2'));

}

// ... display the activites prepared for the next post only by a teacher.
Expand Down Expand Up @@ -190,7 +193,8 @@ protected function definition() {
}

if (!empty($attachgroup)) {
$mform->addGroup($attachgroup);
$group = $mform->addGroup($attachgroup);
$group->setAttributes(array('class' => 'fgroup_id_group_3'));
}

$loadfilemanager = optional_param('loadfilemanager', 0, PARAM_INT);
Expand Down
12 changes: 8 additions & 4 deletions styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
.course-content ul.socialwall li.section .right img.icon { padding: 0 0 4px 0;}
.course-content ul.socialwall li.section .left .section-handle img.icon { padding:0; vertical-align: baseline; }

.format-socialwall #postform {
width: 90%;
}

.format-socialwall #postform .fitem div.fitemtitle {
float: none;
Expand All @@ -29,23 +32,24 @@
margin-right: 5px;
}

.format-socialwall #postform .sw-texarea, #posttext {
.format-socialwall #postform textarea.sw-texarea, #posttext {
width:100%;
}

.format-socialwall #postform #fitem_posttext {
.format-socialwall #postform #fitem_posttext,
.format-socialwall #postform div.sw-texarea {
margin-bottom: 0px;
margin-right: 100px;
}

.format-socialwall #postform #fgroup_id_group_1 {
.format-socialwall #postform .fgroup_id_group_1 {
margin-top:30px;
float:right;
width:100px;
text-align: right;
}

.format-socialwall #postform #fgroup_id_group_2 {
.format-socialwall #postform .fgroup_id_group_2 {
float:left;
}

Expand Down
8 changes: 4 additions & 4 deletions version.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@

defined('MOODLE_INTERNAL') || die();

$plugin->version = 2016022200; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires = 2014050800; // Requires this Moodle version.
$plugin->version = 2017092600; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires = 2016051900; // Requires this Moodle version.
$plugin->component = 'format_socialwall'; // Full name of the plugin (used for diagnostics).
$plugin->dependencies = array('format_topics' => 2014051200);
$plugin->dependencies = array('format_topics' => 2016052300);
$plugin->maturity = MATURITY_STABLE;
$plugin->release = '3.0';
$plugin->release = '3.2';
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,33 @@ M.format_socialwall.addactivityinit = function (data) {

var id = node.get('id').split('_') [1];
var selectedElement = Y.one('#id_recentactivitiesheader .felement label[for="module_' + id + '"]');
var withboost = false;

if (selectedElement === null) {
// Compatibility with boost theme based.
selectedElement = Y.one('#id_recentactivitiesheader .fitem span[data-itemid="' + id + '"]');
withboost = true;

if (selectedElement === null) {
if (M.cfg.developerdebug) {
Y.log("Error: Incompatible theme.");
}
return false;
}
}

var li = Y.Node.create('<li></li>');
var clone = selectedElement.cloneNode(true);
li.append(clone);
var label;

if (withboost) {
label = Y.Node.create('<label for="module_' + id + '"></li>');
li.append(label);
label.append(clone);
} else {
li.append(clone);
}

selectedactivities.append(li);

attachrecentactivitiyids.push(id);
Expand Down Expand Up @@ -124,12 +148,13 @@ M.format_socialwall.addactivityinit = function (data) {

function onClickFilterByType() {

var recentactivities = Y.all('#id_recentactivitiesheader div[id^="fitem_module_"]');
var recentactivities = Y.all('#id_recentactivitiesheader div.fitem');

if (recentactivities) {
recentactivities.hide();
}

var checkedfilterelements = Y.all('#fgroup_id_filterbytype input[id^="type_"]');
var checkedfilterelements = Y.all('#id_filtersheader input[id^="type_"]');

if (checkedfilterelements) {

Expand All @@ -140,6 +165,7 @@ M.format_socialwall.addactivityinit = function (data) {
var type = node.get('id').split('_') [1];

var shownactivities = Y.all('#id_recentactivitiesheader input[name^="module_' + type + '"]');

if (shownactivities) {
shownactivities.each(function (node) {
node.ancestor('.fitem').show();
Expand Down Expand Up @@ -170,7 +196,7 @@ M.format_socialwall.addactivityinit = function (data) {
function onChangeSearchName(searchfield) {

var searchtext = searchfield.get('value');
var recentactivities = Y.all('#id_recentactivitiesheader div[id^="fitem_module_"]');
var recentactivities = Y.all('#id_recentactivitiesheader div.fitem');

if (searchtext.length < 3) {

Expand Down Expand Up @@ -223,7 +249,8 @@ M.format_socialwall.addactivityinit = function (data) {

initDialog();

var typefilter = Y.one('#fgroup_id_filterbytype');
var typefilter = Y.one('#id_filtersheader');

if (typefilter) {
typefilter.delegate('click', function (e) {
onClickFilterByType();
Expand Down Expand Up @@ -251,8 +278,12 @@ M.format_socialwall.addactivityinit = function (data) {

Y.one('window').on('resize', function (e) {
onResizeDialog();
}
);
});

Y.one('#tl-addrecentactivity-form').on('submit', function(e) {
e.preventDefault();
return false;
});
}

initialize();
Expand Down

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

Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,32 @@ M.format_socialwall.addactivityinit = function (data) {

var id = node.get('id').split('_') [1];
var selectedElement = Y.one('#id_recentactivitiesheader .felement label[for="module_' + id + '"]');
var withboost = false;

if (selectedElement === null) {
// Compatibility with boost theme based.
selectedElement = Y.one('#id_recentactivitiesheader .fitem span[data-itemid="' + id + '"]');
withboost = true;

if (selectedElement === null) {
if (M.cfg.developerdebug) {
}
return false;
}
}

var li = Y.Node.create('<li></li>');
var clone = selectedElement.cloneNode(true);
li.append(clone);
var label;

if (withboost) {
label = Y.Node.create('<label for="module_' + id + '"></li>');
li.append(label);
label.append(clone);
} else {
li.append(clone);
}

selectedactivities.append(li);

attachrecentactivitiyids.push(id);
Expand Down Expand Up @@ -124,12 +147,13 @@ M.format_socialwall.addactivityinit = function (data) {

function onClickFilterByType() {

var recentactivities = Y.all('#id_recentactivitiesheader div[id^="fitem_module_"]');
var recentactivities = Y.all('#id_recentactivitiesheader div.fitem');

if (recentactivities) {
recentactivities.hide();
}

var checkedfilterelements = Y.all('#fgroup_id_filterbytype input[id^="type_"]');
var checkedfilterelements = Y.all('#id_filtersheader input[id^="type_"]');

if (checkedfilterelements) {

Expand All @@ -140,6 +164,7 @@ M.format_socialwall.addactivityinit = function (data) {
var type = node.get('id').split('_') [1];

var shownactivities = Y.all('#id_recentactivitiesheader input[name^="module_' + type + '"]');

if (shownactivities) {
shownactivities.each(function (node) {
node.ancestor('.fitem').show();
Expand Down Expand Up @@ -170,7 +195,7 @@ M.format_socialwall.addactivityinit = function (data) {
function onChangeSearchName(searchfield) {

var searchtext = searchfield.get('value');
var recentactivities = Y.all('#id_recentactivitiesheader div[id^="fitem_module_"]');
var recentactivities = Y.all('#id_recentactivitiesheader div.fitem');

if (searchtext.length < 3) {

Expand Down Expand Up @@ -223,7 +248,8 @@ M.format_socialwall.addactivityinit = function (data) {

initDialog();

var typefilter = Y.one('#fgroup_id_filterbytype');
var typefilter = Y.one('#id_filtersheader');

if (typefilter) {
typefilter.delegate('click', function (e) {
onClickFilterByType();
Expand Down Expand Up @@ -251,8 +277,12 @@ M.format_socialwall.addactivityinit = function (data) {

Y.one('window').on('resize', function (e) {
onResizeDialog();
}
);
});

Y.one('#tl-addrecentactivity-form').on('submit', function(e) {
e.preventDefault();
return false;
});
}

initialize();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@ M.format_socialwall.postforminit = function (data) {
// ...adapt counts.
data.postsloaded = responsedata.postsloaded;
data.poststotal = responsedata.poststotal;
var counttotalpost = M.str.format_socialwall.counttotalpost.replace('{$a->count}', data.postsloaded).replace('{$a->total}', data.poststotal);
var counttotalpost = M.str.format_socialwall.counttotalpost.replace('{$a->count}', data.postsloaded)
.replace('{$a->total}', data.poststotal);

Y.one('#counttotalpost').setHTML(counttotalpost);

loading = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@ M.format_socialwall.postforminit = function (data) {
// ...adapt counts.
data.postsloaded = responsedata.postsloaded;
data.poststotal = responsedata.poststotal;
var counttotalpost = M.str.format_socialwall.counttotalpost.replace('{$a->count}', data.postsloaded).replace('{$a->total}', data.poststotal);
var counttotalpost = M.str.format_socialwall.counttotalpost.replace('{$a->count}', data.postsloaded)
.replace('{$a->total}', data.poststotal);

Y.one('#counttotalpost').setHTML(counttotalpost);

loading = false;
Expand Down
Loading