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 previous 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
 
Read Message
Read Message
Previous Topic: WORKFLOW template_id
Next Topic: Localization of task_desc in workitem
Goto Forum:
  


Current Time: Mon Nov 25 02:03:26 EST 2024

Total time taken to generate the page: 0.03330 seconds