• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP BxDolForm类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中BxDolForm的典型用法代码示例。如果您正苦于以下问题:PHP BxDolForm类的具体用法?PHP BxDolForm怎么用?PHP BxDolForm使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了BxDolForm类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: performActionEdit

 public function performActionEdit($bUpdateGrid = false)
 {
     $sAction = 'edit';
     $sFormObject = $this->oModule->_oConfig->getObject('form_nav_item');
     $sFormDisplay = $this->oModule->_oConfig->getObject('form_display_nav_item_edit');
     $aItem = $this->_getItem('getItems');
     if ($aItem === false) {
         $this->_echoResultJson(array());
         exit;
     }
     bx_import('BxDolForm');
     $oForm = BxDolForm::getObjectInstance($sFormObject, $sFormDisplay, $this->oModule->_oTemplate);
     $oForm->aFormAttrs['action'] = BX_DOL_URL_ROOT . 'grid.php?o=' . $this->_sObject . '&a=' . $sAction . '&set=' . $this->sSet;
     $oForm->aInputs['controls'][0]['value'] = _t('_bx_dev_nav_btn_items_save');
     $this->fillInSelects($oForm->aInputs);
     $oForm->initChecker($aItem);
     if ($oForm->isSubmittedAndValid()) {
         if ($oForm->update($aItem['id']) !== false) {
             $aRes = array('grid' => $this->getCode(false), 'blink' => $aItem['id']);
         } else {
             $aRes = array('msg' => _t('_bx_dev_nav_err_items_edit'));
         }
         $this->_echoResultJson($aRes, true);
     } else {
         bx_import('BxTemplStudioFunctions');
         $sContent = BxTemplStudioFunctions::getInstance()->popupBox('bx-dev-nav-item-edit-popup', _t('_bx_dev_nav_txt_items_edit_popup', _t($aItem['title_system'])), $this->oModule->_oTemplate->parseHtmlByName('nav_add_item.html', array('form_id' => $oForm->aFormAttrs['id'], 'form' => $oForm->getCode(true), 'object' => $this->_sObject, 'action' => $sAction)));
         $this->_echoResultJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))), true);
     }
 }
开发者ID:blas-dmx,项目名称:trident,代码行数:29,代码来源:BxDevNavigationItems.php


示例2: serviceLoginForm

 public function serviceLoginForm($sParams = '', $sForceRelocate = '')
 {
     if (isLogged()) {
         return false;
     }
     // get all auth types
     $aAuthTypes = BxDolDb::getInstance()->fromCache('sys_objects_auths', 'getAll', 'SELECT * FROM `sys_objects_auths`');
     $oForm = BxDolForm::getObjectInstance('sys_login', 'sys_login');
     $sCustomHtmlBefore = '';
     $sCustomHtmlAfter = '';
     bx_alert('profile', 'show_login_form', 0, 0, array('oForm' => $oForm, 'sParams' => &$sParams, 'sCustomHtmlBefore' => &$sCustomHtmlBefore, 'sCustomHtmlAfter' => &$sCustomHtmlAfter, 'aAuthTypes' => &$aAuthTypes));
     if ($sForceRelocate && 0 === mb_stripos($sForceRelocate, BX_DOL_URL_ROOT)) {
         $oForm->aInputs['relocate']['value'] = $sForceRelocate;
     } elseif ('homepage' == $sForceRelocate) {
         $oForm->aInputs['relocate']['value'] = BX_DOL_URL_ROOT;
     }
     $sFormCode = $oForm->getCode();
     $sJoinText = '';
     if (strpos($sParams, 'no_join_text') === false) {
         $sJoinText = '<hr class="bx-def-hr bx-def-margin-sec-topbottom" /><div class="bx-def-font-align-center">' . _t('_sys_txt_login_description', BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=create-account')) . '</div>';
     }
     BxDolTemplate::getInstance()->addJs(array('jquery.form.min.js'));
     $sAuth = $this->serviceMemberAuthCode($aAuthTypes);
     return $sCustomHtmlBefore . $sAuth . $sFormCode . $sCustomHtmlAfter . $sJoinText;
 }
开发者ID:blas-dmx,项目名称:trident,代码行数:25,代码来源:BxBaseServiceLogin.php


示例3: performActionAdd

 public function performActionAdd()
 {
     $sAction = 'add';
     $aForm = array('form_attrs' => array('id' => 'adm-form-pre-list-create', 'action' => BX_DOL_URL_ROOT . 'grid.php?o=' . $this->_sObject . '&a=' . $sAction, 'method' => BX_DOL_STUDIO_METHOD_DEFAULT), 'params' => array('db' => array('table' => 'sys_form_pre_lists', 'key' => 'id', 'uri' => '', 'uri_title' => '', 'submit_name' => 'do_submit')), 'inputs' => array('module' => array('type' => 'hidden', 'name' => 'module', 'value' => BX_DOL_STUDIO_MODULE_CUSTOM, 'db' => array('pass' => 'Xss')), 'use_for_sets' => array('type' => 'hidden', 'name' => 'use_for_sets', 'value' => 1, 'db' => array('pass' => 'Int')), 'title' => array('type' => 'text_translatable', 'name' => 'title', 'caption' => _t('_adm_form_txt_pre_lists_title'), 'info' => _t('_adm_form_dsc_pre_lists_title'), 'value' => '_adm_form_txt_pre_lists', 'required' => '1', 'db' => array('pass' => 'Xss'), 'checker' => array('func' => 'LengthTranslatable', 'params' => array(3, 100, 'title'), 'error' => _t('_adm_form_err_pre_lists_title'))), 'controls' => array('name' => 'controls', 'type' => 'input_set', array('type' => 'submit', 'name' => 'do_submit', 'value' => _t('_adm_form_btn_pre_lists_add')), array('type' => 'reset', 'name' => 'close', 'value' => _t('_adm_form_btn_pre_lists_cancel'), 'attrs' => array('onclick' => "\$('.bx-popup-applied:visible').dolPopupHide()", 'class' => 'bx-def-margin-sec-left')))));
     $oForm = new BxTemplStudioFormView($aForm);
     $oForm->initChecker();
     if ($oForm->isSubmittedAndValid()) {
         bx_import('BxDolStudioLanguagesUtils');
         $oLanguage = BxDolStudioLanguagesUtils::getInstance();
         $sLanguage = $oLanguage->getCurrentLangName(false);
         $sKey = BxDolForm::getSubmittedValue('title-' . $sLanguage, $aForm['form_attrs']['method']);
         $sKey = uriGenerate($sKey, 'sys_form_pre_lists', 'key', 'key');
         $iId = (int) $oForm->insert(array('key' => $sKey));
         if ($iId != 0) {
             $aRes = array('grid' => $this->getCode(false), 'blink' => $iId);
         } else {
             $aRes = array('msg' => _t('_adm_form_err_pre_lists_create'));
         }
         $this->_echoResultJson($aRes, true);
     } else {
         bx_import('BxTemplStudioFunctions');
         $sContent = BxTemplStudioFunctions::getInstance()->popupBox('adm-form-pre-list-create-popup', _t('_adm_form_txt_pre_lists_create_popup'), $this->_oTemplate->parseHtmlByName('form_add_list.html', array('form_id' => $aForm['form_attrs']['id'], 'form' => $oForm->getCode(true), 'object' => $this->_sObject, 'action' => $sAction)));
         $this->_echoResultJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))), true);
     }
 }
开发者ID:blas-dmx,项目名称:trident,代码行数:25,代码来源:BxBaseStudioFormsPreLists.php


示例4: deleteConvo

 public function deleteConvo($iConversationId, $iProfileId = 0)
 {
     $aContentInfo = $this->getContentInfoById($iConversationId);
     if (!$aContentInfo) {
         return true;
     }
     // delete convo
     $sWhere = '';
     if ($iProfileId) {
         $sWhere = $this->prepare(" AND `collaborator` = ?", $iProfileId);
     }
     $sQuery = $this->prepare("DELETE FROM `" . $this->getPrefix() . "conv2folder` WHERE `conv_id` = ?", $iConversationId);
     if (!$this->query($sQuery . $sWhere)) {
         return false;
     }
     // delete whole conversation if there is no refencences to the conversation in conv2folder table
     $sQuery = $this->prepare("SELECT `id` FROM `" . $this->getPrefix() . "conv2folder` WHERE `conv_id` = ?", $iConversationId);
     if (!$this->getOne($sQuery)) {
         $CNF =& $this->_oConfig->CNF;
         bx_import('BxDolForm');
         $oForm = BxDolForm::getObjectInstance($CNF['OBJECT_FORM_ENTRY'], $CNF['OBJECT_FORM_ENTRY_DISPLAY_ADD']);
         return $oForm->delete((int) $iConversationId, $aContentInfo);
     }
     return true;
 }
开发者ID:blas-dmx,项目名称:trident,代码行数:25,代码来源:BxCnvDb.php


示例5: performActionAdd

 public function performActionAdd()
 {
     $sAction = 'add';
     $sMsg = $this->_oModule->isAllowedAdd();
     if ($sMsg !== CHECK_ACTION_RESULT_ALLOWED) {
         $this->_echoResultJson(array('msg' => $sMsg), true);
         return;
     }
     $oForm = BxDolForm::getObjectInstance('bx_sites', 'bx_sites_site_add');
     if (!$oForm) {
         $this->_echoResultJson(array('msg' => _t('_sys_txt_error_occured')), true);
         return;
     }
     $oForm->aFormAttrs['action'] = BX_DOL_URL_ROOT . 'grid.php?o=' . $this->_sObject . '&a=' . $sAction;
     $oForm->initChecker();
     if (!$oForm->isSubmittedAndValid()) {
         $sContent = BxTemplFunctions::getInstance()->popupBox('bx-sites-site-create-popup', _t('_bx_sites_grid_browse_popup_create'), $this->_oModule->_oTemplate->parseHtmlByName('block_create.html', array('form_id' => $oForm->aFormAttrs['id'], 'form' => $oForm->getCode(true), 'object' => $this->_sObject, 'action' => $sAction)));
         $this->_echoResultJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))), true);
         return;
     }
     $sDomain = $oForm->getCleanValue('domain');
     if ($this->_oModule->_oDb->isAccount(array('domain' => $sDomain))) {
         $this->_echoResultJson(array('msg' => _t('_bx_sites_txt_err_site_exists')), true);
         return;
     }
     $iAccountId = $oForm->insert(array('owner_id' => bx_get_logged_profile_id(), 'created' => time(), 'status' => BX_SITES_ACCOUNT_STATUS_UNCONFIRMED));
     if (!$iAccountId) {
         $this->_echoResultJson(array('msg' => _t('_bx_sites_txt_err_site_creation')), true);
         return;
     }
     $oAccount = $this->_oModule->getObject('Account');
     $oAccount->onAccountCreated($iAccountId);
     $sUrl = $this->_oModule->startSubscription($iAccountId);
     $this->_echoResultJson(array('eval' => 'window.open(\'' . $sUrl . '\', \'_self\');', 'popup_not_hide' => 1), true);
 }
开发者ID:blas-dmx,项目名称:trident,代码行数:35,代码来源:BxSitesGridBrowse.php


示例6: _performAction

 protected function _performAction($sAction, $sDisplay, $iId = 0)
 {
     bx_import('BxDolForm');
     $oForm = BxDolForm::getObjectInstance('bx_antispam_ip_table_form', $sDisplay);
     // get form instance for specified form object and display
     if (!$oForm) {
         $this->_echoResultJson(array('msg' => _t('_sys_txt_error_occured')), true);
         exit;
     }
     $oForm->addMarkers(array('grid_object' => $this->_sObject, 'grid_action' => $sAction));
     $aIpTableDirective = array();
     if ($iId) {
         bx_import('BxDolModule');
         $oModule = BxDolModule::getInstance('bx_antispam');
         $oAntispamIp = bx_instance('BxAntispamIP', array(), $oModule->_aModule);
         $aIpTableDirective = $oAntispamIp->getIpTableDirective($iId);
         $aIpTableDirective['From'] = long2ip($aIpTableDirective['From']);
         $aIpTableDirective['To'] = long2ip($aIpTableDirective['To']);
     }
     $oForm->initChecker($aIpTableDirective);
     if ($oForm->isSubmittedAndValid()) {
         // if form is submitted and all fields are valid
         $aCustomValues = array('From' => sprintf("%u", ip2long($oForm->getCleanValue('From'))), 'To' => sprintf("%u", ip2long($oForm->getCleanValue('To'))));
         if ($iId) {
             if ($oForm->update($iId, $aCustomValues)) {
                 // update record
                 $iRecentId = $iId;
             }
         } else {
             $iRecentId = $oForm->insert($aCustomValues, true);
             // insert new record
         }
         if ($iRecentId) {
             $aRes = array('grid' => $this->getCode(false), 'blink' => $iRecentId);
         } else {
             $aRes = array('msg' => _t('_sys_txt_error_occured'));
         }
         // if record adding failed, display error message
         $this->_echoResultJson($aRes, true);
     } else {
         // if form is not submitted or some fields are invalid, display popup with form
         bx_import('BxTemplFunctions');
         $s = BxTemplFunctions::getInstance()->popupBox($oForm->getId() . '_form', _t('_bx_antispam_form_ip_table_add'), $oForm->getCode() . '
             <script>
                 $(document).ready(function () {
                     $("#' . $oForm->getId() . '").ajaxForm({
                         dataType: "json",
                         beforeSubmit: function (formData, jqForm, options) {
                             bx_loading($("#' . $oForm->getId() . '"), true);
                         },
                         success: function (data) {
                             $(".bx-popup-applied:visible").dolPopupHide();
                             glGrids.' . $this->_sObject . '.processJson(data, "' . $sAction . '");
                         }
                     });
                 });
             </script>');
         $this->_echoResultJson(array('popup' => array('html' => $s, 'options' => array('closeOnOuterClick' => false))), true);
     }
 }
开发者ID:blas-dmx,项目名称:trident,代码行数:60,代码来源:BxAntispamGridIpTable.php


示例7: performActionEdit

 public function performActionEdit()
 {
     $sAction = 'edit';
     $sFormObject = $this->oModule->_oConfig->getObject('form_forms_prelist');
     $sFormDisplay = $this->oModule->_oConfig->getObject('form_display_forms_prelist_edit');
     $aList = $this->_getItem('getLists');
     if ($aList === false) {
         $this->_echoResultJson(array());
         exit;
     }
     bx_import('BxDolForm');
     $oForm = BxDolForm::getObjectInstance($sFormObject, $sFormDisplay, $this->oModule->_oTemplate);
     $oForm->aFormAttrs['action'] = BX_DOL_URL_ROOT . 'grid.php?o=' . $this->_sObject . '&a=' . $sAction;
     $oForm->aInputs['module']['values'] = array_merge(array('' => _t('_bx_dev_frm_txt_select_module')), BxDolStudioUtils::getModules());
     $oForm->aInputs['controls'][0]['value'] = _t('_bx_dev_frm_btn_prelists_save');
     $oForm->initChecker($aList);
     if ($oForm->isSubmittedAndValid()) {
         if ($oForm->update($aList['id']) !== false) {
             $aRes = array('grid' => $this->getCode(false), 'blink' => $aList['id']);
         } else {
             $aRes = array('msg' => _t('_bx_dev_frm_err_prelists_edit'));
         }
         $this->_echoResultJson($aRes, true);
     } else {
         bx_import('BxTemplStudioFunctions');
         $sContent = BxTemplStudioFunctions::getInstance()->popupBox('bx-dev-frm-prelist-edit-popup', _t('_bx_dev_frm_txt_prelists_edit_popup', _t($aList['title'])), $this->oModule->_oTemplate->parseHtmlByName('form_add_list.html', array('form_id' => $oForm->aFormAttrs['id'], 'form' => $oForm->getCode(true), 'object' => $this->_sObject, 'action' => $sAction)));
         $this->_echoResultJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))), true);
     }
 }
开发者ID:blas-dmx,项目名称:trident,代码行数:29,代码来源:BxDevFormsPreLists.php


示例8: serviceLoginForm

 public function serviceLoginForm($sParams = '', $sForceRelocate = '')
 {
     if (isLogged()) {
         return false;
     }
     // get all auth types
     $aAuthTypes = BxDolDb::getInstance()->fromCache('sys_objects_auths', 'getAll', 'SELECT * FROM `sys_objects_auths`');
     // define additional auth types
     if ($aAuthTypes) {
         $aAddInputEl[''] = _t('_Basic');
         // procces all additional menu's items
         foreach ($aAuthTypes as $iKey => $aItems) {
             $aAddInputEl[$aItems['Link']] = _t($aItems['Title']);
         }
         $aAuthTypes = array('type' => 'select', 'caption' => _t('_Auth type'), 'values' => $aAddInputEl, 'value' => '', 'attrs' => array('onchange' => 'if (this.value) { location.href = "' . BX_DOL_URL_ROOT . '" + this.value }'));
     } else {
         $aAuthTypes = array('type' => 'hidden');
     }
     $oForm = BxDolForm::getObjectInstance('sys_login', 'sys_login');
     $sCustomHtmlBefore = '';
     $sCustomHtmlAfter = '';
     bx_alert('profile', 'show_login_form', 0, 0, array('oForm' => $oForm, 'sParams' => &$sParams, 'sCustomHtmlBefore' => &$sCustomHtmlBefore, 'sCustomHtmlAfter' => &$sCustomHtmlAfter, 'aAuthTypes' => &$aAuthTypes));
     if ($sForceRelocate && 0 === mb_stripos($sForceRelocate, BX_DOL_URL_ROOT)) {
         $oForm->aInputs['relocate']['value'] = $sForceRelocate;
     } elseif ('homepage' == $sForceRelocate) {
         $oForm->aInputs['relocate']['value'] = BX_DOL_URL_ROOT;
     }
     $sFormCode = $oForm->getCode();
     $sJoinText = '';
     if (strpos($sParams, 'no_join_text') === false) {
         $sJoinText = '<hr class="bx-def-hr bx-def-margin-sec-topbottom" /><div>' . _t('_sys_txt_login_description', BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=create-account')) . '</div>';
     }
     BxDolTemplate::getInstance()->addJs(array('jquery.form.min.js'));
     return $sCustomHtmlBefore . $sFormCode . $sCustomHtmlAfter . $sJoinText;
 }
开发者ID:blas-dmx,项目名称:trident,代码行数:35,代码来源:BxBaseServiceLogin.php


示例9: addCssJs

 /**
  * Add comments CSS/JS
  */
 public function addCssJs()
 {
     $this->_oTemplate->addCss(array('cmts.css'));
     $this->_oTemplate->addJs(array('jquery.anim.js', 'jquery.form.min.js', 'BxDolCmts.js'));
     $oForm = BxDolForm::getObjectInstance($this->_sFormObject, $this->_sFormDisplayPost);
     $oForm->addCssJs();
 }
开发者ID:blas-dmx,项目名称:trident,代码行数:10,代码来源:BxBaseCmts.php


示例10: performActionDelete

 public function performActionDelete($aParams = array())
 {
     $iProfileId = $this->_oModule->getProfileId();
     $mixedAllowed = $this->_oModule->isAllowedDeleteRequest($iProfileId);
     if ($mixedAllowed !== true) {
         $this->_echoResultJson(array('msg' => $mixedAllowed));
         exit;
     }
     $iAffected = 0;
     $aIds = bx_get('ids');
     if (!$aIds || !is_array($aIds)) {
         $this->_echoResultJson(array());
         exit;
     }
     bx_import('BxDolForm');
     $oForm = BxDolForm::getObjectInstance($this->_oModule->_oConfig->getObject('form_request'), $this->_oModule->_oConfig->getObject('form_display_request_send'));
     $aIdsAffected = array();
     foreach ($aIds as $iId) {
         if (!$oForm->delete($iId)) {
             continue;
         }
         $this->_oModule->isAllowedDeleteRequest($iProfileId, true);
         $aIdsAffected[] = $iId;
         $iAffected++;
     }
     $this->_echoResultJson($iAffected ? array('grid' => $this->getCode(false), 'blink' => $aIdsAffected) : array('msg' => _t('_bx_invites_err_delete_request')));
 }
开发者ID:blas-dmx,项目名称:trident,代码行数:27,代码来源:BxInvGridRequests.php


示例11: getAuthorAddon

 function getAuthorAddon($aData, $oProfile)
 {
     $s = parent::getAuthorAddon($aData, $oProfile);
     if (!$aData['cat']) {
         return $s;
     }
     if (!($oCat = BxTemplCategory::getObjectInstance('bx_posts_cats'))) {
         return $s;
     }
     if (!($aCats = BxDolForm::getDataItems('bx_posts_cats')) || !isset($aCats[$aData['cat']])) {
         return $s;
     }
     $s = _t('_bx_posts_txt_category_link', $oCat->getCategoryUrl($aData['cat']), $aCats[$aData['cat']]) . '<br />' . $s;
     return $s;
 }
开发者ID:blas-dmx,项目名称:trident,代码行数:15,代码来源:BxPostsTemplate.php


示例12: getLoginForm

 function getLoginForm()
 {
     $oTemplate = BxDolStudioTemplate::getInstance();
     $sUrlRelocate = bx_get('relocate');
     if (empty($sUrlRelocate) || basename($sUrlRelocate) == 'index.php') {
         $sUrlRelocate = '';
     }
     $oTemplate->addJsTranslation(array('_adm_txt_login_username', '_adm_txt_login_password'));
     $sHtml = $oTemplate->parseHtmlByName('login_form.html', array('role' => BX_DOL_ROLE_ADMIN, 'csrf_token' => BxDolForm::genCsrfToken(true), 'relocate_url' => bx_html_attribute($sUrlRelocate), 'action_url' => BX_DOL_URL_ROOT . 'member.php', 'forgot_password_url' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=forgot-password')));
     $sHtml = $oTemplate->parseHtmlByName('login.html', array('form' => $this->transBox('bx-std-login-form-box', $sHtml, true)));
     $oTemplate->setPageNameIndex(BX_PAGE_CLEAR);
     $oTemplate->setPageParams(array('css_name' => array('forms.css', 'login.css'), 'js_name' => array('jquery-ui/jquery.ui.position.min.js', 'jquery.form.min.js', 'jquery.dolPopup.js', 'login.js'), 'header' => _t('_adm_page_cpt_login')));
     $oTemplate->setPageContent('page_main_code', $sHtml);
     $oTemplate->getPageCode();
 }
开发者ID:blas-dmx,项目名称:trident,代码行数:15,代码来源:BxBaseStudioFunctions.php


示例13: performActionEdit

 public function performActionEdit()
 {
     $sAction = 'edit';
     $sFormObject = $this->oModule->_oConfig->getObject('form_forms_form');
     $sFormDisplay = $this->oModule->_oConfig->getObject('form_display_forms_form_edit');
     $aIds = bx_get('ids');
     if (!$aIds || !is_array($aIds)) {
         $iId = (int) bx_get('id');
         if (!$iId) {
             $this->_echoResultJson(array());
             exit;
         }
         $aIds = array($iId);
     }
     $iId = $aIds[0];
     $aForm = array();
     $this->oDb->getForms(array('type' => 'by_id', 'value' => $iId), $aForm, false);
     if (empty($aForm) || !is_array($aForm)) {
         $this->_echoResultJson(array());
         exit;
     }
     bx_import('BxDolForm');
     $oForm = BxDolForm::getObjectInstance($sFormObject, $sFormDisplay, $this->oModule->_oTemplate);
     $oForm->aFormAttrs['action'] = BX_DOL_URL_ROOT . 'grid.php?o=' . $this->_sObject . '&a=' . $sAction;
     $oForm->aInputs['module']['values'] = array_merge(array('' => _t('_bx_dev_frm_txt_select_module')), BxDolStudioUtils::getModules());
     $oForm->aInputs['controls'][0]['value'] = _t('_bx_dev_frm_btn_forms_save');
     $aForm['form_attrs'] = BxDevFunctions::unserializeString($aForm['form_attrs']);
     $aForm['params'] = BxDevFunctions::unserializeString($aForm['params']);
     $oForm->initChecker($aForm);
     if ($oForm->isSubmittedAndValid()) {
         $sValue = BxDolForm::getSubmittedValue('form_attrs', $oForm->aFormAttrs['method']);
         $sValue = BxDevFunctions::serializeString($sValue);
         BxDolForm::setSubmittedValue('form_attrs', $sValue, $oForm->aFormAttrs['method']);
         $sValue = BxDolForm::getSubmittedValue('params', $oForm->aFormAttrs['method']);
         $sValue = BxDevFunctions::serializeString($sValue);
         BxDolForm::setSubmittedValue('params', $sValue, $oForm->aFormAttrs['method']);
         if ($oForm->update($iId) !== false) {
             $aRes = array('grid' => $this->getCode(false), 'blink' => $iId);
         } else {
             $aRes = array('msg' => _t('_bx_dev_frm_err_forms_edit'));
         }
         $this->_echoResultJson($aRes, true);
     } else {
         bx_import('BxTemplStudioFunctions');
         $sContent = BxTemplStudioFunctions::getInstance()->popupBox('bx-dev-frm-form-edit-popup', _t('_bx_dev_frm_txt_forms_edit_popup', _t($aForm['title'])), $this->oModule->_oTemplate->parseHtmlByName('form_add_form.html', array('form_id' => $oForm->aFormAttrs['id'], 'form' => $oForm->getCode(true), 'object' => $this->_sObject, 'action' => $sAction)));
         $this->_echoResultJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))), true);
     }
 }
开发者ID:blas-dmx,项目名称:trident,代码行数:48,代码来源:BxDevFormsForms.php


示例14: genTable

 /**
  * Generate Table HTML code
  *
  * @return string
  */
 function genTable()
 {
     // add default className to attributes
     $this->aTableAttrs['class'] = 'form_advanced_table' . (isset($this->aTableAttrs['class']) ? ' ' . $this->aTableAttrs['class'] : '');
     // add CSRF token if it's needed.
     if ($GLOBALS['MySQL']->getParam('sys_security_form_token_enable') == 'on' && !defined('BX_DOL_CRON_EXECUTE') && (!isset($this->aParams['csrf']['disable']) || isset($this->aParams['csrf']['disable']) && $this->aParams['csrf']['disable'] !== true) && ($mixedCsrfToken = BxDolForm::getCsrfToken()) !== false) {
         $this->aInputs['csrf_token'] = array('type' => 'hidden', 'name' => 'csrf_token', 'value' => $mixedCsrfToken, 'db' => array('pass' => 'Xss'));
     }
     // generate table contents
     $sTableContent = '';
     foreach ($this->aInputs as $aInput) {
         $sTableContent .= $this->genRow($aInput);
     }
     $this->addCssJs($this->_isDateControl, $this->_isDateTimeControl);
     return $this->_sCodeAdd . $GLOBALS['oSysTemplate']->parseHtmlByName('form_content.html', array('wrapper_id' => $this->id, 'table_attrs' => $this->convertArray2Attrs($this->aTableAttrs), 'content' => $sTableContent));
 }
开发者ID:Gotgot59,项目名称:dolphin.pro,代码行数:21,代码来源:BxBaseFormView.php


示例15: actionDeleteProfileImg

 public function actionDeleteProfileImg($iFileId, $iContentId, $sFieldPicture)
 {
     $aResult = array();
     $CNF =& $this->_oConfig->CNF;
     $oSrorage = BxDolStorage::getObjectInstance($CNF['OBJECT_STORAGE']);
     if (!($aFile = $oSrorage->getFile((int) $iFileId)) || !($aContentInfo = $this->_oDb->getContentInfoById($iContentId)) || $aContentInfo[$sFieldPicture] != (int) $iFileId) {
         $aResult = array('error' => 1, 'msg' => _t('_sys_storage_err_file_not_found'));
     }
     if (!$aResult && !isLogged() || !$aResult && $aFile['profile_id'] != bx_get_logged_profile_id() && !$this->_isModerator()) {
         $aResult = array('error' => 2, 'msg' => _t('_Access denied'));
     }
     $oForm = BxDolForm::getObjectInstance($CNF['OBJECT_FORM_ENTRY'], $CNF['OBJECT_FORM_ENTRY_DISPLAY_ADD'], $this->_oTemplate);
     if (!$aResult && !$oForm->_deleteFile($iContentId, $sFieldPicture, (int) $iFileId, true)) {
         $aResult = array('error' => 3, 'msg' => _t('_Failed'));
     } elseif (!$aResult) {
         $aResult = array('error' => 0, 'msg' => '');
     }
     header('Content-Type: application/json; charset=utf-8');
     echo json_encode($aResult);
 }
开发者ID:blas-dmx,项目名称:trident,代码行数:20,代码来源:BxBaseModProfileModule.php


示例16: serviceGetBlockForm

 /**
  * SERVICE METHODS
  */
 public function serviceGetBlockForm()
 {
     $aDefaultFields = array('name', 'email', 'subject', 'body', 'do_submit');
     $mixedAllowed = $this->isAllowedContact();
     if ($mixedAllowed !== true) {
         return array('content' => MsgBox($mixedAllowed));
     }
     $sResult = '';
     bx_import('BxDolForm');
     $oForm = BxDolForm::getObjectInstance($this->_oConfig->getObject('form_contact'), $this->_oConfig->getObject('form_display_contact_send'), $this->_oTemplate);
     $oForm->initChecker();
     if ($oForm->isSubmittedAndValid()) {
         $iId = $oForm->insert(array('uri' => $oForm->generateUri(), 'date' => time()));
         if ($iId !== false) {
             $sCustomFields = '';
             $aCustomFields = array();
             foreach ($oForm->aInputs as $aInput) {
                 if (in_array($aInput['name'], $aDefaultFields)) {
                     continue;
                 }
                 $aCustomFields[$aInput['name']] = bx_process_output($oForm->getCleanValue($aInput['name']));
                 $sCustomFields .= $aInput['caption'] . ': ' . $aCustomFields[$aInput['name']] . '<br />';
             }
             $aTemplateKeys = array('SenderName' => bx_process_output($oForm->getCleanValue('name')), 'SenderEmail' => bx_process_output($oForm->getCleanValue('email')), 'MessageSubject' => bx_process_output($oForm->getCleanValue('subject')), 'MessageBody' => bx_process_output(nl2br($oForm->getCleanValue('body')), BX_DATA_TEXT_MULTILINE), 'CustomFields' => $sCustomFields);
             $aTemplateKeys = array_merge($aTemplateKeys, $aCustomFields);
             bx_import('BxDolEmailTemplates');
             $aMessage = BxDolEmailTemplates::getInstance()->parseTemplate('bx_contact_contact_form_message', $aTemplateKeys);
             $sResult = '';
             $sRecipientEmail = $this->_oConfig->getEmail();
             if (sendMail($sRecipientEmail, $aMessage['Subject'], $aMessage['Body'], 0, array(), BX_EMAIL_SYSTEM)) {
                 $this->onContact();
                 $sResult = '_ADM_PROFILE_SEND_MSG';
             } else {
                 $sResult = '_Email sent failed';
             }
             $sResult = MsgBox(_t($sResult));
         }
     }
     return array('content' => $sResult . $oForm->getCode());
 }
开发者ID:blas-dmx,项目名称:trident,代码行数:43,代码来源:BxContactModule.php


示例17: performActionEdit

 public function performActionEdit()
 {
     $sAction = 'edit';
     $sFormObject = $this->oModule->_oConfig->getObject('form_nav_set');
     $sFormDisplay = $this->oModule->_oConfig->getObject('form_display_nav_set_edit');
     $aIds = bx_get('ids');
     if (!$aIds || !is_array($aIds)) {
         $sId = bx_get('set_name');
         if (!$sId) {
             $this->_echoResultJson(array());
             exit;
         }
         $aIds = array($sId);
     }
     $sId = bx_process_input($aIds[0]);
     $aSet = array();
     $this->oDb->getSets(array('type' => 'by_name', 'value' => $sId), $aSet, false);
     if (empty($aSet) || !is_array($aSet)) {
         $this->_echoResultJson(array());
         exit;
     }
     bx_import('BxDolForm');
     $oForm = BxDolForm::getObjectInstance($sFormObject, $sFormDisplay, $this->oModule->_oTemplate);
     $oForm->aFormAttrs['action'] = BX_DOL_URL_ROOT . 'grid.php?o=' . $this->_sObject . '&a=' . $sAction;
     $oForm->aInputs['module']['values'] = array_merge(array('' => _t('_bx_dev_frm_txt_select_module')), BxDolStudioUtils::getModules());
     $oForm->aInputs['controls'][0]['value'] = _t('_bx_dev_frm_btn_displays_save');
     $oForm->initChecker($aSet);
     if ($oForm->isSubmittedAndValid()) {
         if ($oForm->update($sId) !== false) {
             $aRes = array('grid' => $this->getCode(false), 'blink' => $sId);
         } else {
             $aRes = array('msg' => _t('_bx_dev_nav_err_sets_edit'));
         }
         $this->_echoResultJson($aRes, true);
     } else {
         bx_import('BxTemplStudioFunctions');
         $sContent = BxTemplStudioFunctions::getInstance()->popupBox('bx-dev-nav-set-edit-popup', _t('_bx_dev_nav_txt_sets_edit_popup', _t($aSet['title'])), $this->_oTemplate->parseHtmlByName('nav_add_set.html', array('form_id' => $oForm->aFormAttrs['id'], 'form' => $oForm->getCode(true), 'object' => $this->_sObject, 'action' => $sAction)));
         $this->_echoResultJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))), true);
     }
 }
开发者ID:blas-dmx,项目名称:trident,代码行数:40,代码来源:BxDevNavigationSets.php


示例18: getCategoriesList

 /**
  * Get all categories list
  * @param $bDisplayEmptyCats display categories with no items, true by default
  * @return categories list html
  */
 public function getCategoriesList($bDisplayEmptyCats = true)
 {
     $a = BxDolForm::getDataItems($this->_aObject['list_name']);
     if (!$a) {
         return '';
     }
     $aVars = array('bx_repeat:cats' => array());
     foreach ($a as $sValue => $sName) {
         if (!$sValue) {
             continue;
         }
         $iNum = $this->getItemsNum($sValue);
         if (!$bDisplayEmptyCats && !$iNum) {
             continue;
         }
         $aVars['bx_repeat:cats'][] = array('url' => $this->getCategoryUrl($sValue), 'name' => $sName, 'value' => $sValue, 'num' => $iNum);
     }
     if (!$aVars['bx_repeat:cats']) {
         return '';
     }
     return $this->_oTemplate->parseHtmlByName('category_list.html', $aVars);
 }
开发者ID:blas-dmx,项目名称:trident,代码行数:27,代码来源:BxBaseCategory.php


示例19: performActionEdit

 public function performActionEdit()
 {
     $sAction = 'edit';
     $sFormObject = $this->oModule->_oConfig->getObject('form_forms_display');
     $sFormDisplay = $this->oModule->_oConfig->getObject('form_display_forms_display_edit');
     $aIds = bx_get('ids');
     if (!$aIds || !is_array($aIds)) {
         $iId = (int) bx_get('id');
         if (!$iId) {
             $this->_echoResultJson(array());
             exit;
         }
         $aIds = array($iId);
     }
     $iId = $aIds[0];
     $aDisplay = array();
     $iDisplay = $this->oDb->getDisplays(array('type' => 'by_id', 'value' => $iId), $aDisplay);
     if ($iDisplay != 1 || empty($aDisplay)) {
         $this->_echoResultJson(array());
         exit;
     }
     bx_import('BxDolForm');
     $oForm = BxDolForm::getObjectInstance($sFormObject, $sFormDisplay, $this->oModule->_oTemplate);
     $this->_fillDisplayForm($oForm, $sAction);
     $oForm->aInputs['controls'][0]['value'] = _t('_bx_dev_frm_btn_displays_save');
     $oForm->initChecker($aDisplay);
     if ($oForm->isSubmittedAndValid()) {
         if ($oForm->update($iId) !== false) {
             $aRes = array('grid' => $this->getCode(false), 'blink' => $iId);
         } else {
             $aRes = array('msg' => _t('_bx_dev_frm_err_displays_edit'));
         }
         $this->_echoResultJson($aRes, true);
     } else {
         bx_import('BxTemplStudioFunctions');
         $sContent = BxTemplStudioFunctions::getInstance()->popupBox('bx-dev-frm-display-edit-popup', _t('_bx_dev_frm_txt_displays_edit_popup', _t($aDisplay['title'])), $this->_oTemplate->parseHtmlByName('form_add_display.html', array('form_id' => $oForm->aFormAttrs['id'], 'form' => $oForm->getCode(true), 'object' => $this->_sObject, 'action' => $sAction)));
         $this->_echoResultJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))), true);
     }
 }
开发者ID:blas-dmx,项目名称:trident,代码行数:39,代码来源:BxDevFormsDisplays.php


示例20: performActionEdit

 public function performActionEdit()
 {
     $sAction = 'edit';
     $aMenu = $this->_getItem('getMenus');
     if ($aMenu === false) {
         $this->_echoResultJson(array());
         exit;
     }
     $oForm = $this->_getFormObject($sAction, $aMenu);
     if ($oForm->isSubmitted() && isset($oForm->aInputs['set_name'])) {
         $this->updateSetFields($oForm);
     }
     $oForm->initChecker();
     if ($oForm->isSubmittedAndValid()) {
         //--- New Set Creation
         if ($oForm->getCleanValue('set_name') == $this->sCreateNew) {
             $sSetTitleValue = $oForm->getCleanValue('set_title');
             $sSetName = 'custom_' . $this->getSystemName($sSetTitleValue);
             $sSetTitleKey = '_adm_nav_txt_set_' . $sSetName;
             if ($this->oDb->addSet(array('set_name' => $sSetName, 'module' => BX_DOL_STUDIO_MODULE_CUSTOM, 'title' => $sSetTitleKey, 'deletable' => 1))) {
                 bx_import('BxDolStudioLanguagesUtils');
                 BxDolStudioLanguagesUtils::getInstance()->addLanguageString($sSetTitleKey, $sSetTitleValue);
                 BxDolForm::setSubmittedValue('set_name', $sSetName, $oForm->aFormAttrs['method']);
             }
         }
         unset($oForm->aInputs['set_title']);
         if ($oForm->update($aMenu['id']) !== false) {
             $aRes = array('grid' => $this->getCode(false), 'blink' => $aMenu['id']);
         } else {
             $aRes = array('msg' => _t('_adm_nav_err_menus_edit'));
         }
         $this->_echoResultJson($aRes, true);
     } else {
         bx_import('BxTemplStudioFunctions');
         $sContent = BxTemplStudioFunctions::getInstance()->popupBox('adm-nav-menu-edit-popup', _t('_adm_nav_txt_menus_edit_popup', _t($aMenu['title'])), $this->_oTemplate->parseHtmlByName('nav_add_menu.html', array('form_id' => $oForm->aFormAttrs['id'], 'form' => $oForm->getCode(true), 'object' => $this->_sObject, 'action' => $sAction)));
         $this->_echoResultJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))), true);
     }
 }
开发者ID:Baloo7super,项目名称:dolphin,代码行数:38,代码来源:BxBaseStudioNavigationMenus.php



注:本文中的BxDolForm类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP BxDolInstaller类代码示例发布时间:2022-05-23
下一篇:
PHP BxDolEmailTemplates类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap