简体   繁体   English

Drupal:自定义WorkFlow模块的外观

[英]Drupal: customizing the look of WorkFlow module

Workflow module adds a workflow box to Edit node screen. 工作流程模块将工作流程框添加到“编辑”节点屏幕。 This box contains a list of available States for this node and also such extra-options as: 此框包含此节点的可用状态列表以及诸如以下的附加选项:

" Schedule: Immediately Schedule for state change at: " “时间表:立即在以下位置更改状态的时间表:”

I don't want to confuse users with abundance of options and want to remove the last two (date related). 我不想将用户的大量选项弄糊涂,也不想删除最后两个(与日期有关)。 Where should I customize this look of Edit screen and hide these fields? 我应该在哪里自定义“编辑”屏幕的外观并隐藏这些字段?

You can disable the workflow scheduling on the Permissions page. 您可以在“权限”页面上禁用工作流程计划。 On admin/user/permissions uncheck "schedule workflow transitions." 在管理员/用户/权限上,取消选中“计划工作流程过渡”。

The hook_form_alter hook can be used to modify the appearance of any Drupal form. hook_form_alter钩子可用于修改任何Drupal表单的外观。

Here's a little pseudocode to get you started. 这里有一些伪代码可以帮助您入门。

<?php

function mymodule_form_alter(&$form, $form_state, $form_id) {
  if($form_id == 'id_of_the_form') {
    unset($form['field_you_want_to_hide']);
  }
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM