###################### 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
...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(...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 zwischenCMS-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<