function workspace_admin in Workspace 5
1 string reference to 'workspace_admin'
- workspace_menu in ./
workspace.module - Implementation of hook_menu().
File
- ./
workspace.module, line 69 - Presents a user-centric view of content.
Code
function workspace_admin() {
global $user;
// This is bad form but still secure since we're just doing a drupal_goto().
if (isset($_POST['content_type'])) {
$node_type = $_POST['content_type'];
if ($node_type == t('Select...')) {
drupal_goto('node/add');
}
foreach (node_get_types() as $type => $typeobject) {
if (node_access('create', $type, $user->uid)) {
$options[$type] = $typeobject->name;
}
if (isset($options[$node_type])) {
drupal_goto('node/add/' . $node_type);
}
}
}
$title = t('Workspace') . ' : ' . $user->name;
drupal_set_title($title);
$output = workspace_list();
return $output;
}