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.

  1. Bo module Drupal, thay vao do la module OpenID, nhieu uu diem hon.
  2. Them Schema API, lam viec voi CSDL don gian hon rat nhieu.
  3. Nang cap thu vien jQuery moi nhat: 1.2.1
  4. Them module update status, tu dong kiem tra cac phien ban moi hop le.
  5. Ho tro trigger va action: cau hinh mot so thao tac khi mot node duoc tao
  6. 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.
  7. Cai thien forum:
    • Kieu noi dung nao bay gio cung co the loi vao dien dan.
  8. 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
  9. 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.
  10. Them vao bo loc HTML corrector:
    • Sua lai nhung HTML dom
    • Tu dong dong the o ban cat (teaser)
  11. 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
  12. To chuc lai update.php
  13. 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
  14. 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
  15. Di chuyen "PHP input filter" vao mot module rieng
  16. 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
  17. Loc URL aliases o trang dieu hanh alias
  18. Chu ky cua nguoi dung:
    • Tro thanh mot tuy chon, co the tat
    • Co the giao dien hoa
  19. Them scripts/drupal.sh thuc hien Drupal code o giao dien dong lenh
  20. He thong menu hoan toan moi
  21. Form API 3.0
  22. 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'] with ip_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 ham drupal_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

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():

  1. $data = array();
  2. $data['#my_property'] = 'Some data!';
  3. $data['#my_other_property'] = 'More data...';
  4. drupal_alter('my_data', $data);
  5.  
  6. // Do your stuff here...

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:

  • O Drupal 5, muon alter len mot form, chi co mot cach duy nhat la su dung hook_form_alter.
  • O Drupal 6, muon alter len mot form, ngoai cach su dung hook_form_alter, chung ta con co the su dung hook_{form_id}_alter, {form_id} la ID cua form muon duoc alter.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <sup> <br> <p> <h3>
  • Lines and paragraphs break automatically.
  • Link to content with [[some text]], where "some text" is the title of existing content or the title of a new piece of content to create. You can also link text to a different title by using [[link to this title|show this text]]. Link to outside URLs with [[http://www.example.com|some text]], or even [[http://www.example.com]].
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>. The supported tag styles are: <foo>, [foo]. PHP source code can also be enclosed in <?php ... ?> or <% ... %>.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.