function tmgmt_rules_action_info in Translation Management Tool 7
File
- ./
tmgmt.rules.inc, line 11 - Rules integration.
Code
function tmgmt_rules_action_info() {
$info['tmgmt_rules_job_request_translation'] = array(
'label' => t('Request Job translation'),
'group' => t('Translation Management'),
'parameter' => array(
'job' => array(
'type' => 'tmgmt_job',
'label' => t('Translation Job'),
'description' => t('The translation job for which translations should be requested.'),
),
),
'access callback' => 'tmgmt_rules_job_submit_access',
);
$info['tmgmt_rules_job_accept_translation'] = array(
'label' => t('Accept Job translation'),
'group' => t('Translation Management'),
'parameter' => array(
'job' => array(
'type' => 'tmgmt_job',
'label' => t('Translation Job'),
'description' => t('The translation job for which translations should be accepted.'),
),
'message' => array(
'type' => 'text',
'label' => t('An optional message'),
'description' => t('Will be stored in the job message and displayed to the user.'),
'optional' => TRUE,
),
),
'access callback' => 'tmgmt_rules_job_accept_translation_access',
);
$info['tmgmt_rules_job_abort_translation'] = array(
'label' => t('Abort translation job'),
'group' => t('Translation Management'),
'parameter' => array(
'job' => array(
'type' => 'tmgmt_job',
'label' => t('Translation Job'),
'description' => t('The translation job that should be aborted.'),
),
),
'access callback' => 'tmgmt_rules_job_submit_access',
);
$info['tmgmt_rules_job_delete'] = array(
'label' => t('Delete Job'),
'group' => t('Translation Management'),
'parameter' => array(
'job' => array(
'type' => 'tmgmt_job',
'label' => t('Translation Job'),
'description' => t('The translation job that should be deleted.'),
),
),
'access callback' => 'tmgmt_rules_job_delete_access',
);
$info['tmgmt_rules_job_checkout'] = array(
'label' => t('Checkout a job'),
'group' => t('Translation Management'),
'parameter' => array(
'job' => array(
'type' => 'tmgmt_job',
'label' => t('Translation Job'),
'description' => t('The translation job that should be checked out.'),
),
),
'access callback' => 'tmgmt_rules_job_submit_access',
);
$info['tmgmt_get_first_from_node_list'] = array(
'label' => t('Get first item from a list of nodes'),
'group' => t('Data'),
'parameter' => array(
'list' => array(
'type' => 'list<node>',
'label' => t('List'),
'restriction' => 'selector',
),
),
'provides' => array(
'first_node' => array(
'type' => 'node',
'label' => t('Node'),
),
),
);
$info['tmgmt_rules_create_job'] = array(
'label' => t('Create a job for a given source language'),
'group' => t('Translation Management'),
'parameter' => array(
'source_language' => array(
'type' => 'text',
'label' => t('Source Language'),
'description' => t('The language from which should be translated'),
'options list' => 'entity_metadata_language_list',
),
),
'provides' => array(
'job' => array(
'label' => t('Job'),
'type' => 'tmgmt_job',
),
),
);
$info['tmgmt_rules_job_add_item'] = array(
'label' => t('Add an item to a job'),
'group' => t('Translation Management'),
'parameter' => array(
'job' => array(
'type' => 'tmgmt_job',
'label' => t('Translation Job'),
'description' => t('The translation job that should be canceled.'),
),
'plugin' => array(
'type' => 'token',
'label' => t('Source plugin'),
'description' => t('The source plugin of this item'),
),
'item_type' => array(
'type' => 'token',
'label' => t('Item type'),
'description' => t('The item type'),
),
'item_id' => array(
'type' => 'text',
'label' => t('Item ID'),
'description' => t('ID of the referenced item'),
),
),
);
return $info;
}