Esempio n. 1
0
 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);
 }
Esempio n. 2
0
 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());
 }
Esempio n. 3
0
 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);
 }
Esempio n. 4
0
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);
}
Esempio n. 5
0
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);
}
Esempio n. 6
0
 /**
  * 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();
 }
Esempio n. 7
0
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')));
}
 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();
 }
/**
 * 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);
}
Esempio n. 10
0
 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;
 }
Esempio n. 11
0
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);
}
Esempio n. 12
0
/**
 * 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();
}
Esempio n. 13
0
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)));
}
Esempio n. 14
0
/**
 * 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()));
}
Esempio n. 15
0
/**
 * 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);
}
Esempio n. 16
0
 function getCodeCharts()
 {
     $aObjects = $GLOBALS['MySQL']->getAll("SELECT * FROM `sys_objects_charts` WHERE `active` = 1 ORDER BY `order` ASC");
     foreach ($aObjects as $k => $a) {
         $aObjects[$k]['title'] = _t($a['title']);
     }
     $sContent = $GLOBALS['oAdmTemplate']->parseHtmlByName('dashboard_charts.html', array('proto' => bx_proto(), 'admin_url' => BX_DOL_URL_ADMIN, 'from' => date('Y-m-d', time() - 30 * 24 * 60 * 60), 'to' => date('Y-m-d', time()), 'bx_repeat:objects' => $aObjects));
     // add datepicker
     bx_import('BxTemplFormView');
     $oForm = new BxTemplFormView(array());
     $oForm->addCssJs(true);
     return DesignBoxAdmin(_t('_adm_box_cpt_charts'), $sContent, '', '', 11);
 }
Esempio n. 17
0
function PageCodeEdit()
{
    $aForm = array('form_attrs' => array('id' => 'adm-css-edit', 'name' => 'adm-css-edit', 'action' => $GLOBALS['site']['url_admin'] . 'css_file.php', 'method' => 'post', 'enctype' => 'multipart/form-data'), 'params' => array('db' => array('table' => '', 'key' => '', 'uri' => '', 'uri_title' => '', 'submit_name' => 'adm-css-save')), 'inputs' => array('css_file' => array('type' => 'select', 'name' => 'css_file', 'caption' => _t('_adm_txt_css_file'), 'value' => '', 'values' => array(), 'attrs' => array('onchange' => "javascript:document.forms['adm-css-edit'].submit();")), 'content' => array('type' => 'textarea', 'name' => 'content', 'caption' => _t('_adm_txt_css_content', $sFileName), 'value' => '', 'db' => array('pass' => 'XssHtml')), 'adm-css-save' => array('type' => 'submit', 'name' => 'adm-css-save', 'value' => _t('_adm_btn_css_save'))));
    //--- Get CSS files ---//
    $aItems = array();
    $sBasePath = BX_DIRECTORY_PATH_ROOT . "templates/tmpl_" . $GLOBALS['oSysTemplate']->getCode() . "/css/";
    $rHandle = opendir($sBasePath);
    while (($sFile = readdir($rHandle)) !== false) {
        if (is_file($sBasePath . $sFile) && substr($sFile, -3) == 'css') {
            $aItems[] = array('key' => $sFile, 'value' => $sFile);
        }
    }
    closedir($rHandle);
    $sCurrentFile = isset($_POST['css_file']) && preg_match("/^\\w+\\.css\$/", $_POST['css_file']) ? $_POST['css_file'] : $aItems[0]['key'];
    $aForm['inputs']['css_file']['value'] = $sCurrentFile;
    $aForm['inputs']['css_file']['values'] = $aItems;
    //--- Get CSS file's content ---//
    $sContent = '';
    $sAbsolutePath = $sBasePath . $sCurrentFile;
    if (strlen($sCurrentFile) > 0 && is_file($sAbsolutePath)) {
        $rHandle = fopen($sAbsolutePath, 'r');
        while (!feof($rHandle)) {
            $sContent .= fgets($rHandle, 4096);
        }
        fclose($rHandle);
    }
    //$aForm['inputs']['content']['value'] = isset($_POST['content']) ? $_POST['content'] : $sContent;
    $aForm['inputs']['content']['value'] = $sContent;
    $oForm = new BxTemplFormView($aForm);
    $oForm->initChecker();
    if ($oForm->isSubmittedAndValid()) {
        if (file_exists($sAbsolutePath) && isRWAccessible($sAbsolutePath)) {
            $rHandle = fopen($sAbsolutePath, 'w');
            if ($rHandle) {
                fwrite($rHandle, clear_xss($_POST['content']));
                fclose($rHandle);
                $mixedResult = '_adm_txt_css_success_save';
            } else {
                $mixedResult = '_adm_txt_css_failed_save';
            }
        } else {
            $mixedResult = '_adm_txt_css_cannot_write';
        }
    }
    $sResult = $GLOBALS['oAdmTemplate']->parseHtmlByName('design_box_content.html', array('content' => $oForm->getCode()));
    if ($mixedResult !== true && !empty($mixedResult)) {
        $sResult = MsgBox(_t($mixedResult, $sCurrentFile), 3) . $sResult;
    }
    return $sResult;
}
Esempio n. 18
0
 function BxEventsFormSearch()
 {
     $oProfileFields = new BxDolProfileFields(0);
     $aCountries = $oProfileFields->convertValues4Input('#!Country');
     $aCountries = array_merge(array('' => _t('_bx_events_all_countries')), $aCountries);
     $aCustomForm = array('form_attrs' => array('name' => 'form_search_events', 'action' => '', 'method' => 'get'), 'params' => array('db' => array('submit_name' => 'submit_form'), 'csrf' => array('disable' => true)), 'inputs' => array('Keyword' => array('type' => 'text', 'name' => 'Keyword', 'caption' => _t('_bx_events_caption_keyword'), 'required' => true, 'checker' => array('func' => 'length', 'params' => array(3, 100), 'error' => _t('_bx_events_err_keyword')), 'db' => array('pass' => 'Xss')), 'Country' => array('type' => 'select_box', 'name' => 'Country', 'caption' => _t('_bx_events_caption_country'), 'values' => $aCountries, 'required' => true, 'checker' => array('func' => 'preg', 'params' => array('/^[a-zA-Z]{0,2}$/'), 'error' => _t('_bx_events_err_country')), 'db' => array('pass' => 'Preg', 'params' => array('/([a-zA-Z]{0,2})/'))), 'Submit' => array('type' => 'submit', 'name' => 'submit_form', 'value' => _t('_Submit'), 'colspan' => true)));
     parent::BxTemplFormView($aCustomForm);
 }
Esempio n. 19
0
 function insert($aValsToAdd = array())
 {
     $aValsToAdd['client_id'] = strtolower(genRndPwd(self::$LENGTH_ID, false));
     $aValsToAdd['client_secret'] = strtolower(genRndPwd(self::$LENGTH_SECRET, false));
     $aValsToAdd['scope'] = 'basic';
     $aValsToAdd['user_id'] = getLoggedId();
     return parent::insert($aValsToAdd);
 }
Esempio n. 20
0
 function getFormCode()
 {
     $oForm = new BxTemplFormView($this->aForm);
     $oForm->initChecker();
     if ($oForm->isSubmittedAndValid()) {
         $aValsAdd = array('Date' => time(), 'Uri' => $oForm->generateUri(), 'Status' => 'active', 'Owner' => $this->iOwnerId);
         if ($this->iAlbumId > 0 && $this->aInfo['Owner'] == $this->iOwnerId) {
             $aValsAdd = array('Date' => time());
             if (!$oForm->update($this->iAlbumId, $aValsAdd)) {
                 return MsgBox(_t('_sys_album_save_error'));
             } else {
                 return MsgBox(_t('_sys_album_save_succ'));
             }
         } else {
             $iAlbumId = $oForm->insert($aValsAdd);
             if (!$iAlbumId) {
                 return MsgBox(_t('_sys_album_save_error'));
             } else {
                 return MsgBox(_t('_sys_album_save_succ'));
             }
         }
     } else {
         return $oForm->getCode();
     }
 }
Esempio n. 21
0
 function BxSitesFormAdd($oModule, $aParam = array())
 {
     $this->_oModule = $oModule;
     $this->_aParam = $aParam;
     $this->_aCustomForm = count($this->_aParam) > 0 ? $this->getFullForm() : $this->getUrlForm();
     $aFormInputsSubmit = array('Submit' => array('type' => 'submit', 'name' => 'submit_form', 'value' => _t('_Submit'), 'colspan' => false));
     $this->_aCustomForm['inputs'] = array_merge($this->_aCustomForm['inputs'], $aFormInputsSubmit);
     parent::BxTemplFormView($this->_aCustomForm);
 }
Esempio n. 22
0
 function isValid()
 {
     if (!parent::isValid()) {
         return false;
     }
     $sErrorString = bx_check_password($this->getCleanValue('ID'), $this->getCleanValue('Password'), $this->getRole());
     $this->_setCustomError($sErrorString);
     return $sErrorString ? false : true;
 }
Esempio n. 23
0
 function __construct()
 {
     bx_import('BxDolCategories');
     $oCategories = new BxDolCategories();
     $oCategories->getTagObjectConfig();
     $aCategories = $oCategories->getCategoriesList('bx_store', (int) $iProfileId, true);
     $aCustomForm = array('form_attrs' => array('name' => 'form_search_store', 'action' => '', 'method' => 'get'), 'params' => array('db' => array('submit_name' => 'submit_form'), 'csrf' => array('disable' => true)), 'inputs' => array('Keyword' => array('type' => 'text', 'name' => 'Keyword', 'caption' => _t('_bx_store_form_caption_keyword'), 'required' => true, 'checker' => array('func' => 'length', 'params' => array(3, 100), 'error' => _t('_bx_store_form_err_keyword')), 'db' => array('pass' => 'Xss')), 'Category' => array('type' => 'select_box', 'name' => 'Category', 'caption' => _t('_bx_store_form_caption_category'), 'values' => $aCategories, 'required' => true, 'checker' => array('func' => 'avail', 'error' => _t('_bx_store_form_err_category')), 'db' => array('pass' => 'Xss')), 'Submit' => array('type' => 'submit', 'name' => 'submit_form', 'value' => _t('_Submit'), 'colspan' => true)));
     parent::__construct($aCustomForm);
 }
Esempio n. 24
0
 function __construct($aCustomForm)
 {
     if (isset($aCustomForm['inputs']['allow_post_in_forum_to']['type'])) {
         $oModuleDb = new BxDolModuleDb();
         if (!$oModuleDb->getModuleByUri('forum')) {
             $aCustomForm['inputs']['allow_post_in_forum_to']['type'] = 'hidden';
         }
     }
     parent::__construct($aCustomForm);
 }
 function addCssJs()
 {
     if (!isset($this->aParams['view_mode']) || !$this->aParams['view_mode']) {
         if (self::$_isCssJsAdded) {
             return;
         }
         $this->_oModule->_oTemplate->addCss('forms.css');
     }
     return parent::addCssJs();
 }
Esempio n. 26
0
 function BxMapFormPrivacy(&$oMain)
 {
     $aCustomForm = array('form_attrs' => array('name' => 'form_map_privacy', 'action' => '', 'method' => 'post'), 'params' => array('db' => array('table' => $oMain->_oConfig->getDbPrefix() . 'profiles', 'key' => 'id', 'submit_name' => 'submit_form')), 'inputs' => array('header_privacy' => array('type' => 'block_header', 'caption' => _t('_bx_map_privacy_view_location')), 'allow_view_location_to' => $oMain->_oPrivacy->getGroupChooser($oMain->_iProfileId, 'map_profiles', 'view_location'), 'Submit' => array('type' => 'submit', 'name' => 'submit_form', 'value' => _t('_Submit'), 'colspan' => true)));
     $aCustomForm['inputs']['allow_view_location_to']['colspan'] = true;
     /*
     if (empty($aCustomForm['inputs']['allow_view_location_to']['value']) || !$aCustomForm['inputs']['allow_view_location_to']['value'])
         $aCustomForm['inputs']['allow_view_location_to']['value'] = BX_MAP_DEFAULT_PRIVACY;
     */
     parent::BxTemplFormView($aCustomForm);
 }
Esempio n. 27
0
 function BxDolFormMedia($aCustomForm)
 {
     if (isset($aCustomForm['inputs']['allow_post_in_forum_to']['type'])) {
         $oModuleDb = new BxDolModuleDb();
         if (!$oModuleDb->getModuleByUri('forum')) {
             $aCustomForm['inputs']['allow_post_in_forum_to']['type'] = 'hidden';
         }
     }
     parent::BxTemplFormView($aCustomForm);
 }
Esempio n. 28
0
 function __construct($oMain, $sMsgNoUsers)
 {
     $aVisitorsPreapare = $oMain->_oDb->getPotentialVisitors($oMain->_iProfileId);
     $aVisitors = array();
     foreach ($aVisitorsPreapare as $k => $r) {
         $aVisitors[] = array('Icon' => $GLOBALS['oFunctions']->getMemberIcon($r['ID'], 'left'), 'Link' => getProfileLink($r['ID']), 'NickName' => getNickName($r['ID']), 'ID' => $r['ID']);
     }
     $aVars = array('bx_repeat:rows' => $aVisitors, 'msg_no_users' => $aVisitors ? '' : $sMsgNoUsers);
     $aCustomForm = array('form_attrs' => array('name' => 'form_inviter', 'action' => '', 'method' => 'post'), 'params' => array('db' => array('submit_name' => 'submit_form')), 'inputs' => array('inviter_users' => array('type' => 'custom', 'content' => $oMain->_oTemplate->parseHtmlByName('inviter', $aVars), 'name' => 'inviter_users', 'caption' => _t('_sys_invitation_step_select_users'), 'info' => _t('_sys_invitation_step_select_users_info'), 'required' => false, 'db' => array('pass' => 'Int')), 'inviter_emails' => array('type' => 'textarea', 'name' => 'inviter_emails', 'caption' => _t('_sys_invitation_step_additional_emails'), 'info' => _t('_sys_invitation_step_additional_emails_info'), 'db' => array('pass' => 'Xss')), 'inviter_text' => array('type' => 'textarea', 'name' => 'inviter_text', 'caption' => _t('_sys_invitation_step_invitation_text'), 'info' => _t('_sys_invitation_step_invitation_text_info'), 'db' => array('pass' => 'Xss')), 'Submit' => array('type' => 'submit', 'name' => 'submit_form', 'value' => _t('_Submit'))));
     parent::__construct($aCustomForm);
 }
Esempio n. 29
0
/**
 * page code function
 */
function PageCompPageMainCode()
{
    $aForm = array('form_attrs' => array('id' => 'test_email_templates', 'action' => BX_DOL_URL_ROOT . '_ml.php', 'method' => 'post'), 'params' => array('db' => array('submit_name' => 'do_submit')), 'inputs' => array('l_new' => array('type' => 'textarea', 'name' => 'l_new', 'caption' => 'New Language'), 'l_old' => array('type' => 'textarea', 'name' => 'l_old', 'caption' => 'Old Language'), 'module_lang_file' => array('type' => 'checkbox', 'name' => 'module_lang_file', 'caption' => 'Module language file', 'value' => 1, 'checked' => true), 'submit' => array('type' => 'submit', 'name' => 'do_submit', 'value' => _t('_Submit'))));
    $oForm = new BxTemplFormView($aForm);
    $oForm->initChecker();
    if ($oForm->isSubmittedAndValid()) {
        $isModuleLangFile = $_POST['module_lang_file'] ? true : false;
        $aLang71 = getLangArray(process_pass_data($_POST['l_new']), $isModuleLangFile);
        $aLang70 = getLangArray(process_pass_data($_POST['l_old']), $isModuleLangFile);
        if (is_array($aLang71) && is_array($aLang70)) {
            $s .= prepareTextarea('Added Keys', findAddedKeys($aLang71, $aLang70));
            $s .= prepareTextarea('Changed Keys', findChangedKeys($aLang71, $aLang70));
            $aDeletedKeys = findDeletedKeys($aLang71, $aLang70);
            $s .= prepareTextarea('Deleted Keys', $aDeletedKeys);
            $s .= prepareTextareaWithDeltedKeys($aDeletedKeys);
        } else {
            $s = MsgBox("Invalid arrays") . $oForm->getCode();
        }
    } else {
        $s = $oForm->getCode();
    }
    return DesignBoxContent($GLOBALS['_page']['header'], $s, 11);
}
Esempio n. 30
0
 public function __construct($aInfo, $oTemplate)
 {
     parent::__construct($aInfo, $oTemplate);
     $this->_sStorageObject = 'sys_cmts_images';
     $this->_sTranscoderPreview = 'sys_cmts_images_preview';
     $this->_aImageUploaders = array('sys_cmts_simple');
     if (isset($this->aInputs['cmt_image'])) {
         $aFormNested = array('params' => array('nested_form_template' => 'comments_uploader_nfw.html'), 'inputs' => array());
         $oFormNested = new BxDolFormNested('cmt_image', $aFormNested, 'cmt_submit');
         $this->aInputs['cmt_image']['storage_object'] = $this->_sStorageObject;
         $this->aInputs['cmt_image']['images_transcoder'] = $this->_sTranscoderPreview;
         $this->aInputs['cmt_image']['uploaders'] = $this->_aImageUploaders;
         $this->aInputs['cmt_image']['upload_buttons_titles'] = array('Simple' => 'camera');
         $this->aInputs['cmt_image']['multiple'] = true;
         $this->aInputs['cmt_image']['ghost_template'] = $oFormNested;
     }
 }