Commit f2549a68 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Add default titles for dashboard & grouphomepage blocks



Change-Id: I08f2769a4b5f11aa8dc20438bf9dbb53a3c691d3
Signed-off-by: default avatarRichard Mansfield <richard.mansfield@catalyst.net.nz>
parent d9c1560b
......@@ -42,3 +42,5 @@ $string['options_order_desc'] = 'You can choose to display the latest group memb
$string['Latest'] = 'Latest';
$string['Random'] = 'Random';
$string['defaulttitledescription'] = 'A default title will be generated if you leave the title field blank';
......@@ -121,4 +121,7 @@ class PluginBlocktypeGroupMembers extends SystemBlocktype {
);
}
public static function get_instance_title () {
return get_string('Members', 'group');
}
}
\ No newline at end of file
......@@ -33,3 +33,4 @@ $string['displaygroupviews'] = 'Display Group pages?';
$string['displaygroupviewsdesc'] = 'Group pages - pages created in the group';
$string['displaysharedviews'] = 'Display Shared pages?';
$string['displaysharedviewsdesc'] = 'Shared pages - pages shared by group members from their individual portfolio';
$string['defaulttitledescription'] = 'A default title will be generated if you leave the title field blank';
......@@ -169,6 +169,8 @@ class PluginBlocktypeGroupViews extends SystemBlocktype {
$data['group'] = $group;
return $data;
}
}
?>
public static function get_instance_title() {
return get_string('title', 'blocktype.groupviews');
}
}
......@@ -34,4 +34,4 @@ $string['maxitems'] = 'Maximum number of items to display';
$string['maxitemsdescription'] = 'Between 1 and 100';
$string['More'] = 'More';
$string['nomessages'] = 'No messages';
?>
$string['defaulttitledescription'] = 'A default title will be generated if you leave the title field blank';
......@@ -157,6 +157,27 @@ class PluginBlocktypeInbox extends SystemBlocktype {
public static function allowed_in_view(View $view) {
return $view->get('owner') != null;
}
}
?>
/**
* We need a default title for this block, so that the inbox blocks
* on the dashboard are translatable.
*
* To maintain existing behaviour, use the 'recentactivity' string unless
* the block has only got forum post notifications in it, in which case
* use 'topicsimfollowing'
*/
public static function get_instance_title(BlockInstance $instance) {
if ($configdata = $instance->get('configdata')) {
foreach ($configdata as $k => $v) {
if ($v && $k != 'newpost' && $k != 'maxitems') {
return get_string('recentactivity');
}
}
if ($configdata['newpost']) {
return get_string('topicsimfollowing');
}
}
return get_string('recentactivity');
}
}
......@@ -31,5 +31,4 @@ $string['title'] = 'Latest Pages';
$string['description'] = 'List the most recently updated pages on the site';
$string['viewstoshow'] = 'Maximum number of pages to show';
$string['viewstoshowdescription'] = 'Between 1 and 100';
?>
$string['defaulttitledescription'] = 'A default title will be generated if you leave the title field blank';
\ No newline at end of file
......@@ -80,5 +80,8 @@ class PluginBlocktypeNewViews extends SystemBlocktype {
return 'shallow';
}
public static function get_instance_title(BlockInstance $instance) {
return get_string('title', 'blocktype.newviews');
}
}
......@@ -34,5 +34,5 @@ $string['nogroupstochoosefrom'] = 'Sorry, no groups to choose from';
$string['poststoshow'] = 'Maximum number of posts to show';
$string['poststoshowdescription'] = 'Between 1 and 100';
$string['recentforumpostsforgroup'] = "Recent Forum Posts for %s";
$string['defaulttitledescription'] = 'A default title will be generated if you leave the title field blank';
?>
......@@ -198,6 +198,10 @@ class PluginBlocktypeRecentForumPosts extends SystemBlocktype {
}
}
public static function get_instance_title(BlockInstance $instance) {
if ($instance->get_view()->get('type') == 'grouphomepage') {
return get_string('latestforumposts', 'interaction.forum');
}
return get_string('title', 'blocktype.recentforumposts');
}
}
?>
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