欢迎各位兄弟 发布技术文章
这里的技术是共享的
//下面两种方式都可以增加js
if($arg0=='kfzx-bingzhuantu' || $arg0=='kfzx-bingzhuantu-onlyxuexiao'|| $arg0=='kfzx-bingzhuantu-onlyzg'){ global $json_shoujiguishudi; global $json_shoujiguishudi1; global $json_shoujiguishudi2; $vars['json_shoujiguishudi'] = $json_shoujiguishudi; $vars['json_shoujiguishudi1'] = $json_shoujiguishudi1; $vars['json_shoujiguishudi2'] = $json_shoujiguishudi2; drupal_add_js(drupal_get_path('theme', 'myminnellizhutwo') . '/js/chart_pie/highcharts.js'); drupal_add_js(drupal_get_path('theme', 'myminnellizhutwo') . '/js/chart_pie/modules/exporting.js'); $vars['scripts'] = drupal_get_js();
//为什么下面的增加js的代码,在template.php中不起作用呢,为什么只能在模块中增加呢?
drupal_add_js('var ue = UE.getEditor("container");', 'inline', 'footer'); } if($arg0=='kfzx-bingzhuantu' || $arg0=='kfzx-bingzhuantu-onlyxuexiao' || $arg0=='kfzx-bingzhuantu-onlyzg') { $scripts = drupal_add_js(); $new_jquery = array('misc/jquery-1.4.4.min.js' => $scripts['core']['misc/jquery.js']); $scripts['core'] = array_merge($new_jquery, $scripts['core']); unset($scripts['core']['misc/jquery.js']); $vars['scripts'] = drupal_get_js('header', $scripts); }