Jump to content

Recommended Posts

Posted

Hi there,

 

i try to customize the header of my theme but i'm stuck with problem changing the output of the language chooser and the text "you're logged in ...".

 

<?php echo $menu ?>

 

This is the part where i want to change the code behind, but i'm not able to find where $menu is set. I hope somebody could help me pls.

Posted
In my Theme there's in header.html the php variabel $menu and i want to knwo, where moodle get's the code behind $menu ... And behind $menu there must be HTML and PHP ...
Posted (edited)

What precisely do you want to change? Do you mean the words "you're logged in as"? Forget looking in the code on your server.

Go to your Moodle >site admin on the front page>language>language editing>edit words and phrases.

Select the one that says moodle.php and scroll down until you find the text you want to change.

While you can alter the default text within the actual php files this is a far quicker and simpler way of editing any of Moodle's language.#

Edited by secretlife
Posted

Sorry that i wrote a little bit inapprehensible.

 

I don't want to change any language strings. I want to change the code behind where the output is created! I want to hack the source code to create an output i'll like to have! So i need to know where $menu is "created".

Posted
Sorry for choosing the wrong Forum. It will be better if i'm asking directly on the moodle site for developers.
Posted
My post is clear. I want to know where moodle "creates" the $menu variable in header.html of a theme. There's the login and the language selection. I want to modify the html behing the language selection and the login and this is stored in a variable named $menu.
Posted

The reason no-one has answered you is that it isn't as simple as you might have liked...

 

$menu isn't defined in only one place!

 

However depending on what you want to do that might not matter - but you haven't given any indication of what you actually want to achieve...

 

Most of the definitition of $menu takes place in /lib/weblib.php around line 2551

 

However I would caution you against hacking around too much in core files as it creates huge problems when it comes to upgrades (he says speaking from experience!)

 

If you are only looking to make a few changes, I would try and do it either through langauge strings or using JS to change things after they are printed... This way upgrades are not an issue.

 

Alternatively don't edit $menu, but instead don't call $menu in header.html but instead just call the functions that do the bits you are interested in (finding the functions from within weblib.php etc)...

 

Full details of where $menu is defined and also where it is used cand be found:

PHPXref 0.7: Moodle 1.9.3 [build 15-Oct-2008]

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...