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