anpera.net https://anpera.dyndns.org/phpbb3/ |
|
Die Hotkeys https://anpera.dyndns.org/phpbb3/viewtopic.php?f=34&t=2512 |
Seite 1 von 1 |
Autor: | Andragor [ Mo 01 Mai, 2006 10:51 ] |
Betreff des Beitrags: | Die Hotkeys |
Hi ich habe folgendes Problem: Ich wollte gerade in meinem Logd die Hotkeys zuweisen, das ganze funktioniert aber nicht so wie ich mir das vorstelle ![]() wenn ich z.B. auf "B" die Bank haben will, dann definiere ich das ja folgenermaßen: [php]addnav("B?Die alte Bank","bank.php");[/php] Nur leider ist die Bank nicht auf B, da mein Logd das "B" automatis der Bibilothek zuweist, die etwas weiter oben steht [php]addnav("Stadtbibilothek","library.php");[/php] Jetzt ist die Frage, was ich machen kann, damit mein Logd die Hotkeys auch akzeptiert die ich definiere. Ich hoffe ihr könnt mir helfen thx Andragor |
Autor: | Harthas [ Mo 01 Mai, 2006 10:54 ] |
Betreff des Beitrags: | |
versuche es doch mal, indem du die Stadtbibliothek mit [php]addnav("S?Stadtbibilothek","library.php"); [/php] definierst... |
Autor: | Andragor [ Mo 01 Mai, 2006 10:57 ] |
Betreff des Beitrags: | |
*gg* die Tasten sind schon alle für Irgendwas vordefiniert .... ![]() Ich muss es irgedwie schaffen, dass einige navs keinen hotkey haben |
Autor: | Harthas [ Mo 01 Mai, 2006 10:58 ] |
Betreff des Beitrags: | |
hmm... das wäre wohl in der addnav() irgendwo..hab leider grad keine zugriff darauf..kann es mir also ned anschaun... EDIT: Es wird wohl irgendwo hier sein,*grübel* addnav() [php]function addnav($text,$link=false,$priv=false,$pop=false,$newwin=false){ global $nav,$session,$accesskeys,$REQUEST_URI,$quickkeys; $text = translate($text); /* if (date("m-d")=="04-01"){ $text = borkalize($text); } */ if ($link===false){ $nav.=templatereplace("navhead",array("title"=>appoencode($text,$priv))); }elseif ($link === "") { $nav.=templatereplace("navhelp",array("text"=>appoencode($text,$priv))); }else{ if ($text!=""){ $extra=""; if ($newwin===false) { if (strpos($link,"?")){ $extra="&c=$session[counter]"; }else{ $extra="?c=$session[counter]"; } } if ($newwin===false) $extra.="-".date("His"); //$link = str_replace(" ","%20",$link); //hotkey for the link. $key=""; if (substr($text,1,1)=="?") { // check to see if a key was specified up front. if ($accesskeys[strtolower(substr($text, 0, 1))]==1){ // output ("key ".substr($text,0,1)." already taken`n"); $text = substr($text,2); }else{ $key = substr($text,0,1); $text = substr($text,2); //output("key set to $key`n"); $found=false; for ($i=0;$i<strlen($text); $i++){ $char = substr($text,$i,1); if ($ignoreuntil == $char){ $ignoreuntil=""; }else{ if ($ignoreuntil<>""){ if ($char=="<") $ignoreuntil=">"; if ($char=="&") $ignoreuntil=";"; if ($char=="`") $ignoreuntil=substr($text,$i+1,1); }else{ if ($char==$key) { $found=true; break; } } } } if ($found==false) { if (strpos($text, "__") !== false) $text=str_replace("__", "(".$key.") ", $text); else $text="(".strtoupper($key).") ".$text; $i=strpos($text, $key); // output("Not found`n"); } } // } if ($key==""){ for ($i=0;$i<strlen($text); $i++){ $char = substr($text,$i,1); if ($ignoreuntil == $char) { $ignoreuntil=""; }else{ if (($accesskeys[strtolower($char)]==1) || (strpos("abcdefghijklmnopqrstuvwxyz0123456789", strtolower($char)) === false) || $ignoreuntil<>"") { if ($char=="<") $ignoreuntil=">"; if ($char=="&") $ignoreuntil=";"; if ($char=="`") $ignoreuntil=substr($text,$i+1,1); }else{ break; } } } } if ($i<strlen($text)){ $key=substr($text,$i,1); $accesskeys[strtolower($key)]=1; $keyrep=" accesskey=\"$key\" "; }else{ $key=""; $keyrep=""; } //output("Key is $key for $text`n"); if ($key==""){ //$nav.="<a href=\"".HTMLEntities($link.$extra)."\" class='nav'>".appoencode($text,$priv)."<br></a>"; //$key==""; // This is useless }else{ $text=substr($text,0,strpos($text,$key))."`H".$key."`H".substr($text,strpos($text,$key)+1); if ($pop){ $quickkeys[$key]=popup($link.$extra); }else{ $quickkeys[$key]="window.location='$link$extra';"; } } $nav.=templatereplace("navitem",array( "text"=>appoencode($text,$priv), "link"=>HTMLEntities($link.$extra), "accesskey"=>$keyrep, "popup"=>($pop==true ? "target='_blank' onClick=\"".popup($link.$extra)."; return false;\"" : ($newwin==true?"target='_blank'":"")) )); //$nav.="<a href=\"".HTMLEntities($link.$extra)."\" $keyrep class='nav'>".appoencode($text,$priv)."<br></a>"; } $session[allowednavs][$link.$extra]=true; $session[allowednavs][str_replace(" ", "%20", $link).$extra]=true; $session[allowednavs][str_replace(" ", "+", $link).$extra]=true; } } [/php] |
Autor: | Andragor [ Mo 01 Mai, 2006 22:36 ] |
Betreff des Beitrags: | |
Danke, werds mir morgen mal anschauen und hoff dann das ich das ganze auch raffe ![]() |
Seite 1 von 1 | Alle Zeiten sind UTC + 1 Stunde |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |