I am trying to add extra functionality to the CMS by calling the add_link function to add links to the top horizontal menu of the CMS.
One of these links link to a standalone PHP script which exists outside the Silverstripe framework.
The link in LeftAndMain.php is as follows
CMSMenu::add_link(
'RegisteredUsers',
'RegisteredUsers',
'module_my/code/show_members.php?status=1'
);
No GET variable is being sent to show_members.php. Indeed both $_REQUEST and $_SERVER['QUERY_STRING'] are empty.
Question: How can I retrieve the value of the GET variable in my show_members.php script?
Some more details
Something in my .htaccess file may be causing this. I see that this file contains the following lines.
<IfModule mod_rewrite.c>
SetEnv HTTP_MOD_REWRITE On
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^(.*)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .* sapphire/main.php?url=%1&%{QUERY_STRING} [L]
</IfModule>
However these lines are gibberish to me and I do not know how .htaccess and these lines get accessed.
Indeed inserting lines in sapphire/main.php just before the call to Director::direct($url); to print the value of $url to a log file inserted the following
admin
admin/EditorToolbar/ImageForm
I interpret this to mean that main.php is not being called after the link is clicked.
My external script contains the following code
<?php
include('My.php');
$myMy=new My();
$myMy->showMembers();
?>
My.php contains all my functions of which showMembers is one. My.php starts and ends with this
class My{
...
...
}
As you can see in my call to CMSMenu, My.php is located at root/module_my/code
I am using Silverstripe 2.4.