本文整理汇总了PHP中BxTemplFormView类的典型用法代码示例。如果您正苦于以下问题:PHP BxTemplFormView类的具体用法?PHP BxTemplFormView怎么用?PHP BxTemplFormView使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了BxTemplFormView类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getForm
public function getForm($iDesignBoxTemplate = BX_DB_PADDING_DEF, $sTitle = false)
{
if ($this->_sMetaType) {
return '';
}
if (false === $sTitle) {
$sTitle = _t("_Search");
}
$aValues = $this->getKeyTitlesPairs();
$aValue = isset($_GET['type']) ? bx_process_input($_GET['type']) : array_keys($aValues);
$sIdForm = $this->_sIdForm . ($this->_bLiveSearch ? $this->_sSuffixLiveSearch : '');
$sIdResults = $this->_sIdResults . ($this->_bLiveSearch ? $this->_sSuffixLiveSearch : '');
$sIdLoadingContainer = $this->_bLiveSearch ? $sIdResults : $sIdForm;
$sJsParams = "5, '#{$sIdForm}', '#{$sIdResults}', '#{$sIdLoadingContainer}', '{$this->_bLiveSearch}'";
$aForm = array('form_attrs' => array('id' => $sIdForm, 'action' => BX_DOL_URL_ROOT . 'searchKeyword.php', 'method' => 'post'), 'csrf' => array('disable' => true), 'inputs' => array('live_search' => array('type' => 'hidden', 'name' => 'live_search', 'value' => $this->_bLiveSearch ? 1 : 0), 'section' => array('type' => 'checkbox_set', 'name' => 'section', 'caption' => _t('_Section'), 'values' => $aValues, 'value' => $aValue), 'keyword' => array('type' => 'text', 'name' => 'keyword', 'caption' => _t('_Keyword'), 'value' => bx_get('keyword') ? bx_process_input(bx_get('keyword')) : ''), 'search' => array('type' => 'submit', 'name' => 'search', 'value' => _t('_Search'))));
if ($this->_bLiveSearch) {
unset($aForm['inputs']['section']);
unset($aForm['inputs']['search']);
unset($aForm['inputs']['keyword']['caption']);
$aForm['inputs']['keyword']['attrs']['placeholder'] = _t('_sys_search_placeholder');
$aForm['inputs']['keyword']['attrs']['onkeypress'] = "return bx_search_on_type(event, {$sJsParams});";
$aForm['inputs']['keyword']['attrs']['onpaste'] = $aForm['inputs']['keyword']['attrs']['onkeypress'];
}
bx_import('BxTemplFormView');
$oForm = new BxTemplFormView($aForm);
$sForm = $oForm->getCode();
if (!$this->_bLiveSearch) {
bx_import('BxTemplPaginate');
$o = new BxTemplPaginate(array());
$o->addCssJs();
}
return DesignBoxContent($sTitle, $sForm, $iDesignBoxTemplate);
}
示例2: getPostForm
function getPostForm($iUnitID = 0)
{
$sAddNewC = _t('_bx_quotes_add_new');
$sAction = 'add';
$sQText = $sQText = '';
if ($iUnitID) {
$aQinfo = $this->_oDb->getQuote($iUnitID);
$sQText = $aQinfo['Text'];
$sQAuthor = $aQinfo['Author'];
$sAction = 'edit';
}
$aForm = array('form_attrs' => array('name' => 'create_quotes_form', 'action' => BX_DOL_URL_ROOT . 'modules/?r=quotes/administration/', 'method' => 'post'), 'params' => array('db' => array('table' => 'bx_quotes_units', 'key' => 'ID', 'submit_name' => 'add_button')), 'inputs' => array('action' => array('type' => 'hidden', 'name' => 'action', 'value' => $sAction), 'Text' => array('type' => 'textarea', 'name' => 'Text', 'caption' => _t('_bx_quotes_text'), 'required' => true, 'value' => $sQText, 'checker' => array('func' => 'length', 'params' => array(3, 1024), 'error' => _t('_bx_quotes_text_err', 1024)), 'db' => array('pass' => 'Xss')), 'Author' => array('type' => 'text', 'name' => 'Author', 'caption' => _t('_bx_quotes_author'), 'required' => true, 'value' => $sQAuthor, 'checker' => array('func' => 'length', 'params' => array(3, 128), 'error' => _t('_bx_quotes_author_err', 128)), 'db' => array('pass' => 'Xss')), 'add_button' => array('type' => 'submit', 'name' => 'add_button', 'value' => _t('_Submit'))));
if ($iUnitID) {
$aForm['inputs']['hidden_unitid'] = array('type' => 'hidden', 'name' => 'ID', 'value' => $iUnitID);
}
$sCode = '';
$oForm = new BxTemplFormView($aForm);
$oForm->initChecker();
if ($oForm->isSubmittedAndValid()) {
$sCode = MsgBox(_t('_bx_quotes_fail'), 1);
$aValsAdd = array();
$iLastId = -1;
if ($iUnitID > 0) {
$oForm->update($iUnitID, $aValsAdd);
$iLastId = $iUnitID;
$sCode = MsgBox(_t('_bx_quotes_edited_success'), 1);
} else {
$iLastId = $oForm->insert($aValsAdd);
$sCode = MsgBox(_t('_bx_quotes_success'), 1);
}
}
return DesignBoxAdmin($sAddNewC, $sCode . $oForm->getCode());
}
示例3: blockFiles
function blockFiles(&$aData)
{
$iEntryId = $aData['id'];
$aReadyMedia = array();
if ($iEntryId) {
$aReadyMedia = $GLOBALS['oBxStoreModule']->_oDb->getFiles($iEntryId, true);
}
if (!$aReadyMedia) {
return '';
}
$aVars = array('bx_repeat:files' => array());
$sCurrencySign = getParam('pmt_default_currency_sign');
foreach ($aReadyMedia as $r) {
$iMediaId = $r['media_id'];
$a = BxDolService::call('files', 'get_file_array', array($iMediaId), 'Search');
if (!$a['date']) {
continue;
}
bx_import('BxTemplFormView');
$oForm = new BxTemplFormView(array());
$aInputBtnDownload = array('type' => 'submit', 'name' => 'bx_store_download', 'value' => _t('_bx_store_download'), 'attrs' => array('onclick' => "window.open ('" . BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . "download/{$r['id']}','_self');"));
$aVars['bx_repeat:files'][] = array('id' => $iMediaId, 'title' => $a['title'], 'icon' => $a['file'], 'price' => $sCurrencySign . ' ' . $r['price'], 'for_group' => sprintf(_t('_bx_store_for_group'), $GLOBALS['oBxStoreModule']->getGroupName($r['allow_purchase_to'])), 'date' => defineTimeInterval($a['date']), 'bx_if:purchase' => array('condition' => $GLOBALS['oBxStoreModule']->isAllowedPurchase($r), 'content' => array('btn_purchase' => BxDolService::call('payment', 'get_add_to_cart_link', array($r['author_id'], $this->_oConfig->getId(), $r['id'], 1)))), 'bx_if:download' => array('condition' => $GLOBALS['oBxStoreModule']->isAllowedDownload($r), 'content' => array('btn_download' => $oForm->genInputButton($aInputBtnDownload))));
}
if (!$aVars['bx_repeat:files']) {
return '';
}
return $this->parseHtmlByName('block_files', $aVars);
}
示例4: PageCompPageMainCodeWithForm
function PageCompPageMainCodeWithForm()
{
global $oTemplConfig, $site;
$aForm = array('form_attrs' => array('id' => 'post_us_form', 'action' => BX_DOL_URL_ROOT . 'contact.php', 'method' => 'post'), 'params' => array('db' => array('submit_name' => 'do_submit')), 'inputs' => array('name' => array('type' => 'text', 'name' => 'name', 'caption' => _t('_Your name'), 'required' => true, 'checker' => array('func' => 'length', 'params' => array(1, 150), 'error' => _t('_Name is required'))), 'email' => array('type' => 'text', 'name' => 'email', 'caption' => _t('_Your email'), 'required' => true, 'checker' => array('func' => 'email', 'error' => _t('_Incorrect Email'))), 'message_subject' => array('type' => 'text', 'name' => 'subject', 'caption' => _t('_message_subject'), 'required' => true, 'checker' => array('func' => 'length', 'params' => array(5, 300), 'error' => _t('_ps_ferr_incorrect_length'))), 'message_text' => array('type' => 'textarea', 'name' => 'body', 'caption' => _t('_Message text'), 'required' => true, 'checker' => array('func' => 'length', 'params' => array(10, 5000), 'error' => _t('_ps_ferr_incorrect_length'))), 'captcha' => array('type' => 'captcha', 'caption' => _t('_Enter what you see'), 'name' => 'securityImageValue', 'required' => true, 'checker' => array('func' => 'captcha', 'error' => _t('_Incorrect Captcha'))), 'submit' => array('type' => 'submit', 'name' => 'do_submit', 'value' => _t('_Submit'))));
$oForm = new BxTemplFormView($aForm);
$sForm = $oForm->getCode();
$oForm->initChecker();
if ($oForm->isSubmittedAndValid()) {
$sSenderName = process_pass_data($_POST['name'], BX_TAGS_STRIP);
$sSenderEmail = process_pass_data($_POST['email'], BX_TAGS_STRIP);
$sLetterSubject = process_pass_data($_POST['subject'], BX_TAGS_STRIP);
$sLetterBody = process_pass_data($_POST['body'], BX_TAGS_STRIP);
$sLetterBody = $sLetterBody . "\r\n" . '============' . "\r\n" . _t('_from') . ' ' . $sSenderName . "\r\n" . 'with email ' . $sSenderEmail;
if (sendMail($site['email'], $sLetterSubject, $sLetterBody)) {
$sActionKey = '_ADM_PROFILE_SEND_MSG';
} else {
$sActionKey = '_Email sent failed';
}
$sActionText = MsgBox(_t($sActionKey));
$sForm = $sActionText . $sForm;
} else {
$sForm = $oForm->getCode();
}
return DesignBoxContent(_t('_CONTACT_H1'), $sForm, $oTemplConfig->PageCompThird_db_num);
}
示例5: getSearchForm
function getSearchForm()
{
$aList = $GLOBALS['MySQL']->fromCache('sys_objects_search', 'getAllWithKey', 'SELECT `ID` as `id`,
`Title` as `title`,
`ClassName` as `class`,
`ClassPath` as `file`,
`ObjectName`
FROM `sys_objects_search`', 'ObjectName');
$aValues = array();
foreach ($aList as $sKey => $aValue) {
$aValues[$sKey] = _t($aValue['title']);
if (!class_exists($aValue['class'])) {
$sPath = BX_DIRECTORY_PATH_ROOT . str_replace('{tmpl}', $GLOBALS['tmpl'], $aValue['file']);
require_once $sPath;
}
$oClass = new $aValue['class']();
$oClass->addCustomParts();
}
if (isset($_GET['type'])) {
$aValue = strip_tags($_GET['type']);
} else {
$aValue = array_keys($aValues);
}
$aForm = array('form_attrs' => array('id' => 'searchForm', 'action' => '', 'method' => 'post', 'onsubmit' => ''), 'inputs' => array('section' => array('type' => 'checkbox_set', 'name' => 'section', 'caption' => _t('_Section'), 'values' => $aValues, 'value' => $aValue), 'keyword' => array('type' => 'text', 'name' => 'keyword', 'caption' => _t('_Keyword')), 'search' => array('type' => 'submit', 'name' => 'search', 'value' => _t('_Search'))));
$oForm = new BxTemplFormView($aForm);
$sFormVal = $oForm->getCode();
return DesignBoxContent(_t("_Search"), $sFormVal, 11);
}
示例6: _addJsCss
/**
* add js file for AJAX form submission
*/
protected function _addJsCss()
{
parent::_addJsCss();
$this->_oTemplate->addJs('jquery.form.min.js');
$oForm = new BxTemplFormView(array());
$oForm->addCssJs();
}
示例7: _getList
function _getList($mixedResult, $bActive = false)
{
$aForm = array('form_attrs' => array('id' => 'adm-email-templates', 'action' => $GLOBALS['site']['url_admin'] . 'email_templates.php', 'method' => 'post', 'enctype' => 'multipart/form-data'), 'params' => array('db' => array('table' => 'sys_email_templates', 'key' => 'ID', 'uri' => '', 'uri_title' => '', 'submit_name' => 'adm-emial-templates-save')), 'inputs' => array());
$aLanguages = $GLOBALS['MySQL']->getAll("SELECT `ID` AS `id`, `Title` AS `title` FROM `sys_localization_languages`");
$aLanguageChooser = array(array('key' => 0, 'value' => 'default'));
foreach ($aLanguages as $aLanguage) {
$aLanguageChooser[] = array('key' => $aLanguage['id'], 'value' => $aLanguage['title']);
}
$sLanguageCpt = _t('_adm_txt_email_language');
$sSubjectCpt = _t('_adm_txt_email_subject');
$sBodyCpt = _t('_adm_txt_email_body');
$aEmails = $GLOBALS['MySQL']->getAll("SELECT `ID` AS `id`, `Name` AS `name`, `Subject` AS `subject`, `Body` AS `body`, `Desc` AS `description` FROM `sys_email_templates` WHERE `LangID`='0' ORDER BY `ID`");
foreach ($aEmails as $aEmail) {
$aForm['inputs'] = array_merge($aForm['inputs'], array($aEmail['name'] . '_Beg' => array('type' => 'block_header', 'caption' => $aEmail['description'], 'collapsable' => true, 'collapsed' => true), $aEmail['name'] . '_Language' => array('type' => 'select', 'name' => $aEmail['name'] . '_Language', 'caption' => $sLanguageCpt, 'value' => 0, 'values' => $aLanguageChooser, 'db' => array('pass' => 'Int'), 'attrs' => array('onchange' => "javascript:getTranslations(this)")), $aEmail['name'] . '_Subject' => array('type' => 'text', 'name' => $aEmail['name'] . '_Subject', 'caption' => $sSubjectCpt, 'value' => $aEmail['subject'], 'db' => array('pass' => 'Xss')), $aEmail['name'] . '_Body' => array('type' => 'textarea', 'name' => $aEmail['name'] . '_Body', 'caption' => $sBodyCpt, 'value' => $aEmail['body'], 'db' => array('pass' => 'XssHtml')), $aEmail['name'] . '_End' => array('type' => 'block_end')));
}
$aForm['inputs']['adm-emial-templates-save'] = array('type' => 'submit', 'name' => 'adm-emial-templates-save', 'value' => _t('_adm_btn_email_save'));
$oForm = new BxTemplFormView($aForm);
$oForm->initChecker();
$sResult = "";
if ($oForm->isSubmittedAndValid()) {
$iResult = 0;
foreach ($aEmails as $aEmail) {
$iEmailId = (int) $GLOBALS['MySQL']->getOne("SELECT `ID` FROM `sys_email_templates` WHERE `Name`='" . process_db_input($aEmail['name']) . "' AND `LangID`='" . (int) $_POST[$aEmail['name'] . '_Language'] . "' LIMIT 1");
if ($iEmailId != 0) {
$iResult += (int) $GLOBALS['MySQL']->query("UPDATE `sys_email_templates` SET `Subject`='" . process_db_input($_POST[$aEmail['name'] . '_Subject']) . "', `Body`='" . process_db_input($_POST[$aEmail['name'] . '_Body']) . "' WHERE `ID`='" . $iEmailId . "'");
} else {
$iResult += (int) $GLOBALS['MySQL']->query("INSERT INTO `sys_email_templates` SET `Name`='" . process_db_input($aEmail['name']) . "', `Subject`='" . process_db_input($_POST[$aEmail['name'] . '_Subject']) . "', `Body`='" . process_db_input($_POST[$aEmail['name'] . '_Body']) . "', `LangID`='" . (int) $_POST[$aEmail['name'] . '_Language'] . "'");
}
}
$bActive = true;
$sResult .= MsgBox(_t($iResult > 0 ? "_adm_txt_email_success_save" : "_adm_txt_email_nothing_changed"), 3);
}
$sResult .= $oForm->getCode();
return $GLOBALS['oAdmTemplate']->parseHtmlByName('email_templates_list.html', array('display' => $bActive ? 'block' : 'none', 'content' => stripslashes($sResult), 'loading' => LoadingBox('adm-email-loading')));
}
示例8: getManagingForm
function getManagingForm()
{
$sApplyChangesC = _t('_sys_admin_apply');
$sFromC = _t('_From');
$sToC = _t('_To');
$sSampleC = _t('_adm_ipbl_sample');
$sTypeC = _t('_adm_ipbl_IP_Role');
$sDescriptionC = _t('_Description');
$sDatatimeC = _t('_adm_ipbl_Date_of_finish');
$sErrorC = _t('_Error Occured');
$aForm = array('form_attrs' => array('name' => 'apply_ip_list_form', 'action' => $this->_sActionUrl, 'method' => 'post'), 'params' => array('db' => array('table' => 'sys_ip_list', 'key' => 'ID', 'submit_name' => 'add_button')), 'inputs' => array('FromIP' => array('type' => 'text', 'name' => 'from', 'caption' => $sFromC, 'info' => $sSampleC . ': 10.0.0.0', 'required' => true, 'checker' => array('func' => 'length', 'params' => array(7, 15), 'error' => $sErrorC)), 'ToIP' => array('type' => 'text', 'name' => 'to', 'caption' => $sToC, 'info' => $sSampleC . ': 10.0.0.100', 'required' => true, 'checker' => array('func' => 'length', 'params' => array(7, 15), 'error' => $sErrorC)), 'IPRole' => array('type' => 'select', 'name' => 'type', 'caption' => $sTypeC, 'values' => array('allow', 'deny'), 'required' => true), 'DateTime' => array('type' => 'datetime', 'name' => 'LastDT', 'caption' => $sDatatimeC, 'required' => true, 'checker' => array('func' => 'DateTime', 'error' => $sErrorC), 'db' => array('pass' => 'DateTime')), 'Desc' => array('type' => 'text', 'name' => 'desc', 'caption' => $sDescriptionC, 'required' => true, 'checker' => array('func' => 'length', 'params' => array(2, 128), 'error' => $sErrorC), 'db' => array('pass' => 'Xss')), 'ID' => array('type' => 'hidden', 'value' => '0', 'name' => 'id'), 'add_button' => array('type' => 'submit', 'name' => 'add_button', 'value' => $sApplyChangesC)));
$sResult = '';
$oForm = new BxTemplFormView($aForm);
$oForm->initChecker();
if ($oForm->isSubmittedAndValid()) {
/*list($iDay, $iMonth, $iYear) = explode( '/', $_REQUEST['datatime']);
$iDay = (int)$iDay;
$iMonth = (int)$iMonth;
$iYear = (int)$iYear;
//$sCurTime = date("Y:m:d H:i:s");// 2012-06-20 15:46:21
$sCurTime = "{$iYear}:{$iMonth}:{$iDay} 12:00:00";*/
$sFrom = sprintf("%u", ip2long($_REQUEST['from']));
$sTo = sprintf("%u", ip2long($_REQUEST['to']));
$sType = (int) $_REQUEST['type'] == 1 ? 'deny' : 'allow';
$aValsAdd = array('From' => $sFrom, 'To' => $sTo, 'Type' => $sType);
$iLastId = (int) $_REQUEST['id'] > 0 ? (int) $_REQUEST['id'] : -1;
if ($iLastId > 0) {
$oForm->update($iLastId, $aValsAdd);
} else {
$iLastId = $oForm->insert($aValsAdd);
}
$sResult = $iLastId > 0 ? MsgBox(_t('_Success'), 3) : MsgBox($sErrorC);
}
return $sResult . $oForm->getCode();
}
示例9: PageCompPageMainCode
/**
* page code function
*/
function PageCompPageMainCode($iID, $sConfCode)
{
global $site;
$ID = (int) $iID;
$ConfCode = clear_xss($sConfCode);
$p_arr = getProfileInfo($ID);
if (!$p_arr) {
$_page['header'] = _t("_Error");
$_page['header_text'] = _t("_Profile Not found");
return MsgBox(_t('_Profile Not found Ex'));
}
$aCode = array('message_status' => '', 'message_info' => '', 'bx_if:form' => array('condition' => false, 'content' => array('form' => '')), 'bx_if:next' => array('condtion' => false, 'content' => array('next_url' => '')));
if ($p_arr['Status'] == 'Unconfirmed') {
$ConfCodeReal = base64_encode(base64_encode(crypt($p_arr[Email], CRYPT_EXT_DES ? "secret_co" : "se")));
if (strcmp($ConfCode, $ConfCodeReal) != 0) {
$aForm = array('form_attrs' => array('action' => BX_DOL_URL_ROOT . 'profile_activate.php', 'method' => 'post', 'name' => 'form_change_status'), 'inputs' => array('conf_id' => array('type' => 'hidden', 'name' => 'ConfID', 'value' => $ID), 'conf_code' => array('type' => 'text', 'name' => 'ConfCode', 'value' => '', 'caption' => _t("_Confirmation code")), 'submit' => array('type' => 'submit', 'name' => 'submit', 'value' => _t("_Submit"))));
$oForm = new BxTemplFormView($aForm);
$aCode['message_status'] = _t("_Profile activation failed");
$aCode['message_info'] = _t("_EMAIL_CONF_FAILED_EX");
$aCode['bx_if:form']['condition'] = true;
$aCode['bx_if:form']['content']['form'] = $oForm->getCode();
} else {
$aCode['bx_if:next']['condition'] = true;
$aCode['bx_if:next']['content']['next_url'] = BX_DOL_URL_ROOT . 'member.php';
$send_act_mail = false;
if (getParam('autoApproval_ifJoin') == 'on' && !(getParam('sys_dnsbl_enable') && 'approval' == getParam('sys_dnsbl_behaviour') && bx_is_ip_dns_blacklisted('', 'join'))) {
$status = 'Active';
$send_act_mail = true;
$aCode['message_info'] = _t("_PROFILE_CONFIRM");
} else {
$status = 'Approval';
$aCode['message_info'] = _t("_EMAIL_CONF_SUCCEEDED", $site['title']);
}
$update = bx_admin_profile_change_status($ID, $status, $send_act_mail);
// Promotional membership
if (getParam('enable_promotion_membership') == 'on') {
$memership_days = getParam('promotion_membership_days');
setMembership($p_arr['ID'], MEMBERSHIP_ID_PROMOTION, $memership_days, true);
}
// check couple profile;
if ($p_arr['Couple']) {
$update = bx_admin_profile_change_status($p_arr['Couple'], $status);
//Promotional membership
if (getParam('enable_promotion_membership') == 'on') {
$memership_days = getParam('promotion_membership_days');
setMembership($p_arr['Couple'], MEMBERSHIP_ID_PROMOTION, $memership_days, true);
}
}
if (getParam('newusernotify')) {
$oEmailTemplates = new BxDolEmailTemplates();
$aTemplate = $oEmailTemplates->getTemplate('t_UserConfirmed', $p_arr['ID']);
sendMail($site['email_notify'], $aTemplate['Subject'], $aTemplate['Body'], $p_arr['ID']);
}
}
} else {
$aCode['message_info'] = _t('_ALREADY_ACTIVATED');
}
return $GLOBALS['oSysTemplate']->parseHtmlByName('profile_activate.html', $aCode);
}
示例10: actionGetInvitation
function actionGetInvitation()
{
$aForm = array('form_attrs' => array('name' => 'invitation_form'), 'params' => array('remove_form' => true), 'inputs' => array(array('type' => 'input_set', 'colspan' => true, 0 => array('type' => 'button', 'name' => 'accept', 'value' => _t("_messenger_invitation_accept"), 'attrs' => array('class' => 'bx-btn-small', 'onclick' => 'BxMsgPerformAction("__sender_id__", "accept");')), 1 => array('type' => 'button', 'name' => 'decline', 'value' => _t("_messenger_invitation_decline"), 'attrs' => array('class' => 'bx-btn-small', 'onclick' => 'BxMsgPerformAction("__sender_id__", "decline");')), 2 => array('type' => 'button', 'name' => 'block', 'value' => _t("_messenger_invitation_block"), 'attrs' => array('class' => 'bx-btn-small', 'onclick' => 'BxMsgPerformAction("__sender_id__", "block");')), 3 => array('type' => 'button', 'name' => 'report', 'value' => _t("_messenger_invitation_report"), 'attrs' => array('class' => 'bx-btn-small', 'onclick' => 'BxMsgPerformAction("__sender_id__", "spam");')))));
$oForm = new BxTemplFormView($aForm);
$aVariables = array('invitation_buttons' => $oForm->getCode());
$sResult = $this->_oTemplate->parseHtmlByName("invitation.html", $aVariables);
return $sResult;
}
示例11: PageCodeLogo
function PageCodeLogo($mixedResultLogo)
{
$aForm = array('form_attrs' => array('id' => 'adm-settings-form-logo', 'name' => 'adm-settings-form-logo', 'action' => $GLOBALS['site']['url_admin'] . 'basic_settings.php', 'method' => 'post', 'enctype' => 'multipart/form-data'), 'params' => array(), 'inputs' => array('upload_header_beg' => array('type' => 'block_header', 'caption' => _t('_adm_txt_settings_logo_header'), 'collapsable' => false, 'collapsed' => false), 'old_file' => array('type' => 'custom', 'content' => getMainLogo(), 'colspan' => true), 'new_file' => array('type' => 'file', 'name' => 'new_file', 'caption' => _t('_adm_txt_settings_logo_upload'), 'value' => ''), 'resize_header_beg' => array('type' => 'block_header', 'caption' => _t('_adm_txt_settings_resize_header'), 'collapsable' => false, 'collapsed' => false), 'resize' => array('type' => 'checkbox', 'name' => 'resize', 'caption' => _t('_adm_txt_settings_resize_enable'), 'value' => 'yes', 'checked' => true), 'new_width' => array('type' => 'text', 'name' => 'new_width', 'caption' => _t('_adm_txt_settings_resize_width'), 'value' => '64'), 'new_height' => array('type' => 'text', 'name' => 'new_height', 'caption' => _t('_adm_txt_settings_resize_height'), 'value' => '64'), 'resize_header_end' => array('type' => 'block_end'), 'upload' => array('type' => 'submit', 'name' => 'upload', 'value' => _t("_adm_btn_settings_upload"))));
$oForm = new BxTemplFormView($aForm);
$sResult = $GLOBALS['oAdmTemplate']->parseHtmlByName('design_box_content.html', array('content' => $oForm->getCode()));
if ($mixedResultLogo !== true && !empty($mixedResultLogo)) {
$sResult = MsgBox(_t($mixedResultLogo), 3) . $sResult;
}
return DesignBoxAdmin(_t('_adm_box_cpt_logo'), $sResult);
}
示例12: PageCompPageMainCode
/**
* page code function
*/
function PageCompPageMainCode()
{
if ($_POST['DELETE']) {
profile_delete(getLoggedId());
bx_logout();
return MsgBox(_t("_DELETE_SUCCESS"));
}
$aForm = array('form_attrs' => array('action' => BX_DOL_URL_ROOT . 'unregister.php', 'method' => 'post', 'name' => 'form_unregister'), 'inputs' => array('delete' => array('type' => 'hidden', 'name' => 'DELETE', 'value' => '1'), 'info' => array('type' => 'custom', 'content' => _t("_DELETE_TEXT"), 'colspan' => true), 'submit' => array('type' => 'submit', 'name' => 'submit', 'value' => _t("_Delete account"))));
$oForm = new BxTemplFormView($aForm);
return $oForm->getCode();
}
示例13: _getDefaults
function _getDefaults($mixedResult, $bActive = false)
{
$sNamePrefix = 'adm-pvc-action-';
$aForm = array('form_attrs' => array('id' => 'adm-pvc-defaults', 'action' => $GLOBALS['site']['url_admin'] . 'privacy.php', 'method' => 'post', 'enctype' => 'multipart/form-data'), 'params' => array('db' => array('table' => 'sys_privacy_actions', 'key' => 'ID', 'uri' => '', 'uri_title' => '', 'submit_name' => 'adm-pvc-defaults-save')), 'inputs' => array());
$aValues = array();
$aGroupIds = $GLOBALS['MySQL']->getColumn("SELECT `id` FROM `sys_privacy_groups` WHERE `owner_id`='0' AND `id` NOT IN('" . implode("','", array(BX_DOL_PG_DEFAULT, BX_DOL_PG_HIDDEN)) . "')");
foreach ($aGroupIds as $iGroupId) {
if (getParam('sys_ps_enabled_group_' . $iGroupId) == 'on') {
$aValues[$iGroupId] = _t('_ps_group_' . $iGroupId . '_title');
}
}
$sModule = '';
$aActions = $GLOBALS['MySQL']->getAll("SELECT `id` AS `id`, `module_uri` AS `module`, `title` AS `title`, `default_group` AS `default_group` FROM `sys_privacy_actions` WHERE 1 ORDER BY `module_uri` ASC");
foreach ($aActions as $aAction) {
$sName = $sNamePrefix . $aAction['id'];
$sValue = $aAction['default_group'];
if ($aAction['module'] != $sModule) {
if (!empty($sModule)) {
$aForm['inputs'][$sModule . '_end'] = array('type' => 'block_end');
}
$sModule = $aAction['module'];
$aForm['inputs'][$sModule . '_beg'] = array('type' => 'block_header', 'caption' => _t('_sys_module_' . $sModule), 'collapsable' => true, 'collapsed' => true);
}
if (!in_array($sValue, $aGroupIds)) {
continue;
}
$aForm['inputs'][$sName] = array('type' => 'select', 'name' => $sName, 'caption' => _t($aAction['title']), 'value' => (int) $sValue, 'values' => $aValues, 'db' => array('pass' => 'Int'));
}
$aForm['inputs'][$sModule . '_end'] = array('type' => 'block_end');
$aForm['inputs']['adm-pvc-defaults-save'] = array('type' => 'submit', 'name' => 'adm-pvc-defaults-save', 'value' => _t('_adm_btn_pvc_save'));
$oForm = new BxTemplFormView($aForm);
$oForm->initChecker();
$sResult = "";
if ($oForm->isSubmittedAndValid()) {
$iResult = 0;
foreach ($aActions as $aAction) {
$sName = $sNamePrefix . $aAction['id'];
$sValueOld = $aAction['default_group'];
if (!in_array($sValueOld, $aGroupIds)) {
continue;
}
$sValueNew = bx_get($sName);
if ($sValueNew === false || (int) $sValueNew == (int) $sValueOld) {
continue;
}
$iResult += (int) $GLOBALS['MySQL']->query("UPDATE `sys_privacy_actions` SET `default_group`='" . (int) $sValueNew . "' WHERE `id`='" . $aAction['id'] . "'");
}
$bActive = true;
$sResult .= MsgBox(_t($iResult > 0 ? "_adm_txt_pvc_success_save" : "_adm_txt_pvc_nothing_changed"), 3);
}
$sResult .= $oForm->getCode();
return $GLOBALS['oAdmTemplate']->parseHtmlByName('privacy_defaults.html', array('display' => $bActive ? 'block' : 'none', 'form' => stripslashes($sResult)));
}
示例14: PageCompPageMainCode
/**
* page code function
*/
function PageCompPageMainCode()
{
$iUserId = getLoggedId();
if ($_POST['DELETE']) {
profile_delete($iUserId);
bx_logout();
return MsgBox(_t("_DELETE_SUCCESS"));
}
$aForm = array('form_attrs' => array('action' => BX_DOL_URL_ROOT . 'unregister.php', 'method' => 'post', 'name' => 'form_unregister'), 'inputs' => array('delete' => array('type' => 'hidden', 'name' => 'DELETE', 'value' => '1'), 'info' => array('type' => 'custom', 'content' => _t("_DELETE_TEXT"), 'colspan' => true), 'submit' => array('type' => 'submit', 'name' => 'submit', 'value' => _t("_Delete account"))));
$oForm = new BxTemplFormView($aForm);
$GLOBALS['oTopMenu']->setCurrentProfileID($iUserId);
return $GLOBALS['oSysTemplate']->parseHtmlByName('default_margin.html', array('content' => $oForm->getCode()));
}
示例15: PageCompMainCode
/**
* page code function
*/
function PageCompMainCode()
{
ob_start();
$aForm = array('form_attrs' => array('id' => 'sample_form', 'action' => BX_DOL_URL_ROOT . 'samples/forms.php', 'method' => 'post'), 'params' => array('db' => array('submit_name' => 'do_submit')), 'inputs' => array('header_contact' => array('type' => 'block_header', 'caption' => 'Contact details'), 'name' => array('type' => 'text', 'name' => 'name', 'caption' => _t('_Your name'), 'required' => true, 'checker' => array('func' => 'length', 'params' => array(1, 150), 'error' => _t('_Name is required'))), 'date' => array('type' => 'datepicker', 'name' => 'date', 'caption' => _t('Date'), 'required' => true, 'checker' => array('func' => 'avail', 'error' => _t('Date is required'))), 'datetime' => array('type' => 'datetime', 'name' => 'datetime', 'caption' => _t('Datetime'), 'required' => true, 'checker' => array('func' => 'avail', 'error' => _t('Datetime is required'))), 'email' => array('type' => 'text', 'name' => 'email', 'caption' => _t('_Your email'), 'required' => true, 'checker' => array('func' => 'email', 'error' => _t('_Incorrect Email'))), 'header_message' => array('type' => 'block_header', 'caption' => 'Message details', 'collapsable' => true, 'collapsed' => false), 'message_subject' => array('type' => 'text', 'name' => 'subject', 'caption' => _t('_message_subject'), 'required' => true, 'checker' => array('func' => 'length', 'params' => array(5, 300), 'error' => _t('_ps_ferr_incorrect_length'))), 'message_text' => array('type' => 'textarea', 'name' => 'body', 'caption' => _t('_Message text'), 'required' => true, 'checker' => array('func' => 'length', 'params' => array(10, 5000), 'error' => _t('_ps_ferr_incorrect_length'))), 'header_advanced' => array('type' => 'block_header', 'caption' => 'Advanced details', 'collapsable' => true, 'collapsed' => true), 'select_something' => array('type' => 'select', 'name' => 'select_something', 'caption' => _t('Select something'), 'values' => array(1 => 'One', 'Two', 'Three', 'Four', 'Five'), 'required' => true), 'select_radio' => array('type' => 'radio_set', 'name' => 'select_radio', 'caption' => _t('Select radio something'), 'values' => array(1 => 'One', 'Two', 'Three'), 'required' => true), 'choose_something' => array('type' => 'checkbox_set', 'name' => 'choose_something', 'caption' => _t('Choose something'), 'values' => array(1 => 'One', 'Two', 'Three', 'Four', 'Five'), 'required' => true), 'select_multiple' => array('type' => 'select_multiple', 'name' => 'select_multiple', 'caption' => _t('Multiple select'), 'values' => array(1 => 'One', 'Two', 'Three', 'Four', 'Five'), 'required' => true), 'doublerange' => array('type' => 'doublerange', 'name' => 'doublerange', 'caption' => _t('Double Range'), 'attrs' => array('min' => 10, 'max' => 200), 'value' => '20-30', 'required' => true), 'header_submit' => array('type' => 'block_header', 'caption' => ''), 'iagree' => array('type' => 'checkbox', 'name' => 'iagree', 'value' => '1', 'caption' => _t('Do you like it?'), 'required' => true, 'checker' => array('func' => 'avail', 'error' => _t('Form can not be submitted if you don\'t like it.'))), 'submit' => array('type' => 'input_set', 0 => array('type' => 'submit', 'name' => 'do_submit', 'value' => _t('_Submit')), 1 => array('type' => 'reset', 'name' => 'close', 'value' => _t('_Reset'), 'attrs' => array('class' => 'bx-def-margin-sec-left')))));
$oForm = new BxTemplFormView($aForm);
$oForm->initChecker();
if ($oForm->isSubmittedAndValid()) {
echo MsgBox('Data was successfully submitted');
}
echo $oForm->getCode();
$s = ob_get_clean();
return DesignBoxContent("Sample form", $s, BX_DB_PADDING_DEF);
}