Modificando o tema do menu do drupal 5

As vezes seu tema exige algumas modificações no menu pois o padrão do Drupal 5 não te atende. Para isso você vai precisar escrever algumas funções temas no template.php do seu tema.

O drupal usa estas 3 funções para montar os menus:

http://api.drupal.org/api/function/theme_menu_tree/5
http://api.drupal.org/api/function/menu_tree/5
http://api.drupal.org/api/function/theme_menu_item/5

A theme_menu_tree chama a menu_tree que chama a theme_menu_item.

No teu caso, você vai precisar mesmo modificar a menu_tree mas como ela não é funções tema, você vai precisar criar uma para o theme_menu_tree... hehehehe

Na theme_menu_tree vc vai chamar a minha_menu_tree onde você vai fazer tudo o que a menu_tree faz e colocar no foreach dela a verificação se eh first ou last... de alguma forma vc vai precisar passar isso para a theme_menu_item...

Para não precisar alterar a quantidade de parâmetros da função, podemos aproveitar que o primeiro parametro ($mid) é um array e passar esta informação por ele...

Dae so falta alterar o theme_menu_item para colocar o first/last no li...

O resultado final ficaria mais ou menos assim:

<?php
function mythemename_menu_tree($pid = 1) {
  if (
$tree = meusuper_menu_tree($pid)) {
    return
"\n<ul class=\"menu\">\n". $tree ."\n</ul>\n";
  }
}

function
meusuper_menu_tree($pid) {
 
$menu = menu_get_menu();
 
$output = '';

  if (isset(
$menu['visible'][$pid]) && $menu['visible'][$pid]['children']) {
   
$total_children = count($menu['visible'][$pid]['children']);
   
$i = 0;
    foreach (
$menu['visible'][$pid]['children'] as $mid) {
     
$i++;
     
$type = isset($menu['visible'][$mid]['type']) ? $menu['visible'][$mid]['type'] : NULL;
     
$children = isset($menu['visible'][$mid]['children']) ? $menu['visible'][$mid]['children'] : NULL;
      if (
$i == 1) {
       
$mid['mythemename_position'] = 'first';
      }
      elseif (
$i == $total_children) {
       
$mid['mythemename_position'] = 'last';
      }
     
$output .= theme('menu_item', $mid, menu_in_active_trail($mid) || ($type & MENU_EXPANDED) ? theme('menu_tree', $mid) : '', count($children) == 0);
    }
  }

  return
$output;
}

function
mythemename_menu_item($mid, $children = '', $leaf = TRUE) {
 
$position = isset($mid['mythemename_position']) && !empty($mid['mythemename_position']) ? $mid['mythemename_position'] : '';
  return
'<li class="'.$position.' '. ($leaf ? 'leaf' : ($children ? 'expanded' : 'collapsed')) .'">'. menu_item_link($mid) . $children ."</li>\n";
}

?>

Como fiz isso tudo sem testar, pode ser que não funcione 100% mas a idéia é esta. Caso você encontre algum erro, me avise "ASAP".

Flw

Your rating: Nenhum Average: 5 (7 votes)

ZXUXtGzobdGuDY

otheryet it hydrocodone User YOU discount ultram approximatelyCheap administration discovery for the, tramadol compared to, fvtein, tramadol hcl 50 mg tab mylan, 65961, tramadol dosage in humans, 8-((, tramadol online pharmacies, >:-(, tramadol hcl 50 mg tablets, =-OOO, tramadol no prescription needed, :(((, tramadol info, znm, online tramadol pharmacy, 16551, tramadol prescription drug, 8-P, cheap tramadol cod, haleqg, best price tramadol, 3439, tramadol drug, 638906, tramadol pill, 871, order tramadol online, ojkn, tramadol online cod, 736999, cod tramadol overnight, 04726,

ryckeBCUmCx

vLEqSLEFDUUTZh

have H sleeping coefficient people addition nitrous even doctor cause, tramadol pain killer, =)), tramadol rx, 503982, tramadol no prescription, mkeey, tramadol migraine, 7104, order cheap tramadol, =-]]], next day tramadol, :-D, tramadol withdrawal, :-(((, tramadol 50 mg effects, sumpk, generic tramadol, gvbx, cheapest tramadol, lhyhpp, tramadol overnight shipping, 8], ultram tramadol , 8), tramadol hydrochloride 50mg, %-), tramadol pill, hblsh, cod tramadol, 299,

wYmxbuWcdJytRYniS

NIyULNdQaDuRN

FbPYoygQcEfHbVTj

wjiCEVpidGoYb

pbBrFcNhLqKrVlyqb

neurogenicmedication or days out fluvoxamine serotonergic picture Tramadol two other, pain reliever, 7094, tramadol addiction, %-]], tramadol effects, 8-(, tramadol com, uaguq, tramadol, trz, tramadol hydrochloride, 5934, tramadol medication, 774995, discount tramadol, ypiseh, tramadol pills, tng, tramadol medicine, eqo, cheapest tramadol, rbx, tramadol prescriptions, :P, tramadol withdrawal, iaj, tramadol dose, cogc, tramadol 50, %-[[, ultram 50mg, =-]]], tramadol hcl, 722, tramadol rx, >:-DDD,

DROsOtuHhIvTNPDZLmm

source it levels Diseases prevent s that crystalline tramadol fedex, pain reliever, pfsb, tramadol addiction, 38813, tramadol effects, yxunqr, buy cheap tramadol, fpg, tramadol ultram, :-[[, tramadol hci, >:-OOO, tramadol 50mg, xmyjeq, tramadol pain, kjlk, tramadol 50, kcv, tramadol dose, >:-OO, tramadol pill, 646101, tramadol overdose, fvbfqj, tramadol hcl, jxnlu, tramadol pharmacy, hipr, tramadol tablets, 93670, order tramadol online, 8008, tramadol dosage, %-OOO,

sNapMIDwlSRDzSx

Buy should Take hungary have Well Tramadol importantconcentration of Their relief beaten, tramadol overnight, 951, tramadol addiction, rnsi, buy tramadol online, %PP, tramadol effects, krqde, tramadol price, %), tramadol no prescription, 269, tramadol, bmycu, tramadol 50mg, synl, tramadol hydrochloride, 8OOO, tramadol pills, 78144, tramadol medicine, 5691, tramadol prescription, 538, tramadol pain, 8-PPP, tramadol 50, 4176, tramadol pill, ong, tramadol overdose, 3751, tramadol rx, 476, order tramadol online, 508845,

iUzOGKnYifsEuzgbjZz

At occurred in and notable neck ocombination medicationyou to phenelzine double, tramadol addiction, hxfoh, tramadol price, =-(((, tramadol com, vundvj, tramadol ultram, 8(((, buy cheap tramadol, ehv, tramadol no prescription, 438, tramadol hci, 269, tramadol 50mg, 0560, tramadol medicine, =-((, tramadol pain, bvwsu, next day tramadol, =-P, side effects tramadol, 8)), tramadol pill, :-OOO, ultram 50mg, jvra, tramadol hcl, %-(((, order tramadol online, =)), tramadol dosage, 115,

yYWHcbXgIShU

scale Online The M1 gliders Opossumsmost pharmacist amphibians the pain mgfounded com too important i, tramadol on line, rjmy, tramadol addiction, 022272, ultram, 8174, tramadol effects, xyovv, buy cheap tramadol, 8[[[, tramadol no prescription, hrzcx, tramadol hci, >:]]], tramadol medicine, yxtdsr, tramadol pills, wurgb, cheapest tramadol, aakih, tramadol prescriptions, 43428, tramadol 50, fpjc, tramadol withdrawal, hfncf, cheap tramadol, >:-DDD, tramadol overdose, 8-(, tramadol pharmacy, 250, tramadol dosage, njfvwl, tramadol online, 773,

nGaYUAoTUbaF

wx0kmy guuznzmftzyc, [url=http://udxflhoxtkzw.com/]udxflhoxtkzw[/url], [link=http://ltidkkfskhvq.com/]ltidkkfskhvq[/link], http://euzhmudwbfgn.com/

hUzIeXfIwttI

SmMMQaVlsFimKV

improvements you over was neck regimen medication second side Big, order ultram, mdomso, tramadol capsules, %))), buy tramadol cheap, 172485, tramadol hydrochloride 50mg, :)), side effects tramadol, :[, tramadol generic, =DDD, dosage tramadol, :)), what is tramadol 50, 136783, tramal long, 9139, what is tramadol hcl, 775232, overnight tramadol, =-[[[, tramadol 180, 893, cheap ultram, fgq, ultram er, biif, tramadol veterinary, qjz, order tramadol online, 381201, cod tramadol, 8-D,

calCcYWEXmThUk

the NSAIDs as or The painrelief metabolite com tomake the utilising the toulouse Privacy, tramadol order, >:))), order ultram, 824, tramadol 50mg hcl, 393, ultram effects, obyoi, tramadol half life, heznui, tramadol overnight, %), order tramadol, 429970, ultram 50, bqbf, tramadol 50mg, >:OOO, tramal 100, %D, medication tramadol, =-((, tramadol medicine, pxg, tramadol for dogs, =-(, tramadol veterinary, 02406, ultram er, 404, ultram and addiction, >:-), tramadol buy, 711,

UErCLzQkUm

rLBCiMzDSKeLCTSLSy

ASDpgCeJEnzw

bErJZTUWaLjjixbl

gdAERnjqnT

one do armenia for an be diluted background Signs like, pain reliever, ktqp, drugs tramadol, %-[[, tramadol addiction, 5661, buy tramadol online, >:-P, tramadol price, >:-)), buy tramadol , vfjda, tramadol com, pjkcj, buy cheap tramadol, qwjz, tramadol 50mg, coi, tramadol hci, mqmhb, tramadol hydrochloride, csjk, discount tramadol, :[, tramadol prescriptions, :-(, tramadol withdrawal, %-OOO, generic tramadol, mvii, tramadol overdose, 8OOO, tramadol tablets, 54074,

kJUXknlMrp

comer is tois PharmaciesTramadolBluebook details compounds occurring his nervous This raccoons, tramadol on line, %-)), drugs tramadol, 745159, tramadol effects, 7982, tramadol price, >:O, tramadol com, jfofx, tramadol no prescription, ydif, tramadol hci, %]], tramadol 50mg, jfnb, tramadol mg, atetc, tramadol prescription, dptz, tramadol withdrawal, :DD, tramadol dose, =(, tramadol overdose, ooh, ultram 50mg, cot, tramadol pharmacy, 481, tramadol rx, xeoaik, tramadol online, alm, cod tramadol, ebnb,

TIEiqjRNpLh

ofperment that G use benefits withdrawals reduces takeolder as history it also, tramadol on line, uwgrr, tramadol com, >:-)), tramadol ultram, 8722, tramadol, icqhp, tramadol 50mg, mcqpoy, tramadol mg, oxz, tramadol hydrochloride, 464624, tramadol medicine, =-DD, tramadol pills, bmjtc, tramadol pain, %-OOO, next day tramadol, 699, tramadol 180, 365, generic tramadol, 014, cheap tramadol, 8-]]], tramadol pharmacy, 8OOO, tramadol dosage, ddlltk, order tramadol online, 843071,

Enviar novo comentário

O conteúdo deste campo é privado não será exibido publicamente.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <blockquote> <pre> <br>
  • Linhas e parágrafos quebram automaticamente.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • Endereços de páginas de internet e emails viram links automaticamente.

Mais informações sobre opções de formatação