本文整理汇总了PHP中contrexx_strip_tags函数的典型用法代码示例。如果您正苦于以下问题:PHP contrexx_strip_tags函数的具体用法?PHP contrexx_strip_tags怎么用?PHP contrexx_strip_tags使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了contrexx_strip_tags函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: load
/**
* Load your component.
*
* @param \Cx\Core\ContentManager\Model\Entity\Page $page The resolved page
*/
public function load(\Cx\Core\ContentManager\Model\Entity\Page $page)
{
global $_CORELANG, $page, $objTemplate, $subMenuTitle;
switch ($this->cx->getMode()) {
case \Cx\Core\Core\Controller\Cx::MODE_FRONTEND:
$newsObj = new News(\Env::get('cx')->getPage()->getContent());
\Env::get('cx')->getPage()->setContent($newsObj->getNewsPage());
$newsObj->getPageTitle(\Env::get('cx')->getPage()->getTitle());
// Set the meta page description to the teaser text if displaying news details
$teaser = $newsObj->getTeaser();
if ($teaser !== null) {
//news details, else getTeaser would return null
$page->setMetadesc(contrexx_raw2xhtml(contrexx_strip_tags(html_entity_decode($teaser, ENT_QUOTES, CONTREXX_CHARSET))));
}
if (substr($page->getCmd(), 0, 7) == 'details') {
\Env::get('cx')->getPage()->setTitle($newsObj->newsTitle);
\Env::get('cx')->getPage()->setContentTitle($newsObj->newsTitle);
\Env::get('cx')->getPage()->setMetaTitle($newsObj->newsTitle);
}
break;
case \Cx\Core\Core\Controller\Cx::MODE_BACKEND:
$this->cx->getTemplate()->addBlockfile('CONTENT_OUTPUT', 'content_master', 'LegacyContentMaster.html');
$objTemplate = $this->cx->getTemplate();
\Permission::checkAccess(10, 'static');
$subMenuTitle = $_CORELANG['TXT_NEWS_MANAGER'];
$objNews = new NewsManager();
$objNews->getPage();
break;
default:
break;
}
}
示例2: save
/**
* Save the event to the database
*
* @param array $data
*
* @return boolean true if saved successfully, false otherwise
*/
function save($data)
{
global $objDatabase, $_LANGID, $_CONFIG, $objInit;
parent::getSettings();
if (empty($data['startDate']) || empty($data['endDate']) || empty($data['category']) || $data['seriesStatus'] == 1 && $data['seriesType'] == 2 && empty($data['seriesWeeklyDays'])) {
return false;
}
foreach ($_POST['showIn'] as $key => $langId) {
if (empty($_POST['title'][$langId]) && empty($_POST['title'][$_LANGID])) {
return false;
}
}
list($startDate, $strStartTime) = explode(' ', $data['startDate']);
list($startHour, $startMin) = explode(':', $strStartTime);
list($endDate, $strEndTime) = explode(' ', $data['endDate']);
list($endHour, $endMin) = explode(':', $strEndTime);
if ($data['all_day']) {
list($startHour, $startMin) = array(0, 0);
list($endHour, $endMin) = array(23, 59);
}
//event data
$id = isset($data['copy']) && !empty($data['copy']) ? 0 : (isset($data['id']) ? intval($data['id']) : 0);
$type = isset($data['type']) ? intval($data['type']) : 0;
$startDate = date("Y-m-d H:i:s", parent::getDateTimestamp($startDate, intval($startHour), intval($startMin)));
$endDate = date("Y-m-d H:i:s", parent::getDateTimestamp($endDate, intval($endHour), intval($endMin)));
$google = isset($data['map'][$_LANGID]) ? intval($data['map'][$_LANGID]) : 0;
$allDay = isset($data['all_day']) ? 1 : 0;
$convertBBCode = $objInit->mode == 'frontend' && empty($id);
$useCustomDateDisplay = isset($data['showDateSettings']) ? 1 : 0;
$showStartDateList = isset($data['showStartDateList']) ? $data['showStartDateList'] : 0;
$showEndDateList = isset($data['showEndDateList']) ? $data['showEndDateList'] : 0;
if ($objInit->mode == 'backend') {
// reset time values if "no time" is selected
if ($data['showTimeTypeList'] == 0) {
$showStartTimeList = 0;
$showEndTimeList = 0;
} else {
$showStartTimeList = isset($data['showStartTimeList']) ? $data['showStartTimeList'] : '';
$showEndTimeList = isset($data['showEndTimeList']) ? $data['showEndTimeList'] : '';
}
$showTimeTypeList = isset($data['showTimeTypeList']) ? $data['showTimeTypeList'] : '';
$showStartDateDetail = isset($data['showStartDateDetail']) ? $data['showStartDateDetail'] : '';
$showEndDateDetail = isset($data['showEndDateDetail']) ? $data['showEndDateDetail'] : '';
// reset time values if "no time" is selected
if ($data['showTimeTypeDetail'] == 0) {
$showStartTimeDetail = 0;
$showEndTimeDetail = 0;
} else {
$showStartTimeDetail = isset($data['showStartTimeDetail']) ? $data['showStartTimeDetail'] : '';
$showEndTimeDetail = isset($data['showEndTimeDetail']) ? $data['showEndTimeDetail'] : '';
}
$showTimeTypeDetail = isset($data['showTimeTypeDetail']) ? $data['showTimeTypeDetail'] : '';
} else {
$showStartDateList = $this->arrSettings['showStartDateList'] == 1 ? 1 : 0;
$showEndDateList = $this->arrSettings['showEndDateList'] == 1 ? 1 : 0;
$showStartTimeList = $this->arrSettings['showStartTimeList'] == 1 ? 1 : 0;
$showEndTimeList = $this->arrSettings['showEndTimeList'] == 1 ? 1 : 0;
// reset time values if "no time" is selected
if ($showStartTimeList == 1 || $showEndTimeList == 1) {
$showTimeTypeList = 1;
} else {
$showStartTimeList = 0;
$showEndTimeList = 0;
$showTimeTypeList = 0;
}
$showStartDateDetail = $this->arrSettings['showStartDateDetail'] == 1 ? 1 : 0;
$showEndDateDetail = $this->arrSettings['showEndDateDetail'] == 1 ? 1 : 0;
$showStartTimeDetail = $this->arrSettings['showStartTimeDetail'] == 1 ? 1 : 0;
$showEndTimeDetail = $this->arrSettings['showEndTimeDetail'] == 1 ? 1 : 0;
// reset time values if "no time" is selected
if ($showStartTimeDetail == 1 || $showEndTimeDetail == 1) {
$showTimeTypeDetail = 1;
} else {
$showStartTimeDetail = 0;
$showEndTimeDetail = 0;
$showTimeTypeDetail = 0;
}
}
$access = isset($data['access']) ? intval($data['access']) : 0;
$priority = isset($data['priority']) ? intval($data['priority']) : 0;
$placeMediadir = isset($data['placeMediadir']) ? intval($data['placeMediadir']) : 0;
$hostMediadir = isset($data['hostMediadir']) ? intval($data['hostMediadir']) : 0;
$price = isset($data['price']) ? contrexx_addslashes(contrexx_strip_tags($data['price'])) : 0;
$link = isset($data['link']) ? contrexx_addslashes(contrexx_strip_tags($data['link'])) : '';
$pic = isset($data['picture']) ? contrexx_addslashes(contrexx_strip_tags($data['picture'])) : '';
$attach = isset($data['attachment']) ? contrexx_addslashes(contrexx_strip_tags($data['attachment'])) : '';
$catId = isset($data['category']) ? intval($data['category']) : '';
$showIn = isset($data['showIn']) ? contrexx_addslashes(contrexx_strip_tags(join(",", $data['showIn']))) : '';
$invited_groups = isset($data['selectedGroups']) ? join(',', $data['selectedGroups']) : '';
$invited_mails = isset($data['invitedMails']) ? contrexx_addslashes(contrexx_strip_tags($data['invitedMails'])) : '';
$send_invitation = isset($data['sendInvitation']) ? intval($data['sendInvitation']) : 0;
$invitationTemplate = isset($data['invitationEmailTemplate']) ? contrexx_input2db($data['invitationEmailTemplate']) : 0;
$registration = isset($data['registration']) ? intval($data['registration']) : 0;
//.........这里部分代码省略.........
示例3: saveInputfield
function saveInputfield($intInputfieldId, $strValue, $langId = 0)
{
$strValue = contrexx_strip_tags(contrexx_input2raw($strValue));
return $strValue;
}
示例4: updateCategorie
/**
* update category
* @access public
* @global array
* @global ADONewConnection
* @global array
*/
function updateCategorie()
{
global $_CONFIG, $objDatabase, $_ARRAYLANG;
//get post data
if (isset($_POST['edit_submit'])) {
$catCategorie = intval($_POST['edit_category']);
$catParentid = intval($_POST['edit_parentid']);
$catName = contrexx_strip_tags($_POST['edit_name']);
$catDescription = contrexx_strip_tags($_POST['edit_description']);
$catMetadesc = contrexx_strip_tags($_POST['edit_metadesc']);
$catMetakeys = contrexx_strip_tags($_POST['edit_metakeys']);
$catShowEntries = contrexx_strip_tags($_POST['edit_showentries']);
$catId = intval($_POST['edit_id']);
//check parent id
if ($catCategorie == $catId) {
$catParentid = $catParentid;
} else {
$catParentid = $catCategorie;
}
//update categorie
$objResult = $objDatabase->Execute("UPDATE " . DBPREFIX . "module_directory_categories SET\n name='" . $catName . "',\n description='" . $catDescription . "',\n parentid=" . $catParentid . ",\n metadesc='" . $catMetadesc . "',\n metakeys='" . $catMetakeys . "',\n showentries='" . $catShowEntries . "' WHERE id='" . $catId . "'");
//status and back to ooverview
if ($objResult !== false) {
$this->showCategories();
$this->strOkMessage = $_ARRAYLANG['TXT_CAT_SUCCESSFULL_EDIT'];
} else {
$this->strErrMessage = $_ARRAYLANG['TXT_CAT_CORRUPT_EDIT'];
}
}
}
示例5: _showPicture
/**
* Show picture
*
* Either show the current picture of the livecam or one from the archive
*
* @access private
*/
function _showPicture()
{
$this->camSettings = $this->getCamSettings($this->cam);
//var_dump($this->camSettings);
\JS::activate("shadowbox", array('players' => array('img')));
\JS::activate('jqueryui');
\JS::registerCode("\n cx.ready(function() {\n cx.jQuery('input[name=date]').datepicker({dateFormat: 'yy-mm-dd'});\n });\n ");
if ($this->camSettings['shadowboxActivate'] == 1) {
$imageLink = $this->camSettings['currentImagePath'];
} else {
// reset archive file path in case the current picture has been requested
if ($this->_action == 'current') {
unset($_GET['file']);
}
if (isset($_GET['file'])) {
$archiveDate = substr($_GET['file'], 0, 10);
$imageLink = '[[NODE_LIVECAM]]?act=archive&date=' . $archiveDate;
} else {
$cmd = '';
if (!empty($_GET['cmd'])) {
$cmd = '&cmd=' . intval($_GET['cmd']);
}
$imageLink = '[[NODE_LIVECAM]]?act=today';
}
}
$this->_objTpl->setVariable(array('LIVECAM_CURRENT_IMAGE' => isset($_GET['file']) ? \Cx\Core\Core\Controller\Cx::instanciate()->getWebsiteOffsetPath() . $this->camSettings['archivePath'] . '/' . $_GET['file'] : $this->camSettings['currentImagePath'], 'LIVECAM_IMAGE_TEXT' => isset($_GET['file']) ? contrexx_strip_tags($_GET['file']) : 'Aktuelles Webcam Bild', 'LIVECAM_IMAGE_SHADOWBOX' => $this->camSettings['shadowboxActivate'] == 1 ? 'shadowboxgallery' : '', 'LIVECAM_IMAGE_LINK' => $imageLink, 'LIVECAM_IMAGE_SIZE' => $this->camSettings['currentMaxSize']));
}
示例6: saveInputfield
function saveInputfield($intInputfieldId, $arrValue, $intLangId)
{
$arrValues = array();
foreach ($arrValue as $intKey => $arrValuesTmp) {
$arrValues[] = join("##", $arrValuesTmp);
}
$strValue = contrexx_strip_tags(contrexx_input2raw(join("||", $arrValues)));
return $strValue;
}
示例7: saveInputfield
function saveInputfield($intInputfieldId, $arrValue, $langId = 0)
{
//$strValue = join(',', array_map('intval', explode(',', $strValue)));
$strValue = contrexx_strip_tags(contrexx_input2raw(join(",", $arrValue)));
return $strValue;
}
示例8: saveInputfield
function saveInputfield($intInputfieldId, $arrValue, $intLangId)
{
global $objInit, $_LANGID;
$arrValues = array();
if ($objInit->mode == 'backend') {
foreach ($arrValue as $intKey => $arrValuesTmp) {
$arrValues[] = join("##", $arrValuesTmp);
}
} else {
$uploaderId = !empty($_POST['uploaderId']) ? $_POST['uploaderId'] : '';
foreach ($arrValue as $intKey => $arrValuesTmp) {
if ($_POST['mediadirInputfieldSource'][$intInputfieldId][0][$intKey] != '' && $intLangId == $_LANGID) {
$this->deleteFile($arrValuesTmp['file']);
$filePath = $this->getUploadedFilePath($uploaderId, $_POST['mediadirInputfieldSource'][$intInputfieldId][0][$intKey]);
if ($filePath) {
$arrValuesTmp['file'] = $this->uploadMedia($filePath);
// ugly way,try to get it from post
$_POST['mediadirInputfieldSource'][$intInputfieldId][$intKey]['defaultFile'] = $arrValuesTmp['file'];
}
}
if ($_POST['mediadirInputfieldSource'][$intInputfieldId][$intLangId][$intKey] != '') {
$this->deleteFile($arrValuesTmp['file']);
$filePath = $this->getUploadedFilePath($uploaderId, $_POST['mediadirInputfieldSource'][$intInputfieldId][$intLangId][$intKey]);
$arrValuesTmp['file'] = $this->uploadMedia($filePath);
} else {
if ($arrValuesTmp['file'] == '' || $arrValuesTmp['file'] == 'new_file') {
$arrValuesTmp['file'] = $_POST['mediadirInputfieldSource'][$intInputfieldId][$intKey]['defaultFile'];
}
}
$arrValues[] = join("##", $arrValuesTmp);
}
}
$strValue = contrexx_input2raw(contrexx_strip_tags(join("||", $arrValues)));
return $strValue;
}
示例9: _showInterestForm
/**
* Show the form when someone is interested
* @return unknown
*/
function _showInterestForm()
{
global $objDatabase, $_ARRAYLANG, $_CONFIG;
require_once ASCMS_LIBRARY_PATH . DIRECTORY_SEPARATOR . 'phpmailer' . DIRECTORY_SEPARATOR . "class.phpmailer.php";
if (!empty($_REQUEST['immoid'])) {
$this->_objTpl->setVariable('IMMO_ID', intval($_REQUEST['immoid']));
}
if (!empty($_REQUEST['submitContactForm'])) {
$immoid = intval($_REQUEST['contactFormField_immoid']);
//hidden field: immoid
$name = !empty($_REQUEST['contactFormField_name']) ? contrexx_addslashes(contrexx_strip_tags($_REQUEST['contactFormField_name'])) : '';
$firstname = !empty($_REQUEST['contactFormField_vorname']) ? contrexx_addslashes(contrexx_strip_tags($_REQUEST['contactFormField_vorname'])) : '';
$street = !empty($_REQUEST['contactFormField_strasse']) ? contrexx_addslashes(contrexx_strip_tags($_REQUEST['contactFormField_strasse'])) : '';
$zip = !empty($_REQUEST['contactFormField_postleitzahl']) ? contrexx_addslashes(contrexx_strip_tags($_REQUEST['contactFormField_postleitzahl'])) : '';
$location = !empty($_REQUEST['contactFormField_ortschaft']) ? contrexx_addslashes(contrexx_strip_tags($_REQUEST['contactFormField_ortschaft'])) : '';
$email = !empty($_REQUEST['contactFormField_email']) ? contrexx_addslashes(contrexx_strip_tags($_REQUEST['contactFormField_email'])) : '';
$phone_office = !empty($_REQUEST['contactFormField_fongeschaeft']) ? contrexx_addslashes(contrexx_strip_tags($_REQUEST['contactFormField_fongeschaeft'])) : '';
$phone_home = !empty($_REQUEST['contactFormField_fonprivat']) ? contrexx_addslashes(contrexx_strip_tags($_REQUEST['contactFormField_fonprivat'])) : '';
$phone_mobile = !empty($_REQUEST['contactFormField_fonmobil']) ? contrexx_addslashes(contrexx_strip_tags($_REQUEST['contactFormField_fonmobil'])) : '';
$doc_via_mail = !empty($_REQUEST['contactFormField_dokuperpost']) ? contrexx_addslashes(contrexx_strip_tags($_REQUEST['contactFormField_dokuperpost'])) : '';
$funding_advice = !empty($_REQUEST['contactFormField_beratungfinanzierung']) ? contrexx_addslashes(contrexx_strip_tags($_REQUEST['contactFormField_beratungfinanzierung'])) : '';
$inspection = !empty($_REQUEST['contactFormField_besichtigung']) ? contrexx_addslashes(contrexx_strip_tags($_REQUEST['contactFormField_besichtigung'])) : '';
$contact_via_phone = !empty($_REQUEST['contactFormField_kontakttelefon']) ? contrexx_addslashes(contrexx_strip_tags($_REQUEST['contactFormField_kontakttelefon'])) : '';
$comment = !empty($_REQUEST['contactFormField_bemerkungen']) ? contrexx_addslashes(contrexx_strip_tags($_REQUEST['contactFormField_bemerkungen'])) : '';
$query = "\n INSERT INTO " . DBPREFIX . "module_immo_interest VALUES (\n NULL, {$immoid}, '{$name}', '{$firstname}',\n '{$street}', '{$zip}', '{$location}', '{$email}',\n '{$phone_office}', '{$phone_home}', '{$phone_mobile}',\n '{$doc_via_mail}', '{$funding_advice}', '{$inspection}',\n '{$contact_via_phone}', '{$comment}', " . mktime() . ")";
if (!$objDatabase->Execute($query)) {
$this->_objTpl->setVariable('CONTACT_FEEDBACK_TEXT', $_ARRAYLANG['TXT_IMMO_DATABASE_ERROR']);
return false;
}
$query = "\n SELECT reference, ref_nr_note\n FROM " . DBPREFIX . "module_immo\n WHERE id={$immoid}";
$objRS = $objDatabase->Execute($query);
if ($objRS) {
$reference = $objRS->fields['reference'];
$ref_note = $objRS->fields['ref_nr_note'];
}
//set immo ID for _getFieldFromText function
$this->_getFieldNames($immoid);
$this->_currFieldID = $immoid;
$address = $this->_getFieldFromText('adresse');
$location = $this->_getFieldFromText('ort');
$mailer = new PHPMailer();
$objRS = $objDatabase->Execute('
SELECT setvalue
FROM ' . DBPREFIX . 'module_immo_settings
WHERE setname="contact_receiver"');
//set recipients
$emails = explode(',', $objRS->fields['setvalue']);
foreach ($emails as $email) {
$mailer->AddAddress($email);
}
if ($_CONFIG['coreSmtpServer'] > 0 && @(include_once ASCMS_CORE_PATH . '/SmtpSettings.class.php')) {
if (($arrSmtp = SmtpSettings::getSmtpAccount($_CONFIG['coreSmtpServer'])) !== false) {
$mailer->IsSMTP();
$mailer->Host = $arrSmtp['hostname'];
$mailer->Port = $arrSmtp['port'];
$mailer->SMTPAuth = true;
$mailer->Username = $arrSmtp['username'];
$mailer->Password = $arrSmtp['password'];
}
}
$mailer->CharSet = CONTREXX_CHARSET;
$mailer->SetFrom(contrexx_addslashes($_REQUEST['contactFormField_email']), 'Interessent');
$mailer->Subject = 'Neuer Interessent für ' . $ref_note . ' Ref-Nr.: ' . $reference;
$mailer->IsHTML(false);
$mailer->Body = 'Jemand interessiert sich für das Objekt ' . $ref_note . ' Ref-Nr.: ' . $reference . "\n \nhttp://" . $_CONFIG['domainUrl'] . ASCMS_PATH_OFFSET . "/admin/index.php?cmd=immo&act=stats\n";
$mailer->Body .= $_ARRAYLANG['TXT_IMMO_E_MAIL'] . ': ' . contrexx_addslashes($_REQUEST['contactFormField_email']) . "\n";
$mailer->Body .= $_ARRAYLANG['TXT_IMMO_NAME'] . ': ' . $name . "\n";
$mailer->Body .= $_ARRAYLANG['TXT_IMMO_FIRSTNAME'] . ': ' . $firstname . "\n";
$mailer->Body .= $_ARRAYLANG['TXT_IMMO_STREET'] . ': ' . $street . "\n";
$mailer->Body .= $_ARRAYLANG['TXT_IMMO_LOCATION'] . ': ' . $location . "\n";
$mailer->Body .= $_ARRAYLANG['TXT_IMMO_TELEPHONE'] . ': ' . $phone_home . "\n";
$mailer->Body .= $_ARRAYLANG['TXT_IMMO_TELEPHONE_OFFICE'] . ': ' . $phone_office . "\n";
$mailer->Body .= $_ARRAYLANG['TXT_IMMO_TELEPHONE_MOBILE'] . ': ' . $phone_mobile . "\n";
$mailer->Body .= $_ARRAYLANG['TXT_IMMO_DOC_VIA_MAIL'] . ': ' . ($doc_via_mail ? $_ARRAYLANG['TXT_IMMO_YES'] : $_ARRAYLANG['TXT_IMMO_NO']) . "\n";
$mailer->Body .= $_ARRAYLANG['TXT_IMMO_FUNDING_ADVICE'] . ': ' . ($funding_advice ? $_ARRAYLANG['TXT_IMMO_YES'] : $_ARRAYLANG['TXT_IMMO_NO']) . "\n";
$mailer->Body .= $_ARRAYLANG['TXT_IMMO_CONTACT_FOR_INSPECTION'] . ': ' . ($inspection ? $_ARRAYLANG['TXT_IMMO_YES'] : $_ARRAYLANG['TXT_IMMO_NO']) . "\n";
$mailer->Body .= $_ARRAYLANG['TXT_IMMO_CONTACT_VIA_PHONE'] . ': ' . ($contact_via_phone ? $_ARRAYLANG['TXT_IMMO_YES'] : $_ARRAYLANG['TXT_IMMO_NO']) . "\n";
$mailer->Body .= $_ARRAYLANG['TXT_IMMO_COMMENTS'] . ': ' . $comment . "\n";
$mailer->Send();
//mail for interested customer
$mailer->ClearAddresses();
$mailer->SetFrom($this->arrSettings['sender_email'], $this->arrSettings['sender_name']);
$mailer->AddAddress($_REQUEST['contactFormField_email']);
$mailer->Subject = $this->arrSettings['interest_confirm_subject'];
$message = str_replace('[[IMMO_OBJECT]]', $address . ', ' . $location . " (Ref.Nr.: {$reference})", $this->arrSettings['interest_confirm_message']);
$mailer->Body = $message;
$mailer->Send();
$this->_objTpl->setVariable('CONTACT_FEEDBACK_TEXT', $_ARRAYLANG['TXT_IMMO_CONTACT_SUCCESSFUL']);
}
return true;
}
示例10: saveForm
function saveForm($arrData, $intFormId = null)
{
global $_ARRAYLANG, $_CORELANG, $objDatabase, $_LANGID;
$intId = intval($intFormId);
$strPicture = contrexx_addslashes(contrexx_strip_tags($arrData['formImage']));
$arrName = $arrData['formName'];
$arrDescription = $arrData['formDescription'];
$strCmd = strtolower(contrexx_addslashes(contrexx_strip_tags($arrData['formCmd'])));
$intUseCategory = intval($arrData['formUseCategory']);
$intUseLevel = isset($arrData['formUseLevel']) ? contrexx_input2int($arrData['formUseLevel']) : 0;
$intUseReadyToConfirm = isset($arrData['formUseReadyToConfirm']) ? contrexx_input2int($arrData['formUseReadyToConfirm']) : 0;
$intEntriesPerPage = isset($arrData['formEntriesPerPage']) ? contrexx_input2int($arrData['formEntriesPerPage']) : 0;
if (empty($intId)) {
//insert new form
$objInsertAttributes = $objDatabase->Execute("\n INSERT INTO\n " . DBPREFIX . "module_" . $this->moduleTablePrefix . "_forms\n SET\n `order`='99',\n `picture`='" . $strPicture . "',\n `cmd`='" . $strCmd . "',\n `use_category`='" . $intUseCategory . "',\n `use_level`='" . $intUseLevel . "',\n `use_ready_to_confirm`='" . $intUseReadyToConfirm . "',\n `entries_per_page`='" . $intEntriesPerPage . "',\n `active`='0'\n ");
if ($objInsertAttributes !== false) {
$intId = $objDatabase->Insert_ID();
foreach ($this->arrFrontendLanguages as $key => $arrLang) {
if (empty($arrName[0])) {
$arrName[0] = "";
}
$strName = $arrName[$arrLang['id']];
$strDescription = $arrDescription[$arrLang['id']];
if (empty($strName)) {
$strName = $arrName[0];
}
if (empty($strDescription)) {
$strDescription = $arrDescription[0];
}
$objInsertNames = $objDatabase->Execute("\n INSERT INTO\n " . DBPREFIX . "module_" . $this->moduleTablePrefix . "_form_names\n SET\n `lang_id`='" . intval($arrLang['id']) . "',\n `form_id`='" . intval($intId) . "',\n `form_name`='" . contrexx_raw2db(contrexx_input2raw($strName)) . "',\n `form_description`='" . contrexx_raw2db(contrexx_input2raw($strDescription)) . "'\n ");
}
$objCreateCatSelectors = $objDatabase->Execute("\n INSERT INTO\n " . DBPREFIX . "module_" . $this->moduleTablePrefix . "_order_rel_forms_selectors\n SET\n `selector_id`='9',\n `form_id`='" . intval($intId) . "',\n `selector_order`='0',\n `exp_search`='1'\n ");
$objCreateLevelSelectors = $objDatabase->Execute("\n INSERT INTO\n " . DBPREFIX . "module_" . $this->moduleTablePrefix . "_order_rel_forms_selectors\n SET\n `selector_id`='10',\n `form_id`='" . intval($intId) . "',\n `selector_order`='1',\n `exp_search`='1'\n ");
//permissions
parent::getCommunityGroups();
foreach ($this->arrCommunityGroups as $intGroupId => $arrGroup) {
$objInsertPerm = $objDatabase->Execute("\n INSERT INTO\n " . DBPREFIX . "module_" . $this->moduleTablePrefix . "_settings_perm_group_forms\n SET\n `group_id`='" . intval($intGroupId) . "',\n `form_id`='" . intval($intId) . "',\n `status_group`='1'\n ");
}
if ($objInsertNames !== false && $objCreateCatSelectors !== false && $objCreateLevelSelectors !== false) {
return true;
} else {
return false;
}
} else {
return false;
}
} else {
//update form
$objUpdateAttributes = $objDatabase->Execute("\n UPDATE\n " . DBPREFIX . "module_" . $this->moduleTablePrefix . "_forms\n SET\n `picture`='" . $strPicture . "',\n `cmd`='" . $strCmd . "',\n `use_category`='" . $intUseCategory . "',\n `use_level`='" . $intUseLevel . "',\n `use_ready_to_confirm`='" . $intUseReadyToConfirm . "',\n `entries_per_page`='" . $intEntriesPerPage . "'\n WHERE\n `id`='" . $intId . "'\n ");
if ($objUpdateAttributes !== false) {
//permissions
$objDeletePerm = $objDatabase->Execute("DELETE FROM " . DBPREFIX . "module_" . $this->moduleTablePrefix . "_settings_perm_group_forms WHERE form_id='" . $intId . "'");
$settingsPermissionGroupForm = isset($arrData['settingsPermGroupForm'][$intId]) ? $arrData['settingsPermGroupForm'][$intId] : array();
foreach ($settingsPermissionGroupForm as $intGroupId => $intGroupStatus) {
$objInsertPerm = $objDatabase->Execute("\n INSERT INTO\n " . DBPREFIX . "module_" . $this->moduleTablePrefix . "_settings_perm_group_forms\n SET\n `group_id`='" . intval($intGroupId) . "',\n `form_id`='" . intval($intId) . "',\n `status_group`='" . intval($intGroupStatus) . "'\n ");
}
$objInsertNames = $this->updateFormLocale($arrName, $arrDescription, $intId);
if ($objInsertNames !== false) {
return true;
} else {
return false;
}
} else {
return false;
}
}
}
示例11: getPostRecipients
/**
* Get the recipient addresses from the post
*
* @author Comvation AG <info@comvation.com>
* @author Stefan Heinemann <sh@adfinis.com>
* @return string
*/
private function getPostRecipients()
{
global $_CONFIG;
$formEmailsTmp = isset($_POST['contactFormEmail']) ? explode(',', strip_tags(contrexx_stripslashes($_POST['contactFormEmail']))) : '';
if (empty($formEmails)) {
$formEmails = $_CONFIG['contactFormEmail'];
}
if (is_array($formEmailsTmp)) {
$formEmails = array();
foreach ($formEmailsTmp as $email) {
$email = trim(contrexx_strip_tags($email));
if (!empty($email)) {
array_push($formEmails, $email);
}
}
$formEmails = implode(',', $formEmails);
} else {
$formEmails = '';
}
return $formEmails;
}
示例12: save
/**
* Save the Host data's into database
*
* @param array $data posted data from the form
*
* @return boolean true if the data updated successfully, false otherwise
*/
function save($data)
{
global $objDatabase;
$title = contrexx_addslashes(contrexx_strip_tags($data['title']));
$uri = contrexx_addslashes(contrexx_strip_tags($data['uri']));
if (substr($uri, -1) != '/') {
$uri = $uri . "/";
}
$category = intval($data['category']);
$key = contrexx_addslashes(contrexx_strip_tags($data['key']));
$status = intval($data['status']);
$confirmed = intval(1);
if (empty($key)) {
$key = $this->generateKey();
}
if (intval($this->id) == 0) {
$query = "INSERT INTO " . DBPREFIX . "module_" . $this->moduleTablePrefix . "_host\n (`title`,`uri`,`cat_id`,`key`,`confirmed`,`status`) \n VALUES ('" . $title . "','" . $uri . "','" . $category . "','" . $key . "','" . $confirmed . "','" . $status . "')";
} else {
$query = "UPDATE " . DBPREFIX . "module_" . $this->moduleTablePrefix . "_host\n SET `title` = '" . $title . "',\n `uri` = '" . $uri . "',\n `cat_id` = '" . $category . "',\n `key` = '" . $key . "',\n `status` = '" . $status . "'\n WHERE `id` = '" . intval($this->id) . "'";
}
$objResult = $objDatabase->Execute($query);
if ($objResult !== false) {
return true;
} else {
return false;
}
}
示例13: save
/**
* Save the category
*
* @param array $data posted data from the user
*
* @return boolean true if data saved successfully, false otherwise
*/
function save($data)
{
global $objDatabase, $_LANGID;
$arrHosts = array();
$arrHosts = $data['selectedHosts'];
$arrNames = array();
$arrNames = $data['name'];
if (intval($this->id) == 0) {
$query = "INSERT INTO " . DBPREFIX . "module_" . $this->moduleTablePrefix . "_category\n \t\t (`pos`,`status`)\n VALUES ('0','0')";
$objResult = $objDatabase->Execute($query);
if ($objResult === false) {
return false;
}
$this->id = intval($objDatabase->Insert_ID());
}
//names
$query = "DELETE FROM " . DBPREFIX . "module_" . $this->moduleTablePrefix . "_category_name\n WHERE cat_id = '" . intval($this->id) . "'";
$objResult = $objDatabase->Execute($query);
if ($objResult !== false) {
foreach ($arrNames as $langId => $categoryName) {
if ($langId != 0) {
$categoryName = $categoryName == '' ? $arrNames[0] : $categoryName;
if ($_LANGID == $langId) {
$categoryName = $arrNames[0] != $this->name ? $arrNames[0] : $categoryName;
}
$query = "INSERT INTO " . DBPREFIX . "module_" . $this->moduleTablePrefix . "_category_name\n\t (`cat_id`,`lang_id`,`name`)\n\t VALUES ('" . intval($this->id) . "','" . intval($langId) . "','" . contrexx_addslashes(contrexx_strip_tags($categoryName)) . "')";
$objResult = $objDatabase->Execute($query);
}
}
if ($objResult !== false) {
//hosts
foreach ($arrHosts as $key => $hostId) {
$query = "UPDATE " . DBPREFIX . "module_" . $this->moduleTablePrefix . "_host\n\t\t\t SET cat_id = '" . intval($this->id) . "' \n\t\t\t WHERE id = '" . intval($hostId) . "'";
$objResult = $objDatabase->Execute($query);
}
if ($objResult !== false) {
return true;
} else {
return false;
}
} else {
return false;
}
} else {
return false;
}
}
示例14: _saveForm
/**
* Store the form data for the product
*/
function _saveForm()
{
global $_CONFIG;
if (empty($_REQUEST['saveForm'])) {
return true;
}
$formId = isset($_REQUEST['formId']) ? intval($_REQUEST['formId']) : 0;
$productName = isset($_POST['productFormName']) ? contrexx_addslashes(strip_tags($_POST['productFormName'])) : '';
$contactFormDesc = isset($_POST['contactFormDesc']) ? contrexx_addslashes($_POST['contactFormDesc']) : '';
$productFormTargetUrl = isset($_POST['productFormTargetUrl']) ? contrexx_addslashes(strip_tags($_POST['productFormTargetUrl'])) : '';
$productFormTargetMessage = isset($_POST['productFormTargetMessage']) ? contrexx_addslashes($_POST['productFormTargetMessage']) : '';
$productFormPerDay = intval($_POST['productFormPerDay']);
$productFormQuantity = intval($_POST['productFormQuantity']);
$productQuantityLimit = intval($_POST['productQuantityLimit']);
$productFormPrice = floatval($_POST['productFormPrice']);
$productAutoStatus = intval($_POST['productAutoStatus']);
$productFile = isset($_POST['productFile']) ? contrexx_addslashes($_POST['productFile']) : '';
$productSenderName = isset($_POST['productSenderName']) ? contrexx_addslashes(strip_tags($_POST['productSenderName'])) : '';
$productSenderEmail = isset($_POST['productSenderEmail']) ? contrexx_addslashes(strip_tags($_POST['productSenderEmail'])) : '';
$productTargetSubject = isset($_POST['productTargetSubject']) ? contrexx_addslashes(strip_tags($_POST['productTargetSubject'])) : '';
$productTargetBody = isset($_POST['productTargetBody']) ? contrexx_addslashes(strip_tags($_POST['productTargetBody'])) : '';
$productPayPal = intval($_POST['paypal']);
$productPayPalSandbox = isset($_POST['sandbox_mail']) ? contrexx_addslashes(strip_tags($_POST['sandbox_mail'])) : '';
$productPayPalCurrency = isset($_POST['general_currency']) ? contrexx_addslashes(strip_tags($_POST['general_currency'])) : '';
$productYellowpay = intval($_POST['yellowpay_enable']);
// Alternative payment methods, comma separated list
$productAlternativePaymentMethods = isset($_POST['alternative_names']) ? contrexx_addslashes(strip_tags($_POST['alternative_names'])) : '';
if ($productQuantityLimit < 1) {
$productQuantityLimit = 1;
}
if ($productQuantityLimit >= $productFormQuantity) {
$productQuantityLimit = $productFormQuantity - 1;
}
$FileErr = '';
// Disallow the config file to be used as product file
if ($productFile == 'config/configuration.php' || $productFile == '/config/configuration.php') {
$productFile = '';
$FileErr = 2;
}
$productState = isset($_POST['productState']) ? 1 : 0;
$productElectro = isset($_POST['ElectroProduct']) ? 1 : 0;
$uniqueFieldNames = true;
$arrFields = $this->_getFormFieldsFromPost($uniqueFieldNames);
if (!$uniqueFieldNames) {
$this->_products(1);
return false;
}
$formEmailsTmp = isset($_POST['productFormEmail']) ? explode(',', contrexx_addslashes($_POST['productFormEmail'])) : '';
$formEmails = '';
if (is_array($formEmailsTmp)) {
$formEmails = array();
foreach ($formEmailsTmp as $email) {
$email = trim(contrexx_strip_tags($email));
if (!empty($email)) {
array_push($formEmails, $email);
}
}
$formEmails = implode(',', $formEmails);
}
if (empty($formEmails)) {
$formEmails = $_CONFIG['contactFormEmail'];
}
$result = false;
if ($formId > 0) {
$result = $this->_updateProduct($formId, $productName, $contactFormDesc, $productFormTargetUrl, $productFormTargetMessage, $productFormPerDay, $productFormQuantity, $productQuantityLimit, $productFormPrice, $arrFields, $formEmails, $productState, $productAutoStatus, $productElectro, $productFile, $productSenderName, $productSenderEmail, $productTargetSubject, $productTargetBody, $productPayPal, $productPayPalSandbox, $productPayPalCurrency, $productYellowpay, $productAlternativePaymentMethods);
} else {
$result = $this->_saveProduct($formId, $productName, $contactFormDesc, $productFormTargetUrl, $productFormTargetMessage, $productFormPerDay, $productFormQuantity, $productQuantityLimit, $productFormPrice, $arrFields, $formEmails, $productState, $productAutoStatus, $productElectro, $productFile, $productSenderName, $productSenderEmail, $productTargetSubject, $productTargetBody, $productPayPal, $productPayPalSandbox, $productPayPalCurrency, $productYellowpay, $productAlternativePaymentMethods);
}
$this->_products($FileErr);
return $result;
}
示例15: renderForm
/**
* Generate the form and show hints if necessary.
* If user input validation is successful a new transaction will be added.
* In this case the form will be hidden and only a status message will be shown.
*
* @access private
*/
private function renderForm()
{
global $objDatabase, $_ARRAYLANG, $_CORELANG;
//check the payment service provider configuration
$objSettingsGeneral = new SettingsGeneral($objDatabase);
if (!$objSettingsGeneral->getEpaymentStatus()) {
$this->arrStatusMessages['error'][] = $_ARRAYLANG['TXT_CHECKOUT_EPAYMENT_DEACTIVATED'];
$this->objTemplate->hideblock('form');
$this->objTemplate->hideblock('redirect');
return;
}
//initialize variables
$arrFieldValues = array();
$arrFieldsToHighlight = array();
$arrCssClasses = array();
$cssHighlightingClass = 'highlight';
$cssLabelClass = 'label';
$htmlRequiredField = ' *';
$arrSelectOptions[] = array();
//validate submitted user data
if (isset($_REQUEST['submit'])) {
$arrFieldValues['invoice_number'] = !empty($_REQUEST['invoice_number']) && $_REQUEST['invoice_number'] !== $_ARRAYLANG['TXT_CHECKOUT_INVOICE_NUMBER'] . $htmlRequiredField ? $_REQUEST['invoice_number'] : '';
$arrFieldValues['invoice_currency'] = !empty($_REQUEST['invoice_currency']) ? $_REQUEST['invoice_currency'] : '';
$arrFieldValues['invoice_amount'] = !empty($_REQUEST['invoice_amount']) && $_REQUEST['invoice_amount'] !== $_ARRAYLANG['TXT_CHECKOUT_INVOICE_AMOUNT'] . $htmlRequiredField ? $_REQUEST['invoice_amount'] : '';
$arrFieldValues['contact_title'] = !empty($_REQUEST['contact_title']) ? $_REQUEST['contact_title'] : '';
$arrFieldValues['contact_forename'] = !empty($_REQUEST['contact_forename']) && $_REQUEST['contact_forename'] !== $_ARRAYLANG['TXT_CHECKOUT_CONTACT_FORENAME'] . $htmlRequiredField ? contrexx_input2raw(contrexx_strip_tags($_REQUEST['contact_forename'])) : '';
$arrFieldValues['contact_surname'] = !empty($_REQUEST['contact_surname']) && $_REQUEST['contact_surname'] !== $_ARRAYLANG['TXT_CHECKOUT_CONTACT_SURNAME'] . $htmlRequiredField ? contrexx_input2raw(contrexx_strip_tags($_REQUEST['contact_surname'])) : '';
$arrFieldValues['contact_company'] = !empty($_REQUEST['contact_company']) && $_REQUEST['contact_company'] !== $_ARRAYLANG['TXT_CHECKOUT_CONTACT_COMPANY'] ? contrexx_input2raw(contrexx_strip_tags($_REQUEST['contact_company'])) : '';
$arrFieldValues['contact_street'] = !empty($_REQUEST['contact_street']) && $_REQUEST['contact_street'] !== $_ARRAYLANG['TXT_CHECKOUT_CONTACT_STREET'] . $htmlRequiredField ? contrexx_input2raw(contrexx_strip_tags($_REQUEST['contact_street'])) : '';
$arrFieldValues['contact_postcode'] = !empty($_REQUEST['contact_postcode']) && $_REQUEST['contact_postcode'] !== $_ARRAYLANG['TXT_CHECKOUT_CONTACT_POSTCODE'] . $htmlRequiredField ? contrexx_input2raw(contrexx_strip_tags($_REQUEST['contact_postcode'])) : '';
$arrFieldValues['contact_place'] = !empty($_REQUEST['contact_place']) && $_REQUEST['contact_place'] !== $_ARRAYLANG['TXT_CHECKOUT_CONTACT_PLACE'] . $htmlRequiredField ? contrexx_input2raw(contrexx_strip_tags($_REQUEST['contact_place'])) : '';
$arrFieldValues['contact_country'] = !empty($_REQUEST['contact_country']) ? $_REQUEST['contact_country'] : '';
$arrFieldValues['contact_phone'] = !empty($_REQUEST['contact_phone']) && $_REQUEST['contact_phone'] !== $_ARRAYLANG['TXT_CHECKOUT_CONTACT_PHONE'] . $htmlRequiredField ? contrexx_input2raw(contrexx_strip_tags($_REQUEST['contact_phone'])) : '';
$arrFieldValues['contact_email'] = !empty($_REQUEST['contact_email']) && $_REQUEST['contact_email'] !== $_ARRAYLANG['TXT_CHECKOUT_CONTACT_EMAIL'] . $htmlRequiredField ? contrexx_input2raw(contrexx_strip_tags($_REQUEST['contact_email'])) : '';
//get keys of passed data
if (!isset($this->arrCurrencies[$invoiceCurrency]) && ($key = array_search(strtoupper($invoiceCurrency), $this->arrCurrencies))) {
$invoiceCurrency = $key;
}
if (strtolower($contactTitle) !== self::MISTER && strtolower($contactTitle) !== self::MISS) {
if (ucfirst(strtolower($contactTitle)) == $_ARRAYLANG['TXT_CHECKOUT_CONTACT_TITLE_MISTER']) {
$contactTitle = self::MISTER;
} elseif (ucfirst(strtolower($contactTitle)) == $_ARRAYLANG['TXT_CHECKOUT_CONTACT_TITLE_MISS']) {
$contactTitle = self::MISS;
}
} else {
$contactTitle = strtolower($contactTitle);
}
if (!isset($this->arrCountries[$contactCountry]) && ($key = array_search(ucfirst(strtolower($contactCountry)), $this->arrCountries))) {
$contactCountry = $key;
}
$arrUserData['text']['invoice_number']['name'] = $_ARRAYLANG['TXT_CHECKOUT_INVOICE_NUMBER'];
$arrUserData['text']['invoice_number']['value'] = $arrFieldValues['invoice_number'];
$arrUserData['text']['invoice_number']['length'] = 255;
$arrUserData['text']['invoice_number']['mandatory'] = 1;
$arrUserData['selection']['invoice_currency']['name'] = $_ARRAYLANG['TXT_CHECKOUT_INVOICE_CURRENCY'];
$arrUserData['selection']['invoice_currency']['value'] = $arrFieldValues['invoice_currency'];
$arrUserData['selection']['invoice_currency']['options'] = $this->arrCurrencies;
$arrUserData['selection']['invoice_currency']['mandatory'] = 1;
$arrUserData['numeric']['invoice_amount']['name'] = $_ARRAYLANG['TXT_CHECKOUT_INVOICE_AMOUNT'];
$arrUserData['numeric']['invoice_amount']['value'] = $arrFieldValues['invoice_amount'];
$arrUserData['numeric']['invoice_amount']['length'] = 15;
$arrUserData['numeric']['invoice_amount']['mandatory'] = 1;
$arrUserData['selection']['contact_title']['name'] = $_ARRAYLANG['TXT_CHECKOUT_CONTACT_TITLE'];
$arrUserData['selection']['contact_title']['value'] = $arrFieldValues['contact_title'];
$arrUserData['selection']['contact_title']['options'] = array(self::MISTER => '', self::MISS => '');
$arrUserData['selection']['contact_title']['mandatory'] = 1;
$arrUserData['text']['contact_forename']['name'] = $_ARRAYLANG['TXT_CHECKOUT_CONTACT_FORENAME'];
$arrUserData['text']['contact_forename']['value'] = $arrFieldValues['contact_forename'];
$arrUserData['text']['contact_forename']['length'] = 255;
$arrUserData['text']['contact_forename']['mandatory'] = 1;
$arrUserData['text']['contact_surname']['name'] = $_ARRAYLANG['TXT_CHECKOUT_CONTACT_SURNAME'];
$arrUserData['text']['contact_surname']['value'] = $arrFieldValues['contact_surname'];
$arrUserData['text']['contact_surname']['length'] = 255;
$arrUserData['text']['contact_surname']['mandatory'] = 1;
$arrUserData['text']['contact_company']['name'] = $_ARRAYLANG['TXT_CHECKOUT_CONTACT_COMPANY'];
$arrUserData['text']['contact_company']['value'] = $arrFieldValues['contact_company'];
$arrUserData['text']['contact_company']['length'] = 255;
$arrUserData['text']['contact_company']['mandatory'] = 0;
$arrUserData['text']['contact_street']['name'] = $_ARRAYLANG['TXT_CHECKOUT_CONTACT_STREET'];
$arrUserData['text']['contact_street']['value'] = $arrFieldValues['contact_street'];
$arrUserData['text']['contact_street']['length'] = 255;
$arrUserData['text']['contact_street']['mandatory'] = 1;
$arrUserData['text']['contact_postcode']['name'] = $_ARRAYLANG['TXT_CHECKOUT_CONTACT_POSTCODE'];
$arrUserData['text']['contact_postcode']['value'] = $arrFieldValues['contact_postcode'];
$arrUserData['text']['contact_postcode']['length'] = 255;
$arrUserData['text']['contact_postcode']['mandatory'] = 1;
$arrUserData['text']['contact_place']['name'] = $_ARRAYLANG['TXT_CHECKOUT_CONTACT_PLACE'];
$arrUserData['text']['contact_place']['value'] = $arrFieldValues['contact_place'];
$arrUserData['text']['contact_place']['length'] = 255;
$arrUserData['text']['contact_place']['mandatory'] = 1;
$arrUserData['selection']['contact_country']['name'] = $_ARRAYLANG['TXT_CHECKOUT_CONTACT_COUNTRY'];
$arrUserData['selection']['contact_country']['value'] = $arrFieldValues['contact_country'];
$arrUserData['selection']['contact_country']['options'] = $this->arrCountries;
//.........这里部分代码省略.........