Functions | |
| planet_multiple_delete_confirm (&$form_state, $nodes, $fid, $redirect) | |
| TODO. | |
| planet_settings_form (&$form_state) | |
| TODO. | |
| planet_feed_form (&$form_state, $edit=array(), $individual=false, $user=NULL) | |
| TODO. | |
| planet_feed_form | ( | &$ | form_state, | |
| $ | edit = array(), |
|||
| $ | individual = false, |
|||
| $ | user = NULL | |||
| ) |
TODO.
| &$form_state | ||
| $edit | ||
| $individual | ||
| $user |
DB @CRUD: role[R]
DB @CRUD: users_roles[R]
DB @CRUD: variables[R]
00662 { 00663 $uids = array(); 00664 $result = db_query('SELECT u.uid, u.name FROM {users} u, {role} r, {users_roles} ur WHERE u.uid = ur.uid AND ur.rid = r.rid AND r.rid = %d ORDER BY u.name ASC', variable_get('planet_author_roles', 2)); 00665 while ($f_user = db_fetch_object($result)) { 00666 $uids[$f_user->uid] = $f_user->name; 00667 } 00668 00669 if ($individual) { 00670 if (!isset($uids[$edit['uid']])) { 00671 $g_user = db_fetch_array(db_query('SELECT uid, name FROM {users} WHERE uid = %d', $edit['uid'])); 00672 $uids[$edit['uid']] = $g_user['name']; 00673 } 00674 } 00675 00676 $form = array(); 00677 00678 $form['feeds'] = array( 00679 '#type' => 'fieldset', 00680 '#title' => 'Feeds' 00681 ); 00682 00683 $form['feeds']['fid'] = array( 00684 '#type' => 'hidden', 00685 '#value' => $edit['fid'] 00686 ); 00687 00688 $form['feeds']['title'] = array( 00689 '#type' => 'textfield', 00690 '#title' => t('Title'), 00691 '#value' => $edit['title'], 00692 '#size' => 40, 00693 '#maxlength' => 40 00694 ); 00695 00696 if ($user == NULL) { 00697 $form['feeds']['uid'] = array( 00698 '#type' => 'select', 00699 '#title' => t('Original author'), 00700 '#value' => $edit['uid'], 00701 '#options' => $uids, 00702 '#description' => t('Select a user to associate this feed with') 00703 ); 00704 } 00705 else { 00706 $form['feeds']['uid'] = array( 00707 '#type' => 'hidden', 00708 '#value' => $user->uid, 00709 ); 00710 } 00711 $form['feeds']['link'] = array( 00712 '#type' => 'textfield', 00713 '#title' => t('URL'), 00714 '#value' => $edit['link'], 00715 '#size' => 40, 00716 '#maxlength' => 80 00717 ); 00718 00719 $form['feeds']['submit'] = array( 00720 '#type' => 'submit', 00721 '#value' => $edit['fid'] > 0 ? 'Save' : 'Add'.' Feed' 00722 ); 00723 00724 if ($individual) { 00725 $form['feeds']['delete'] = array( 00726 '#type' => 'submit', 00727 '#value' => 'Delete', 00728 ); 00729 } 00730 00731 return $form; 00732 }

| planet_multiple_delete_confirm | ( | &$ | form_state, | |
| $ | nodes, | |||
| $ | fid, | |||
| $ | redirect | |||
| ) |
TODO.
| &$form_state | ||
| $nodes | ||
| $fid | ||
| $redirect |
00536 { 00537 $form_state['values']['fid'] = $fid; 00538 $form_state['values']['redirect'] = $redirect; 00539 $form['nodes'] = array('#prefix' => '<ul>', '#suffix' => '</ul>', '#tree' => TRUE); 00540 // array_filter returns only elements with TRUE values 00541 foreach ($nodes as $nid => $value) { 00542 $title = db_result(db_query('SELECT title FROM {node} WHERE nid = %d', $nid)); 00543 $form['nodes'][$nid] = array( 00544 '#type' => 'hidden', 00545 '#value' => $nid, 00546 '#prefix' => '<li>', 00547 '#suffix' => check_plain($title) ."</li>\n", 00548 ); 00549 } 00550 $form['operation'] = array('#type' => 'hidden', '#value' => 'delete'); 00551 $form['#submit'][] = 'planet_multiple_delete_confirm_submit'; 00552 return confirm_form($form, 00553 t('Are you sure you want to delete these items?'), 00554 $redirect, t('This action cannot be undone.'), 00555 t('Delete all'), t('Cancel')); 00556 }

| planet_settings_form | ( | &$ | form_state | ) |
TODO.
| &$form_state |
DB @CRUD: variables[R]
00595 { 00596 $roles = array(); 00597 00598 $result = db_query('SELECT rid, name FROM {role}'); 00599 while ($role = db_fetch_object($result)) { 00600 $roles[$role->rid] = $role->name; 00601 } 00602 00603 unset($result); 00604 $result = db_query('SELECT format, name FROM {filter_formats}'); 00605 while ($format = db_fetch_object($result)) { 00606 $formats[$format->format] = $format->name; 00607 } 00608 00609 $form = array(); 00610 00611 $form['general'] = array( 00612 '#type' => 'fieldset', 00613 '#title' => t('General Settings') 00614 ); 00615 00616 $form['general']['planet_author_roles'] = array( 00617 '#type' => 'select', 00618 '#title' => t('Role to select authors from'), 00619 '#options' => $roles, 00620 '#default_value' => variable_get('planet_author_roles', 2), 00621 '#description' => t('Select the role from which blog authors should be selected on the feed creation screen.') 00622 ); 00623 00624 $form['general']['planet_filter_formats'] = array( 00625 '#type' => 'select', 00626 '#title' => t('Filter format for planet entry nodes'), 00627 '#options' => $formats, 00628 '#default_value' => variable_get('planet_filter_formats', 1), 00629 '#description' => t('Select the filter format that will be used to show planet entry nodes.') 00630 ); 00631 00632 $form['general']['planet_redirect_page'] = array( 00633 '#type' => 'checkbox', 00634 '#title' => t('Redirect node?'), 00635 '#return_value' => 1, 00636 '#value' => (variable_get('planet_redirect_page', 0) == 1) ? 1 : null, 00637 '#description' => t('Check this if you want the node view to redirect to the original content link; this is useful if you want the feed to forward through instead of showing the planet node.') 00638 ); 00639 00640 $form['general']['submit'] = array( 00641 '#type' => 'submit', 00642 '#value' => 'Save Configuration' 00643 ); 00644 00645 return $form; 00646 }

1.5.8