45 lines
1.1 KiB
PHP
45 lines
1.1 KiB
PHP
<?php
|
|
/**
|
|
* @file
|
|
* Administrative functions for Wing.
|
|
*/
|
|
|
|
/**
|
|
* Form builder for Workflow add/edit.
|
|
*
|
|
* @param array $form
|
|
* @param array $form_state
|
|
* @param WingWorkflow $entity
|
|
* @param string $op
|
|
* @param string $entity_type
|
|
* Should be 'wing_workflow'
|
|
*/
|
|
function wing_workflow_form($form, &$form_state, $entity, $op, $entity_type) {
|
|
dsm(func_get_args(), __FUNCTION__);
|
|
field_attach_form($entity_type, $entity, $form, $form_state);
|
|
|
|
$form = array_merge($form, $entity->editForm());
|
|
|
|
$form['actions'] = array('#type' => 'actions');
|
|
|
|
$form['actions']['submit'] = array(
|
|
'#type' => 'submit',
|
|
'#value' => t('Submit'),
|
|
);
|
|
|
|
return $form;
|
|
}
|
|
|
|
function wing_workflow_form_submit($form, &$form_state) {
|
|
$workflow = entity_ui_form_submit_build_entity($form, $form_state);
|
|
$workflow->status |= ENTITY_CUSTOM;
|
|
$workflow->save();
|
|
dsm($workflow, 'Post save');
|
|
$path = $workflow->entityInfo['admin ui']['path'];
|
|
$form_state['redirect'] = $path;
|
|
}
|
|
|
|
function wing_settings_form($form, &$form_state) {
|
|
dsm(get_defined_vars(), __FUNCTION__);
|
|
return array();
|
|
}
|