1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- <?php
- /**
- * @file
- * Administrative functions for Wing.
- */
- function wing_page_info() {
- dsm(func_get_args(), __FUNCTION__);
- return 'Info';
- }
- /**
- * 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();
- }
|