Closed (won't fix)
Project:
Event
Version:
4.7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
12 May 2006 at 14:32 UTC
Updated:
14 Oct 2006 at 01:08 UTC
Jump to comment: Most recent file
I have been hacking away at event code to
A- not show taxonomy for 'solo' nodes when presenting nodes labeled as 'all'. This was easily done. It is useful because if you make a node not visible in the (all) calendar view (i.e. 'solo' node), why would you want to see the taxonomy for that node? - No problem.
B- only show the taxonomic terms related to the taxonomy (AKA category) used for the selected type (AKA node) view. - Serious difficulties
I am trying to use $curtype to get the currently displayed node name and then grab its taxonomy (unless all is selected of course). This may not be the right approach. Any help would be appreciated.
/**
* Returns a dropdown event taxonomy term input control.
*
* @ingroup event_support.
* @param $curterm The current term id.
* @param $submit Adds 'onChange' form submit javascript command to control.
* @return A form with a dropdown event taxonomy term input control.
*/
function _event_get_taxonomy_control($curterm = NULL, $autosubmit = TRUE) {
if (module_exist('taxonomy')) {
$types = event_get_types();
$vs = array();
if ($curtype == 'all') {
foreach ($types['all'] as $type) {
$results = taxonomy_get_vocabularies($type);
foreach ($results as $vocab) {
$vs[$vocab->vid] = $vocab;
}
}
$results = null;
$items['all'] = t('(all)');
foreach ($vs as $vid => $vocab) {
$tree = taxonomy_get_tree($vid);
foreach ($tree as $term) {
$items[$term->tid] = $vocab->name.' - '.$term->name;
}
}
}
else {
$results = taxonomy_get_vocabularies($curtype);
foreach ($results as $vocab) {
$vs[$vocab->vid] = $vocab;
}
$results = null;
$items['all'] = t('(all)');
foreach ($vs as $vid => $vocab) {
$tree = taxonomy_get_tree($vid);
foreach ($tree as $term) {
$items[$term->tid] = $vocab->name.' - '.$term->name;
}
}
}
$form['event_term_select'] = array(
'#type' => 'select',
'#default_value' => $curterm,
'#options' => $items,
'#description' => t('Select event terms to filter by'));
if ($autosubmit) {
$form['event_term_select']['#attributes'] = array('onChange'=>'this.form.submit()');
}
$form = drupal_get_form('event_taxonomy_filter', $form);
return theme('event_filter_control', $form);
}
}
/**
* Returns a dropdown event-enabled content type input control.
*
* @ingroup event_support.
* @param $tid The current term id.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | event_module_typ13.diff | 1.91 KB | rubenk |
| #1 | event_module_types.diff | 2.1 KB | rubenk |
Comments
Comment #1
rubenk commentedOkay. Well. I fixed it. Seems to work by only presenting taxonomy related to selected (i.e. filtered in) node, and in the case of 'all' does not show taxonomy associated with 'solo' nodes. I made this diff but i don't understand the problem with carriage returns.
Comment #2
rubenk commentedComment #3
rubenk commentedChanged title for better hits on searches.
Comment #4
rubenk commenteddoes anybody know how I can fix my line breaks in the diff...I don't think they are compatible with linux for some reason.
Comment #5
rubenk commentedI believe i made a diff with the correct carriage returns. Will someone try this to make sure.
Comment #6
rubenk commentedComment #7
rubenk commentedDumping this because it looks like there is probably no interest.
If it is desired by anyone, then feel free to pick it up.
Comment #8
gerhard killesreiter commentedis there any interest by others than rubenk in this patch? otherwise I'll won't ix it.
Comment #9
killes@www.drop.org commentedno interest, apparently