1414// You should have received a copy of the GNU General Public License
1515// along with Moodle. If not, see <https://www.gnu.org/licenses/>.
1616
17- use block_townsquare \contentcontroller ;
18-
1917/**
20- * Plugin strings are defined here .
18+ * Townsquare block class .
2119 *
2220 * @package block_townsquare
2321 * @copyright 2023 Tamaro Walter
@@ -41,22 +39,14 @@ public function init(): void {
4139 * @throws \core\exception\moodle_exception
4240 */
4341 public function get_content (): stdClass {
44- global $ OUTPUT , $ DB , $ USER , $ CFG ;
42+ global $ DB , $ USER ;
4543
4644 if ($ this ->content !== null ) {
4745 return $ this ->content ;
4846 }
4947
50- $ controller = new contentcontroller ();
51- $ mustachedata = new stdClass ();
52- $ mustachedata ->content = $ controller ->get_content ();
53- $ mustachedata ->courses = $ controller ->courses ;
54- $ mustachedata ->savehelpicon = ['text ' => get_string ('savehelpicontext ' , 'block_townsquare ' )];
55- $ mustachedata ->resethelpicon = ['text ' => get_string ('resethelpicontext ' , 'block_townsquare ' )];
56- // Learnweb-Todo: If versions <M.5.0 are not supported anymore, delete this check and the old sidepanel template.
57- $ mustachedata ->newsidepanel = $ CFG ->branch >= 500 ;
5848 $ this ->content = new stdClass ();
59- $ this ->content ->text = $ OUTPUT -> render_from_template ('block_townsquare/blockcontent ' , $ mustachedata );
49+ $ this ->content ->text = $ this -> page -> get_renderer ('block_townsquare ' )-> render_main ( );
6050
6151 // Get the user settings if available.
6252 $ usersettings = $ DB ->get_record ('block_townsquare_preferences ' , ['userid ' => $ USER ->id ]);
0 commit comments