Drupal学习笔记(一)
来源:互联网 发布:bash 数组 编辑:程序博客网 时间:2024/06/04 17:40
学习写一个Drupal模块。
编写一个.info模块信息文件,文件名要与模块的名字相同。
name = Annotate //模块名description = "Allows users to annotate nodes." //关于这个模块的描述package = Pro Drupal Development //我的理解类似与于命名空间,也就是该模块属于哪一个类型core = 7.xfiles[] = annotate.module //files数组是与这个模块相关联的文件files[] = annotate.installfiles[] = annotate.admin.incconfigure=admin/config/content/annotate/settings
编写.module文件
First, we’ll define a path where we can access our settings. Then, we’ll create the settings form. To make a path, I need to implement a hook,specifically hook_menu.
首先要定义一个我们能够设置的路径,然后创建一个设置表单页面。
hook_menu() 定义管理员菜单项
function annotate_menu() {$items['admin/config/annotate'] = array('title' => 'Node annotation','description' => 'Adjust node annotation options.','position' => 'right','weight' => -5,'page callback' => 'system_admin_menu_block_page','access arguments' => array('administer site configuration'),'file' => 'system.admin.inc','file path' => drupal_get_path('module', 'system'),);$items['admin/config/annotate/settings'] = array('title' => 'Annotation settings', //链接名称'description' => 'Change how annotations behave.', //描述'page callback' => 'drupal_get_form', //应该是生成表单的函数'page arguments' => array('annotate_admin_settings'), //表单ID'access arguments' => array('administer site configuration'), //后台页面配置权限 就是能访问配置页面'type' => MENU_NORMAL_ITEM,'file' => 'annotate.admin.inc',);return $items;}
- Drupal学习笔记(一)
- drupal 学习笔记一 安装docker or drupal
- Drupal学习笔记一:Druple安装
- Drupal介绍(Drupal笔记一)
- Drupal学习笔记
- Drupal 系列一:如何快速学习 Drupal
- Drupal--Day7:git学习笔记
- 从头学习Drupal--基本架构一
- Drupal学习笔记-1.模块入门
- Drupal commerce checkout流程学习笔记
- drupal笔记
- 建设一个学习Drupal的网站----------之学习笔记
- drupal学习笔记(1)--关于drupal管理员密码忘记后重置
- Drupal零散知识笔记
- drupal的views学习
- 欢迎一起学习Drupal
- 从头学习Drupal--基本概念
- drupal的学习
- web系统流量控制
- JavaScript学习(四)
- dedecms 上传图片出现ERROR:Copy Uploadfile Error!提示
- 数组左边减去右边数值的最大差值
- ffdshow开发笔记——从安装到构建成功第一个FilterGraph(一)
- Drupal学习笔记(一)
- 硬盘安装ubuntu
- 一键安装双击运行——Java安装程序制作
- 大学生破译周鸿祎手机号 李开复放“橄榄枝”
- Java实现司机售票员线程同步模式
- centos 6.2 安装chrome
- C++ 11 Lambda表达式
- 2012年华为软件工程师机试题
- Principles of Continuous Integration - 持续集成的原则,来自James Betteley