Miscellaneous > Roundcube Discussion

inserting new variable in a skin

(1/4) > >>

flash:
I would like to take a $variable that I have set in a mod to index.php and insert that $variable value in a html skin file. What is the syntax to do the variable insertion in the skins. For example, in a normal php file you could use in the html:

What do you insert in the skin files in roundcube to display the php variable?

bpat1434:
I'm gonna look into the templating system today. If I find out, I'll let you know ;)

flash:
It appears that the $variable needs to be converted to


I can see, for example
$rcmail_config['product_name']
in the config file becomes


I have found the object handlers in main.inc (and have found the example above), but the process is very confusing. Documentation would be good.

flash:
I am posting this as I get through it so there will be some documentation for others.

This function in main.inc does the replacement

function parse_rcube_xml($input)
 {
 $output = preg_replace('/]+)>/Uie', "rcube_xml_command('\\1', '\\2')", $input);
 return $output;
 }

Then you have to make your way though this function, also in main.inc

function rcube_xml_command($command, $str_attrib, $add_attrib=array())

to go through each command type (of which object is one). now I just have to figure out how to load one.

This seems quite complex for such a simple task.

It would be easy at this point just to code a translation for the object to my $variable in that function, but I am trying to fit into the RC structure and not make any mods in main.inc. So I need to figure out where to load $variable, or to say it clearer, what array to load it into. At least I think that is how to make it work with the structure.

bpat1434:
Well... it's not as complex as you think....

Basically, it's a template parsing script that takes tags and their items and creates HTML code out of it. If you just take your time, and follow some of the ones already laid out in the template (like include or script) you'll soon find yourself learning the parsing script.

Navigation

[0] Message Index

[#] Next page

Go to full version