[development] Newbie Question
Ivey, Chris
Chris.ivey at acs-inc.com
Mon Oct 1 15:15:17 UTC 2007
Greetings, all. I am new to Drupal, working on my first module. I am
having an issue that I can't seem to see where my issue is. Here is the
flow:
function alldotdev_advsearch_groups_form_submit($form_id, $form_values) {
$op = $form_values['op'];
$pagerrows = 50;
if ($op == t('Non-Standard Results')) {
$query_field = t('nonstd');
$query_value = $form_values['nonstd'];
}
$query_string = $query_field . " = '" . $query_value . "'";
return "AllDotDev/alldotdev_groups_display/" . $query_string . "/" .
$pagerrows;
}
function alldotdev_groups_display($query_string = "", $pagerrows = '50') {
$page_content = '';
$header = alldotdev_wholeheader();
$rows = alldotdev_groupsquery($query_string,$pagerrows);
$pager = theme('pager', NULL, $pagerrows, 0);
if (count($rows) && !empty($pager)) {
$rows[] = array(array('data' => $pager, 'colspan' =>
count($rows[0])));
}
if (count($rows)) {
$page_content .= theme('table', $header, $rows);
}
else {
$page_content .= "No devices meet the selection criteria";
}
print theme('page', $page_content);
}
function alldotdev_groupsquery($query_string, $pagerrows = 50) {
$header = alldotdev_wholeheader();
db_set_active('alldotdev');
$alldotdev_alldbfields = array_keys(alldotdev_allfields());
$fields = implode(",", $alldotdev_alldbfields);
//$query = "SELECT " . $fields ." FROM devices WHERE " .
$query_field . " = '" . $query_value . "'";
$query = "SELECT " . $fields ." FROM devices WHERE " .
$query_string;
$query .= tablesort_sql($header);
//drupal_set_message($query);
$query_result = pager_query($query, $pagerrows, 0, NULL,
$query_string);
db_set_active('default');
while ($record = db_fetch_object($query_result)) {
$values = array();
foreach ($alldotdev_alldbfields as $value) {
$values[] = $record->$value;
}
$rows[] = $values;
}
return $rows;
}
When I click one of the radio buttons for "nonstd" (which gives true or
false), the application thinks about it for a second or two, then brings me
back to the page that is listed in the menus as MENU_DEFAULT_LOCAL_TASK
instead of the page that I am asking for in my functions
(alldotdev_groups_display). I don't follow the Drupal flow (as of this
point) enough to know where to look to fix this issue. Could someone please
point me in a direction to get this issue resolved? Thank you kindly!
Chris Ivey
Affiliated Computer Services
Enterprise Management Integration Services
Infrastructure Management Senior Analyst
chris.ivey at acs-inc.com
"I have not failed, I have simply found 10,000 ways which do not work!" --
Thomas Edison
"When you find yourself in a hole, the best thing to do is stop digging!" --
Nick Stokes
"I reject your reality, and substitute my own!" -- Adam Savage
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/development/attachments/20071001/f768eb35/attachment.htm
More information about the development
mailing list