Learning Drupal 6 Module Development. A practical tutorial for creating your first Drupal 6 modules with PHP - Helion
ebook
Autor: Dries Buytaert, Matt ButcherTytuł oryginału: Learning Drupal 6 Module Development. A practical tutorial for creating your first Drupal 6 modules with PHP
ISBN: 9781847194459
stron: 328, Format: ebook
Data wydania: 2008-05-08
Księgarnia: Helion
Cena książki: 107,10 zł (poprzednio: 119,00 zł)
Oszczędzasz: 10% (-11,90 zł)
Osoby które kupowały "Learning Drupal 6 Module Development. A practical tutorial for creating your first Drupal 6 modules with PHP", wybierały także:
- Windows Media Center. Domowe centrum rozrywki 66,67 zł, (8,00 zł -88%)
- Ruby on Rails. Ćwiczenia 18,75 zł, (3,00 zł -84%)
- Przywództwo w świecie VUCA. Jak być skutecznym liderem w niepewnym środowisku 58,64 zł, (12,90 zł -78%)
- Scrum. O zwinnym zarządzaniu projektami. Wydanie II rozszerzone 58,64 zł, (12,90 zł -78%)
- Od hierarchii do turkusu, czyli jak zarządzać w XXI wieku 58,64 zł, (12,90 zł -78%)
Spis treści
Learning Drupal 6 Module Development. A practical tutorial for creating your first Drupal 6 modules with PHP eBook -- spis treści
- Learning Drupal 6 Module Development
- Table of Contents
- Learning Drupal 6 Module Development
- Credits
- About the Author
- About the Reviewers
- Preface
- What This Book Covers
- Who Is This Book For?
- Conventions
- Reader Feedback
- Customer Support
- Downloading the Example Code for the Book
- Errata
- Questions
- 1. Introduction to Drupal Modules
- Drupals Architecture
- Module Architecture
- Core Modules
- Hooks
- Themes
- Module Architecture
- Crucial Drupal Concepts
- Nodes
- Comments Are Not Nodes
- Users
- Access and Security
- Blocks and Page Rendering
- Menus
- Forms
- Database and Schema APIs
- Nodes
- Developers' Tools
- Developer Module
- Coder Module
- A Word on Our Demonstration Site
- Summary
- Drupals Architecture
- 2. Creating Our First Module
- Starting Out
- A Place for the Module
- Creating a .info File
- A Basic .module File
- Our Goal: A Block Hook
- Starting the .module
- The hook_block() Implementation
- The t() Function
- A view Operation
- Installing a Module
- Step 1: Copying the Module
- Step 2: Enabling the Module
- Step 3: Displaying the Module's Content
- Using Goodreads Data
- Modifying the Block Hook
- Retrieving XML Content over HTTP
- The watchdog() Function
- Processing the HTTP Results
- Formatting the Block's Contents
- Finishing Touches: hook_help()
- Summary
- Starting Out
- 3. The Theme System
- The Theme System's Architecture
- Theme Templates
- Theme Engines
- Theme Hooks
- Creating a Custom Theme
- Organization of Themes
- Sub-themes (Derivative Themes)
- How Each Theme Functions
- Creating a Theme
- Creating the Theme Directory
- A .info File
- A CSS Stylesheet
- A PHPTemplate Theme
- Template Structure
- A Page Template for Descartes
- Using PHP to Override Theme Behavior
- Custom Breadcrumbs
- Interacting with Other Theme Functions
- template.php Gotchas
- Creating a Screenshot
- From Here to a Full Theme
- Organization of Themes
- Summary
- The Theme System's Architecture
- 4. Theming Modules
- Our Target Module: What We Want
- Creating a Custom Content Type
- Using the Administration Interface to Create a Content Type
- Content and Nodes
- Using the Administration Interface to Create a Content Type
- The Foundations of the Module
- A Simple Database Lookup
- Getting the Node ID
- Getting the Node's Content
- Theming Inside a Module
- Registering a Theme
- Creating a Theme Hook Function
- Adding a Stylesheet
- Overriding the Default Theme from a Theme
- A Quick Clarification
- Overriding the Default Theme's CSS
- Overriding Layout with Templates
- Summary
- 5. Using JavaScript and AJAX/JSON in Modules
- Picking up Where We Left Off
- Introducing jQuery
- Modifying HTML with jQuery
- Checking for JavaScript Support with Drupal
- Namespaces in JavaScript
- Drupal's Namespace
- A Drupal Function: Drupal.jsEnabled()
- Delaying JavaScript Execution with jQuery
- Including JavaScript from the Module's Theme
- Writing a Drupal AJAX/JSON Service
- The JSON Format
- Our Module Roadmap
- Server Side: Defining a New Page
- Creating a JSON Message
- Mapping a Function to a URL
- Passing PHP Settings to JavaScript
- Client Side: AJAX Handlers
- A JavaScript Function to Get JSON Content
- Adding an Event Handler
- Summary
- 6. An Administration Module
- The emailusers Module
- The Beginning of the Module
- Mail Configuration
- Registering an Administration Page
- A Detailed Look at the Path
- Marking the Path as an Administration Page
- Path Registration Parameters
- Defining the Callback Function
- A Detailed Look at the Path
- Handling Forms with the Forms API (FAPI)
- Loading a Form with drupal_get_form()
- A Form Constructor
- Handling Form Results
- The Form Submissions Callback
- Sending Mail with the Mail API
- Formatting Mail with hook_mail()
- Altering Messages with hook_mail_alter()
- Altering Hooks
- Adding a Mail Footer
- Incorporating the Module into Administration
- Modifying the User Profile with hook_user()
- Constructing the Content
- Modifying the User Profile with hook_user()
- Summary
- 7. Building a Content Type
- The biography Module
- The Content Creation Kit
- The Starting Point
- The Module Installation Script
- The Schema API: Defining Database Structures
- A First Look at the Table Definition
- Defining Fields (Columns)
- Defining Keys and Indexes
- The Schema API: Defining Database Structures
- Correlating the New Table with Nodes
- The Content Creation Form
- Overriding hook_form() Defaults
- Adding New hook_form() Form Elements
- Access Controls
- Database Hooks
- Database Inserts with hook_insert()
- Updating and Deleting Database Records
- Hooks for Getting Data
- Loading a Node with hook_load()
- Preparing the Node for Display with hook_view()
- Theming Biography Content
- Registering a Theme
- The biography_info.tpl.php Template
- The Results
- Summary
- 8. Filters, Actions, and Hooks
- The sitenews Module
- Getting Started
- Citing Dependencies in the .info File
- The Beginning of the .module File
- A Simple Content Type, Defined in Code
- Creating Filters and an Input Format
- Creating Filters
- The First Filter: News Brief Placeholders
- The Second Filter: Remove All Tags
- Adding an Input Format
- The Beginning of an Action
- Implementing hook_action_info()
- The Action Callback
- Defining a Hook
- Invoking a Custom Hook
- So What Is a Hook?
- Creating a hook_sitenews() Function
- Implementing hook_sitenews() in Other Modules
- In the philquotes Module
- In the biography Module
- Theming Content before Returning It
- Invoking a Custom Hook
- Completing the Action: Theming and Mailing
- Theme Functions
- The hook_mail() Implementation
- Adding a Trigger
- Summary
- 9. An Installation Profile
- Introducing Installation Profiles
- Why Use Installation Profiles?
- Setting up a Distribution
- Creating a Profile Directory
- Programming Profiles
- The .profile Script
- The Details Function
- The Modules List
- The Installation Task System
- The Profile Task
- A Basic Profile Task
- A Complex Profile Task
- Creating a Content Type
- Creating a Trigger
- Moving to the Next Task
- The 'profile' Task is Special
- Registering a New Task
- The Theme Selection Form
- Returning to the philosopherbios_pick_theme Task
- The Submission Handler
- Finishing the Installation Profile
- The Profile Task
- Packaging the Distribution
- Summary
- Introducing Installation Profiles
- Index