Moodle Create A New Account link - how to make it as a button

Moodle Create A New Account link - how to make it as a button

by Frankie Kam -
Number of replies: 2
Picture of Plugin developers


Is the a reason why the Create new account is a link rather than a button? To combat spam?
I would like to convert the link into a button. I had a look at the code, and this is the html_writer code that creates the link.

blocks/login_logout/block_login_logout.php

            if (!empty($signup)) {
$this->content->footer .= html_writer::start_tag('div');
$this->content->footer .= html_writer::link(new moodle_url($signup), get_string('startsignup'));
$this->content->footer .= html_writer::end_tag('div');
            }

In trying to mimic the Create New Account button in /login/index_form.html tried...

<?php 
           ...
            if (!empty($signup)) {
              $this->content->footer .= html_writer::start_tag('div');
?>
       <div class="signupform">
                <form action="../signup.php" method="get" id="signup">
               <div><input type="submit" value="<?php print_string("startsignup") ?>" /></div>
              </form>
            </div>
<?php

                 $this->content->footer .= html_writer::end_tag('div');
            }
...
?>

but it doesn't work.

Any one can point me in the right direction? StackOverflow?

Cheers
Frankie Kam

Average of ratings: -
In reply to Frankie Kam

Re: Moodle Create A New Account link - how to make it as a button

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers

I wonder if this is a theme issue on your Moodle.

I use Boost, and here is how mine looks (it has a button.)

Attachment Create New Account.png
In reply to Rick Jerz

Re: Moodle Create A New Account link - how to make it as a button

by Frankie Kam -
Picture of Plugin developers
Thanks for replying, Rick. I solved it with some programming.
Here's what it looks like now:



Here's the diff in the DiffChecker.com if anyone is interested to find out how I did it: 
https://www.diffchecker.com/SX9Drl8C

Cheers
Frankie Kam