Hello,
I am currently facing a major problem. I have a grid and linked in IFrame a form for uploading files. With grid OnApplicationIni I need to get Joomla CMS User Name. I managed to do so using a blank application, upload this to my main Joomla installation folder and use Wrapper with CMS. I can echo the Global Var UserName, no problem:
// GET JOOMLA USER NAME
define( '_JEXEC', 1 );
define( '_VALID_MOS', 1 );
define( 'JPATH_BASE', realpath(dirname(__FILE__).'/../..' ));
define( 'DS', DIRECTORY_SEPARATOR );
require_once ( JPATH_BASE .DS.'includes'.DS.'defines.php' );
require_once ( JPATH_BASE .DS.'includes'.DS.'framework.php' );
$mainframe =& JFactory::getApplication('site');
$mainframe->initialise();
$user = JFactory::getUser();
$joomla_name = $user->name;
$joomla_email = $user->email;
$joomla_password = $user->password;
$joomla_username = $user->username;
[UserName] = $joomla_username;
When I try to use this with Grid OnApplicationIni, my Scriptcase app just doesn’t do anything. The page is white, no code at all is being executed. I already tried to use a blank app, sc_redirect to my grid…but the Global Var just isn’t working in grid. I will need [UserName] with grid sql as well as form.
@aductom: would you know a work around using PHP Methods maybe? Never worked with those…somehow I need to execute my code in order to get the Global Var, before Grid is performing it’s sql:
SELECT
`x`,
`y`
FROM
csv_upload
WHERE
CreatedUser = '[UserName]'
ORDER BY
id DESC
I kind of had another problem using the following code with grid OnApplicationIni:
// GET LANGUAGE
$ActiveLanguage = 'english';
[ActiveLanguage] = $ActiveLanguage;
// SET LANGUAGE
if ($ActiveLanguage = 'german'){
sc_set_language('de');
echo 'is german';
}
elseif ($ActiveLanguage = 'english'){
sc_set_language('en_us');
echo 'is english';
}
else {
sc_set_language('en_us');
echo 'no language';
}
Here I get an error message. Some time ago support told me that I have to check my code, but by now I think there is something odd with the execution of codes OnApplicationIni:
Error include() [function.include]: Failed opening ‘/…/_lib/buttons/’ for inclusion (include_path=’.:/usr/local/lib/php’)
I tried to use form as master as well and link a grid IFrame. Same behaviour! This bug is killing my time right now and project is on hold. I opened a ticket as well.