/** * page code function */ function PageCompMainCode() { ob_start(); $oAccount = BxDolAccount::getInstance(); $aAccountInfo = $oAccount ? $oAccount->getInfo() : false; if (!$aAccountInfo) { return DesignBoxContent("Send Email example", 'Please login first', BX_DB_PADDING_DEF); } echo "<h2>Account info</h2>"; echo "Email: " . $aAccountInfo['email'] . '<br />'; echo "Email Confirmed: " . ($aAccountInfo['email_confirmed'] ? 'yes' : 'no') . '<br />'; echo "Receive site updates: " . ($aAccountInfo['receive_updates'] ? 'yes' : 'no') . '<br />'; echo "Receive site newsletters: " . ($aAccountInfo['receive_news'] ? 'yes' : 'no') . '<br />'; echo "Site emails are sent from: " . getParam('site_email_notify') . '<br />'; $a = array('sys' => array('title' => "Send me system email", 'type' => BX_EMAIL_SYSTEM, 'subj' => 'System Email', 'body' => 'This is system email <br /> {unsubscribe}'), 'notif' => array('title' => "Send me notification", 'type' => BX_EMAIL_NOTIFY, 'subj' => 'Notification Email', 'body' => 'This is notification email<br /> {unsubscribe}'), 'mass' => array('title' => "Send me bulk email", 'type' => BX_EMAIL_MASS, 'subj' => 'Bulk Email', 'body' => 'This is bulk email<br /> {unsubscribe}')); $sSendMail = bx_get('send'); if ($sSendMail && isset($a[$sSendMail])) { echo "<h2>Send Email Result</h2>"; $r = $a[$sSendMail]; if (sendMail($aAccountInfo['email'], $r['subj'], $r['body'], 0, array(), $r['type'])) { echo MsgBox($r['subj'] . ' - successfully sent'); } else { echo MsgBox($r['subj'] . ' - sent failed'); } } echo "<h2>Send email</h2>"; foreach ($a as $k => $r) { echo '<a href="samples/email.php?send=' . $k . '">' . $r['title'] . '</a><br />'; } return DesignBoxContent("Send Email Example", ob_get_clean(), BX_DB_PADDING_DEF); }
/** * page code function */ function PageCompMainCode() { ob_start(); ?> <button class="bx-btn bx-def-margin-right">Button text</button> <button class="bx-btn bx-btn-img bx-def-margin-right"><img src="template/images/icons/clock.png" /></button> <button class="bx-btn bx-btn-img bx-def-margin-right"><img src="template/images/icons/clock.png"><u>Button text</u></button> <div class="bx-clear"></div><hr class="bx-def-hr bx-def-margin-topbottom" /> <button class="bx-btn bx-btn-small bx-def-margin-right">Button text</button> <button class="bx-btn bx-btn-small bx-btn-img bx-def-margin-right"><img src="template/images/icons/clock.png" /></button> <button class="bx-btn bx-btn-small bx-btn-img bx-def-margin-right"><img src="template/images/icons/clock.png" /><u>Button text</u></button> <div class="bx-clear"></div><hr class="bx-def-hr bx-def-margin-topbottom" /> <button class="bx-btn bx-def-margin-right"><i class="sys-icon fire-extinguisher"></i></button> <button class="bx-btn bx-def-margin-right"><i class="sys-icon fire-extinguisher sys-icon-bigger"></i></button> <button class="bx-btn bx-def-margin-right"><i class="sys-icon fire-extinguisher sys-icon-bigger col-red1"></i></button> <button class="bx-btn bx-def-margin-right"><i class="sys-icon fire-extinguisher"></i><u>Button text</u></button> <div class="bx-clear"></div><hr class="bx-def-hr bx-def-margin-topbottom" /> <button class="bx-btn bx-btn-small bx-def-margin-right"><i class="sys-icon fire-extinguisher"></i></button> <button class="bx-btn bx-btn-small bx-def-margin-right"><i class="sys-icon fire-extinguisher"></i><u>Button text</u></button> <?php return DesignBoxContent("Buttons", ob_get_clean(), BX_DB_PADDING_DEF); }
/** * page code function */ function PageCompMainCode() { ob_start(); // transBox echo BxTemplFunctions::getInstance()->transBox('bx-sample-popup-transbox', '<div class="bx-def-padding">transBox</div>', true); echo '<button class="bx-btn" onclick="$(\'#bx-sample-popup-transbox\').dolPopup()">transBox</button>'; // transBox AJAX echo '<button class="bx-btn bx-def-margin-left" onclick="$(window).dolPopupAjax({url: \'samples/popup.php?_t=a' . time() . '\'})">transBox AJAX</button>'; // popupBox echo BxTemplFunctions::getInstance()->popupBox('bx-sample-popup-box', 'popupBox', 'popupBox content', true); echo '<button class="bx-btn bx-def-margin-left" onclick="$(\'#bx-sample-popup-box\').dolPopup()">popupBox</button>'; // popupBox without fog echo BxTemplFunctions::getInstance()->popupBox('bx-sample-popup-box-without-fog', 'popupBox', 'popupBox without fog content', true); echo '<button class="bx-btn bx-def-margin-left" onclick="$(\'#bx-sample-popup-box-without-fog\').dolPopup({fog:0})">popupBox without fog</button>'; echo '<div class="bx-clear"></div>'; echo '<hr class="bx-def-hr" />'; // transBox with pointer echo BxTemplFunctions::getInstance()->transBox('bx-sample-popup-transbox-with-pointer', '<div class="bx-def-padding">transBox with pointer</div>', true); echo '<button class="bx-btn" onclick="$(\'#bx-sample-popup-transbox-with-pointer\').dolPopup({pointer:{el:$(this)}})">transBox with pointer</button>'; // popupBox with pointer echo BxTemplFunctions::getInstance()->popupBox('bx-sample-popup-box-with-pointer', 'popupBox', 'popupBox with pointer content', true); echo '<button class="bx-btn bx-def-margin-left" onclick="$(\'#bx-sample-popup-box-with-pointer\').dolPopup({pointer:{el:$(this)}})">popupBox with pointer</button>'; // popupBox with pointer AJAX echo BxTemplFunctions::getInstance()->popupBox('bx-sample-popup-box-with-pointer', 'popupBox', 'popupBox with pointer AJAX', true); echo '<button class="bx-btn bx-def-margin-left" onclick="$(this).dolPopupAjax({url: \'samples/popup.php?_t=b' . time() . '\'})">popupBox with pointer AJAX</button>'; echo '<div class="bx-clear"></div>'; return DesignBoxContent("Sample popup", ob_get_clean(), BX_DB_PADDING_DEF); }
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); }
function getCalendar() { $oProfile = new BxBaseProfileGenerator(getLoggedId()); $mSearchRes = $oProfile->GenProfilesCalendarBlock(); list($sResults, $aDBTopMenu, $sPagination, $sTopFilter) = $mSearchRes; return DesignBoxContent(_t('_People_Calendar'), $sResults, 1); }
function showTags($aParam = array(), $iBoxId = 1, $sAction = '', $iBox = 0, $sTitle = '') { $oTags = new BxTemplTags(); $oTags->getTagObjectConfig($aParam); if (empty($oTags->aTagObjects)) { if ($iBox & BX_TAGS_BOX_DISIGN) { return DesignBoxContent($sTitle, MsgBox(_t('_Empty')), 1); } else { return MsgBox(_t('_Empty')); } } $aParam['type'] = isset($_GET['tags_mode']) && isset($oTags->aTagObjects[$_GET['tags_mode']]) ? $_GET['tags_mode'] : $oTags->getFirstObject(); $sCode = ''; if ($iBox & BX_TAGS_BOX_INT_MENU) { $sCode .= $oTags->getTagsInternalMenuHtml($aParam, $iBoxId, $sAction); } $sCode .= $oTags->display($aParam, $iBoxId, $sAction); if ($iBox & BX_TAGS_BOX_DISIGN) { $aCaptionMenu = $iBox & BX_TAGS_BOX_INT_MENU ? '' : $oTags->getTagsTopMenuHtml($aParam, $iBoxId, $sAction); $sCode = DesignBoxContent($sTitle, $sCode, 1, $aCaptionMenu); $sCode = '<div id="page_block_' . $iBoxId . '">' . $sCode . '<div class="clear_both"></div></div>'; return $sCode; } else { return array($sCode, $iBox & BX_TAGS_BOX_INT_MENU ? '' : $oTags->getTagsTopMenu($aParam, $sAction), array(), $sDate ? _t('_tags_by_day') . $sDate : ''); } }
function profileCustomizeBlock($aTopMenu, $sPage, $aTargets, $sTarget, $aVars) { $sContent = ''; $aMenuItems = array(); $sBaseUrl = BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri(); $aItems = array(); foreach ($aTopMenu as $sName => $aItem) { $aItems[] = array('title' => $sName, 'active' => $aItem['active'], 'href' => $aItem['href'], 'onclick' => 'oBxSctrMain.reloadCustomizeBlock(this.href, false); return false;'); } $sTopMenu = BxDolPageView::getBlockCaptionMenu('site_customize', $aItems); // content for box if ($sPage != 'themes') { $sTopControls = $this->parsePageByName('designbox_top_controls.html', array('top_controls' => $this->parseHtmlByName('content_box_top_controls.html', array('name_box' => _t('_bx_sctr_select_target'), 'name_targets_box' => 'background_box', 'bx_repeat:targets' => $aTargets)))); $sBoxContent = $this->parseHtmlByName('content_box.html', array('bx_if:select_target' => array('condition' => !empty($aTargets), 'content' => array('top_controls' => $sTopControls)), 'content' => call_user_func_array(array($this, '_customPage' . ucfirst($sPage)), array($sPage, $sTarget, $aVars)), 'bx_repeat:buttons' => array(array('btn_type' => 'button', 'btn_name' => 'preview', 'btn_value' => _t('_bx_sctr_btn_preview'), 'btn_action' => "oBxSctrMain.reloadCustom('" . $sPage . "', '" . $sTarget . "', 'preview');"), array('btn_type' => 'button', 'btn_name' => 'reset', 'btn_value' => _t('_bx_sctr_btn_reset'), 'btn_action' => "oBxSctrMain.resetCustom('" . $sPage . "', '" . $sTarget . "', 'reset');"), array('btn_type' => 'button', 'btn_name' => 'save', 'btn_value' => _t('_bx_sctr_btn_save'), 'btn_action' => "oBxSctrMain.reloadCustom('" . $sPage . "', '" . $sTarget . "', 'save');"), array('btn_type' => 'button', 'btn_name' => 'publish', 'btn_value' => _t('_bx_sctr_btn_publish'), 'btn_action' => "oBxSctrMain.showPublish('{$sBaseUrl}publish');")))); } else { $iUserId = $sTarget == 'my' ? $this->_oModule->iUserId : 0; $sPageThemes = $this->_customPageThemes($iUserId, true); if ($sPageThemes) { $aButtons = array(array('btn_type' => 'button', 'btn_name' => 'preview', 'btn_value' => _t('_bx_sctr_btn_preview'), 'btn_action' => "oBxSctrMain.previewTheme();"), array('btn_type' => 'button', 'btn_name' => 'reset', 'btn_value' => _t('_bx_sctr_btn_reset'), 'btn_action' => "oBxSctrMain.resetCustom('', '', 'reset');"), array('btn_type' => 'button', 'btn_name' => 'save', 'btn_value' => _t('_bx_sctr_btn_save'), 'btn_action' => "oBxSctrMain.saveTheme();")); } else { $aButtons = array(); } if ($sPageThemes && $sTarget != 'shared') { $aButtons[] = array('btn_type' => 'button', 'btn_name' => 'delete', 'btn_value' => _t('_bx_sctr_btn_delete'), 'btn_action' => "oBxSctrMain.deleteTheme('" . $sBaseUrl . "deletetheme/');"); } $aButtons[] = array('btn_type' => 'button', 'btn_name' => 'reset', 'btn_value' => _t('_bx_sctr_btn_reset_all'), 'btn_action' => "oBxSctrMain.resetAll('{$sBaseUrl}resetall');"); $sTopControls = $this->parsePageByName('designbox_top_controls.html', array('top_controls' => $this->parseHtmlByName('content_box_top_controls.html', array('name_box' => _t('_bx_sctr_select_target'), 'name_targets_box' => 'background_box', 'bx_repeat:targets' => $aTargets)))); $sBoxContent = $this->parseHtmlByName('content_box.html', array('bx_if:select_target' => array('condition' => !empty($aTargets), 'content' => array('top_controls' => $sTopControls)), 'content' => $sPageThemes ? $sPageThemes : MsgBox(_t('_Empty')), 'bx_repeat:buttons' => $aButtons)); } // customize box $sContent = $this->parseHtmlByName('customize_block.html', array('js_code' => $this->getJsCode(true), 'content' => $GLOBALS['oFunctions']->transBox(DesignBoxContent(_t('_bx_sctr'), $sBoxContent, 1, $sTopMenu), false))); $this->addCss(array('main.css')); $this->addJs(array('colorinput.js', 'main.js')); return $sContent; }
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); }
function login_form($text = "", $member = 0, $bAjaxMode = false) { global $site; global $_page_cont; global $_page; if ($member == 1) { LoginFormAdmin(); exit; } $sLoginFormParams = $bAjaxMode ? 'no_join_text' : ''; $sLoginFormContent = getMemberLoginFormCode('login_box_form', $sLoginFormParams); if ($bAjaxMode) { $iDesignBox = 1; $sContent = $sLoginFormContent; $sJoinFormContent = getMemberJoinFormCode(); if (!empty($sJoinFormContent)) { $iDesignBox = 3; $sContent = $GLOBALS['oSysTemplate']->parseHtmlByName('login_join_popup.html', array('login_form' => $sLoginFormContent, 'join_form' => $sJoinFormContent)); } $sCaption = _t('_Login'); $sCaptionItems = '<div class="dbTopMenu"><i class="bx-popup-element-close sys-icon times"></i></div>'; $sMemberLoginFormAjx = $GLOBALS['oFunctions']->transBox(DesignBoxContent($sCaption, $sContent, $iDesignBox, $sCaptionItems), true); header('Content-Type: text/html; charset=utf-8'); echo $sMemberLoginFormAjx; exit; } $_page['name_index'] = 0; $_page['header'] = $site['title'] . ' ' . _t('_Login'); $_page['header_text'] = _t('_Login'); $_page_cont[0]['page_main_code'] = '<div class="controlsDiv">' . $sLoginFormContent . '</div>'; PageCode(); exit; }
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); }
/** * page code function */ function PageCompMainCode() { global $oTemplConfig; global $logged; $iId = (int) $_COOKIE['memberID']; if ($iId > 0) { $sPassword = getPassword($iId); $bEnableRay = getParam('enable_ray') == 'on'; $check_res = checkAction($iId, ACTION_ID_USE_RAY_CHAT); if ($bEnableRay && $check_res[CHECK_ACTION_RESULT] == CHECK_ACTION_RESULT_ALLOWED) { $ret .= getApplicationContent('chat', 'user', array('id' => $iId, 'password' => $sPassword)); } else { // $ret .= ' // <center> // <table width=100% height=100% cellpadding=0 cellspacing=0> // <td align=center valign=center> // <table width="90%" height="70" cellpadding="5" cellspacing="1" class="table"> // <tr> // <td class="panel" width="100%" align="center" valign="middle"> // <div align="center" class="small">' . $check_res[CHECK_ACTION_MESSAGE] . '</div> // </td> // </tr> // </table> // </td> // </table> // </center>'; $ret .= MsgBox($check_res[CHECK_ACTION_MESSAGE]); } return DesignBoxContent(_t("_RAY_CHAT"), $ret, $oTemplConfig->PageCompThird_db_num); } else { return DesignBoxContent(_t('_LOGIN_ERROR'), MsgBox(_t('_Please login before using Ray chat')), 1); } }
/** * get full comments block with initializations */ function getCommentsBlock($iParentId = 0, $iVParentId = 0, $bInDesignbox = true) { $aBp = array('parent_id' => $iParentId, 'vparent_id' => $iVParentId); $aDp = array('show_empty' => true); $sCaption = _t('_cmt_block_comments_title', $this->getCommentsCount()); $sContent = BxDolTemplate::getInstance()->parseHtmlByName('comments_block.html', array('system' => $this->_sSystem, 'list_anchor' => $this->getListAnchor(), 'id' => $this->getId(), 'comments' => $this->getComments($aBp, $aDp), 'post_form_top' => $this->getFormBoxPost($aBp, array('type' => $this->_sDisplayType, 'position' => BX_CMT_PFP_TOP)), 'post_form_bottom' => $this->getFormBoxPost($aBp, array('type' => $this->_sDisplayType, 'position' => BX_CMT_PFP_BOTTOM)), 'view_image_popup' => $this->_getViewImagePopup(), 'script' => $this->getJsScript())); return $bInDesignbox ? DesignBoxContent($sCaption, $sContent, BX_DB_PADDING_DEF, $this->_getControlsBox()) : array('title' => $sCaption, 'content' => $sContent, 'designbox_id' => BX_DB_PADDING_DEF, 'menu' => $this->_getControlsBox()); }
/** * page code function */ function PageCompPageMainCode() { global $oTemplConfig; global $site; $ret = _t("_TERMS_OF_USE"); $ret = str_replace('<site>', $site['title'], $ret); return DesignBoxContent(_t("_TERMS_OF_USE_H1"), $ret, $oTemplConfig->PageCompThird_db_num); }
function PageCompPageMainCode() { if (!$GLOBALS['MySQL']->getOne("SELECT COUNT(*) FROM `bx_spy_handlers` WHERE `alert_unit` = 'bx_wall' AND `alert_action` = 'post' AND `module_uri` = 'wall' AND `module_class` = 'Module' AND `module_method` = 'get_spy_post'")) { BxDolService::call('spy', 'update_handlers', array('wall', true)); $s = 'Wall handlers for Spy were updated'; } else { $s = 'Wall handlers are already updated'; } return DesignBoxContent($GLOBALS['_page']['header'], $s, $GLOBALS['oTemplConfig']->PageCompThird_db_num); }
/** * page code function */ function PageCompMainCode() { ob_start(); $oGrid = BxDolGrid::getObjectInstance('sample'); // it automatically creates instance of default or custom class by object name if ($oGrid) { echo $oGrid->getCode(); } // print grid object return DesignBoxContent("Sample grid", ob_get_clean(), BX_DB_PADDING_DEF); }
/** * page code function */ function PageCompMainCode() { ob_start(); bx_import('BxDolMenu'); $oMenu = BxDolMenu::getObjectInstance('samples'); // it automatically creates instance of default or custom class by object name if ($oMenu) { echo $oMenu->getCode(); } // print menu object return DesignBoxContent("Sample menu", ob_get_clean(), BX_DB_PADDING_DEF); }
function getContent($iId) { $sPassword = $iId > 0 ? $_COOKIE['memberPassword'] : ""; $aResult = checkAction($iId, ACTION_ID_USE_CHAT, true); if ($aResult[CHECK_ACTION_RESULT] == CHECK_ACTION_RESULT_ALLOWED) { $sResult = getApplicationContent('chat', 'user', array('id' => $iId, 'password' => $sPassword), true); } else { $sResult = MsgBox($aResult[CHECK_ACTION_MESSAGE]); } $sResult = DesignBoxContent(_t('_chat_box_caption'), $sResult, 11); return $sResult; }
/** * 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); }
/** * page code function */ function PageCompMainCode() { ob_start(); $oPermalinks = BxDolPermalinks::getInstance(); $a = array('http://192.168.1.215/d8/page/create-account', 'http://192.168.1.215/d8/page.php?i=create-account', 'http://192.168.1.215/d8/page.php?o=create-account', '/d8/page/create-account', '/d8/page.php?i=create-account', '/d8/page.php?o=create-account', 'page/create-account', 'page.php?i=create-account', 'page.php?o=create-account'); foreach ($a as $sLink) { echo '<hr /><b>Original:</b> ' . $sLink . '<br />'; echo '<b>UNpermalinked:</b> ' . ($sLink = $oPermalinks->unpermalink($sLink)) . '<br />'; echo '<b>Page Name:</b> ' . $oPermalinks->getPageNameFromLink($sLink) . '<br />'; echo '<b>Permalinked:</b> ' . ($sLink = $oPermalinks->permalink($sLink)) . '<br />'; } return DesignBoxContent("Permalinks", ob_get_clean(), BX_DB_PADDING_DEF); }
function PageCompPages($oMlClonetwo) { if (!$oMlClonetwo->isAllowedAdd()) { return DesignBoxContent(_t('_ml_clonetwo_create_page'), MsgBox(_t('_Access denied')), 1); } require_once BX_DIRECTORY_PATH_MODULES . 'modloaded/clonetwo/classes/MlClonetwoCreatePageProcessor.php'; $oCreatePageProc = new MlClonetwoCreatePageProcessor(); $aVars = array('form' => $oCreatePageProc->process(), 'create_url' => BX_DOL_URL_ROOT . 'modules/modloaded/clonetwo/create.php'); $GLOBALS['oSysTemplate']->addJsTranslation('_Errors in join form'); $GLOBALS['oSysTemplate']->addJs(array('join.js', 'jquery.form.js')); $GLOBALS['oSysTemplate']->addCss(array('join.css')); $oMlClonetwo->_oTemplate->addCss(array('main.css')); return DesignBoxContent(_t('_ml_clonetwo_create_page'), $oMlClonetwo->_oTemplate->parseHtmlByName('bx_groups_create_page', $aVars), 1); }
function login_form($text = "", $member = 0, $bbAjaxMode = false) { global $site; global $_page_cont; global $_page; global $admin_dir; if ($member == 1) { LoginFormAdmin(); exit; } $sFormCode = getMemberLoginFormCode('login_box_form'); $sCaptionItem = <<<BLAH <div class="dbTopMenu"> <i class="login_ajx_close sys-icon remove"></i> </div> BLAH; if ($bbAjaxMode) { $sMemberLoginFormAjx = $GLOBALS['oFunctions']->transBox(DesignBoxContent(_t('_Member Login'), $sFormCode, 1, $sCaptionItem), true); header('Content-Type: text/html; charset=utf-8'); echo $sMemberLoginFormAjx; exit; } $sMemberLoginForm = <<<EOF <div class="controlsDiv"> {$sFormCode} </div> EOF; $_page['header'] = $site['title'] . ' ' . _t("_Member Login"); $_page['header_text'] = _t("_Member Login"); if ($bbAjaxMode && $member == 1) { $template = BX_DIRECTORY_PATH_ROOT . "templates/base/login_form_ajax_a.html"; } if ($bbAjaxMode == false && $member == 0) { $_page_cont[0]['page_main_code'] = $sMemberLoginForm; } else { $_page_cont[0]['page_main_code'] = PageCompLoginForm($text, $member, $mem, $login_page, $join_page, $forgot_page, $template); } if ($bbAjaxMode) { echo <<<EOF <div class="login_ajax_wrap"> {$_page_cont[0]['page_main_code']} </div> EOF; exit; } $_page['name_index'] = 0; PageCode(); exit; }
/** * get full comments block with initializations */ function getCommentsBlock($iParentId = 0, $iVParentId = 0, $bInDesignbox = true) { $aBp = $aDp = array(); $this->_getParams($aBp, $aDp); $aBp['parent_id'] = $iParentId; $aBp['vparent_id'] = $iVParentId; $aDp['show_empty'] = true; //add live update $sServiceCall = BxDolService::getSerializedService('system', 'get_live_updates_comments', array($this->_sSystem, $this->_iId, $this->_getAuthorId(), '{count}'), 'TemplCmtsServices'); BxDolLiveUpdates::getInstance()->add($this->_sSystem . '_live_updates_cmts_' . $this->_iId, 1, $sServiceCall); //add live update $sCaption = _t('_cmt_block_comments_title', $this->getCommentsCount()); $sContent = BxDolTemplate::getInstance()->parseHtmlByName('comments_block.html', array('system' => $this->_sSystem, 'list_anchor' => $this->getListAnchor(), 'id' => $this->getId(), 'comments' => $this->getComments($aBp, $aDp), 'post_form_top' => $this->getFormBoxPost($aBp, array('type' => $this->_sDisplayType, 'position' => BX_CMT_PFP_TOP)), 'post_form_bottom' => $this->getFormBoxPost($aBp, array('type' => $this->_sDisplayType, 'position' => BX_CMT_PFP_BOTTOM)), 'view_image_popup' => $this->_getViewImagePopup(), 'script' => $this->getJsScript())); return $bInDesignbox ? DesignBoxContent($sCaption, $sContent, BX_DB_PADDING_DEF, $this->_getControlsBox()) : array('title' => $sCaption, 'content' => $sContent, 'designbox_id' => BX_DB_PADDING_DEF, 'menu' => $this->_getControlsBox()); }
/** * Function will generate default dolphin's page; * * @param : $sPageCaption (string) - page's title; * @param : $sPageContent (string) - page's content; * @param : $sPageIcon (string) - page's icon; * @return : (text) html presentation data; */ function getPage($sPageCaption, $sPageContent, $sPageIcon = 'facebook') { global $_page; global $_page_cont; $iIndex = 55; $_page['name_index'] = $iIndex; // set module's icon; $GLOBALS['oTopMenu']->setCustomSubIconUrl(false === strpos($sPageIcon, '.') ? $sPageIcon : $this->getIconUrl($sPageIcon)); $GLOBALS['oTopMenu']->setCustomSubHeader($sPageCaption); $_page['header'] = $sPageCaption; $_page['header_text'] = $sPageCaption; $_page['css_name'] = 'face_book_connect.css'; $_page_cont[$iIndex]['page_main_code'] = DesignBoxContent($sPageCaption, $sPageContent, 11); PageCode($this); }
/** * Function will generate searched result; * * @return : (text) - Html presentation data ; */ function displaySearchBox($sCode, $sPaginate = '') { // generate the init poll's part ; $sInitSection = $this->oPollObject->getInitPollPage(false); if (isset($this->aCurrent['rss']) && $this->aCurrent['rss']['link']) { $aCaptionMenu = '<div class="dbTopMenu"><div class="notActive notActiveIcon" style="background-image:url(' . getTemplateIcon('rss.png') . ')"><a target="_blank" class="top_members_menu" href="' . $this->aCurrent['rss']['link'] . (false === strpos($this->aCurrent['rss']['link'], '?') ? '?' : '&') . 'rss=1">' . _t('RSS') . '</a></div></div>'; } $sCode = DesignBoxContent(_t($this->aCurrent['title']), $sCode . $sPaginate, 1, $aCaptionMenu); if (!isset($_POST['searchMode'], $_GET['searchMode'])) { $sCode = '<div id="page_block_' . $this->id . '">' . $sCode . '<div class="clear_both"></div></div>'; } // include css file ; $sCssStyles = $this->oPollObject->_oTemplate->addCss('main.css', true); return $sCssStyles . $sInitSection . $sCode; }
function getContent($iId, $iSavedId = 0) { if ($iId > 0) { $sPassword = $_COOKIE['memberPassword']; $aResult = checkAction($iId, ACTION_ID_USE_BOARD, true); if ($aResult[CHECK_ACTION_RESULT] == CHECK_ACTION_RESULT_ALLOWED) { $sResult = getApplicationContent('board', 'user', array('id' => $iId, 'password' => $sPassword, 'saved' => $iSavedId), true); } else { $sResult = MsgBox($aResult[CHECK_ACTION_MESSAGE]); } $sResult = DesignBoxContent(_t('_board_box_caption'), $sResult, 11); } else { $sResult = DesignBoxContent(_t('_board_box_caption'), MsgBox(_t('_board_err_not_logged_in')), 11); } return $sResult; }
function PageCompPages($MlClonetwo) { $iPageId = $_GET['page_id']; if (!$iPageId) { header("location:" . BX_DOL_URL_ROOT . $MlClonetwo->_oConfig->getBaseUri() . "home/"); exit; } require_once BX_DIRECTORY_PATH_MODULES . 'modloaded/clonetwo/classes/MlClonetwoPageEditProcessor.php'; $oEditPageProc = new MlClonetwoPageEditProcessor($iPageId); $aVars = array('form' => $oEditPageProc->process(), 'edit_url' => $MlClonetwo->_oConfig->_sHomeUrl . 'edit.php', 'page_id' => $iPageId); $GLOBALS['oTopMenu']->setCustomVar('ml_clonetwo_view_uri', $oEditPageProc->sUri); $GLOBALS['oSysTemplate']->addJsTranslation('_Errors in join form'); $GLOBALS['oSysTemplate']->addJs(array('join.js', 'jquery.form.js')); $GLOBALS['oSysTemplate']->addCss(array('join.css')); return DesignBoxContent(_t('_ml_clonetwo_edit_page'), $MlClonetwo->_oTemplate->parseHtmlByName('bx_groups_edit_page', $aVars), 1); }
function getBlockCode_Browse() { bx_events_import('SearchResult'); $o = new BxEventsSearchResult('user', process_db_input($this->_aProfile['NickName'], BX_TAGS_NO_ACTION, BX_SLASHES_NO_ACTION)); $o->aCurrent['rss'] = 0; $o->sBrowseUrl = "browse/my"; $o->aCurrent['title'] = _t('_bx_events_block_my_events'); if ($o->isError) { return MsgBox(_t('_Empty')); } if ($s = $o->processing()) { $this->_oTemplate->addCss(array('unit.css', 'main.css', 'twig.css')); return $s; } else { return DesignBoxContent(_t('_bx_events_block_user_events'), MsgBox(_t('_Empty')), 1); } }
/** * page code function */ function PageCompMainCode() { ob_start(); // transBox echo BxTemplFunctions::getInstance()->transBox('bx-sample-popup-transbox', '<div class="bx-def-padding">transBox</div>', true); echo '<div></div><button class="bx-btn bx-def-margin-sec" onclick="$(\'#bx-sample-popup-transbox\').dolPopup()">transBox</button>'; // transBox AJAX echo '<button class="bx-btn bx-def-margin-sec" onclick="$(window).dolPopupAjax({url: \'samples/popup.php?_t=a' . time() . '\'})">transBox AJAX</button>'; // popupBox echo BxTemplFunctions::getInstance()->popupBox('bx-sample-popup-box', 'popupBox', 'popupBox content', true); echo '<button class="bx-btn bx-def-margin-sec" onclick="$(\'#bx-sample-popup-box\').dolPopup()">popupBox</button>'; // popupBox without fog echo BxTemplFunctions::getInstance()->popupBox('bx-sample-popup-box-without-fog', 'popupBox', 'popupBox without fog content', true); echo '<button class="bx-btn bx-def-margin-sec" onclick="$(\'#bx-sample-popup-box-without-fog\').dolPopup({fog:0})">popupBox without fog</button>'; echo '<div class="bx-clear"></div>'; echo '<hr class="bx-def-hr" />'; // transBox echo BxTemplFunctions::getInstance()->transBox('bx-sample-popup-transbox-scrolled', '<div class="bx-def-padding">' . str_repeat('transBox transBox transBox <br />', 100) . '</div>', true); echo '<div></div><button class="bx-btn bx-def-margin-sec" onclick="$(\'#bx-sample-popup-transbox-scrolled\').dolPopup()">transBox scrolled</button>'; // popupBox echo BxTemplFunctions::getInstance()->popupBox('bx-sample-popup-box-scrolled', 'popupBox', str_repeat('popupBox ', 1000), true); echo '<button class="bx-btn bx-def-margin-sec" onclick="$(\'#bx-sample-popup-box-scrolled\').dolPopup()">popupBox scrolled</button>'; echo '<div class="bx-clear"></div>'; echo '<hr class="bx-def-hr" />'; // transBox with pointer echo BxTemplFunctions::getInstance()->transBox('bx-sample-popup-transbox-with-pointer', '<div class="bx-def-padding">transBox with pointer</div>', true); echo '<button class="bx-btn bx-def-margin-sec" onclick="$(\'#bx-sample-popup-transbox-with-pointer\').dolPopup({pointer:{el:$(this)}})">transBox with pointer</button>'; // popupBox with pointer echo BxTemplFunctions::getInstance()->popupBox('bx-sample-popup-box-with-pointer', 'popupBox', 'popupBox with pointer content', true); echo '<button class="bx-btn bx-def-margin-sec" onclick="$(\'#bx-sample-popup-box-with-pointer\').dolPopup({pointer:{el:$(this)}})">popupBox with pointer</button>'; // popupBox with pointer AJAX echo BxTemplFunctions::getInstance()->popupBox('bx-sample-popup-box-with-pointer', 'popupBox', 'popupBox with pointer AJAX', true); echo '<button class="bx-btn bx-def-margin-sec" onclick="$(this).dolPopupAjax({url: \'samples/popup.php?_t=b' . time() . '\'})">popupBox with pointer AJAX</button>'; echo '<div class="bx-clear"></div>'; echo '<hr class="bx-def-hr" />'; // image popup echo BxTemplFunctions::getInstance()->transBox('bx-sample-popup-image', '<img src="samples/img/landscape.jpg" />', true, true); echo '<button class="bx-btn bx-def-margin-sec" onclick="$(\'#bx-sample-popup-image\').dolPopupImage(\'samples/img/landscape.jpg\', this)">popupImage (landscape)</button>'; echo '<button class="bx-btn bx-def-margin-sec" onclick="$(\'#bx-sample-popup-image\').dolPopupImage(\'samples/img/landscape_wide.jpg\', this)">popupImage (landscape wide)</button>'; echo '<button class="bx-btn bx-def-margin-sec" onclick="$(\'#bx-sample-popup-image\').dolPopupImage(\'samples/img/portrate.jpg\', this)">popupImage (portrate)</button>'; echo '<button class="bx-btn bx-def-margin-sec" onclick="$(\'#bx-sample-popup-image\').dolPopupImage(\'samples/img/portrate_thin.jpg\', this)">popupImage (portrate thin)</button>'; echo '<button class="bx-btn bx-def-margin-sec" onclick="$(\'#bx-sample-popup-image\').dolPopupImage(\'samples/img/small.jpg\', this)">popupImage (small)</button>'; echo '<button class="bx-btn bx-def-margin-sec" onclick="$(\'#bx-sample-popup-image\').dolPopupImage(\'samples/img/square.jpg\', this)">popupImage (square)</button>'; echo str_repeat(' <br />', 100); return DesignBoxContent("Sample popup", ob_get_clean(), BX_DB_PADDING_DEF); }
function showBlockPFBlock($iPageBlockID, $sCaption, $sContent, $bNoDB = false, $iId, $aPFBlocks) { if (!$iId) { return; } $this->_getPageData($iId); $iPFBlockID = (int) $sContent; $this->aPFBlocks = $aPFBlocks; $sRet = $this->_getViewValuesTable($iPageBlockID, $iPFBlockID); if ($bNoDB) { $iHeight = $this->aPFBlocks[$iPFBlockID]['BoxHeight']; $sAddStyle = is_numeric($iHeight) && $iHeight > 0 ? "height:{$iHeight}px;overflow:auto;" : ''; return empty($sRet) ? $sRet : array('<div class=" bx_sys_default_padding" style="' . $sAddStyle . '">' . $sRet . '</div>', array(), array(), ''); } else { echo DesignBoxContent(_t($sCaption), $sRet, 1); } }
function displaySearchBox($sCode, $sPaginate = '', $bAdminBox = false) { $sMenu = ''; if (isset($this->aCurrent['rss']) && $this->aCurrent['rss']['link']) { bx_import('BxDolPageView'); $sMenu = BxDolPageView::getBlockCaptionItemCode(time(), array(_t('RSS') => array('href' => $this->aCurrent['rss']['link'] . (false === strpos($this->aCurrent['rss']['link'], '?') ? '?' : '&') . 'rss=1', 'icon' => 'rss'))); } $sTitle = _t($this->aCurrent['title']); if (!$bAdminBox) { $sCode = DesignBoxContent($sTitle, $sCode . $sPaginate, 1, $sMenu); } else { $sCode = DesignBoxAdmin($sTitle, $sCode, '', $sPaginate, 1); } if (!isset($_GET['searchMode'])) { $sCode = '<div id="page_block_' . $this->id . '">' . $sCode . '<div class="clear_both"></div></div>'; } return $sCode; }