Joomla Session Variable as Plugin Parameter - joomla

I have a Joomla plugin which takes varying parameters. I need to retrieve one of these parameters from the current session. I've tried using Jumi and a little PHP snipped to retrieve the value and output it in the plugin's parameter list, but the Joomla plugin parser only handles the outter-most set of curly braces. ex.
{fabrik view=table id=62 resetfilters=1 fab_tours_ro___tour_id=[tour_id]}
[tour_id] I need to retrieve from the current session. I've tried
{fabrik view=table id=62 resetfilters=1 fab_tours_ro___tour_id={jumi [scripts/get_tour_id.php]}}
In that case the {jumi} tag never gets parsed. I could hack the {fabrik} plugin, but I'd prefer to do this without making any core or component changes, especially since I update Fabrik quite regularly via svn.

I actually ended up using the latest Jumi 2.1 beta plugin which runs as System rather than Content. Then it was as simple as echoing the plugin syntax with the value already filled in:
{jumi}
<?php
$tour_id = $mainframe->getUserState("tour_id", '0');
echo '{fabrik view=table id=62 resetfilters=1 fab_tours_ro___tour_id='.$tour_id.'}';
?>
{/jumi}

Make sure your jumi plugin is executing before your fabrik plugin. You can check the order they are being fired in Extensions -> Plugin Manager.

Related

Where is the site.vm of the maven-default-skin?

When I run mvn site with no site.xml on a simple Maven project (meaning it will use the maven-default-skin) which site.vm file site used?
I have looked into maven-site-plugin, maven-project-info-reports-plugin, maven-doxia-sitetools and of course maven-default-skin, but I could not find it anywhere.
For the maven-fluido-skin, I can find the site.vm in src/main/resources/META-INF/maven. But there is no such file for maven-default-skin.
When using maven-site-plugin 4.0.0-M3, the maven-doxia-sitetools version used is 2.0.0-M3. This version provides the default-site.vm file in its resources, which is used as the default template in the DefaultSiteRenderer class if the skin doesn't provide any (e.g. maven-default-skin).
In maven-site-plugin 4.0.0-M4, the version of maven-doxia-sitetools is 2.0.0-M4. In this version, the default-site.vm has been removed and the default skin has been changed to maven-fluido-skin.
This means it's not possible anymore to use a skin that doesn't provide the site.vm template. If one tries to force the use of the maven-default-skin with version 4.0.0-M4, it will fail with the message Skin does not contain template at META-INF/maven/site.vm.
This change has been done in https://issues.apache.org/jira/browse/DOXIASITETOOLS-270. maven-default-skin is unmaintained and will be replaced by maven-fluido-skin, see https://issues.apache.org/jira/browse/MSKINS-196.
For information, the site.vm is a Velocity template file and is rendered by maven-doxia-sitetools (doxia-site-renderer to be precise) on maven-site-plugin's request.

How to add prefix in URI while loading XQuery file using ml-gradle

I am using gradle 6.8 and MarkLogic version is 10.0-5.2,
My XQuery code is in directory \ml-gradle\src\main\common. When I run the command mlLoadModules to load XQuery into the modules database it loads with default URI /common/test.xqy.
I want to add some prefix to the URIs e.g. /rsc/common/test.xqy. How can I achieve that?
Note: I don't want to create an extra folder in my source for prefix "rsc".
It's not supported, though you could write a custom Gradle task to change the URI to whatever you like.
Why do you not want to create an "rsc" folder above "common"? I think other developers would find it much more intuitive that "rsc/common/test.xqy" becomes "/rsc/common/test.xqy" when loaded, rather than "common/test.xqy" becomes "rsc/common/test.xqy", which begs the question - where is "rsc" coming from? And then that developer would need to understand what property / custom code is adding that "rsc".

How to load PHPMailer on cakePHP 3 [duplicate]

I'm currently building a new CakePHP app with version 3.0.0-RC1, and trying to install and use the jasig/phpCAS plugin. Using this guide, I've run the following command from the command prompt: composer require jasig/phpcas
This correctly copies the jasig/phpcas files into the vendor directory of my app, but one of the other files that the guide says should be updated (vendor/cakephp-plugins.php) doesn't even exist.
I've had a tough time accessing the plugin. I want to be able to call its static methods, and I keep getting errors of the form: Error: Class 'App\Controller\phpCAS' not found. (The exact directory in the error changes depending on where I'm calling the method from.)
I don't know if this is due to not having the cakephp-plugins.php file, or if I'm not calling the plugin correctly. It's my understanding that if the plugin is loaded I should just be able to call static methods on it like this: phpCAS::methodName()
First of all jasig/phpcas is not a CakePHP plugin. And the vendor/cakephp-plugins.php file is created by the CakePHP plugin installer, so if you don't see such a file, you seem to have either not installed any plugins yet, or you are not using a recent version of the installer, as the creation of this file has been introduced just recently.
Regarding the error about the class not being found, you are missing the leading namespace separator (\phpCAS::methodName()) to access the class in the global namespace, respectively you are missing a proper import (use phpCAS;) that would make the class available in the current namespace.
In case you are not familiar with namespaces, you may want to start with: http://php.net/namespaces

How to debug symfony in Netbeans? I cannot call specific pages

I've already read posts like Passing PHP arguments into NetBeans into a page that features symfony url-routing
but I cannot make things work.
I would like to run the following page:
http://localhost/s/web/frontend_dev.php/travel
So I tried first the "Local Website Configuration" with Netbeans 6.9.1. As stated in the linked thread there is an issue here since I can point to the project url and to the "web/frontend_dev.php" index file but I am not able to have "/travel" as an argument since Netbeans always prefixes it with ? for parameter passing which I don't want.
I the mentioned thread the solution is supposed to be using the Script Config option. Fine
I can point to php.exe and I can point to the index file again at web/frontend_dev.php but although I can pass arguments like /travel there it still does not work since it creates a whitespace in the call:
php.exe ./web/frontend_dev.php /travel
which does not work either.
It is easier to use the following:
Set the Debug URL to "Do not open Webbrowser" (Project->Properties->Run Configuration->Advanced)
Start the debugging session with Netbeans (Netbeans doesn't start a browser but waits for a XDebug connection)
Use the easy XDebug-Firefox-Plugin to start XDebug for you Symfony App (easy XDebug)
Thats it. This is working perfectly for my Symfony apps
As far as I undersand you, this is a std-situation when there is no 101-path-mapping from file-path to URL-path.
In Eclipse you can either define a completely new path-mapping or make Eclipse request a certain URL-path. In your case you would just define localhost as your server and '/s/web/frontend_dev.php/travel' as the path to attach.
I'm pretty sure there is a similar option in NetBeans as this is in times of mod-rewrite and Zend FW a very common situation.

Placeholder substitution in a Maven APT page

I am working on Maven site documentation for some related projects, and I want to create a hyperlink from one site's documentation to another sites documentation. The wrinkle is that the URL for the link target depends on a Maven property.
I tried this:
{{{http://example.com/site/project-${some-prop}/some.html}the documentation}}
but the ${some-prop} placeholder doesn't get replaced, and the APT processor then gets
confused by the first '}'. Escaping the { and } characters (e.g. $\{some-prop\} ) doesn't help, and the following doesn't work either:
{{http://example.com/site/project-${some-prop}/some.html}}
Is there some other way that I can accomplish this task? For example, is there a way to define a Doxia macro that could be used to substitute a URL that had the placeholder expanded?
Are you using version 2.0-beta-6 or later of the site plugin? Also, does your apt filename ends with a .vm extension (as described in the filtering section of Creating Content?

Resources