Software Hosting and Development Services available at PKP Publishing Services
As the developers of Open Journal Systems, Open Conference Systems, Open Harvester Systems, and Open Monograph Press, the PKP team are experts in helping journal managers and conference organizers make the most of their online publishing projects. PKP Publishing Services offers support for:
As a customer of PKP Publishing Services, you will not only receive direct, personalized support from the PKP Development Team, but will be contributing to the ongoing development of the PKP applications. All funds raised by PKP Publishing Services go directly toward enhancing our free, open source software. For more information, please contact us.
OJS development discussion, enhancement requests, third-party patches and plug-ins.
Moderators: jmacgreg, michael, jheckman, barbarah, btbell, bdgregg, asmecher
Forum rules
Developer Resources:Documentation: The
OJS Technical Reference and the OJS
API Reference are both available from the
OJS Documentation page.
Git: You can access our public Git Repository
here. Comprehensive Git usage instructions are available on the
wiki.
Bugzilla: You can access our Bugzilla report tracker
here.
Search: You can use our
Google Custom Search to search across our main website, the support forum, and Bugzilla.
Questions and discussion are welcome, but if you have a workflow or usability question you should probably post to the
OJS Editorial Support and Discussion subforum; if you have a technical support question, try the
OJS Technical Support subforum.
by christo » Thu Aug 16, 2007 1:44 am
Is there a function as part of the plugin class which enables you to get a list of all the available locales for that plugin? I have had a look around but dont think i found one...
something like:
- Code: Select all
$myPlugin = &PluginRegistry::getPlugin('generic', 'MyPlugin');
$availableLocales = $myPlugin->getLocales();
would be useful..
-
christo
-
- Posts: 22
- Joined: Mon Jan 09, 2006 12:04 am
- Location: Grahamstown, South Africa
-
by asmecher » Thu Aug 16, 2007 9:41 am
Hi Christo,
No function currently exists for this; I'd suggest using the glob or opendir functions to have a look at the locale directory's contents manually.
Regards,
Alec Smecher
Public Knowledge Project Team
-
asmecher
-
- Posts: 5769
- Joined: Wed Aug 10, 2005 12:56 pm
-
by christo » Thu Aug 16, 2007 1:41 pm
Hi Alec
Cool, just didnt want to re-invent the wheel. if i write such function for the plugin class, would it be worth including in the core? or should i rather just write it for my plugin?
-
christo
-
- Posts: 22
- Joined: Mon Jan 09, 2006 12:04 am
- Location: Grahamstown, South Africa
-
by asmecher » Thu Aug 16, 2007 2:21 pm
Hi Christo,
This might be a good method to include in classes/plugin/Plugin.inc.php. Feel free to submit it and I'll review the code for inclusion in OJS 2.2.
Thanks,
Alec Smecher
Public Knowledge Project Team
-
asmecher
-
- Posts: 5769
- Joined: Wed Aug 10, 2005 12:56 pm
-
by christo » Fri Aug 24, 2007 7:05 am
ok. I have written a little function for gettng the locales installed for a plugin. Here it is:
- Code: Select all
/**
* Function to get all the available locales for a plugin
*
* @return string[] $locales
*/
function getAvailableLocales(){
$locales = array();
$fullPath = $this->getTemplatePath().'locale'; //get the absolute url to the locale folder
// get the relative url (glob appears only to like relative urls - or its is a windows issue with the path...
$splitPath = split("plugins",$fullPath);
$path = 'plugins'.$splitPath[1];
//get the folders and remove the path except for the last bit (the locale folder)
foreach (glob($path.'/*',GLOB_ONLYDIR) as $locale){
$locale = ereg_replace($path.'/','',$locale);
array_push($locales,$locale);
}
return $locales;
}
-
christo
-
- Posts: 22
- Joined: Mon Jan 09, 2006 12:04 am
- Location: Grahamstown, South Africa
-
Return to OJS Development
Who is online
Users browsing this forum: No registered users and 2 guests