workflow_basic/workflow_basic.defaults.inc 100644 765 765 13210 11246277345 14631 'field_workflow',
'type_name' => 'page',
'display_settings' => array(
'weight' => '-3',
'parent' => '',
'label' => array(
'format' => 'inline',
),
'teaser' => array(
'format' => 'hidden',
'exclude' => 1,
),
'full' => array(
'format' => 'default',
'exclude' => 0,
),
'5' => array(
'format' => 'default',
'exclude' => 0,
),
'4' => array(
'format' => 'default',
'exclude' => 0,
),
'token' => array(
'format' => 'default',
'exclude' => 0,
),
),
'widget_active' => '1',
'type' => 'text',
'required' => '1',
'multiple' => '0',
'module' => 'text',
'active' => '1',
'text_processing' => '0',
'max_length' => '',
'allowed_values' => 'Draft
Published',
'allowed_values_php' => '',
'widget' => array(
'default_value' => array(
'0' => array(
'value' => 'Draft',
),
),
'default_value_php' => NULL,
'label' => 'Workflow',
'weight' => '-3',
'description' => '',
'type' => 'optionwidgets_buttons',
'module' => 'optionwidgets',
),
);
// Translatables
array(
t('Workflow'),
);
return $fields;
}
/**
* Helper to implementation of hook_rules_defaults().
*/
function _workflow_basic_rules_defaults() {
return array(
'rules' => array(
'workflow_basic_1' => array(
'#type' => 'rule',
'#set' => 'event_node_presave',
'#label' => 'Publish content',
'#active' => 1,
'#weight' => '0',
'#categories' => array(
'workflow_basic' => 'workflow_basic',
),
'#status' => 'default',
'#conditions' => array(
'0' => array(
'#weight' => 0,
'#type' => 'condition',
'#settings' => array(
'field_name' => 'field_workflow',
'#argument map' => array(
'node' => 'node',
),
'value' => array(
'0' => array(
'value' => 'Published',
),
),
'code' => '',
'vars' => array(),
),
'#name' => 'content_rules_field_has_value',
'#info' => array(
'label' => 'Saved content\'s field \'field_workflow\' has value published',
'label callback' => FALSE,
'arguments' => array(
'node' => array(
'type' => 'node',
'label' => 'Content',
),
),
'eval input' => array(
'0' => 'code',
'1' => 'value|0|value',
),
'module' => 'CCK',
),
),
'1' => array(
'#weight' => 0,
'#info' => array(
'label' => 'Saved content\'s field \'field_workflow\' has been changed',
'arguments' => array(
'node' => array(
'type' => 'node',
'label' => 'Content containing changes',
),
'node_unchanged' => array(
'type' => 'node',
'label' => 'Content not containing changes',
),
),
'module' => 'CCK',
),
'#name' => 'content_rules_field_changed',
'#settings' => array(
'field_name' => 'field_workflow',
'#argument map' => array(
'node' => 'node',
'node_unchanged' => 'node_unchanged',
),
),
'#type' => 'condition',
),
),
'#actions' => array(
'0' => array(
'#type' => 'action',
'#settings' => array(
'auto_save' => 1,
'#argument map' => array(
'node' => 'node',
),
),
'#name' => 'rules_core_node_publish_action',
'#info' => array(
'label' => 'Publish saved content',
'module' => 'Node',
'arguments' => array(
'node' => array(
'label' => 'Content',
'type' => 'node',
),
),
'base' => 'rules_core_action_execute',
'action_name' => 'node_publish_action',
'configurable' => FALSE,
'label callback' => 'rules_core_node_label_callback',
'label_skeleton' => 'Publish @node',
),
'#weight' => 0,
),
),
'#version' => 6003,
),
),
);
}
/**
* Helper to implementation of hook_user_default_permissions().
*/
function _workflow_basic_user_default_permissions() {
$permissions = array();
// Exported permission: edit any page content
$permissions[] = array(
'name' => 'edit any page content',
'roles' => array(
'0' => 'editor',
'1' => 'publisher',
),
);
// Exported permission: edit field_workflow
$permissions[] = array(
'name' => 'edit field_workflow',
'roles' => array(
'0' => 'admin',
'1' => 'publisher',
),
);
// Exported permission: view field_workflow
$permissions[] = array(
'name' => 'view field_workflow',
'roles' => array(
'0' => 'editor',
'1' => 'publisher',
),
);
return $permissions;
}
workflow_basic/workflow_basic.features.inc 100644 765 765 2627 11246277345 14632 array(
'name' => t('Page'),
'module' => 'node',
'description' => t('A page, similar in form to a story, is a simple method for creating and displaying information that rarely changes, such as an "About us" section of a website. By default, a page entry does not allow visitor comments and is not featured on the site\'s initial home page.'),
'has_title' => '1',
'title_label' => t('Title'),
'has_body' => '1',
'body_label' => t('Body'),
),
);
return $items;
}
workflow_basic/workflow_basic.features.views.inc 100644 765 765 12453 11246277345 16004 name = 'workflow_moderation';
$view->description = 'View listing pages that aren\'t published yet.';
$view->tag = '';
$view->view_php = '';
$view->base_table = 'node';
$view->is_cacheable = FALSE;
$view->api_version = 2;
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
$handler = $view->new_display('default', 'Defaults', 'default');
$handler->override_option('fields', array(
'changed' => array(
'label' => 'Updated date',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'link_class' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'strip_tags' => 0,
'html' => 0,
),
'date_format' => 'time ago',
'custom_date_format' => '',
'exclude' => 0,
'id' => 'changed',
'table' => 'node',
'field' => 'changed',
'override' => array(
'button' => 'Override',
),
'relationship' => 'none',
),
'title' => array(
'label' => 'Title',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'link_class' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'strip_tags' => 0,
'html' => 0,
),
'link_to_node' => 0,
'exclude' => 0,
'id' => 'title',
'table' => 'node',
'field' => 'title',
'relationship' => 'none',
),
'edit_node' => array(
'label' => 'Edit link',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'link_class' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'strip_tags' => 0,
'html' => 0,
),
'text' => '',
'exclude' => 0,
'id' => 'edit_node',
'table' => 'node',
'field' => 'edit_node',
'relationship' => 'none',
),
));
$handler->override_option('sorts', array(
'changed' => array(
'order' => 'ASC',
'granularity' => 'second',
'id' => 'changed',
'table' => 'node',
'field' => 'changed',
'relationship' => 'none',
),
));
$handler->override_option('filters', array(
'type' => array(
'operator' => 'in',
'value' => array(
'page' => 'page',
),
'group' => '0',
'exposed' => FALSE,
'expose' => array(
'operator' => FALSE,
'label' => '',
),
'id' => 'type',
'table' => 'node',
'field' => 'type',
'relationship' => 'none',
),
'field_workflow_value_many_to_one' => array(
'operator' => 'not',
'value' => array(
'Published' => 'Published',
),
'group' => '0',
'exposed' => FALSE,
'expose' => array(
'operator' => FALSE,
'label' => '',
),
'id' => 'field_workflow_value_many_to_one',
'table' => 'node_data_field_workflow',
'field' => 'field_workflow_value_many_to_one',
'relationship' => 'none',
'reduce_duplicates' => 0,
'override' => array(
'button' => 'Override',
),
),
));
$handler->override_option('access', array(
'type' => 'role',
'role' => array(
'5' => 5,
),
));
$handler->override_option('cache', array(
'type' => 'none',
));
$handler->override_option('title', 'Moderation queue');
$handler->override_option('empty', 'Empty.');
$handler->override_option('empty_format', '1');
$handler->override_option('items_per_page', 25);
$handler->override_option('use_pager', '1');
$handler->override_option('style_plugin', 'table');
$handler->override_option('style_options', array(
'grouping' => '',
'override' => 1,
'sticky' => 0,
'order' => 'asc',
'columns' => array(
'title' => 'title',
'field_workflow_value' => 'field_workflow_value',
'edit_node' => 'edit_node',
),
'info' => array(
'title' => array(
'sortable' => 0,
'separator' => '',
),
'field_workflow_value' => array(
'sortable' => 0,
'separator' => '',
),
'edit_node' => array(
'separator' => '',
),
),
'default' => '-1',
));
$handler = $view->new_display('page', 'Page', 'page_1');
$handler->override_option('path', 'workflow/moderation');
$handler->override_option('menu', array(
'type' => 'normal',
'title' => 'Moderation queue',
'description' => '',
'weight' => '0',
'name' => 'navigation',
));
$handler->override_option('tab_options', array(
'type' => 'none',
'title' => '',
'description' => '',
'weight' => 0,
));
$views[$view->name] = $view;
return $views;
}
workflow_basic/workflow_basic.info 100644 765 765 1160 11246277345 13166 core = "6.x"
package = "Features"
project = "workflow_basic"
name = "Workflow Basic"
description = "A basic workflow using rules"
version = "6.x-1.0"
features[content][] = "page-field_workflow"
features[node][] = "page"
features[rules][] = "workflow_basic_1"
features[user][] = "edit any page content"
features[user][] = "edit field_workflow"
features[user][] = "view field_workflow"
features[views][] = "workflow_moderation"
dependencies[] = "content_permissions"
dependencies[] = "features"
dependencies[] = "node"
dependencies[] = "optionwidgets"
dependencies[] = "rules"
dependencies[] = "text"
dependencies[] = "views"
workflow_basic/workflow_basic.module 100644 765 765 64 11246277345 13462