summaryrefslogtreecommitdiff
path: root/modules/blog
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2005-10-07 06:11:12 +0000
committerDries Buytaert <dries@buytaert.net>2005-10-07 06:11:12 +0000
commit7e1527ee61bc10b3765b95b9af8faaa2254da5a8 (patch)
tree2225c7f571b4a3f635564f8281406a12b2a271a7 /modules/blog
parent7b5b460534e5c54b07d28467c2aa2fc670c714e4 (diff)
downloadbrdo-7e1527ee61bc10b3765b95b9af8faaa2254da5a8.tar.gz
brdo-7e1527ee61bc10b3765b95b9af8faaa2254da5a8.tar.bz2
- Patch #29465: new form API by Adrian et al.
TODO: + The contact.module was broken; a new patch for contact.module is needed. + Documentation is needed. + The most important modules need to be updated ASAP.
Diffstat (limited to 'modules/blog')
-rw-r--r--modules/blog/blog.module18
1 files changed, 11 insertions, 7 deletions
diff --git a/modules/blog/blog.module b/modules/blog/blog.module
index 43a1760dc..4ac9240f7 100644
--- a/modules/blog/blog.module
+++ b/modules/blog/blog.module
@@ -42,7 +42,11 @@ function blog_access($op, $node) {
*/
function blog_user($type, &$edit, &$user) {
if ($type == 'view' && user_access('edit own blog', $user)) {
- return array(t('History') => array('blog' => form_item(t('Blog'), l(t('view recent blog entries'), "blog/$user->uid", array('title' => t("Read %username's latest blog entries.", array('%username' => $user->name)))))));
+ $form['blog'] = array(
+ type => 'item', title => t('Blog'),
+ value => l(t('view recent blog entries'), "blog/$user->uid", array('title' => t("Read %username's latest blog entries.", array('%username' => $user->name))))
+ );
+ return array(t('History') => $form);
}
}
@@ -196,7 +200,6 @@ function blog_form(&$node) {
global $nid;
$iid = $_GET['iid'];
- $output = form_textfield(t('Title'), 'title', $node->title, 60, 128, NULL, NULL, TRUE);
if (empty($node->body)) {
/*
@@ -213,16 +216,17 @@ function blog_form(&$node) {
// Note: $item->description has been validated on aggregation.
$node->body = '<a href="'. check_url($item->link) .'">'. check_plain($item->title) .'</a> - <em>'. $item->description .'</em> [<a href="'. check_url($item->flink) .'">'. check_plain($item->ftitle) ."</a>]\n";
}
+
}
if (function_exists('taxonomy_node_form')) {
- $output .= implode('', taxonomy_node_form('blog', $node));
+ $form['taxonomy'] = taxonomy_node_form('blog', $node);
}
- $output .= form_textarea(t('Body'), 'body', $node->body, 60, 20, '', NULL, TRUE);
- $output .= filter_form('format', $node->format);
-
- return $output;
+ $form['title'] = array(type => 'textfield', title => t('Title'), size => 60, maxlength => 128, required => TRUE, default_value => $node->title);
+ $form['body'] = array(type => 'textarea', title => t('Body'), default_value => $node->body, required => TRUE);
+ $form = array_merge($form, filter_form($node->format));
+ return $form;
}
/**