Commit bee2dabb authored by Doris Tam's avatar Doris Tam

Bug 1810990: blocktype: recentforumposts

Change-Id: I9e1a0ad9412bc54b8e9aa9b30863bc7b52acf170
parent 29aa709a
......@@ -1282,6 +1282,33 @@ EOD;
return $configdata;
}
public static function generate_configdata_recentforumposts($data, $ownertype, $ownerid) {
if (!$data) return;
$configdata = array();
$fields = explode(';',$data);
foreach ($fields as $field) {
$field = trim($field);
list($key, $value) = explode('=',$field);
if ($key == 'groupname') {
$groupid;
//make sure the group exists
if (!$groupid = get_field('group', 'id', 'name', $value)) {
throw new SystemException("Invalid Group '" . $value . "'");
}
else {
$configdata['groupid'] = $groupid;
}
}
if ($key == 'maxposts') {
$key = 'limit';
$configdata[$key] = $value > 0 ? $value: 5;
}
}
$configdata[] = $data;
return $configdata;
}
/**
* generate configdata for the blocktype: social profile
* @param string $data inside data column in behat test
......
......@@ -12,7 +12,7 @@ Background:
| UserB | Kupuh1pa!| UserB@example.org | Bob | Boi | mahara | internal | member |
And the following "groups" exist:
| name | owner | description | grouptype | open | invitefriends | editroles | submittableto | allowarchives | members | staff |
| name | owner | description | grouptype | open | invitefriends | editroles | submittableto | allowarchives | members | staff |
| Group1 | UserB | Group1 owned by UserB | standard | ON | OFF | all | ON | OFF | UserA | |
And the following "pages" exist:
......@@ -59,38 +59,39 @@ Background:
And the following "blocks" exist:
| title | type | page |retractable | data |
| My text 1 | text | Page UserA_00 | yes | This is some text |
| image jpg | image | Page UserA_00 | no | attachment=Image1.jpg; width=100 |
| image png | image | Page UserA_00 | no | attachment=Image2.png |
| My files 1 | filedownload | Page UserA_00 | auto | attachments=mahara_about.pdf |
| My files 2 | filedownload | Page UserA_00 | no | attachments=mahara_about.pdf,Image2.png |
| Rss news | externalfeed | Page UserA_00 | No | source=http://rss.nzherald.co.nz/rss/xml/nzhtsrsscid_000000698.xml |
| Rss food | externalfeed | Page UserA_00 | no | source=http://www.thekitchenmaid.com/feed |
| G image 3 | image | Page Grp1 | no | attachment=Image3.png |
| G files 2 | filedownload | Page Grp1 | no | attachments=mahara_about.pdf,Image2.png,testvid3.mp4,mahara.mp3 |
| nzslang | externalvideo | Page Grp1 | no | source=https://youtu.be/yRxFm70nOrY |
| my social | socialprofile | Page UserB_00 | no | sns=instagram,twitter,facebook,tumblr,pinterest |
| gall style1 | gallery | Page UserB_00 | no | attachments=Image1.jpg,Image3.png,Image3.png,Image2.png;imagesel=2;showdesc=yes;width=75;imagestyle=1;photoframe=1 |
| gall style2 | gallery | Page UserB_00 | yes | attachments=Image3.png,Image2.png,Image1.jpg;imagesel=2;showdesc=yes;width=75;imagestyle=2 |
| gall style3 | gallery | Page UserB_00 | yes | attachments=Image3.png,Image2.png,Image1.jpg;imagesel=2;showdesc=no;imagestyle=3;photoframe=0|
| myfolder | folder | Page UserB_00 | no | dirname=myfolder;attachments=mahara_about.pdf,Image2.png,Image1.jpg,Image3.png,mahara.mp3 |
| my html | html | Page UserB_00 | yes | attachment=test_html.html |
| my blog | blog | Page One | no | copytype=nocopy;count=5;journaltitle=journal1 |
| my blogpost | blogpost | Page One | no | copytype=nocopy;journaltitle=journal1;entrytitle=Entry Two |
| Comments | comment | Page One | | no configdata |
| PeerAssessmt| peerassessment | Page One | auto | no configdata |
| creativecoms| creativecommons| Page One | no | commercialuse=yes;license=3.0;allowmods=no |
| my nav | navigation | Page Two | no | collection=collection one;copytoall=yes |
| my plan | plans | Page Two | no | plans=Plan One,Plan Two;tasksdisplaycount=10 |
| internalm v | internalmedia | Page Three | no | attachment=testvid3.mp4 |
| internalm a | internalmedia | Page Three | no | attachment=mahara.mp3 |
| my pdf | pdf | Page Three | no | attachment=mahara_about.pdf |
| title | type | page |retractable | data |
| My text 1 | text | Page UserA_00 | yes | This is some text |
| image jpg | image | Page UserA_00 | no | attachment=Image1.jpg; width=100 |
| image png | image | Page UserA_00 | no | attachment=Image2.png |
| My files 1 | filedownload | Page UserA_00 | auto | attachments=mahara_about.pdf |
| My files 2 | filedownload | Page UserA_00 | no | attachments=mahara_about.pdf,Image2.png |
| Rss news | externalfeed | Page UserA_00 | No | source=http://rss.nzherald.co.nz/rss/xml/nzhtsrsscid_000000698.xml |
| Rss food | externalfeed | Page UserA_00 | no | source=http://www.thekitchenmaid.com/feed |
| G image 3 | image | Page Grp1 | no | attachment=Image3.png |
| G files 2 | filedownload | Page Grp1 | no | attachments=mahara_about.pdf,Image2.png,testvid3.mp4,mahara.mp3 |
| nzslang | externalvideo | Page Grp1 | no | source=https://youtu.be/yRxFm70nOrY |
| my social | socialprofile | Page UserB_00 | no | sns=instagram,twitter,facebook,tumblr,pinterest |
| gall style1 | gallery | Page UserB_00 | no | attachments=Image1.jpg,Image3.png,Image3.png,Image2.png;imagesel=2;showdesc=yes;width=75;imagestyle=1;photoframe=1 |
| gall style2 | gallery | Page UserB_00 | yes | attachments=Image3.png,Image2.png,Image1.jpg;imagesel=2;showdesc=yes;width=75;imagestyle=2 |
| gall style3 | gallery | Page UserB_00 | yes | attachments=Image3.png,Image2.png,Image1.jpg;imagesel=2;showdesc=no;imagestyle=3;photoframe=0|
| myfolder | folder | Page UserB_00 | no | dirname=myfolder;attachments=mahara_about.pdf,Image2.png,Image1.jpg,Image3.png,mahara.mp3 |
| my html | html | Page UserB_00 | yes | attachment=test_html.html |
| my blog | blog | Page One | no | copytype=nocopy;count=5;journaltitle=journal1 |
| my blogpost | blogpost | Page One | no | copytype=nocopy;journaltitle=journal1;entrytitle=Entry Two |
| Comments | comment | Page One | | no configdata |
| PeerAssessmt| peerassessment | Page One | auto | no configdata |
| creativecoms| creativecommons | Page One | no | commercialuse=yes;license=3.0;allowmods=no |
| my nav | navigation | Page Two | no | collection=collection one;copytoall=yes |
| my plan | plans | Page Two | no | plans=Plan One,Plan Two;tasksdisplaycount=10 |
| internalm v | internalmedia | Page Two | no | attachment=testvid3.mp4 |
| internalm a | internalmedia | Page Two | no | attachment=mahara.mp3 |
| my pdf | pdf | Page Three | no | attachment=mahara_about.pdf |
| g rcnt posts| recentforumposts| Page Three | no | groupname=Group1; maxposts=-1 |
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment