app->Tpl->Add('JQUERYREADY', "$('#onlyde').click( function() { fnFilterColumn1( 0 ); } );");
$this->app->Tpl->Add('JQUERYREADY', "$('#onlyen').click( function() { fnFilterColumn2( 0 ); } );");
$this->app->Tpl->Add('JQUERYREADY', "$('#onlyonline').click( function() { fnFilterColumn3( 0 ); } );");
$this->app->Tpl->Add('JQUERYREADY', "$('#onlyoffline').click( function() { fnFilterColumn4( 0 ); } );");
$this->app->Tpl->Add('JQUERYREADY', "$('#onlyhtml').click( function() { fnFilterColumn5( 0 ); } );");
$this->app->Tpl->Add('JQUERYREADY', "$('#onlyemail').click( function() { fnFilterColumn6( 0 ); } );");
$this->app->Tpl->Add('JQUERYREADY', "$('#onlygroups').click( function() { fnFilterColumn7( 0 ); } );");
$this->app->Tpl->Add('JQUERYREADY', "$('#onlyteaser').click( function() { fnFilterColumn8( 0 ); } );");
$this->app->Tpl->Add('JQUERYREADY', "$('#onlynews').click( function() { fnFilterColumn9( 0 ); } );");
for ($r = 1;$r < 10;$r++) {
$this->app->Tpl->Add('JAVASCRIPT', '
function fnFilterColumn' . $r . ' ( i )
{
if(oMoreData' . $r . $name . '==1)
oMoreData' . $r . $name . ' = 0;
else
oMoreData' . $r . $name . ' = 1;
$(\'#' . $name . '\').dataTable().fnFilter(
\'\',
i,
0,0
);
}
');
}
// ENDE EXTRA CHECKBOXEN
$heading = array('Inhalts-ID', 'Typ', 'Sprache', 'Shop', 'Erstellt', 'Sichtbar bis', 'Status', 'Menü');
$width = array('10%', '10%', '1%', '15%', '10%', '10%', '7%', '10%');
$findcols = array('inhalt', 'inhaltstyp', 'sprache', 'shop', 'datum', 'sichtbarbis', 'aktiv', 'id');
$searchsql = array('i.inhalt', 'i.inhaltstyp', 's.bezeichnung', 'i.datum', 'i.sichtbarbis');
$menu = "app->Conf->WFconf['defaulttheme']}/images/edit.svg\" border=\"0\">" . " " . "app->Conf->WFconf['defaulttheme']}/images/delete.svg\" border=\"0\">" . " app->Conf->WFconf['defaulttheme']}/images/copy.svg\" border=\"0\">";
$sql = "SELECT SQL_CALC_FOUND_ROWS i.id, i.inhalt, i.inhaltstyp, i.sprache, s.bezeichnung AS shop, i.datum, DATE(i.sichtbarbis) as sichtbarbis,
IF(i.aktiv=1,'ONLINE','OFFLINE') AS aktiv, i.id
FROM inhalt AS i LEFT JOIN shopexport AS s ON s.id=i.shop ";
$subwhere = array();
$more_data1 = $this->app->Secure->GetGET("more_data1");
if ($more_data1 == 1) $subwhere[] = " i.sprache='de' ";
$more_data2 = $this->app->Secure->GetGET("more_data2");
if ($more_data2 == 1) $subwhere[] = " i.sprache='en' ";
$more_data3 = $this->app->Secure->GetGET("more_data3");
if ($more_data3 == 1) $subwhere[] = " i.aktiv=1 ";
$more_data4 = $this->app->Secure->GetGET("more_data4");
if ($more_data4 == 1) $subwhere[] = " i.aktiv=1 ";
$more_data5 = $this->app->Secure->GetGET("more_data5");
if ($more_data5 == 1) $subwhere[] = " i.inhaltstyp='page' ";
$more_data6 = $this->app->Secure->GetGET("more_data6");
if ($more_data6 == 1) $subwhere[] = " i.inhaltstyp='email' ";
$more_data7 = $this->app->Secure->GetGET("more_data7");
if ($more_data7 == 1) $subwhere[] = " i.inhaltstyp='group' ";
$more_data8 = $this->app->Secure->GetGET("more_data8");
if ($more_data8 == 1) $subwhere[] = " i.inhaltstyp='teaser' ";
$more_data9 = $this->app->Secure->GetGET("more_data9");
if ($more_data9 == 1) $subwhere[] = " i.inhaltstyp='news' ";
$tmp = '';
if(!empty($subwhere)){
foreach($subwhere as $s) {
$tmp .= ' AND '.$s;
}
}
$where = "i.id $tmp";
$count = "SELECT COUNT(i.id) FROM inhalt i";
$moreinfo = false;
break;
case 'inhaltsseitenshop':
$allowed['inhalt'] = array('listshop');
// EXTRA CHECKBOXEN
$this->app->Tpl->Add('JQUERYREADY', "$('#onlyde').click( function() { fnFilterColumn1( 0 ); } );");
$this->app->Tpl->Add('JQUERYREADY', "$('#onlyen').click( function() { fnFilterColumn2( 0 ); } );");
$this->app->Tpl->Add('JQUERYREADY', "$('#onlyonline').click( function() { fnFilterColumn3( 0 ); } );");
$this->app->Tpl->Add('JQUERYREADY', "$('#onlyoffline').click( function() { fnFilterColumn4( 0 ); } );");
$this->app->Tpl->Add('JQUERYREADY', "$('#onlyhtml').click( function() { fnFilterColumn5( 0 ); } );");
$this->app->Tpl->Add('JQUERYREADY', "$('#onlyemail').click( function() { fnFilterColumn6( 0 ); } );");
$this->app->Tpl->Add('JQUERYREADY', "$('#onlygroups').click( function() { fnFilterColumn7( 0 ); } );");
$this->app->Tpl->Add('JQUERYREADY', "$('#onlyteaser').click( function() { fnFilterColumn8( 0 ); } );");
$this->app->Tpl->Add('JQUERYREADY', "$('#onlynews').click( function() { fnFilterColumn9( 0 ); } );");
for ($r = 1;$r < 10;$r++) {
$this->app->Tpl->Add('JAVASCRIPT', '
function fnFilterColumn' . $r . ' ( i )
{
if(oMoreData' . $r . $name . '==1)
oMoreData' . $r . $name . ' = 0;
else
oMoreData' . $r . $name . ' = 1;
$(\'#' . $name . '\').dataTable().fnFilter(
\'\',
i,
0,0
);
}
');
}
// ENDE EXTRA CHECKBOXEN
$heading = array('Inhalts-ID', 'Typ', 'Sprache', 'Erstellt', 'Sichtbar bis', 'Status', 'Menü');
$width = array('10%', '10%', '1%', '10%', '10%', '7%', '10%');
$findcols = array('inhalt', 'inhaltstyp', 'sprache', 'datum', 'sichtbarbis', 'aktiv', 'id');
$searchsql = array('i.inhalt', 'i.inhaltstyp', 's.bezeichnung', 'i.datum', 'i.sichtbarbis');
$menu = "app->Conf->WFconf['defaulttheme']}/images/edit.svg\" border=\"0\">" . " " . "app->Conf->WFconf['defaulttheme']}/images/delete.svg\" border=\"0\">" . " app->Conf->WFconf['defaulttheme']}/images/copy.svg\" border=\"0\">";
$sql = "SELECT SQL_CALC_FOUND_ROWS i.id, i.inhalt, i.inhaltstyp, i.sprache, i.datum, DATE(i.sichtbarbis) as sichtbarbis,
IF(i.aktiv=1,'ONLINE','OFFLINE') AS aktiv, i.id
FROM inhalt AS i LEFT JOIN shopexport AS s ON s.id=i.shop ";
$subwhere = array();
$more_data1 = $this->app->Secure->GetGET("more_data1");
if ($more_data1 == 1) $subwhere[] = " i.sprache='de' ";
$more_data2 = $this->app->Secure->GetGET("more_data2");
if ($more_data2 == 1) $subwhere[] = " i.sprache='en' ";
$more_data3 = $this->app->Secure->GetGET("more_data3");
if ($more_data3 == 1) $subwhere[] = " i.aktiv=1 ";
$more_data4 = $this->app->Secure->GetGET("more_data4");
if ($more_data4 == 1) $subwhere[] = " i.aktiv=1 ";
$more_data5 = $this->app->Secure->GetGET("more_data5");
if ($more_data5 == 1) $subwhere[] = " i.inhaltstyp='page' ";
$more_data6 = $this->app->Secure->GetGET("more_data6");
if ($more_data6 == 1) $subwhere[] = " i.inhaltstyp='email' ";
$more_data7 = $this->app->Secure->GetGET("more_data7");
if ($more_data7 == 1) $subwhere[] = " i.inhaltstyp='group' ";
$more_data8 = $this->app->Secure->GetGET("more_data8");
if ($more_data8 == 1) $subwhere[] = " i.inhaltstyp='teaser' ";
$more_data9 = $this->app->Secure->GetGET("more_data9");
if ($more_data9 == 1) $subwhere[] = " i.inhaltstyp='news' ";
$tmp = '';
if(!empty($subwhere)) {
foreach($subwhere as $s)
{
$tmp .= ' AND '.$s;
}
}
$shop = $this->app->Secure->GetGET('id');
$where = "i.id AND i.shop='$shop' $tmp";
$count = "SELECT COUNT(i.id) FROM inhalt i WHERE i.shop='$shop'";
$moreinfo = false;
break;
}
$erg = [];
foreach($erlaubtevars as $k => $v)
{
if(isset($$v))
{
$erg[$v] = $$v;
}
}
return $erg;
}
function __construct($app, $intern = false) {
$this->app=$app;
if($intern) {
return;
}
$this->app->ActionHandlerInit($this);
$this->app->ActionHandler("create","InhaltCreate");
$this->app->ActionHandler("edit","InhaltEdit");
$this->app->ActionHandler("list","InhaltList");
$this->app->ActionHandler("delete","InhaltDelete");
$this->app->ActionHandler("listshop","InhaltListShop");
$this->app->ActionHandlerListen($app);
}
function InhaltCreate()
{
$this->app->Tpl->Set('UEBERSCHRIFT',"Inhalt anlegen");
$this->app->erp->Headlines('Inhalt anlegen');
$this->app->erp->MenuEintrag("index.php?module=inhalt&action=list","Zurück zur Übersicht");
$inhaltstyp = $this->app->Secure->GetPOST('inhaltstyp');
$shop = $this->app->Secure->GetPOST('shop');
$inhalt = $this->app->Secure->GetPOST('inhalt');
$sprache = $this->app->Secure->GetPOST('sprache');
$aktiv = $this->app->Secure->GetPOST('aktiv');
$template = $this->app->Secure->GetPOST('template');
$finalparse = $this->app->Secure->GetPOST('finalparse');
$navigation = $this->app->Secure->GetPOST('navigation');
$datum = $this->app->Secure->GetPOST('datum');
$sichtbarbis = $this->app->Secure->GetPOST('sichtbarbis');
$title = $this->app->Secure->GetPOST('title');
$kurztext = $this->app->Secure->GetPOST('kurztext');
$html = $this->app->Secure->GetPOST('html');
$description = $this->app->Secure->GetPOST('description');
$keywords = $this->app->Secure->GetPOST('keywords');
$saveform = $this->app->Secure->GetPOST('saveform');
$submit = $this->app->Secure->GetPOST('inhalt_submit');
if($submit!='' && $saveform=='1') {
$shopid = $this->app->DB->Select("SELECT id FROM shopexport WHERE bezeichnung='$shop' LIMIT 1");
$error = "";
if(trim($shop)=='') $error .= "Wählen sie bitte einen Online-Shop aus
";
if(trim($inhalt)=='') $error.= 'Geben Sie bitte einen internen Bezeichner ein';
else {
$exists = $this->app->DB->Select("SELECT '1' FROm inhalt WHERE inhalt='$inhalt' AND sprache='$sprache' AND shop='$shopid' LIMIT 2");
if($exists=='2') $error .= 'Der eingegebene Bezeichner wird bereits verwendet
';
}
if($error=='') {
$datum_new = $this->app->erp->ReplaceDatum(true, $datum);
$sichtbarbis_new = $this->app->erp->ReplaceDatum(true, $sichtbarbis);
$html_new = htmlentities($html);
$this->app->DB->Insert("INSERT INTO inhalt (sprache, inhalt, kurztext, html, title, description, keywords, inhaltstyp, sichtbarbis, datum, aktiv, shop, template, finalparse, navigation)
VALUES ('$sprache','$inhalt','$kurztext','$html_new','$title','$description','$keywords','$inhaltstyp','$sichtbarbis_new','$datum_new','$aktiv',#
'$shopid','$template','$finalparse','$navigation')");
$this->app->Tpl->Set('MESSAGE', "