New Hack! Site Pages Editing

New Hack! Site Pages Editing

by Mowafag Ali -
Number of replies: 5

Hello, 

This is my first post to this forum. I just launched my first moodle website ( www.benghazischool.com ) and feel like I've reached a new plateau with Moodle. It was an awesome experience. : ) 


One challenge with the site that I was working on was that I needed to edit/delete/hide pages (eg: about us, team, privacy, ..) easily after submitted it. So I made this small hack for showing the icons at the footer of page.


Open mod/page/view.php file and add the following lines at the end before ( echo $OUTPUT->footer(); ) line :


$isadmin = is_siteadmin($USER);

 if ($isadmin) {

echo '<div>

       <a href="'.$CFG->wwwroot.'/course/mod.php?sesskey='.sesskey().'&amp;update='.$id.'"><img src="'.$OUTPUT->pix_url('t/editstring') . '" class="iconlarge" title="'.get_string('edit').'" alt="'.get_string('edit').'" /></>

  <a href="'.$CFG->wwwroot.'/course/mod.php?sesskey='.sesskey().'&amp;delete='.$id.'"><img src="'.$OUTPUT->pix_url('t/delete') . '" class="iconlarge" title="'.get_string('delete').'" alt="'.get_string('delete').'" /></>

  <a href="'.$CFG->wwwroot.'/course/mod.php?sesskey='.sesskey().'&amp;hide='.$id.'"><img src="'.$OUTPUT->pix_url('t/hide') . '" class="iconlarge" title="'.get_string('hide').'" alt="'.get_string('hide').'" /></a></>

  </div>';

}


That's it .. Enjoy : )


Attachment Untitled22902.jpg
Average of ratings: Useful (1)
In reply to Mowafag Ali

Re: New Hack! Site Pages Editing

by Justin Hunt -
Picture of Particularly helpful Moodlers Picture of Plugin developers

So now we have to ask you some questions.

What theme are you using? It looks great.

How did you do that login / sign up popup thingy? Thats great too.

In reply to Justin Hunt

Re: New Hack! Site Pages Editing

by Usman Asar -
Picture of Plugin developers Picture of Testers
Justin, the theme is Lambda (Responsive), you can get it from Themeforest. I can bet Essential will turn out to be way better if one can really pull the strings.
Infact, the lambda is based on Essential wink
In reply to Justin Hunt

Re: New Hack! Site Pages Editing

by Mowafag Ali -

Hi, I'm using Lambda theme designed by my friend "Eva Pietryka" and you can get it for themeforest.net


Regarding to popup, it is based on this script :

http://www.jqueryscript.net/lightbox/Simple-jQuery-Plugin-For-Opening-A-Popup-Window-On-Page-load.html


Feel free to copy my code via Developer tools in your browser wink


Average of ratings: Useful (1)