Drupal 6 co gi moi?
@Updted: Greg Knaddison (greggles) co thuc hien doan video 21' gioi thieu cac tinh nang moi trong Drupal 6.
Drupal cang ngay cang tot hon. Duoi day la danh sach cac thay doi trong ma nguon Drupal phien ban tu 5 len 6.
- Bo module Drupal, thay vao do la module OpenID, nhieu uu diem hon.
- Them Schema API, lam viec voi CSDL don gian hon rat nhieu.
- Nang cap thu vien jQuery moi nhat: 1.2.1
- Them module update status, tu dong kiem tra cac phien ban moi hop le.
- Ho tro trigger va action: cau hinh mot so thao tac khi mot node duoc tao
- Cai thien module taxonomy:
- Co phan mo ta cho moi term. Phan nay se hien thi o trang taxonomy/term/x cung nhu o RSS feed
- Luu lai cau hinh taxonomy khi tao ban duyet (revision) moi cho node.
- Cai thien forum:
- Kieu noi dung nao bay gio cung co the loi vao dien dan.
- Thao tac tren tap tin (upload) co cac cai tien:
- Luu lai ma so nguoi upload file (co the viet module kiem tra quota cua tung nguoi de dang hon)
- Co the tao hoac xoa cac file tam khi chay cron job
- Nang suat:
- Module nhan duoc tach ra lam cac file .inc phu, nham giam code du thua (anonymous khong can tai code quan ly block, taxonomy, ...)
- Kha nang nen ma javascript (Drupal 5 co nen CSS). Tuy nhien, viec viet ma Javascript doi hoi phai chat che hon (mot chut).
- Dem block: cai thien cho anonymous va authenticated users.
- Them vao bo loc HTML corrector:
- Sua lai nhung HTML dom
- Tu dong dong the o ban cat (teaser)
- Bo cai dat:
- Theme garland duoc trinh lang ngay o qua trinh cai dat
- Co the cau hinh thong tin site o installing time
- Co the them nhieu step o qua trinh cai dat (thich hop cho cac cong ty lam web day!)
- Nhap vao ban dich duoc tich hop
- To chuc lai update.php
- He thong giao dien (theme system)
- Them cac tap tin .info cho cac theme, de dang hon de dinh nghia them cac region, chuc nang cua theme.
- Theme vao theme registry: cac module co the cung cap cac tap tin giao dien .tpl.php ma khong can tao ra cac ham theme_* nua
- Su dung theme Garland cho qua trinh cai dat va thong bao Bao tri he thong
- Ho tro cac ham co the giao dien hoa (themable) trong javascript
- Tinh tien dung:
- Xac dinh ban cat de dang hon o trang soan thao
- Them sticky table header (thu o trang Access control, module management)
- Bo tap tin default/settings.php - he thong se tu tao trong qua trinh cai dat.
- Co the cau hinh dinh dang ngay gio tuy bien
- Nho lai ten nguoi gui phan hoi cua anonymous user
- Chi cho phep kich hoat cac module va theme khi chung that su hop le cho phien ban moi
- Co the xac dinh phien ban PHP thich hop voi module o tap tin .info
- Kiem tra dong do an toan va hop le cua mat khau
- Lam lai trang dieu hanh poll
- Di chuyen "PHP input filter" vao mot module rieng
- Nhung cai tien cua he thong ngon ngu:
- Ho tro cac ngon ngu viet tu phai sang trai (Hebrew, Greek)
- Nhan dang ngon ngu dua tren cac phan cua URL
- Xac dinh ngon ngu cua mot node
- Ho tro dich node sang cac ngon ngu khac
- Ngon ngu phu thuoc cac path aliases
- Tu dong nhap vao ban dich khi them vao cac ngon ngu moi
- Giao dien dich thuat Javascript
- Tu dong nhap vao ban dich tuong ung khi kich hoat cac module
- Loc URL aliases o trang dieu hanh alias
- Chu ky cua nguoi dung:
- Tro thanh mot tuy chon, co the tat
- Co the giao dien hoa
- Them scripts/drupal.sh thuc hien Drupal code o giao dien dong lenh
- He thong menu hoan toan moi
- Form API 3.0
- He thong watchdog moi
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
Ho tro keo tha o cac trang quan ly: blocks, menu items, taxonomy terms, profile fields.
[JS] Tu dong them bien Drupal.settings.basePath
Lam viec voi javascript trong Drupal 5, chung ta thuong phai tu them vao bien
Drupal.settings.basePath. O phien ban 6, Drupal se tu dong them vao bien nay, khi hamdrupal_add_js ()duoc goi it nhat mot lan.Thay the chuoi
Co the thay the mot chuoi thong qua bien duoc khai bao o settings.php
<?php# ...
$conf['locale_custom_strings_en']['My String'] = 'My New String';
# ...
?>
Ho tro sub-query
http://drupal.org/node/151910
New drupal_alter() function for developers
Du lieu cua mot module co the duoc mo rong cho cac module khac thao tac len cach de dang nho ham drupal_alter():
Voi doan code nhu tren, cac module co the dinh nghia ham hook_my_data_alter () de su dung/thao tac noi dung bien $data. Nho ham moi nay, viec alter len mot form trong he thong da duoc cai thien:
hook_{form_id}_alter, {form_id} la ID cua form muon duoc alter.Post new comment