1
我想在Drupal CMS模块中测试jqScheduler for PHP。在drupal中添加javascript
当$ eventcal-> render();函数在Drupal模块中调用,以下代码在页面开始之外的<html>
部分之前生成。
<style type=text/css>/*
Document : calendar
.
.
.
<script type='text/javascript'>jQuery(document).ready(function() {jQuery.datepicker...
<html xmlns="http://www.w3.org/1999/xhtml" lang="fa" xml:lang="fa">
<head>
有没有办法拦截上面的代码,以便我可以将它们放在我需要它们的地方。
例子:
$output = "<script type='text/javascript'>jQuery(document).ready(function() .... </script>";
我添加CSS & JA文件添加此类似代码
function study_jqScheduler() {
drupal_add_css('sites/all/libraries/jqgrid/themes/redmond/jquery-ui-1.8.16.custom.css');
drupal_add_css('sites/all/libraries/jqgrid/themes/jquery.ui.tooltip.css');
drupal_add_css('sites/all/libraries/jqgrid/themes/ui.jqscheduler.css');
drupal_add_js('sites/all/libraries/jqgrid/js/jquery-ui-custom.min.js');
drupal_add_js('sites/all/libraries/jqgrid/js/jquery.js');
drupal_add_js('sites/all/libraries/jqgrid/js/jquery.jqScheduler.min.js');
require_once "sites/all/libraries/jqgrid/php/jqUtils.php";
require_once "sites/all/libraries/jqgrid/php/jqScheduler.php";
require_once "sites/all/libraries/jqgrid/php/jqGridPdo.php";
require_once "sites/all/libraries/jqgrid/jq-config.php";
global $base_path;
$base_path1=drupal_get_path('module', 'study');
// Set the url from where we obtain the data
ini_set("display_errors",1);
$conn = new PDO(DB_DSN,DB_USER,DB_PASSWORD);
$conn->query("SET NAMES utf8");
$eventcal = new jqScheduler($conn);
$eventcal->setLocale('en_GB');
$eventcal->setUrl($base_path.$base_path1.'/eventcal.php');
$eventcal->setUser(1);
$eventcal->setUserNames(array('1'=>"Calender User 1",'2'=>"Calendar user 2",'3'=>"Calendar user 3"));
$eventcal->multiple_cal = true;
$output.= $eventcal->render();
return $output;
}
我正在使用return但不起作用 –
好吧,我得到它,'render()'直接输出到缓冲区,它不会返回呈现的日历。这很容易解决,但我不愿意告诉你,直到你接受你以前的问题的答案......这是一个社区,所有成员都需要参与该社区:-) – Clive