-
AuthorPosts
-
September 21, 2011 at 8:02 pm #168814
I try to integrate the default media field in the params.xml in the t3 core. It works, but the modal popup can not be closed by selecting (Insert) a file.
If I put again one field in the templatedetails.xml (in the template folder), everything works.
The mistake shall come from adding the jInsert function to the document head!media.php…..
// Build the script.
$script = array();
$script[] = ‘ function jInsertFieldValue(value, id) {‘;
$script[] = ‘ var old_id = document.id(id).value;’;
$script[] = ‘ if (old_id != id) {‘;
$script[] = ‘ var elem = document.id(id)’;
$script[] = ‘ elem.value = value;’;
$script[] = ‘ elem.fireEvent(“change”);’;
$script[] = ‘ }’;
$script[] = ‘ }’;// Add the script to the document head.
JFactory::getDocument()->addScriptDeclaration(implode(“n”, $script));It is only working in the templatedetails.xml!!!
Any ideas?
Andreas
jooservices Friend
jooservices
- Join date:
- October 2014
- Posts:
- 8556
- Downloads:
- 0
- Uploads:
- 130
- Thanked:
- 1245 times in 1121 posts
October 9, 2011 at 11:00 am #417891Hi,
I’m sorry I can’t help you resolve this issue because it’s out of my support scope, but I’m reporting it to our T3 developers to check if they can help you.
Thanks
Viet Vujooservices Friend
jooservices
- Join date:
- October 2014
- Posts:
- 8556
- Downloads:
- 0
- Uploads:
- 130
- Thanked:
- 1245 times in 1121 posts
October 20, 2011 at 9:07 am #420416The insert script could not be added into the document and the modal popup can not be closed by selecting (Insert) a file, you can have a little hacking into the t3 core as following
Open the file pluginssystemjat3jat3coreadminutil.php, at about line number 640 you would see a line of code like this
JHTML::_ ( ‘behavior.modal’ );
just add below it this code
$script = array();
$script[] = ' function jInsertFieldValue(value, id) {';
$script[] = ' var old_id = document.id(id).value;';
$script[] = ' if (old_id != id) {';
$script[] = ' var elem = document.id(id)';
$script[] = ' elem.value = value;';
$script[] = ' elem.fireEvent("change");';
$script[] = ' }';
$script[] = ' }';
$dc = &JFactory::getDocument();
// Add the script to the document head.
$dc->addScriptDeclaration(implode("n", $script));Hope that help !
-
AuthorPosts
This topic contains 3 replies, has 2 voices, and was last updated by jooservices 13 years, 3 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum