PageRenderTime 51ms CodeModel.GetById 26ms RepoModel.GetById 1ms app.codeStats 0ms

/sites/all/themes/titan/template.php

https://bitbucket.org/hjain/trinet
PHP | 553 lines | 441 code | 48 blank | 64 comment | 109 complexity | 1c34eaffb21ee5303c46c211bd9a8702 MD5 | raw file
Possible License(s): GPL-2.0, LGPL-3.0, AGPL-1.0
  1. <?php
  2. // $Id: template.php,v 1.5 2011/01/10 13:46:19 jarek Exp $
  3. /**
  4. * Implements hook_css_alter().
  5. */
  6. function titan_css_alter(&$css) {
  7. unset($css[drupal_get_path('module', 'aggregator') . '/aggregator.css']);
  8. unset($css[drupal_get_path('module', 'block') . '/block.css']);
  9. unset($css[drupal_get_path('module', 'book') . '/book.css']);
  10. unset($css[drupal_get_path('module', 'comment') . '/comment.css']);
  11. unset($css[drupal_get_path('module', 'field') . '/theme/field.css']);
  12. unset($css[drupal_get_path('module', 'filter') . '/filter.css']);
  13. unset($css[drupal_get_path('module', 'forum') . '/forum.css']);
  14. unset($css[drupal_get_path('module', 'locale') . '/locale.css']);
  15. unset($css[drupal_get_path('module', 'node') . '/node.css']);
  16. unset($css[drupal_get_path('module', 'poll') . '/poll.css']);
  17. unset($css[drupal_get_path('module', 'search') . '/search.css']);
  18. unset($css[drupal_get_path('module', 'system') . '/system.css']);
  19. unset($css[drupal_get_path('module', 'system') . '/system.base.css']);
  20. unset($css[drupal_get_path('module', 'system') . '/system.behavior.css']);
  21. unset($css[drupal_get_path('module', 'system') . '/system.theme.css']);
  22. unset($css[drupal_get_path('module', 'system') . '/system.menus.css']);
  23. unset($css[drupal_get_path('module', 'system') . '/system.messages.css']);
  24. unset($css[drupal_get_path('module', 'user') . '/user.css']);
  25. unset($css['misc/vertical-tabs.css']);
  26. unset($css['misc/vertical-tabs-rtl.css']);
  27. }
  28. /**
  29. * Implements template_preprocess_html().
  30. */
  31. function titan_preprocess_html(&$variables) {
  32. // Add reset CSS
  33. drupal_add_css($data = path_to_theme() . '/reset.css', $options['type'] = 'file', $options['weight'] = CSS_SYSTEM - 1);
  34. // Add conditional stylesheet for IEs
  35. drupal_add_css(path_to_theme() . '/ie8.css', array('group' => CSS_THEME, 'browsers' => array('IE' => 'lte IE 8', '!IE' => FALSE), 'preprocess' => FALSE));
  36. drupal_add_css(path_to_theme() . '/ie7.css', array('group' => CSS_THEME, 'browsers' => array('IE' => 'lte IE 7', '!IE' => FALSE), 'preprocess' => FALSE));
  37. // Add "has-footer" class to body element. This class is used for styling page closure
  38. if (!empty($variables['page']['footer_column_first']) || !empty($variables['page']['footer_column_second']) || !empty($variables['page']['footer_column_third']) || !empty($variables['page']['footer_column_fourth'])) {
  39. $variables['classes_array'][] = 'has-footer';
  40. }
  41. }
  42. /**
  43. * Implements template_preprocess_page().
  44. */
  45. function titan_process_page(&$variables) {
  46. //echo "<pre>";print_r($variables['page']['header_menu']['system_main-menu']['800']['#href']); exit;
  47. // Add $footer_columns_number variable to page.tpl.php file
  48. $columns = 0;
  49. foreach (array('first', 'second', 'third', 'fourth') as $n) {
  50. if ($variables["page"]["footer_column_$n"]) {
  51. $columns++;
  52. }
  53. }
  54. $variables['footer_columns_number'] = $columns;
  55. //echo "<pre>"; print_r($variables['page']['header_top']['system_user-menu']['775']['#href']); exit;
  56. //if($variables['page']['header_top']['system_user-menu']){
  57. global $user;
  58. $userid=$user->uid;
  59. //$menu_names = menu_get_names();
  60. //$menu = menu_load_links('secondary_menu');
  61. //$menu_entity=menu_load('secondary_menu');
  62. $variables['page']['header_top']['system_user-menu']['775']['#href']='user/'. $userid .'/edit/';
  63. //}
  64. }
  65. /**
  66. * Implements template_preprocess_block().
  67. */
  68. function titan_preprocess_block(&$variables) {
  69. // Remove "block" class from blocks in "Main page content" region
  70. if ($variables['elements']['#block']->region == 'content') {
  71. foreach ($variables['classes_array'] as $key => $val) {
  72. if ($val == 'block') {
  73. unset($variables['classes_array'][$key]);
  74. }
  75. }
  76. }
  77. $variables['classes_array'][] = 'block-content';
  78. }
  79. /**
  80. * Implements template_preprocess_comment().
  81. */
  82. function titan_preprocess_comment(&$variables) {
  83. // Change permalink text from "#" to "permalink"
  84. $comment = $variables['elements']['#comment'];
  85. $variables['permalink'] = l('permalink', 'comment/' . $comment->cid, array('fragment' => "comment-$comment->cid"));
  86. }
  87. /**
  88. * Overrides theme_more_link().
  89. */
  90. function titan_more_link($variables) {
  91. /* Append arrow */
  92. return '<div class="more-link">' . t('<a href="@link" title="@title">more ›</a>', array('@link' => check_url($variables['url']), '@title' => $variables['title'])) . '</div>';
  93. }
  94. /**
  95. * Overrides theme_messages().
  96. */
  97. function titan_messages($variables) {
  98. // If there are serveral messages, print them in separate divs.
  99. $display = $variables['display'];
  100. $output = '';
  101. $status_heading = array(
  102. 'status' => t('Status message'),
  103. 'error' => t('Error message'),
  104. 'warning' => t('Warning message'),
  105. );
  106. foreach (drupal_get_messages($display) as $type => $messages) {
  107. if (!empty($status_heading[$type])) {
  108. $output .= '<h2 class="element-invisible">' . $status_heading[$type] . "</h2>\n";
  109. }
  110. foreach ($messages as $message) {
  111. $output .= "<div class=\"messages message-$type\">\n";
  112. $output .= $message;
  113. $output .= "</div>\n";
  114. }
  115. }
  116. return $output;
  117. }
  118. /**
  119. * Overrides theme_node_recent_block().
  120. */
  121. function titan_node_recent_block($variables) {
  122. // Make output for "Recent content" block consistent with other blocks
  123. $output = '';
  124. foreach ($variables['nodes'] as $node) {
  125. $items[] = theme('node_recent_content', array('node' => $node));
  126. }
  127. if (user_access('access content overview')) {
  128. $items[] = theme('more_link', array('url' => url('admin/content'), 'title' => t('more ›')));
  129. }
  130. return theme('item_list', array('items' => $items));
  131. }
  132. /**
  133. * Overrides theme_node_recent_content().
  134. */
  135. function titan_node_recent_content($variables) {
  136. // Make output for "Recent content" block consistent with other blocks
  137. $node = $variables['node'];
  138. $output = l($node->title, 'node/' . $node->nid);
  139. $output .= theme('mark', array('type' => node_mark($node->nid, $node->changed)));
  140. return $output;
  141. }
  142. /**
  143. * Override of theme_pager().
  144. */
  145. function titan_pager($variables) {
  146. // Reimplement the pager
  147. $tags = $variables['tags'];
  148. $element = $variables['element'];
  149. $parameters = $variables['parameters'];
  150. $pager_width = theme_get_setting('trim_pager');
  151. global $pager_page_array, $pager_total;
  152. $li_previous = theme('pager_previous', array('text' => (isset($tags[1]) ? $tags[1] : t('‹ previous')), 'element' => $element, 'interval' => 1, 'parameters' => $parameters));
  153. $li_next = theme('pager_next', array('text' => (isset($tags[3]) ? $tags[3] : t('next ›')), 'element' => $element, 'interval' => 1, 'parameters' => $parameters));
  154. $total_number_of_pages = $pager_total[$element];
  155. $current_page_number = $pager_page_array[$element] + 1;
  156. /* If there is just one page we don't need a pager. */
  157. if ($total_number_of_pages <= 1) {
  158. return;
  159. }
  160. /* Elipsis does not make sense if there is just one page more than the pager width. */
  161. if ($total_number_of_pages - $pager_width == 1) {
  162. $pager_width++;
  163. }
  164. /* Genarate pager without any elipsis */
  165. if ($total_number_of_pages <= $pager_width) {
  166. if ($li_previous) {
  167. $items[] = array('class' => array('pager-previous'), 'data' => $li_previous,);
  168. }
  169. for ($i = 1; $i <= $total_number_of_pages; $i++) {
  170. if ($i < $current_page_number) {
  171. $items[] = array('class' => array('pager-item'), 'data' => theme('pager_previous', array('text' => $i, 'element' => $element, 'interval' => ($current_page_number - $i), 'parameters' => $parameters)) );
  172. }
  173. if ($i == $current_page_number) {
  174. $items[] = array('class' => array('pager-current'), 'data' => $i);
  175. }
  176. if ($i > $current_page_number) {
  177. $items[] = array('class' => array('pager-item'), 'data' => theme('pager_next', array('text' => $i, 'element' => $element, 'interval' => ($i - $current_page_number), 'parameters' => $parameters)) );
  178. }
  179. }
  180. if ($li_next) {
  181. $items[] = array('class' => array('pager-next'), 'data' => $li_next );
  182. }
  183. }
  184. /* Genarate pager with elipsis */
  185. if ($total_number_of_pages > $pager_width) {
  186. /* Genarate pager with elpisis on right side. */
  187. if ($current_page_number < $pager_width) {
  188. if ($li_previous) {
  189. $items[] = array('class' => array('pager-previous'), 'data' => $li_previous,);
  190. }
  191. for ($i = 1; $i <= $pager_width; $i++) {
  192. if ($i < $current_page_number) {
  193. $items[] = array('class' => array('pager-item'), 'data' => theme('pager_previous', array('text' => $i, 'element' => $element, 'interval' => ($current_page_number - $i), 'parameters' => $parameters)) );
  194. }
  195. if ($i == $current_page_number) {
  196. $items[] = array('class' => array('pager-item pager-current'), 'data' => $i);
  197. }
  198. if ($i > $current_page_number) {
  199. $items[] = array('class' => array('pager-item'), 'data' => theme('pager_next', array('text' => $i, 'element' => $element, 'interval' => ($i - $current_page_number), 'parameters' => $parameters)) );
  200. }
  201. }
  202. $items[] = array(
  203. 'class' => array('pager-ellipsis'),
  204. 'data' => '…',
  205. );
  206. $items[] = array('class' => array('pager-item'), 'data' => theme('pager_last', array('text' => $total_number_of_pages, 'element' => $element, 'interval' => 1, 'parameters' => $parameters)) );
  207. $items[] = array('class' => array('pager-next'), 'data' => $li_next );
  208. }
  209. /* Genarate pager with elpisis on both sides. */
  210. if($current_page_number >= $pager_width && $current_page_number <= $total_number_of_pages - $pager_width + 1) {
  211. if ($li_previous) {
  212. $items[] = array('class' => array('pager-previous'), 'data' => $li_previous,);
  213. }
  214. $items[] = array('class' => array('pager-item'), 'data' => theme('pager_first', array('text' => "1", 'element' => $element, 'interval' => 1, 'parameters' => $parameters)) );
  215. $items[] = array(
  216. 'class' => array('pager-ellipsis'),
  217. 'data' => '…',
  218. );
  219. function isEven($num){
  220. return ($num%2) ? TRUE : FALSE;
  221. }
  222. if (isEven($pager_width) == TRUE) {
  223. $a = floor($pager_width/2);
  224. }
  225. if (isEven($pager_width) == FALSE) {
  226. $a = floor($pager_width/2) - 1;
  227. }
  228. for ($i = $current_page_number - $a; $i <= $current_page_number + floor($pager_width/2); $i++) {
  229. if ($i < $current_page_number) {
  230. $items[] = array('class' => array('pager-item'), 'data' => theme('pager_previous', array('text' => $i, 'element' => $element, 'interval' => ($current_page_number - $i), 'parameters' => $parameters)) );
  231. }
  232. if ($i == $current_page_number) {
  233. $items[] = array('class' => array('pager-current'), 'data' => $i);
  234. }
  235. if ($i > $current_page_number) {
  236. $items[] = array('class' => array('pager-item'), 'data' => theme('pager_next', array('text' => $i, 'element' => $element, 'interval' => ($i - $current_page_number), 'parameters' => $parameters)) );
  237. }
  238. }
  239. $items[] = array(
  240. 'class' => array('pager-ellipsis'),
  241. 'data' => '…',
  242. );
  243. $items[] = array('class' => array('pager-item'), 'data' => theme('pager_last', array('text' => $total_number_of_pages, 'element' => $element, 'interval' => 1, 'parameters' => $parameters)) );
  244. $items[] = array('class' => array('pager-next'), 'data' => $li_next );
  245. }
  246. /* Genarate pager with elpisis on left side. */
  247. if($current_page_number >= $pager_width && $current_page_number > $total_number_of_pages - $pager_width + 1) {
  248. if ($li_previous) {
  249. $items[] = array('class' => array('pager-previous'), 'data' => $li_previous,);
  250. }
  251. $items[] = array('class' => array('pager-item'), 'data' => theme('pager_first', array('text' => "1", 'element' => $element, 'interval' => 1, 'parameters' => $parameters)) );
  252. $items[] = array(
  253. 'class' => array('pager-ellipsis'),
  254. 'data' => '…',
  255. );
  256. for ($i = $total_number_of_pages - $pager_width + 1; $i <= $total_number_of_pages; $i++) {
  257. if ($i < $current_page_number) {
  258. $items[] = array('class' => array('pager-item'), 'data' => theme('pager_previous', array('text' => $i, 'element' => $element, 'interval' => ($current_page_number - $i), 'parameters' => $parameters)) );
  259. }
  260. if ($i == $current_page_number) {
  261. $items[] = array('class' => array('pager-current'), 'data' => $i);
  262. }
  263. if ($i > $current_page_number) {
  264. $items[] = array('class' => array('pager-item'), 'data' => theme('pager_next', array('text' => $i, 'element' => $element, 'interval' => ($i - $current_page_number), 'parameters' => $parameters)) );
  265. }
  266. }
  267. $items[] = array('class' => array('pager-next'), 'data' => $li_next );
  268. }
  269. }
  270. /* Print generated pager */
  271. return '<h2 class="element-invisible">' . t('Pages') . '</h2>' . theme('item_list', array('items' => $items, 'title' => NULL, 'type' => 'ul', 'attributes' => array('class' => array('pager'))));
  272. }
  273. function titan_preprocess_page(&$variables, $hook){
  274. //echo "<pre>"; print_r($variables);exit;
  275. if(isset($variables['node'])){
  276. switch($variables['node']->nid){
  277. case '38':
  278. $variables['title'] = '';
  279. $variables['tabs'] = '';
  280. $variables['action_links'] = '';
  281. $variables['breadcrumb'] = '';
  282. break;
  283. case '44':
  284. $variables['title'] = '';
  285. $variables['tabs'] = '';
  286. $variables['action_links'] = '';
  287. $variables['breadcrumb'] = '';
  288. break;
  289. case '45':
  290. $variables['title'] = '';
  291. $variables['tabs'] = '';
  292. $variables['action_links'] = '';
  293. $variables['breadcrumb'] = '';
  294. break;
  295. case '68':
  296. $variables['title'] = '';
  297. $variables['tabs'] = '';
  298. $variables['action_links'] = '';
  299. //$variables['breadcrumb'] = '';
  300. break;
  301. case '61':
  302. $variables['title'] = '';
  303. $variables['tabs'] = '';
  304. $variables['action_links'] = '';
  305. $variables['breadcrumb'] = '';
  306. break;
  307. case '75':
  308. $variables['node']->title = '';
  309. $variables['tabs'] = '';
  310. $variables['action_links'] = '';
  311. $variables['breadcrumb'] = '';
  312. break;
  313. }
  314. }
  315. if(isset($_SESSION['nid']) && $_SESSION['show_announcement'] == true){
  316. $variables['show_announcement'] = true;
  317. $_SESSION['show_announcement']= false;
  318. }
  319. }
  320. function titan_breadcrumb(&$variables) {
  321. $breadcrumb = $variables['breadcrumb'];
  322. if(isset($breadcrumb[0])){
  323. $breadcrumb[0] = l('Home','<front>',array('attributes' => array('class' => array('home'),'title' => 'Home')));
  324. }
  325. $argument = arg();
  326. if ($argument[0]=='company-directory') {
  327. $breadcrumb[1] = l('People', 'company-directory');
  328. }
  329. if($argument[0]=='user'){
  330. $breadcrumb =NULL;
  331. }
  332. if ($argument[0]=='user'){
  333. if(isset($argument[1])){
  334. if($argument[1]!='register')
  335. {
  336. $breadcrumb_query = db_select('profile', 'p');
  337. $breadcrumb_data=$breadcrumb_query->fields('p', array('pid'))
  338. ->condition('p.uid', $argument[1], '=')
  339. ->execute();
  340. $breadcrumb_obj = $breadcrumb_data->fetchObject();
  341. //echo "<pre>";print_r($breadcrumb_obj->pid);exit;
  342. $cpid=$breadcrumb_obj->pid;
  343. $query = db_select('field_data_field_first_name','f');
  344. $query_data=$query->fields('f',array('field_first_name_value'))
  345. ->condition('f.entity_id',$cpid,'=')
  346. ->execute();
  347. $query_obj=$query_data->fetchObject();
  348. // echo "<pre>";print_r($query_obj->field_first_name_value);exit;
  349. $breadcrumb[0] = l('Home','<front>',array('attributes' => array('class' => array('home'),'title' => 'Home')));
  350. $breadcrumb[1] = l('People', 'company-directory');
  351. $breadcrumb[2] = l($query_obj->field_first_name_value, 'user/' . $argument[1]);
  352. }
  353. }
  354. }
  355. if ($argument[0]=='user'){
  356. if(isset($argument[1] )){
  357. if($argument[1]=='register'){
  358. $breadcrumb =NULL;
  359. }
  360. }
  361. }
  362. if ($argument[0]=='user'){
  363. if( isset($argument[2]) && $argument[2]=='edit'){
  364. $breadcrumb_query = db_select('profile', 'p');
  365. $breadcrumb_data=$breadcrumb_query->fields('p', array('pid'))
  366. ->condition('p.uid', $argument[1], '=')
  367. ->execute();
  368. $breadcrumb_obj = $breadcrumb_data->fetchObject();
  369. //echo "<pre>";print_r($breadcrumb_obj->pid);exit;
  370. $cpid=$breadcrumb_obj->pid;
  371. $query = db_select('field_data_field_first_name','f');
  372. $query_data=$query->fields('f',array('field_first_name_value'))
  373. ->condition('f.entity_id',$cpid,'=')
  374. ->execute();
  375. $query_obj=$query_data->fetchObject();
  376. $breadcrumb[1] = l('People', 'company-directory');
  377. $breadcrumb[2] = l($query_obj->field_first_name_value, 'user/' . $argument[1]);
  378. $breadcrumb[3] = l('Edit', 'user/' . $argument[1].'/edit');
  379. }
  380. }
  381. if ($argument[0]=='user'){
  382. if( isset($argument[2]) && $argument[2]=='followers-list'){
  383. $breadcrumb_query = db_select('profile', 'p');
  384. $breadcrumb_data=$breadcrumb_query->fields('p', array('pid'))
  385. ->condition('p.uid', $argument[1], '=')
  386. ->execute();
  387. $breadcrumb_obj = $breadcrumb_data->fetchObject();
  388. //echo "<pre>";print_r($breadcrumb_obj->pid);exit;
  389. $cpid=$breadcrumb_obj->pid;
  390. $query = db_select('field_data_field_first_name','f');
  391. $query_data=$query->fields('f',array('field_first_name_value'))
  392. ->condition('f.entity_id',$cpid,'=')
  393. ->execute();
  394. $query_obj=$query_data->fetchObject();
  395. $breadcrumb[1] = l('People', 'company-directory');
  396. $breadcrumb[2] = l($query_obj->field_first_name_value, 'user/' . $argument[1]);
  397. $breadcrumb[3] = l('Followers List', 'user/' . $argument[1].'/followers-list');
  398. }
  399. }
  400. if ($argument[0]=='node'){
  401. if( isset($argument[2]) && $argument[2]=='code'){
  402. $breadcrumb[1] = l('Snippet', 'node/61');
  403. $breadcrumb[2] = l('Create', 'node/add/code');
  404. }
  405. }
  406. if ($argument[0]=='node'){
  407. if( isset($argument[2]) && $argument[2]=='reply-to-post'){
  408. $breadcrumb[1] ='Reply';
  409. //$breadcrumb[2] = l('Create', 'node/add/');
  410. }
  411. }
  412. if ($argument[0]=='snippet'){
  413. $breadcrumb[1] = l('Snippet', 'node/61');
  414. $breadcrumb[2] = l('View', 'snippet');
  415. }
  416. if ($argument[0]=='node'){
  417. if( isset($argument[2]) && $argument[2]=='question'){
  418. $breadcrumb[1] = l('Solution Bucket', 'questions/all');
  419. $breadcrumb[2] = l('Ask a new question', 'node/add/question');
  420. }
  421. }
  422. if ($argument[0]=='questions' ){
  423. if(isset($argument[1]) && $argument[1]=='all'){
  424. $breadcrumb[0] = l('Home','<front>',array('attributes' => array('class' => array('home'),'title' => 'Home')));
  425. $breadcrumb[1] = l('Solution Bucket', 'questions/all');
  426. $breadcrumb[2] = l('View all questions', 'questions/all');}
  427. }
  428. if ($argument[0]=='questions' ){
  429. if(isset($argument[1])&& $argument[1]=='unanswered'){
  430. $breadcrumb[1] = l('Solution Bucket', 'questions/all');
  431. $breadcrumb[2] = l('View unanswered questions', 'questions/unanswered');
  432. }
  433. }
  434. if ($argument[0]=='questions'){
  435. if(isset($argument[1])&& $argument[1]=='search'){
  436. $breadcrumb[1] = l('Solution Bucket', 'questions/all');
  437. $breadcrumb[2] = l('Search for a question', 'questions/search');
  438. }
  439. }
  440. if($argument[0]=='questions'){
  441. if(!isset($argument[1])){
  442. $breadcrumb[1] = l('Solution Bucket', 'questions/all');
  443. $breadcrumb[2] = l('All Questions', 'questions');
  444. }
  445. }
  446. if ($argument[0]=='node'){
  447. if( isset($argument[2]) && $argument[2]=='announcement'){
  448. $breadcrumb[1] = l('Announcements', 'node/44');
  449. $breadcrumb[2] = l('Create', 'node/add/announcement');
  450. }
  451. }
  452. if ($argument[0]=='announcement'){
  453. $breadcrumb[1] = l('Announcements', 'node/44');
  454. $breadcrumb[2] = l('View', 'announcement');
  455. }
  456. if ($argument[0]=='node'){
  457. if( isset($argument[2]) && $argument[2]=='events'){
  458. $breadcrumb[1] = l('Events', 'node/45');
  459. $breadcrumb[2] = l('Create', 'node/add/events');
  460. }
  461. }
  462. if ($argument[0]=='events'){
  463. $breadcrumb[1] = l('Events', 'node/45');
  464. $breadcrumb[2] = l('View', 'events');
  465. }
  466. if ($argument[0]=='notifications'){
  467. $breadcrumb[1] = l('Notifications', 'notifications');
  468. }
  469. if ($argument[0]=='node'){
  470. if( isset($argument[2]) && $argument[2]=='add-item'){
  471. $breadcrumb[1] = l('Market Place', 'node/38');
  472. $breadcrumb[2] = l('Add an Item', 'node/add/add-item');
  473. }
  474. }
  475. if ($argument[0]=='node'){
  476. if( isset($argument[2]) && $argument[2]=='request-item'){
  477. $breadcrumb[1] = l('Market Place', 'node/38');
  478. $breadcrumb[2] = l('Request an Item', 'node/add/request-item');
  479. }
  480. }
  481. if ($argument[0]=='items-wanted'){
  482. $breadcrumb[1] = l('Market Place', 'node/38');
  483. $breadcrumb[2] = l('Items Required', 'items-wanted');
  484. }
  485. if ($argument[0]=='items-for-sale'){
  486. $breadcrumb[1] = l('Market Place', 'node/38');
  487. $breadcrumb[2] = l('Items for Sale', 'items-for-sale');
  488. }
  489. if ($argument[0]=='freebies'){
  490. $breadcrumb[1] = l('Market Place', 'node/38');
  491. $breadcrumb[2] = l('Freebies', 'freebies');
  492. }
  493. if ($argument[0]=='all-items'){
  494. $breadcrumb[1] = l('Market Place', 'node/38');
  495. $breadcrumb[2] = l('All Items', 'all-items');
  496. }
  497. if ($argument[0]=='your-item'){
  498. $breadcrumb[1] = l('Market Place', 'node/38');
  499. $breadcrumb[2] = l('Your Items', 'your-item');
  500. }
  501. if(!empty($breadcrumb)){
  502. $output = '<div class="breadcrumb">' . implode('&raquo; ', $breadcrumb) . '</div>';
  503. return $output;
  504. }
  505. }