继续Drupal分享精神 站长QQ:2275288328 skype: hellodrupal 【drupal交流+drupal 建站 drupal theme制作,wordpress 开发】
登录 注册

Drupal theme函数一览

在开发Drupal主题的时候,不免要遇到重写或者使用一些drupla theme主题函数,就需要熟悉一些常用的theme 函数。其中的一些主题函数在默认主题garland下有具体的实例。文件位于themes/garland/template.php里。它覆盖了$breadcrumb,comment_submitted等具体的覆盖实现。先做记录,等以后开发方便查询使用。
其中很多没用到,已经使用有效果的,都做了衔接。等开发使用过程中遇到了,再记录一下到底具体是干什么的。
默认drupal theme 函数如下:(drupal 6)

phptemplate_menu_local_tasks ()
Returns the rendered local tasks.

theme_admin_block ($block)
This function formats an administrative block for display.

theme_admin_block_content ($content)
This function formats the content of an administrative block.

theme_admin_page ($blocks)
This function formats an administrative page for viewing.

theme_aggregator_block_item ($item, $feed=0)
Format an individual feed item for display in the block.

theme_aggregator_categorize_items ($form)
Theme the page list form for assigning categories.

theme_aggregator_page_opml ($feeds)
Theme the OPML feed output.

theme_aggregator_page_rss ($feeds, $category=NULL)
Theme the RSS output.

theme_blocks ($region)
Return a set of blocks available for the current user.

theme_book_admin_table ($form)
Theme function for the book administration page form.

theme_book_title_link ($link)
Generate the HTML output for a link to a book title when used as a block title.

theme_box ($title, $content, $region= 'main')
Return a themed box.

theme_breadcrumb ($breadcrumb)
返回面包屑

theme_button ($element)

theme_checkbox ($element)
Format a checkbox.

theme_checkboxes ($element)
Format a set of checkboxes.

theme_closure ($main=0)
Execute hook_footer() which is run at the end of the page right before the close of the body tag.

theme_color_scheme_form ($form)
Theme color form.

theme_comment_admin_overview ($form)
Theme the comment admin form.

theme_comment_block ()
Returns a formatted list of recent comments to be displayed in the comment block.

theme_comment_controls ($form)
Theme comment controls box where the user can change the default display mode and display order of comments.

theme_comment_flat_collapsed ($comment, $node)
Theme comment flat collapsed view.

theme_comment_flat_expanded ($comment, $node)
Theme comment flat expanded view.

theme_comment_post_forbidden ($node)
Theme a "you can't post comments" notice.

theme_comment_submitted ($comment)
Theme a "Submitted by ..." notice.

theme_comment_thread_collapsed ($comment, $node)
Theme comment thread collapsed view.

theme_comment_thread_expanded ($comment, $node)
Theme comment thread expanded view.

theme_comment_view ($comment, $node, $links=array(), $visible=TRUE)
Theme a single comment block.

theme_date ($element)
Format a date selection element.

theme_dblog_filters ($form)
Theme dblog administration filter selector.

theme_feed_icon ($url, $title)
Return code that emits an feed icon.

theme_fieldset ($element)
Format a group of form items.

theme_file ($element)
Format a file upload field.

theme_filter_admin_order ($form)
Theme filter order configuration form.

theme_filter_admin_overview ($form)
Theme the admin overview form.

theme_filter_tips ($tips, $long=FALSE, $extra= '')
Format a set of filter tips.

theme_filter_tips_more_info ()
Format a link to the more extensive filter tips.

theme_form ($element)
Format a form.

theme_form_element ($element, $value)
Return a themed form element.

theme_help ()
Return a themed help message.

theme_hidden ($element)
Format a hidden form field.

theme_image ($path, $alt= '', $title= '', $attributes=NULL, $getsize=TRUE)
Return a themed image.

theme_image_button ($element)
Theme a form image button.

theme_indentation ($size=1)
Create a standard indentation div.

theme_item ($element)

theme_item_list ($items=array(), $title=NULL, $type= 'ul', $attributes=NULL)
返回一个列表项目,是一列表表现形式,$items是数据源,是一列数组。$tilte就是这个列表的标题,还有$type 类型,可以自己定义其他输出比如 'dl',$attributes 起他额外属性定义。
输出HTML

theme_links ($links, $attributes=array('class'=> 'links'))
返回一组衔接列表。

theme_mark ($type=MARK_NEW)
Return a themed marker, useful for marking new or updated content.

theme_markup ($element)
Format HTML markup for use in forms.

theme_menu_item ($link, $has_children, $menu= '', $in_active_trail=FALSE, $extra_class=NULL)
Generate the HTML output for a menu item and submenu.

theme_menu_item_link ($link)
Generate the HTML output for a single menu link.

theme_menu_local_task ($link, $active=FALSE)
Generate the HTML output for a single local task link.

theme_menu_local_tasks ()
Returns the rendered local tasks.

theme_menu_overview_form ($form)
Theme the menu overview form into a table.

theme_menu_tree ($tree)
Generate the HTML output for a menu tree.

theme_more_help_link ($url)
Returns code that emits the 'more help'-link.

theme_more_link ($url, $title)
Returns code that emits the 'more' link used on blocks.

theme_node_add_list ($content)
Display the list of available node types for node creation.

theme_node_admin_nodes ($form)
Theme node administration overview.

theme_node_filter_form ($form)
Theme node administration filter form.

theme_node_filters ($form)
Theme node administration filter selector.

theme_node_form ($form)
Present a node submission form.

theme_node_list ($items, $title=NULL)
Format a listing of links to nodes.

theme_node_log_message ($log)
Theme a log message.

theme_node_preview ($node)
Display a node preview for display during node creation and editing.

theme_node_search_admin ($form)
Theme the content ranking part of the search settings admin page.

theme_node_submitted ($node)
Format the "Submitted by username on date/time" for each node.

theme_pager ($tags=array(), $limit=10, $element=0, $parameters=array(), $quantity=9)
Format a query pager.

theme_password ($element)
Format a password field.

theme_password_confirm ($element)
Format a password_confirm item.

theme_placeholder ($text)
Formats text for emphasized display in a placeholder inside a sentence.

theme_poll_choices ($form)
Theme the admin poll form for choices.

theme_profile_admin_overview ($form)
Theme the profile field overview into a drag and drop enabled table.

theme_progress_bar ($percent, $message)
Return a themed progress bar.

theme_radio ($element)
Format a radio button.

theme_radios ($element)
Format a set of radio buttons.

theme_select ($element)
Format a dropdown menu or scrolling selection box.

theme_status_messages ($display=NULL)
Return a themed set of status and/or error messages.

theme_status_report (&$requirements)
Theme requirements status report.

theme_submenu ($links)
Return a themed submenu, typically displayed under the tabs.

theme_submit ($element)
Theme a form submit button.

theme_system_admin_by_module ($menu_items)
Theme output of the dashboard page.

theme_system_modules ($form)
Theme callback for the modules form.

theme_system_modules_uninstall ($form)
Themes a table of currently disabled modules.

theme_system_powered_by ($image_path)
Format the Powered by Drupal text.

theme_system_theme_select_form ($form)
Theme the theme select form.

theme_system_themes_form ($form)
Theme function for the system themes form.

theme_table ($header, $rows, $attributes=array(), $caption=NULL)
Return a themed table.

theme_table_select_header_cell ()
Returns a header cell for tables that have a select all functionality.

theme_tablesort_indicator ($style)
Return a themed sort icon.

theme_task_list ($items, $active=NULL)
Return a themed list of maintenance tasks to perform.

theme_taxonomy_overview_terms ($form)
Theme the terms overview as a sortable list of terms.

theme_taxonomy_overview_vocabularies ($form)
Theme the vocabulary overview as a sortable list of vocabularies.

theme_taxonomy_term_page ($tids, $result)
Render a taxonomy term page HTML output.

theme_taxonomy_term_select ($element)
Format the selection field for choosing terms (by deafult the default selection field is used).

theme_textarea ($element)
Format a textarea.

theme_textfield ($element)
Format a textfield.

theme_token ($element)
Format a form token.

theme_trigger_display ($element)
Display actions assigned to this hook-op combination in a table.

theme_update_report ($data)
Theme project status report.

theme_update_version ($version, $tag, $class)
Theme the version display of a project.

theme_upload_attachments ($files)
Displays file attachments in table.

theme_upload_form_current (&$form)
Theme the attachments list.

theme_upload_form_new ($form)
Theme the attachment form.

theme_user_admin_account ($form)
Theme user administration overview.

theme_user_admin_new_role ($form)
Theme the new-role form.

theme_user_admin_perm ($form)
Theme the administer permissions page.

theme_user_filter_form ($form)
Theme user administration filter form.

theme_user_filters ($form)
Theme user administration filter selector.

theme_user_list ($users, $title=NULL)
Make a list of users.

theme_user_signature ($signature)
Theme output of user signature.

theme_username ($object)
Format a username.

theme_xml_icon ($url)
Return code that emits an XML icon.

评论

复杂哦。。顶了

复杂哦。。顶了

发表新评论

此内容将保密,不会被其他人看见。
  • 自动将网址与电子邮件地址转变为链接。
  • 自动断行和分段。
  • You can use BBCode tags in the text.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.

更多关於格式化选项的信息

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.