I've been bothering Alec for a while with this, and since he's very busy, I was hoping to get more help out here, as well as discuss the implementation more openly, as many people would like to learn how to get started on a Plugin (so we don't bother PKP so much...).
The Brazilian Government Bar is a visual standard needed in every website from any government institution. It must be at the top, and run across the whole page, being visible in every page.
Anyway, I plan to create a plugin that, according to Alec's analysis, needs to:
- Add the extra frame to templates/article/view.tpl
- Add the extra content to templates/common/header.tpl
- Add the extra content to templates/issue/header.tpl
- Implement a new UI function (currently in IndexHandler.inc.php, called setGovHeader)
- Add extra style info
I've managed to display the bar without the variables in the right position, but haven't a clue as to how to change the Frameset when viewing the article.
For now, I want to know how to get the URL for the images correctly, without having to do it manually. Also, this plugin must be displayed at Portal level, which means, it must display the bar even if the user is not accessing a specific journal.
This is the output generated
- Code: Select all
if (window.focus) newwindow.focus() ;
<a href="http://www.brasil.gov.br"target="_blank"><img src="/brasil2.gif"width="74" height="21" align="top" alt="Acesse o Portal do Governo Brasileiro"border="0"></a>
<img src="/plugins/generic/brazilGovBar/images/logo_def2.gif"alt="Acesse o Portal do Ministério da Ciência e Tecnologia"width="430" height="21" border="0">
<select name="govOptions" onChange="if(options[selectedIndex].value) openNewWindow(options[selectedIndex].value)" class="pr"><option value="">Destaques do Governo</option><option value="http://www.brasil.gov.br">Portal do Governo Federal</option><option value="http://www.e.gov.br">Portal de Serviços do Governo</option><option value="http://www.radiobras.gov.br">Portla da Agência Nacional de Notícias</option><option value="http://www.brasil.gov.br/emquestao">Em Questão</option><option value="http://www.fomezero.gov.br">Programa Fome Zero</option></select>
I've manged to use a foreach loop to get the select options dynamically, getting the text and values from a locale xml.
The URL for the images, though, are off, since I can't get the Journal URL, and even if I did, when viewing the portal I'm not sure it would be visible.
The URL should be something like, the following but all my attempts so far have accounted for nothing:
- Code: Select all
<img src="'.$baseUrl.'/plugins/generic/brazilGovBar/images/'.$ministryImage.'"alt="'.$ministryImageAlt.'"width="430" height="21" border="0">
I've tried everything, even creating specific functions to return the correct path, but $baseUrl returns something that I don't need or can't use (like the server's main URL - http://cajueiro.ibict.br, or http://cajueiro.ibict.br/seer/ojs2.2/oj ... p/inclusao), when I just need http://cajueiro.ibict.br/seer/ojs2.2/ojs2.2.new/, which should be the $baseUrl.
Is there a way to get this in a plugin without being changed when changing from journal to journal, or journal to Portal view?