Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • kreta Friend
    #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
    #417891

    Hi,
    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 Vu

    jooservices Friend
    #420416

    The 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 !

Viewing 3 posts - 1 through 3 (of 3 total)

This topic contains 3 replies, has 2 voices, and was last updated by  jooservices 13 years, 1 month ago.

We moved to new unified forum. Please post all new support queries in our New Forum