<?php
//$Id$
/**
*@file
*Administration page callbacks for annotate module.
*/
/**
*Form builder. Configure annotations.
*
*@ingroup forms
*@see system_settings_form().
*/
function annotate_admin_settings(){
//Get an array of node types with internal names as keys and
//“friendly names”as values.
//E.G.,array(‘page’ => ‘Page’,’story’ => ‘Story’)
$options = node_get_types(‘names’);
$form[‘annotate_node_types’] = array(
‘#type’ => ‘checkboxes’,
‘#title’ => t(‘Users may annotate these content types’),
'#options' => $options,
'#default_value' => variable_get('annotate_node_types', array('page')),
'#description' => t('A text field will be available on these content types to make user-specific notes.'),
);
return system_settings_form($form);
}$options = node_get_types(‘names’);这里边的names是指什么名字,它只是个参数吗?要换成什么
//$Id$
/**
*@file
*Administration page callbacks for annotate module.
*/
/**
*Form builder. Configure annotations.
*
*@ingroup forms
*@see system_settings_form().
*/
function annotate_admin_settings(){
//Get an array of node types with internal names as keys and
//“friendly names”as values.
//E.G.,array(‘page’ => ‘Page’,’story’ => ‘Story’)
$options = node_get_types(‘names’);
$form[‘annotate_node_types’] = array(
‘#type’ => ‘checkboxes’,
‘#title’ => t(‘Users may annotate these content types’),
'#options' => $options,
'#default_value' => variable_get('annotate_node_types', array('page')),
'#description' => t('A text field will be available on these content types to make user-specific notes.'),
);
return system_settings_form($form);
}$options = node_get_types(‘names’);这里边的names是指什么名字,它只是个参数吗?要换成什么
解决方案 »
- 着急? Windows 2003 iis 7.0下,如何调试 mysql + php 程序?
- 编码为UTF8的页面为什么会GET后的变量成GB2312
- 为何日期时间交互在本机可以实现,在其它机器没反映?
- 新手求解!!关于结果集和数组的对比问题。
- php代碼的執行順序?
- Pr值计算出错。
- 如何把 EXCEL的内容导入mysql?
- 诚恳请教.已经在租用空间和域名来搭建自己测试或者练手或者发展期的网站的朋友,求推荐和介绍租用的服务器空间.
- 请看:Premature end of script headers: c:/php4/php.exe
- php array_unshift 函数的疑问
- 高手指点下,试了好多方法,在购物车里点加减时,总是要点两次才可以有效。什么原因?
- 下拉菜单,不是导航那种
function hello_world_admin_settings(){
$options=node_get_types('names');
$form['hello_world_types']=array(
'#type'=>'checkboxes',
'#title'=>t('Users may annotate those content types'),
'#options'=>$options,
'#defualt_value'=>variable_get('hello_world_types',array('page')),
'#description'=>t('A text field will be available on thest content types to make user-specific notes.'),
);
return system_settings_form($form);
}
我写成这个样子,有错误
参考:http://api.drupal.org/api/drupal/modules!node!node.module/function/node_get_types/6