Index: themes/fb_fbml/fb_fbml.info =================================================================== --- themes/fb_fbml/fb_fbml.info +++ themes/fb_fbml/fb_fbml.info (6.x working copy) @@ -1,4 +0,0 @@ +name = fb_fbml +description = for fb module. +core = 6.x +engine = phptemplate Index: themes/fb_fbml/template.php =================================================================== --- themes/fb_fbml/template.php (revision 1.8) +++ themes/fb_fbml/template.php (6.x working copy) @@ -1,23 +1,21 @@ "; } + // Change 'Home' in breadcrumbs + $crumbs = drupal_get_breadcrumb(); + if (count($crumbs) && strpos($crumbs[0], t('Home'))) { + $crumbs[0] = l(t($fb_app->title), ''); + $vars['breadcrumb'] = theme('breadcrumb', $crumbs); + } + // Style page differently depending on which sidebars are present. // Approach copied from Zen theme. // allows advanced theming based on context (home page, node of certain type, etc.) @@ -45,31 +50,12 @@ } $vars['body_classes'] = implode(' ', $body_classes); - - //var_dump($vars); - if (function_exists('fb_canvas_process')) { - fb_canvas_process($vars); - } - //var_dump($fb_app,$vars); -} - -function fb_fbml_breadcrumb($breadcrumb) { - // Change 'Home' in breadcrumbs - if (!empty($breadcrumb)) { - global $fb_app; - if (count($breadcrumb) && strpos($breadcrumb[0], t('Home'))) { - $breadcrumb[0] = l(t($fb_app->title), ''); - $breadcrumb = theme('breadcrumb', $breadcrumb); - } - } -} -function fb_fbml_preprocess_node(&$vars) { - global $fb_app, $user; - - if ($vars['teaser']) { - $vars['template_file'] = 'node-teaser'; } + else if ($hook == 'node') { + if ($vars['teaser']) { + $vars['template_file'] = 'node-teaser'; + } // TODO: could move this to phptemplate engine. if (count($vars['about'])) @@ -88,54 +74,52 @@ $vars['picture'] = '
'; //drupal_set_message("node vars: " . dprint_r($vars, 1)); + } + return $vars; } -function fb_fbml_preprocess_regions(&$vars) { - $vars['regions'] = array('admin' => t('Admin sidebar'), +function fb_fbml_regions() { + $regions = array('admin' => t('Admin sidebar'), 'header' => t('Canvas Header'), 'right' => t('Canvas Right'), 'content_footer' => t('Content Footer'), 'canvas_footer' => t('Canvas Footer'), ); + return $regions; } //// tabs -//TODO: port this function to 6.x. I don't get the changes to the menu_ functions yet. -function fb_fbml_menu_local_tasks() { -/* global $fb; - if ($fb && $fb->in_canvas()) { - $local_tasks = menu_local_tasks(); - //$output = theme('menu_local_task', $local_tasks); //TODO: total guess - would this give the same result? - $pid = menu_get_active_nontask_item(); - $output = ''; - - if (count($local_tasks[$pid]['children'])) { - $output .= "\n"; - foreach ($local_tasks[$pid]['children'] as $mid) { - $item = menu_get_item($mid); - $selected = menu_in_active_trail($mid) ? "true" : "false"; - $output .= "".$item['title']."\n"; - } - $output .= "\n"; - } - // TODO secondary local tasks + +function phptemplate_menu_local_tasks() { + global $fb; + if ($fb && $fb->in_fb_canvas()) { + $local_tasks = menu_get_local_tasks(); + $pid = menu_get_active_nontask_item(); + $output = ''; + + if (count($local_tasks[$pid]['children'])) { + $output .= "\n"; + foreach ($local_tasks[$pid]['children'] as $mid) { + $item = menu_get_item($mid); + $selected = menu_in_active_trail($mid) ? "true" : "false"; + $output .= "".$item['title']."\n"; + } + $output .= "\n"; + } + // TODO secondary local tasks } else - $output = theme_menu_local_tasks();*/ - -//TEMP DEBUG PATCH -//TODO: FIX _menu_local_tasks -$output = "\nitem"; + $output = theme_menu_local_tasks(); + return $output; } // collapsing fieldsets -function fb_fbml_fieldset($element) { +function phptemplate_fieldset($element) { global $fb; if ($fb && $fb->in_fb_canvas()) { - //drupal_set_message("fb_fbml_fieldset" . dpr($element, 1)); static $count = 0; if ($element['#collapsible']) { @@ -160,9 +144,9 @@ if ($element['#title']) { $output .= ''. $element['#title'] .''; } - $output .= '
'; + $output .= '
'; if ($element['#description']) - $output .= '
'; + $output .= '
'. $element['#description'] .'
'; $output .= $element['#children'] . $element['#value']; $output .= "
\n"; @@ -173,3 +157,4 @@ return $output; } +?> \ No newline at end of file