} else { $defaultTheme = erLhcoreClassModelChatConfig::fetch('default_theme_id')->current_value; if ($defaultTheme > 0) { try { $theme = erLhAbstractModelWidgetTheme::fetch($defaultTheme); $Result['theme'] = $theme; $dynamic_url_append .= '/(theme)/' . $theme->id; } catch (Exception $e) { } } } if (!empty($dynamic_url_append)) { $tpl->set('dynamic_url_append', $dynamic_url_append); } // We use direct queries in this file, because of its complexity $session = erLhcoreClassFaq::getSession(); $q = $session->database->createSelectQuery(); $q->select("COUNT(id)")->from("lh_faq"); $whereConditions = array(); $whereConditions[] = $q->expr->eq('active', 1); $whereConditions[] = $q->expr->lOr($q->expr->eq('url', $q->bindValue('')), $q->expr->eq('url', $q->bindValue(trim($matchStringURL))), $q->expr->lAnd($q->expr->eq('is_wildcard', $q->bindValue(1)), $q->expr->like($session->database->quote(trim($matchStringURL)), 'concat(left(url,length(url)-1),\'%\')'))); if ($identifier != '') { $whereConditions[] = $q->expr->eq('identifier', $q->bindValue($identifier)); } $q->where($whereConditions); $stmt = $q->prepare(); $stmt->execute(); $result = $stmt->fetchColumn(); $pages = new lhPaginator(); $pages->serverURL = erLhcoreClassDesign::baseurl('faq/faqwidget') . $dynamic_url_append; $pages->items_total = $result;
<?php if (!$currentUser->validateCSFRToken($Params['user_parameters_unordered']['csfr'])) { die('Invalid CSFR Token'); exit; } $faq = erLhcoreClassFaq::getSession()->load('erLhcoreClassModelFaq', $Params['user_parameters']['id']); erLhcoreClassFaq::getSession()->delete($faq); erLhcoreClassModule::redirect('faq/list'); exit;
public function removeThis() { erLhcoreClassFaq::getSession()->delete($this); }