public static function ia_print_js($params, Smarty_Internal_Template &$smarty)
 {
     $smarty->add_js($params);
     if (!isset($params['display'])) {
         return '';
     }
     $iaCore = iaCore::instance();
     $resources = self::_arrayCopyKeysSorted($iaCore->iaView->resources->js->toArray());
     $output = '';
     foreach ($resources as $resource) {
         switch (true) {
             case strpos($resource, 'code:') === 0:
                 if ($code = trim(substr($resource, 5))) {
                     $output .= PHP_EOL . "\t" . '<script type="text/javascript"><!-- ' . PHP_EOL . $code . PHP_EOL . ' --></script>';
                 }
                 continue;
             case strpos($resource, 'text:') === 0:
                 if (iaUsers::hasIdentity() && iaCore::ACCESS_ADMIN == iaCore::instance()->getAccessType()) {
                     $text = trim(substr($resource, 5));
                     $output .= "<script type=\"text/javascript\">if(document.getElementById('js-ajax-loader-status'))document.getElementById('js-ajax-loader-status').innerHTML = '" . $text . "';</script>" . PHP_EOL;
                 }
                 continue;
             default:
                 $output .= PHP_EOL . "\t" . sprintf(self::LINK_SCRIPT_PATTERN, $resource);
         }
     }
     return $output;
 }