[erlang-questions] Edoc syntax
Carl McDade
carlmcdade@REDACTED
Fri May 1 06:46:33 CEST 2009
Well, yes and no. I guess the key work is "like". :) More like how Javadoc
inter-spaces the class or method source on the HTML page so that you can
follow along. Doxygen and PHPdocumentor are popular because of this. You can
see examples of what I mean at
http://api.drupal.org/api/function/node_add/6where they use Doxygen
output.
I guess this would be the job of the edoc-info file. But I have not found
much on how to use this or its features and limitations.
http://api.drupal.org/api/function/node_add/6
modules/node/node.pages.inc<http://api.drupal.org/api/file/modules/node/node.pages.inc/6>,
line 46
Versions4.6 – 4.7 <http://api.drupal.org/api/function/node_add/4.7>
node_add($type)
<http://api.drupal.org/api/function/node_add/4.7>5<http://api.drupal.org/api/function/node_add/5>node_add($type
= NULL) <http://api.drupal.org/api/function/node_add/5>*6 – 7**
node_add($type)*
Present a node submission form or a set of links to such forms.
Code
<?php
function node_add <http://api.drupal.org/api/function/node_add/6>($type) {
global $user;
$types = node_get_types
<http://api.drupal.org/api/function/node_get_types/6>();
$type = isset($type) ? str_replace <http://php.net/str_replace>('-',
'_', $type) : NULL;
// If a node type has been specified, validate its existence.
if (isset($types[$type]) && node_access
<http://api.drupal.org/api/function/node_access/6>('create', $type)) {
// Initialize settings:
$node = array('uid' => $user->uid, 'name' => (isset($user->name) ?
$user->name : ''), 'type' => $type, 'language' => '');
drupal_set_title
<http://api.drupal.org/api/function/drupal_set_title/6>(t
<http://api.drupal.org/api/function/t/6>('Create @name', array('@name'
=> $types[$type]->name)));
$output = drupal_get_form
<http://api.drupal.org/api/function/drupal_get_form/6>($type
.'_node_form', $node);
}
return $output;
}
?>
--
Carl McDade
Content Management Systems Consultant
www.hiveminds.co.uk
________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20090501/3a3376bf/attachment.htm>
More information about the erlang-questions
mailing list