OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Is there a BASE_PATH variable in OxS?

Are you responsible for making OJS work -- installing, upgrading, migrating or troubleshooting? Do you think you've found a bug? Post in this forum.

Moderators: jmacgreg, btbell, michael, bdgregg, barbarah, asmecher

Forum rules
The Public Knowledge Project Support Forum is moving to http://forum.pkp.sfu.ca

This forum will be maintained permanently as an archived historical resource, but all new questions should be added to the new forum. Questions will no longer be monitored on this old forum after March 30, 2015.

Is there a BASE_PATH variable in OxS?

Postby ramon » Mon Nov 26, 2012 8:57 am

Hello all,

We'd like to know what would be the best way to find OxS current base path.
Usually there is a defined variable for this, but we can't find it.
Something like gcwd() (which may be disabled for some reason), dirname(__FILE__) (which may or may not work properly), basedirname(), or a mix of them.
The use is planned for a plugin that needs to make a call to an include in the common header.tpl file.
If there's a proper way to "include" files, let us know, as we couldn't find anything related to this...

What we want to accomplish is add code right after the <body> tag, before the <a> tag of the header templates.


_______________________________
Ramón Martins Sodoma da Fonseca
Analista em C&T
Coordenação de Tecnologias de Informação
Instituto Brasileiro de Informação em Ciência e Tecnologia - IBICT
Ministério da Ciência e Tecnologia - MCT
ramon
 
Posts: 945
Joined: Wed Oct 15, 2003 6:15 am
Location: Brasí­lia/DF - Brasil

Re: Is there a BASE_PATH variable in OxS?

Postby asmecher » Mon Nov 26, 2012 9:58 am

Hi Ramon,

I think registering a Smarty resource would be the best solution; see http://www.smarty.net/docsv2/en/template.resources.tpl. (This is the way that "core" templates are referenced, i.e.:
Code: Select all
{include file="core:path/to/template.tpl"}
If you register the resource in the plugin registration function, you'll be able to reference it from any template subsequently displayed. I think this would be a suitable piece of code to add to the plugin base class, if you're willing to submit a patch or something.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 10015
Joined: Wed Aug 10, 2005 12:56 pm

Re: Is there a BASE_PATH variable in OxS?

Postby ramon » Mon Nov 26, 2012 10:09 am

Alec,

THANKS!!
We'll try this...

_______________________________
Ramón Martins Sodoma da Fonseca
Analista em C&T
Coordenação de Tecnologias de Informação
Instituto Brasileiro de Informação em Ciência e Tecnologia - IBICT
Ministério da Ciência e Tecnologia - MCT
ramon
 
Posts: 945
Joined: Wed Oct 15, 2003 6:15 am
Location: Brasí­lia/DF - Brasil


Return to OJS Technical Support

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 3 guests

cron