###################### office_run.txt $ACCOUNT{nr}=$__usernr; $base=$ACCOUNT{uid}; $sid=$ACCOUNT{sid}; ###################### sub bei123_ajax_loading {#---------------------------------- my $__time=time(); @REF=(split("baseportal.pl",$ref)); $BP{(split "=",$_)[0]}=(split "=",$_)[1] for (split "&",$REF[1]); $__load="$REF[0]baseportal.pl?htx=$BP{htx}&uid=$BP{uid}&sid=$BP{sid}"; $__in = get "$__load"; out "".datum($__time,"Wochentag, Tag0.Monat0.Jahr - Stunde:Minute").""; # online aktualisieren $__out ="http://baseportal.de/cgi-bin/baseportal.pl?htx=/bei123/Office/Office_Check_Online&user=$BP{uid}&u_sid=$BP{sid}&u_htx=$htx&u_time=$__time&cmd=online"; $__in = get "$__out"; }#---------------------------------- ######################################################################################################## # Variablen $wait = ""; # hpcload.gif $load = ""; $xp = ""; $pic_cms = ""; $pic_bp = ""; $pic_return = ""; $pic_edit_modul=""; $pic_save_page=""; $pic_1 = "\"\""; $pic_fav = ""; #------------------------------------------------------------------------------- $pic_edit_page=""; $pic_edit_cms=""; $pic_bp_ico="\"\""; $pic_back="\"\""; $pic_check="\"\""; #$pic_check=''; $pic_goto="\"\""; $pic_activ="\"\""; $pic_nopage="\"\""; $pic_goto="\"\""; $pic_cms_data="\"\""; ########## $omover_link="this.style.textDecoration='underline'"; $omout_link ="this.style.textDecoration='none'"; ######## sub bei123_cms_def {#----------------------------------------------------------------------------------------- Field-Hash @Data_type{@{$data{Id}}} = @{$data{Data_type}}; @Data_no{@{$data{Id}}} = @{$data{Data_no}}; @Data_out{@{$data{Id}}} = @{$data{Data_out}}; @Data_subdef{@{$data{Id}}} = @{$data{Data_subdef}}; @Data_content{@{$data{Id}}} = @{$data{Data_content}}; @Data_hidden{@{$data{Id}}} = @{$data{Data_hidden}}; @Data_name{@{$data{Id}}} = @{$data{Data_name}}; @Data_date{@{$data{Id}}} = @{$data{Data_date}}; #@Data_Id{@{$data{Id}}} = @{$data{Id}}; #----------------------------------------------------------------------------------------- Referenz my %bei123_cms = (Id =>\%{$data{_fnr}},type =>\%{$data{type}}); my $for=\%bei123_cms; #-------------------------------------------------------------------------------------------------- # Data_type=Modul ################# %_Mn=map{${$data{Data_name}}[$for->{Id}{$_}] => $_}grep($Data_type{$_} eq "Modul", keys(%Data_type)); %_Mi=map{$_ => ${$data{Data_name}}[$for->{Id}{$_}]}grep($Data_type{$_} eq "Modul", keys(%Data_type)); #------------------------------------------------------------------------------------ Hasch von _MODUL %_MODUL=(%_Mn,%_Mi); # Data_type=Layout ################## %_Ln=map{${$data{Data_name}}[$for->{Id}{$_}] => $_}grep($Data_type{$_} eq "Layout", keys(%Data_type)); %_Li=map{$_ => ${$data{Data_name}}[$for->{Id}{$_}]}grep($Data_type{$_} eq "Layout", keys(%Data_type)); #------------------------------------------------------------------------------------ Hasch von _LAYOUT %_LAYOUT=(%_Ln,%_Li); # Data_type=Page ################ %_Pn=map{${$data{Data_name}}[$for->{Id}{$_}] => $_}grep($Data_type{$_} eq "Page", keys(%Data_type)); %_Pi=map{$_ => ${$data{Data_name}}[$for->{Id}{$_}]}grep($Data_type{$_} eq "Page", keys(%Data_type)); #------------------------------------------------------------------------------------ Hasch von _PAGE %_PAGE=(%_Pn,%_Pi); #----------------------------------------------------------------- Data_name->Id oder Id->Data_name %Data_subdir=map{$_ => [(split "\n","${$data{Data_subdef}}[$for->{Id}{$_}]")]} grep($Data_type{$_} eq "Page", keys(%Data_type)); ######################################################################################################## # Falls über eine UserDatei Rechte vergeben wurden (Data_no="-2" = Seite nur für User mit dem Recht) #@page_right=sort(grep($Data_type{$_} eq "Page" && $Data_no{$_}==-2, keys(%Data_type))); #------------------------------------------------------------------------------------ Array right pages #foreach(@page_right) #{ #delete $Data_type{$_} if($USERRIGHT{$Data_name{$_}} eq ""); # UserRechte(Page) #} ######################################################################################################## #------------------------------------------------------------------------------------ Array main pages @page_main =sort{$Data_no{$a} <=> $Data_no{$b}}(grep($Data_type{$_} eq "Page" && $Data_no{$_}>0, keys(%Data_type))); #------------------------------------------------------------------------------------ sitemap prepare map{&bei123_mapping($_,$i)}@page_main; map{&bei123_fromdir($_,$_)}(keys(%_Pi)); %Pn=map{${$pagemap{$_}}[0] => ${$pagemap{$_}}[1]}keys(%pagemap); %Pi=map{${$pagemap{$_}}[1] => ${$pagemap{$_}}[0]}keys(%pagemap); %PAGE=(%Pn,%Pi); # nur Data_type=Page, die in eine sitemap-Struktur eingebunden sind #---------------------------------------------------------------------------------------------------- }################ sub bei123_fromdir {################# my ($x1,$y1)=@_; unshift(@{$pathfrom{$x1}},$y1); &bei123_fromdir($x1,$PAGE_upid{$_Pi{$y1}}) if($PAGE_upid{$_Pi{$y1}} ne ""); }################# sub bei123_mapping {################# $i=$_[1]+1; $x=$y; $pagemap{$i}=[$Data_name{$_[0]},$_[0],$x]; #------------------------------------------- foreach(@{$Data_subdir{$_[0]}}) { if(@{$Data_subdir{$_[0]}}>0) { if($_PAGE{$_} ne "") { $y=$y+1; &bei123_mapping($_PAGE{$_},$i++); $y=$y-1; } } } #----------------------------------------- }################# &bei123_cms_def(); sub AJAX_MENU {## my $p1 = $_[1]; my $p2 = $_[2]; my $p3 = $_[3]||"  "; #----------------------------- $menu_ = join("",(map{&AJAX_LINK($_[0],$_,"P1=$p1&P2=$p2","","","","").($_ ne "" ? "$p3":"")}($_[1] eq "" ? @page_main : map{$_PAGE{$_}} @{$Data_subdir{$_[1]}}))); $menu_ = "baseportal-Office ::: www.bei123.de ::: Webmaster H.Fehde " if($_[0] eq ""); return("$menu_  "); }## sub AJAX_LINK {## ----------------------------------------------------------- Funktion: neues Div öffnen my($ddiv,$did,$wp,$wm,$wjs,$wcss,$wt,$dfn)=@_; #------------------------------------------------- Parameter #1. $ddiv = DO Name des zu öffenenden Div, #2. $wnn = LinkText, #3. $wp = Parameter z.b. "wert1=16&eingabe=Halo" #4. $wm = Modul #5. $wjs = js-Routinen übernehmen #6. $wcss = CSS-Style des OpenLinks #7. $wt = title #8. $dfn = FunktionsSeite #-------------------------------------------------- if($dfn ne "") {#-------------- falls ModulSeite $wnn=$did; $did=$dfn; } else {#-------------- normale CMS-Page $wnn=$_PAGE{$did}||$did; $wnn=convert_html($wnn); } $wt=convert_html($wt); $wp=(convert_html($wp)); #--------------------------------------------------------------- $fw=($ddiv eq "MENU1" || $wnn eq $sub ? "bold":"normal"); # font-weight $fs=($ddiv eq "MENU1" ? "0.91em":"0.81em"); # font-size $wc=($did eq $ID ? "color:#d80000;font-weight:bold;cursor:pointer;font-size:$fs;font-weight:bold" : "color:#191970;cursor:pointer;font-size:$fs;font-weight:$fw"); $wcss = $wcss||$wc; #-------------------------------------------------------------------------------------------------------- $wt_ = "Routine [$_PAGE{$did}] aufrufen"; $wt = $wt||$wt_; #--------------------------------------------------------- onMouse my $ajax_link="$wnn"; return($ajax_link); }## sub AJAX_BUTTON {## ----------------------------------------------------------- Funktion: neues Div öffnen my($ddiv,$did,$wp,$wm,$wjs,$wt,$button_text)=@_; #------------------------------------------------- Parameter #1. $ddiv = DO Name des zu öffenenden Div, #2. $did = ID der geforderten Page #3. $wp = Parameter z.b. "wert1=16&eingabe=Halo" #4. $wm = Modul #5. $wjs = js-Routinen übernehmen #6. $wt = Button title #7. $button_text #------------------------------------------------- css $bcss="font-size:11px;height:22px;color:#000000;font-weight:normal"; #------------------------------------------------- my $ajax_button=""; return($ajax_button); }## sub MENU1 {#----------------------------- Aufruf des Hauptmenüs my $Menu1=&AJAX_MENU("MENU1","$P1","","","","","",""); my $Menu2=&AJAX_MENU("MENU2","$ID","","","","","",""); out(qq|document.getElementById("CT").innerHTML="$wait";|);#---- blupp-gimmik out(qq|document.getElementById("MENU2").innerHTML="$Menu2";|); out(qq|document.getElementById("MENU1").innerHTML="$Menu1";|); #------------------------------ eval-Anzeige des CONTENT
out(qq|CT("ID=$ID");|); } sub MENU2 {#------------------------------ Aufruf des Sub-Menüs my $Menu2=&AJAX_MENU("MENU2","$P1","","","","","",""); out(qq|document.getElementById("CT").innerHTML="$wait";|);#---- blupp-gimmik out(qq|document.getElementById("MENU2").innerHTML="$Menu2";|); #------------------------------ eval-Anzeige des CONTENT
out(qq|CT("ID=$ID");|); } sub BUTTON_MENU {#------------------------------------------- Aus Array von Pagenamen Menübuttons + BackButton generieren my @MENU=@_; #----------- die Buttons @_menu=map{qq()}@MENU; #----------- Back-Button my $back_button=qq() if($CID ne ""); #-------------- return("@_menu$back_button"); }# sub bei123_page_exists {#----------------------------- Prüfen, ob PAGE schon definiert my $valuepage=$_[0]; my $existing_page="no"; $existing_page="yes" if exists $_PAGE{$valuepage}; return($existing_page); }# sub bei123_button_picture {#----------------------------- Bild auf Button ändern my $_button_picture=($_PAGE{$_[0]} eq "$mDID" ? $pic_activ : $pic_goto); $_button_picture=$pic_nopage unless(exists $_PAGE{$_[0]}); return($_button_picture); }# sub bei123_button_color {#----------------------------- Button-TextFarbe ändern my $_button_color=($_PAGE{$_[0]} eq "$mDID" ? "#d80000":"#191970"); $_button_color="#000000" unless(exists $_PAGE{$_[0]}); return($_button_color); }# sub AJAX_MODUL {##-------------------------------------------------------------------------- Module ausführen my $ajax_sub="$_[0]"; if($_[0] eq "") { out "Modul $_[0] nicht angegeben"; } else { &$ajax_sub(); } }## sub Data_content {## --------------------------------------------------------- Formular Feld Modul(Data_content) if($cmd eq "all") { &CONTAINER($CID); &CONTAINER($DID); } elsif($cmd eq "mod") { #---------------------------------------------------------------------------------- mod "Id==!$DID", ["Data_content", convert_utf8($mod_Data_content)], "$CMS_DATA"; #---------------------------------------------------------------------------------- out qq(
); } elsif($cmd eq "do_mod") { #--------------------------------------------------------------------- $do_mod_Data_content=&AJAX_UMLAUT(convert_utf8($Data_content{$DID})); #--------------------------------------------------------------------- out<
Data_content($_PAGE{$DID}) bearbeiten EOF } else { #------------------------------------------------------------ outl "

...fehlende Daten, kein Befehl \$cmd vorhanden

"; #------------------------------------------------------------ } }#################### Ende Sub Data_content sub Data_subdef {##--------------------------------------------------------- Formular Feld Modul(Data_subdef) if($cmd eq "all") { &CONTAINER($CID); &CONTAINER($DID); } elsif($cmd eq "mod") { $mod_Data_subdef=&html2text($mod_Data_subdef) if($Data_type{$DID} eq "Page");# keine TAGS erlaubt #------------------------------------------------------------------------------------------------------ mod "Id==!$DID", ["Data_subdef", convert_utf8($mod_Data_subdef)], "$CMS_DATA"; #------------------------------------------------------------------------------------------------------ out qq(
); } elsif($cmd eq "do_mod") { #------------------------------------------------------------------- $do_mod_Data_subdef=&AJAX_UMLAUT(convert_utf8($Data_subdef{$DID})); #-------------------------------------------------------------------- out<
Data_subdef($_PAGE{$DID}) bearbeiten $cmd EOF } else { #------------------------------------------------------------ outl "

...fehlende Daten, kein Befehl \$cmd vorhanden

"; #------------------------------------------------------------ } }################### Ende Sub Data_subdef sub admin_menu_header {##-------------------------------------------------------------------------------- Buttons für ADMIN my $amh=""; #--------------- #$amh.=&AJAX_BUTTON("ajax_admin_function","$_MODUL{CMS_Datensatz}","DID=$ID&CID=$CID&cmd=do_mod","","","Page [$_PAGE{$ID}] bearbeiten","$pic_edit_page Page"); #------------- #$amh.=&AJAX_BUTTON("ajax_admin_function","CMS_Modul1","DID=$ID&CID=$CID&cmd=do_mod","Data_content","","Content [$_PAGE{$ID}] bearbeiten","$pic_edit_cms Content"); #------------ #$amh.=&AJAX_BUTTON("ajax_admin_function","CMS_Modul1","DID=$ID&CID=$CID&cmd=do_mod","Data_subdef","","Subdef [$_PAGE{$ID}] bearbeiten","$pic_edit_cms Subdef"); #------------ #$amh.=&AJAX_BUTTON("ajax_admin_function","$_PAGE{TEST2}","","Data_subdef","","Subdef [$_PAGE{$ID}] bearbeiten","$pic_bp Login"); #-------------------------------- return("$amh") ; }## sub ajax_admin_function {#---------------------------------------------------------------------- Buton&Funktionen für den ADMIN #out(qq|document.getElementById("CT").innerHTML="$wait";|); #------------------------------------------ Modul-Button #$modul_button=""; #------------------------------------------ Back-Button #$back_button=""; #------------------------------------------ Save-Button #$save_button=""; #------------------------------------------------------------------------------------------------------- #$dfn="$modul_button$back_button$save_button" if($cmd eq "do_mod"); #------------------------------------------------------------------------------------------------------- #out(qq|CT("ID=$ID&cmd=$cmd&DID=$DID&CID=$CID&MD=$MD&cmd=$cmd&existing_page=$existing_page");|); #out(qq|CT("ID=$ID&cmd=$cmd&DID=$DID&CID=$CID&MD=$MD&cmd=$cmd");|); #out(qq|document.getElementById("ADMIN").innerHTML="$dfn";|); }## sub eval_out_ajax {#---------------------------------------------------- Perl-Code zwischen direkt ausführen $eval_cnt=$_[0]; $ist1 =""; $soll1 ="EOF"; $ist2 =""; $soll2 ="out< falls Page vorhanden my $dfn=""; if($existing_page ne "no") {#------------------------ Admin-Menü nur anzeigen, wenn Page existent $dfn=&admin_menu_header(); } else {#------------------------ $dfn=" - Page noch nicht definiert !!"; } #----------------------------------------------------------- out(qq|document.getElementById("ADMIN").innerHTML="$dfn";|); #------------------------------------------ eval Subroutine out &$DIV($DIV) if($DIV ne ""); }## sub CONTAINER { #----------------------------------------------- durch ID-Übergabe Datensatz-Code direkt ausführen $ID=$_[0]; my $eval_cnt=""; #----------------------- if($ID eq "CMS_Modul1") {#--------------------------------------------------- internes CMS_MODUL1 $mDID=$DID; &AJAX_MODUL($MD); #----------------- out qq(
  • Page ${\html2text($page_exist)} wurde (bisher) NICHT definiert !
) if($existing_page eq "no" ); } else {#--------------------------------------------------- kein internes CMS_MODUL1 if($_[1] eq "" or $_[1] eq "Data_content") {#---------------------------------------------- $eval_cnt="${\AJAX_UMLAUT($Data_content{$ID})}"; } else {#----------------------------------------------- my $cms_field=$_[1]; #------------------------------------------------ $eval_cnt="${\AJAX_UMLAUT($$cms_field{$ID})}"; #------------------------------------------------ #$eval_cnt="

CMS-Field Page $_[0] nicht definiert

" if($$cms_field{$ID} eq ""); } #------------------------- &eval_out_ajax("$eval_cnt"); #-------------------------------------------- Page normal anzeigen } }########################### #-------------------------------------------------------------------------- nützliche Routinen sub html2text {############ entfernt html-tags und gibt nur Text ohne HTML zurück my $html=$_[0]; ($text = $html) =~ s/<(\/|!)?[-.a-zA-Z0-9]*.*?>//g; return($text); }############# ############################################################### out< $ACCOUNT{uid}-Office 1.0| Alles aus baseportal herausholen: www.bei123.de
EOF #####################################################