Re: [SMW-devel] using variables set in localsettings in javascript

2016-04-06 Thread Jeroen De Dauw
Hey,

Note that this is a MediaWiki question, not really a PHP one. You can be
the most brilliant PHP dev out there and still won't know how to do this if
you never saw MediaWiki before.

Cheers

--
Jeroen De Dauw | https://entropywins.wtf | https://keybase.io/jeroendedauw
Software craftsmanship advocate | Developer at Wikimedia Germany
~=[,,_,,]:3
--
___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


Re: [SMW-devel] using variables set in localsettings in javascript

2016-04-06 Thread James HK
Hi,

> Can anybody point to an example in any SMW extension?

For a very simple example, please follow:

- `wnbyExternalGeoipService` being specified in [0]
- Is made available to the RL [1]
- Is accessible in JavaScript [2]

[0] 
https://github.com/SemanticMediaWiki/WhatsNearby/blob/master/WhatsNearby.php#L55

[1] 
https://github.com/SemanticMediaWiki/WhatsNearby/blob/master/src/HookRegistry.php#L93

[2] 
https://github.com/SemanticMediaWiki/WhatsNearby/blob/master/res/ext.whats.nearby.js#L83

Cheers

On 4/6/16, Krabina Bernhard  wrote:
> Dear all,
>
> as I unfortunately cannot call myself a PHP developer, my small commits are
> more hacks than programming, but I'm trying to improve :-)
>
> I have a basic question, you might laugh about, but I could not find a
> decent example. Maybe you can help me?
>
> I have figured out how variables are set in localsettings.php and can be
> reused in PHP code. But if an extension uses JavaScript, how can I make use
> of a variable that I set in localsettings.php in the JavaScript?
>
> Can anybody point to an example in any SMW extension?
>
> cheers,
> Bernhard
>
> --
> ___
> Semediawiki-devel mailing list
> Semediawiki-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/semediawiki-devel
>

--
___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


[SMW-devel] using variables set in localsettings in javascript

2016-04-06 Thread Krabina Bernhard
Dear all,

as I unfortunately cannot call myself a PHP developer, my small commits are 
more hacks than programming, but I'm trying to improve :-)

I have a basic question, you might laugh about, but I could not find a decent 
example. Maybe you can help me?

I have figured out how variables are set in localsettings.php and can be reused 
in PHP code. But if an extension uses JavaScript, how can I make use of a 
variable that I set in localsettings.php in the JavaScript?

Can anybody point to an example in any SMW extension?

cheers,
Bernhard

--
___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel