@Updted: Greg Knaddison (greggles) có thực hiện đoạn video 21' giới thiệu các tính năng mới trong Drupal 6.
Drupal càng ngày càng tốt hơn. Dưới đây là danh sách các thay đổi trong mã nguồn Drupal phiên bản từ 5 lên 6.
- Bỏ module Drupal, thay vào đó là module OpenID, nhiều ưu điểm hơn.
- Thêm Schema API, làm việc với CSDL đơn giản hơn rất nhiều.
- Nâng cấp thư viện jQuery mới nhất: 1.2.1
- Thêm module update status, tự động kiểm tra các phiên bản mới hợp lệ.
- Hỗ trợ trigger và action: cấu hình một số thao tác khi một node được tạo
- Cải thiên module taxonomy:
- Có phần mô tả cho mỗi term. Phần này sẽ hiển thị ở trang taxonomy/term/x cũng như ở RSS feed
- Lưu lại cấu hình taxonomy khi tạo bản duyệt (revision) mới cho node.
- Cải thiện forum:
- Kiểu nội dung nào bây giờ cũng có thể lôi vào diễn đàn.
- Thao tác trên tập tin (upload) có các cải tiến:
- Lưu lại mã số người upload file (có thể viết module kiểm tra quota của từng người dễ dàng hơn)
- Có thể tạo hoặc xóa các file tạm khi chạy cron job
- Năng suất:
- Module nhân được tách ra làm các file .inc phụ, nhằm giảm code dư thừa (anonymous không cần tải code quản lý block, taxonomy, ...)
- Khả năng nén mã javascript (Drupal 5 có nén CSS). Tuy nhiên, việc viết mã Javascript đòi hỏi phải chặt chẽ hơn (một chút).
- Đệm block: cải thiện cho anonymous và authenticated users.
- Thêm vào bộ lọc HTML corrector:
- Sửa lại những HTML dởm
- Tự động đóng thẻ ở bản cắt (teaser)
- Bộ cài đặt:
- Theme garland được trình làng ngay ở quá trình cài đặt
- Có thể cấu hình thông tin site ở installing time
- Có thể thêm nhiều step ở quá trình cài đặt (thích hợp cho các công ty làm web đây!)
- Nhập vào bản dịch được tích hợp
- Tổ chức lại update.php
- Hệ thống giao diện (theme system)
- Thêm các tập tin .info cho các theme, dễ dàng hơn để định nghĩa thêm các region, chức năng của theme.
- Theme vào theme registry: các module có thể cung cấp các tập tin giao diện .tpl.php mà không cần tạo ra các hàm theme_* nữa
- Sử dụng theme Garland cho quá trình cài đặt và thông báo Bảo trì hệ thống
- Hỗ trợ các hàm có thể giao diện hóa (themable) trong javascript
- Tính tiện dụng:
- Xác định bản cắt dễ dàng hơn ở trang soạn thảo
- Thêm sticky table header (thử ở trang Access control, module management)
- Bỏ tập tin default/settings.php - hệ thống sẽ tự tạo trong quá trình cài đặt.
- Có thể cấu hình định dạng ngày giờ tùy biến
- Nhớ lại tên người gửi phản hồi của anonymous user
- Chỉ cho phép kích hoạt các module và theme khi chúng thật sự hợp lệ cho phiên bản mới
- Có thể xác định phiên bản PHP thích hợp với module ở tập tin .info
- Kiểm tra động độ an toàn và hợp lệ của mật khẩu
- Làm lại trang điều hành poll
- Di chuyển "PHP input filter" vào một module riêng
- Những cải tiến của hệ thống ngôn ngữ:
- Hỗ trợ các ngôn ngữ viết từ phải sang trái (Hebrew, Greek)
- Nhận dạng ngôn ngữ dựa trên các phần của URL
- Xác định ngôn ngữ của một node
- Hỗ trợ dịch node sang các ngôn ngữ khác
- Ngôn ngữ phụ thuộc các path aliases
- Tự động nhập vào bản dịch khi thêm vào các ngôn ngữ mới
- Giao diện dịch thuật Javascript
- Tự động nhập vào bản dịch tương ứng khi kích hoạt các module
- Lọc URL aliases ở trang điều hành alias
- Chữ ký của người dùng:
- Trở thành một tùy chọn, có thể tắt
- Có thể giao diện hóa
- Thêm scripts/drupal.sh thực hiện Drupal code ở giao diện dòng lệnh
- Hệ thống menu hoàn toàn mới
- Form API 3.0
- Hệ thống watchdog mới
Theo Drupal change logs
Comments
New ip_address() function
New ip_address() function when working behind proxies.
There is a new function, ip_address() that should be used instead of the superglobal $_SERVER['REMOTE_ADDR']. When Drupal is run behind a reverse proxy, the address of the proxy server will be in this superglobal for all users, and hence many parts of Drupal will log the wrong IP address for the client. This function makes deducing the client IP address transparent, whether a proxy is used or not. It is recommended that you replace all
$_SERVER['REMOTE_ADDR']withip_address().New user_mail_tokens() method
New user_mail_tokens() method
user.module now provides a user_mail_tokens() function to return an array of the tokens available for the email notification messages it sends when accounts are created, activated, blocked, etc. Contributed modules that wish to make use of the same tokens for their own needs are encouraged to use this function.
New image.inc function: image_scale_and_crop()
image_scale_and_crop() scales an image to the exact width and height given. The required aspect ratio is maintained by cropping the image equally on both sides, or equally on the top and bottom. No image toolkit changes are required.
JavaScript themeing
There is now a themeing mechanism for JavaScript code. Together with the automatically included script.js, this allows theme developers more freedom in the domain of scripted events on Drupal webpages. Often, JavaScript code produces markup that is inserted into the page. However, this HTML code has usually been hardcoded into the script, which did not allow alteration of the inserted code.
Modules provide default theme functions in the Drupal.theme.prototype namespace. Themes should place their override functions directly in the Drupal.theme namespace. Scripts call Drupal.theme('function_name', ...) which in turn decides whether to call the function provided by the theme (if present) or the default function.
JavaScript theme functions are entirely free in their return value. It can vary from simple strings, up to complex data types like an object containing in turn several jQuery objects which are wrapped around DOM elements. See the original (default) theme function to see what your custom theme function should return.
Drage and drop
Hỗ trợ kéo thả ở các trang quản lý: blocks, menu items, taxonomy terms, profile fields.
[JS] Tự động thêm biến Drupal.settings.basePath
Làm việc với javascript trong Drupal 5, chúng ta thưởng phải tự thêm vào biến
Drupal.settings.basePath. Ở phiên bản 6, Drupal sẽ tự động thêm vào biến này, khi hàmdrupal_add_js ()được gọi ít nhất một lần.Thay thế chuỗi
Có thể thay thế một chuỗi thông qua biến được khai báo ở settings.php
<?php# ...
$conf['locale_custom_strings_en']['My String'] = 'My New String';
# ...
?>
Hỗ trợ sub-query
http://drupal.org/node/151910
New drupal_alter() function for developers
Dữ liệu của một module có thể được mở rộng cho các module khác thao tác lên cách dễ dàng nhờ hàm drupal_alter():
Với đoạn code như trên, các module có thể định nghĩa hàm hook_my_data_alter () để sử dụng/thao tác nội dung biến $data. Nhờ hàm mới này, việc alter lên một form trong hệ thống đã được cải thiện:
hook_{form_id}_alter, {form_id} là ID của form muốn được alter.Post new comment