Radicore Forum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » RADICORE development » Bug Reports » Not processing $javascript['foot'][]['code']
Not processing $javascript['foot'][]['code'] [message #5918] Sat, 01 October 2016 00:27 Go to next message
kong is currently offline  kong
Messages: 90
Registered: December 2011
Member
Note that http:// www.tonymarston.net/php-mysql/radicore-and-javascript.html#f oot.element has been implemented only for the 'file' option, as shown in include.xml.php5.inc, function setJavaScript:
        if (isset($javascript['foot'])) {
            $file_array = array();
            foreach ($javascript['foot'] as $entry) {
                if (key($entry) == 'file') {
                    if (in_array($entry, $file_array)) {
                        // already processed, so don't repeat
                    } else {
                        $file_array[] = $entry;
                        // add a reference to a file
                        $foot = $doc->createElement('foot');
                        $foot->setAttribute('type', 'file');
                        $foot = $js->appendChild($foot);

                        $url = $GLOBALS['url_files'] .dirname($PHP_SELF) .'/' .$entry[key($entry)];

                        $foot  = $js->appendChild($foot);
                        $value = $doc->createTextNode($url);
                        $value = $foot->appendChild($value);
                    } // if
                } // if
            } // foreach
        } // if

Add the 'code' option:
        if (isset($javascript['foot'])) {
            $file_array = array();
            foreach ($javascript['foot'] as $entry) {
                if (key($entry) == 'file') {
                    if (in_array($entry, $file_array)) {
                        // already processed, so don't repeat
                    } else {
                        $file_array[] = $entry;
                        // add a reference to a file
                        $foot = $doc->createElement('foot');
                        $foot->setAttribute('type', 'file');
                        $foot = $js->appendChild($foot);

                        $url = $GLOBALS['url_files'] .dirname($PHP_SELF) .'/' .$entry[key($entry)];

                        $foot  = $js->appendChild($foot);
                        $value = $doc->createTextNode($url);
                        $value = $foot->appendChild($value);
                    } // if
                } // if

                if (key($entry) == 'code') {
                    // add a block of javascript code
                    $foot = $doc->createElement('foot');
                    $foot->setAttribute('type', 'code');
                    $foot  = $js->appendChild($foot);
                    $value = $doc->createTextNode($entry[key($entry)]);
                    $value = $foot->appendChild($value);
                } // if

            } // foreach
        } // if
Re: Not processing $javascript['foot'][]['code'] [message #5920 is a reply to message #5918] Sat, 01 October 2016 04:17 Go to previous message
AJM is currently offline  AJM
Messages: 2347
Registered: April 2006
Location: Surrey, UK
Senior Member
I shall include this update in the next release, which will be available later today.

Previous Topic: WORKFLOW template_id
Next Topic: Localization of task_desc in workitem
Goto Forum:
  


Current Time: Fri Apr 19 16:31:38 EDT 2024

Total time taken to generate the page: 0.00961 seconds