Đang chuẩn bị liên kết để tải về tài liệu:
Drupal 7 Module Development phần 8

Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ

Ngôn ngữ chức năng làm cho nhiệm vụ này dễ dàng bằng cách lấy một đối tượng người dùng và trở về sự lựa chọn ngôn ngữ của người dùng.Bất kỳ thông tin tùy chỉnh cần thiết để xây dựng các e-mail nênchức năng gọi lại () qua các hình thức vàTrong trường hợp này, | Node Access Creating the role access module We begin with the standard module .info file and a stub .module file as shown below Id name Role Access description Limit content access by user role. core 7.x files role_access.module Save this as role_access.info inside a sites default modules role_access directory. Then create a stub role_access.module file php Id @file Role access module file. Provides a simple content access scheme based on the author s role. Now we are ready to begin building our module. The code in the next sections will all add to this base file. Using hook_node_access_records Enforcing rules with a node access module takes two parts. The first is writing your module s rules to the node_access table. This action is performed with the hook_node_access_records function. This function is called every time a node is created or updated. It is your module s responsibility to respond appropriately to this hook. 1 When creating or updating nodes modules should never perform Tạ direct database queries to node_access . Doing so breaks the API because other modules can no longer rely on the expected behavior of the node access system. 266 Chapter 9 When hook_node_access_records fires it passes a single parameter the node object being acted upon. Our module must respond based on the information in the node object or be able to derive its rules from that information. This last statement may seem obvious but bears repeating. If your business rules rely on special information not found in the default node object it is your responsibility to add that data using hook_node_load . We will look at this in more detail later in this chapter. For Role Access we need to know the roles assigned to the user who authored the node. Implement hook_node_access_records . We want to store a row for each role assigned to the author of the content. function role_access_node_access_records node First get the user record. Note that we avoid using user here since that is the global .

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.