Git repository with block template available on github

Git repository with block template available on github

by Daniel Neis Araujo -
Number of replies: 9
Picture of Core developers Picture of Plugin developers Picture of Translators

Hello,

 

inspired by https://github.com/moodlehq/moodle-mod_newmodule and following the instructions from http://docs.moodle.org/dev/Blocks i've made available at github a minimal block template ( https://github.com/danielneis/moodle-block_newblock ). Hope you like.

Any comments are welcome.

Kind regards,

Daniel


(Edited by Dan Poltawski to make the url work correctly - original submission Friday, 18 January 2013, 12:02 PM)
Average of ratings: Useful (4)
In reply to Daniel Neis Araujo

Re: Git repository with block template available on github

by Rex Lorenzo -

I love it! I would like to see more sample code for the different Moodle plugins. I did notice that in your db/access.php you seem to have an errant capability block/simplehtml:myaddinstance.

 

In reply to Rex Lorenzo

Re: Git repository with block template available on github

by Daniel Neis Araujo -
Picture of Core developers Picture of Plugin developers Picture of Translators

Hello,

thanks for the corrections (link and code)! ;D
I've updated the code on github to correct the capability.

 

Kind regards,

Daniel

In reply to Daniel Neis Araujo

Re: Git repository with block template available on github

by Tomasz Muras -
Picture of Core developers Picture of Plugin developers Picture of Plugins guardians Picture of Translators

Hi Daniel,

Nice work on the template. You could change the readme from:

Rename the file lang/en/newblock.php to lang/en/widget.php where "widget" is the name of your module

to

Rename the file lang/en/block_newblock.php to lang/en/block_widget.php where "widget" is the name of your module. Also rename block_newblock.php in the main directory to block_widget.php

I have used your template to create new moosh command - generate-block, which will generate an empty block based on your code - I hope you don't mind!

cheers,
Tomek

In reply to Tomasz Muras

Re: Git repository with block template available on github

by Daniel Neis Araujo -
Picture of Core developers Picture of Plugin developers Picture of Translators

Hello, Tomasz

 

thanks for the suggestions (i've updated the readme on github) and for the new moosh command (its really an honor ;)

I've made another template, this time for gradereports. It's avaialable on github too: https://github.com/danielneis/moodle-gradereport_newgradereport

 

Hope you like!

 

Kind regards,

Daniel

In reply to Daniel Neis Araujo

Re: Git repository with block template available on github

by Tomasz Muras -
Picture of Core developers Picture of Plugin developers Picture of Plugins guardians Picture of Translators

Hi Daniel,

Thanks for your template, I've added it to moosh 0.7 as a new command generate-gradereport - see here.

cheers,
Tomek

In reply to Daniel Neis Araujo

Re: Git repository with block template available on github

by Alex Black -

Hi,

I can see the block listed in Site Administration >> Plugins Overview >> Blocks >> Manage blocks, however it does not show in the "Add Block" drop down.

What am I missing?


Regards,

Alexx