示例#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);
 }
示例#2
0
 public function getSplash()
 {
     if ($this->_oConfig->getUri() != $this->getCode()) {
         return '';
     }
     $sDownloadUrl = 'http://ci.boonex.com/';
     $sVersion = '8.0';
     $sVersionFull = '8.0.0';
     $sBuild = '';
     $mixedResponse = bx_file_get_contents($sDownloadUrl . "builds/latest-release-file.txt");
     if ($mixedResponse !== false) {
         $sFile = trim(bx_process_input($mixedResponse));
         $aMatches = array();
         if ((int) preg_match("/([0-9]\\.[0-9])\\.([0-9])-?([A-Z]*[a-z]*[0-9]{1,3})/", $sFile, $aMatches) > 0 && !empty($aMatches[1]) && !empty($aMatches[3])) {
             $sDownloadUrl .= 'builds/' . $sFile;
             $sVersion = $aMatches[1];
             $sBuild = $aMatches[3];
         }
         if ((int) preg_match("/Trident-v\\.([0-9A-Za-z\\.-]+)\\.zip/", $sFile, $aMatches) > 0) {
             $sVersionFull = $aMatches[1];
         }
     }
     $this->addCss(array('splash-phone.css', 'splash-tablet.css', 'splash-desktop.css'));
     return $this->parseHtmlByName('splash.html', array('download_url' => $sDownloadUrl, 'version_full' => $sVersionFull, 'version' => $sVersion, 'build' => $sBuild));
 }
 function __construct($sPage = "")
 {
     parent::__construct('builder_permissions');
     $this->oDb = new BxDolStudioPermissionsQuery();
     $this->sPage = BX_DOL_STUDIO_PRM_TYPE_DEFAULT;
     if (is_string($sPage) && !empty($sPage)) {
         $this->sPage = $sPage;
     }
     //--- Check actions ---//
     if (($sAction = bx_get('pgt_action')) !== false) {
         $sAction = bx_process_input($sAction);
         $aResult = array('code' => 1, 'message' => _t('_adm_pgt_err_cannot_process_action'));
         switch ($sAction) {
             case 'get-page-by-type':
                 $sValue = bx_process_input(bx_get('pgt_value'));
                 if (empty($sValue)) {
                     break;
                 }
                 $this->sPage = $sValue;
                 $aResult = array('code' => 0, 'content' => $this->getPageCode());
                 break;
         }
         echo json_encode($aResult);
         exit;
     }
 }
示例#4
0
 function __construct($sType = '', $sCategory = '')
 {
     parent::__construct('settings');
     $this->oDb = new BxDolStudioSettingsQuery();
     $this->sType = BX_DOL_STUDIO_STG_TYPE_DEFAULT;
     if (is_string($sType) && !empty($sType)) {
         $this->sType = $sType;
     }
     $this->sCategory = '';
     if (is_string($sCategory) && !empty($sCategory)) {
         $this->sCategory = $sCategory;
     }
     //--- Check actions ---//
     if (($sAction = bx_get('stg_action')) !== false && ($sValue = bx_get('stg_value')) !== false) {
         $sAction = bx_process_input($sAction);
         $sValue = bx_process_input($sValue);
         $aResult = array('code' => 0, 'message' => '');
         if (!empty($sAction) && !empty($sValue)) {
             switch ($sAction) {
                 case 'get-page-by-type':
                     $this->sType = $sValue;
                     $aResult['content'] = $this->getPageCode();
                     break;
             }
             echo json_encode($aResult);
         }
         exit;
     }
 }
示例#5
0
 function __construct()
 {
     parent::__construct(BX_DOL_STUDIO_PAGE_HOME);
     $aClasses = array('BxTemplStudioModules', 'BxTemplStudioDesigns', 'BxTemplStudioLanguages');
     //--- Check actions ---//
     if (($sAction = bx_get('action')) !== false) {
         $sAction = bx_process_input($sAction);
         $aResult = array('code' => 1, 'message' => _t('_adm_err_operation_failed'));
         switch ($sAction) {
             case 'launcher-update-cache':
                 $aResult = $this->updateCache();
                 break;
             case 'launcher-reorder':
                 $sPage = bx_process_input(bx_get('page'));
                 $aItems = bx_process_input(bx_get('items'));
                 BxDolStudioWidgetsQuery::getInstance()->reorder($sPage, $aItems);
                 $aResult = array('code' => 0, 'message' => _t('_adm_scs_operation_done'));
                 break;
         }
         echo json_encode($aResult);
         exit;
     }
     $this->aIncludes = array();
     foreach ($aClasses as $sClass) {
         $this->aIncludes[] = new $sClass();
     }
 }
 /**
  * 'recheck' action handler
  */
 public function performActionRecheckItem()
 {
     bx_import('BxDolModule');
     $oModule = BxDolModule::getInstance('bx_antispam');
     $o = bx_instance('BxAntispamDNSBlacklists', array(), $oModule->_aModule);
     $aChain = $o->getRule((int) bx_get('id'));
     $iRet = BX_DOL_DNSBL_FAILURE;
     if ($aChain) {
         if (bx_get('chain') == 'dnsbl') {
             $iRet = $o->dnsbl_lookup_ip($aChain, bx_process_input(bx_get('test')));
         } elseif (bx_get('chain') == 'uridnsbl') {
             $sUrl = preg_replace('/^\\w+:\\/\\//', '', bx_process_input(bx_get('test')));
             $sUrl = preg_replace('/^www\\./', '', $sUrl);
             $oBxDolDNSURIBlacklists = bx_instance('BxAntispamDNSURIBlacklists', array(), $oModule->_aModule);
             $aUrls = $oBxDolDNSURIBlacklists->validateUrls(array($sUrl));
             if ($aUrls) {
                 $iRet = $o->dnsbl_lookup_uri($aUrls[0], $aChain);
             }
         }
     }
     $s = '';
     switch ($iRet) {
         case BX_DOL_DNSBL_POSITIVE:
             $s = 'LISTED';
             break;
         case BX_DOL_DNSBL_NEGATIVE:
             $s = 'NOT LISTED';
             break;
         default:
         case BX_DOL_DNSBL_FAILURE:
             $s = 'FAIL';
     }
     echo $s;
     exit;
 }
示例#7
0
 public function serviceGetBlockFormInvite()
 {
     $iProfileId = $this->getProfileId();
     $iAccountId = $this->getAccountId($iProfileId);
     $mixedAllowed = $this->isAllowedInvite($iProfileId);
     if ($mixedAllowed !== true) {
         return array('content' => MsgBox($mixedAllowed));
     }
     $iInvited = (int) $this->_oDb->getInvites(array('type' => 'count_by_account', 'value' => $iAccountId));
     $iInvites = $this->_oConfig->getCountPerUser() - $iInvited;
     if ($iInvites <= 0) {
         return array('content' => MsgBox(_t('_bx_invites_err_limit_reached')));
     }
     $oForm = $this->getFormObjectInvite();
     $oForm->aInputs['text']['value'] = _t('_bx_invites_msg_invitation');
     $sResult = '';
     $oForm->initChecker();
     if ($oForm->isSubmittedAndValid()) {
         $sEmails = bx_process_input($oForm->getCleanValue('emails'));
         $sText = bx_process_pass($oForm->getCleanValue('text'));
         $mixedResult = $this->invite(BX_INV_TYPE_FROM_MEMBER, $sEmails, $sText, $iInvites, $oForm);
         if ($mixedResult !== false) {
             $sResult = _t('_bx_invites_msg_invitation_sent', (int) $mixedResult);
         } else {
             $sResult = _t('_bx_invites_err_not_available');
         }
         $sResult = MsgBox($sResult);
     }
     return array('content' => $sResult . $oForm->getCode());
 }
 function processActions()
 {
     if (($sAction = bx_get($this->sParamPrefix . '_action')) !== false) {
         $sAction = bx_process_input($sAction);
         $aResult = array('code' => 1, 'message' => _t('_adm_' . $this->sLangPrefix . '_err_cannot_process_action'));
         switch ($sAction) {
             case 'uninstall':
                 $sPageName = bx_process_input(bx_get($this->sParamPrefix . '_page_name'));
                 if (empty($sPageName)) {
                     break;
                 }
                 bx_import('BxDolModuleQuery');
                 $aModule = BxDolModuleQuery::getInstance()->getModuleByName($sPageName);
                 if (empty($aModule) || !is_array($aModule)) {
                     break;
                 }
                 if (($iWidgetId = (int) bx_get($this->sParamPrefix . '_widget_id')) != 0 && (int) bx_get($this->sParamPrefix . '_confirmed') != 1) {
                     $aResult['message'] = $this->getPopupConfirm($iWidgetId, $aModule);
                     break;
                 }
                 bx_import('BxDolStudioInstallerUtils');
                 $aResult = BxDolStudioInstallerUtils::getInstance()->perform($aModule['path'], 'uninstall');
                 if (!empty($aResult['message'])) {
                     $aResult['message'] = $this->getPopupResult($aResult['message']);
                 }
                 break;
         }
         if (!empty($aResult['message'])) {
             bx_import('BxTemplStudioFunctions');
             $aResult['message'] = BxTemplStudioFunctions::getInstance()->transBox('', $aResult['message']);
         }
         echo json_encode($aResult);
         exit;
     }
 }
示例#9
0
 public function init()
 {
     if (($sAction = bx_get('pgt_action')) === false) {
         return;
     }
     $sAction = bx_process_input($sAction);
     $oLanguages = BxDolStudioLanguagesUtils::getInstance();
     $aResult = array('code' => 1, 'message' => _t('_adm_pgt_err_cannot_process_action'));
     switch ($sAction) {
         case 'get-page-by-type':
             $sValue = bx_process_input(bx_get('pgt_value'));
             if (empty($sValue)) {
                 break;
             }
             $this->sPage = $sValue;
             $aResult = array('code' => 0, 'content' => $this->getPageCode());
             break;
             /*
              * Available URL params:
              * pgt_action = recompile - action name
              * pgt_language - ID or name(en, ru, etc) of language.
              */
         /*
          * Available URL params:
          * pgt_action = recompile - action name
          * pgt_language - ID or name(en, ru, etc) of language.
          */
         case 'recompile':
             $sLanguage = bx_process_input(bx_get('pgt_language'));
             if ($oLanguages->compileLanguage($sLanguage)) {
                 $aResult = array('code' => 0, 'content' => _t('_adm_pgt_scs_recompiled'));
             } else {
                 $aResult = array('code' => 2, 'content' => _t('_adm_pgt_err_cannot_recompile_lang'));
             }
             break;
             /*
              * Available URL params:
              * pgt_action = restore - action name
              * pgt_language - ID or name(en, ru, etc) of language.
              * pgt_module - ID or Module Uri (@see sys_modules table). Leave empty for 'System' language file.
              */
         /*
          * Available URL params:
          * pgt_action = restore - action name
          * pgt_language - ID or name(en, ru, etc) of language.
          * pgt_module - ID or Module Uri (@see sys_modules table). Leave empty for 'System' language file.
          */
         case 'restore':
             $sLanguage = bx_process_input(bx_get('pgt_language'));
             $sModule = bx_process_input(bx_get('pgt_module'));
             if ($oLanguages->restoreLanguage($sLanguage, $sModule)) {
                 $aResult = array('code' => 0, 'content' => _t('_adm_pgt_scs_restored'));
             } else {
                 $aResult = array('code' => 2, 'content' => _t('_adm_pgt_err_cannot_restore_lang'));
             }
             break;
     }
     echo json_encode($aResult);
     exit;
 }
示例#10
0
 public function init()
 {
     if (($sAction = bx_get('nav_action')) === false) {
         return;
     }
     $sAction = bx_process_input($sAction);
     $aResult = array('code' => 1, 'message' => _t('_adm_nav_err_cannot_process_action'));
     switch ($sAction) {
         case 'get-page-by-type':
             $sValue = bx_process_input(bx_get('nav_value'));
             if (empty($sValue)) {
                 break;
             }
             $this->sPage = $sValue;
             $aResult = array('code' => 0, 'content' => $this->getPageCode());
             break;
         default:
             $sMethod = 'action' . $this->getClassName($sAction);
             if (method_exists($this, $sMethod)) {
                 $aResult = $this->{$sMethod}();
             }
     }
     echo json_encode($aResult);
     exit;
 }
 public function __construct($aObject, $oTemplate = false)
 {
     parent::__construct($aObject, $oTemplate);
     $CNF = $this->_oModule->_oConfig->CNF;
     $iProfileId = bx_process_input(bx_get('profile_id'), BX_DATA_INT);
     $iContentId = bx_process_input(bx_get('id'), BX_DATA_INT);
     if ($iProfileId) {
         $this->_oProfile = BxDolProfile::getInstance($iProfileId);
     }
     if (!$this->_oProfile && $iContentId) {
         $this->_oProfile = BxDolProfile::getInstanceByContentAndType($iContentId, $this->MODULE);
     }
     if ($this->_oProfile) {
         $this->_aProfileInfo = $this->_oProfile->getInfo();
         $this->_aContentInfo = $this->_oModule->_oDb->getContentInfoById($this->_aProfileInfo['content_id']);
         $this->addMarkers($this->_aProfileInfo);
         $this->addMarkers(array('profile_id' => $this->_oProfile->id()));
         if (isLogged()) {
             $oConn = BxDolConnection::getObjectInstance('sys_profiles_friends');
             if ($oConn->isConnectedNotMutual(bx_get_logged_profile_id(), $this->_oProfile->id())) {
                 $this->addMarkers(array('title_add_friend' => _t($CNF['T']['menu_item_title_befriend_sent']), 'title_remove_friend' => _t($CNF['T']['menu_item_title_unfriend_cancel_request'])));
             } elseif ($oConn->isConnectedNotMutual($this->_oProfile->id(), bx_get_logged_profile_id())) {
                 $this->addMarkers(array('title_add_friend' => _t($CNF['T']['menu_item_title_befriend_confirm']), 'title_remove_friend' => _t($CNF['T']['menu_item_title_unfriend_reject_request'])));
             } else {
                 $this->addMarkers(array('title_add_friend' => _t($CNF['T']['menu_item_title_befriend']), 'title_remove_friend' => _t($CNF['T']['menu_item_title_unfriend'])));
             }
         }
     }
 }
示例#12
0
 public function getPost(&$aEvent, $aBrowseParams = array())
 {
     $aResult = $this->_oConfig->isSystem($aEvent['type'], $aEvent['action']) ? $this->_getSystemData($aEvent) : $this->_getCommonData($aEvent);
     if (empty($aResult) || empty($aResult['owner_id']) || empty($aResult['content'])) {
         return '';
     }
     list($sUserName) = $this->getModule()->getUserInfo($aResult['owner_id']);
     if (empty($aEvent['title']) || empty($aEvent['description'])) {
         $sTitle = !empty($aResult['title']) ? $aResult['title'] : '';
         if ($sTitle == '') {
             $sSample = !empty($aResult['content']['sample']) ? $aResult['content']['sample'] : '_bx_timeline_txt_sample';
             $sTitle = _t('_bx_timeline_txt_user_added_sample', $sUserName, _t($sSample));
         }
         $sDescription = !empty($aResult['description']) ? $aResult['description'] : '';
         if ($sDescription == '' && !empty($aResult['content']['text'])) {
             $sDescription = $aResult['content']['text'];
         }
         $this->_oDb->updateEvent(array('title' => bx_process_input(strip_tags($sTitle)), 'description' => bx_process_input(strip_tags($sDescription))), array('id' => $aEvent['id']));
     }
     $aEvent['object_owner_id'] = $aResult['owner_id'];
     $aEvent['content'] = $aResult['content'];
     $aEvent['votes'] = $aResult['votes'];
     $aEvent['comments'] = $aResult['comments'];
     $sType = !empty($aResult['content_type']) ? $aResult['content_type'] : BX_TIMELINE_PARSE_TYPE_DEFAULT;
     return $this->_getPost($sType, $aEvent, $aBrowseParams);
 }
 public function __construct($aObject, $oTemplate = false)
 {
     parent::__construct($aObject, $oTemplate);
     // get profile info
     $iProfileId = bx_process_input(bx_get('profile_id'), BX_DATA_INT);
     if ($iProfileId) {
         $this->_oProfile = BxDolProfile::getInstance($iProfileId);
         $this->_aProfileInfo = $this->_oProfile ? $this->_oProfile->getInfo() : false;
     }
     if (!$this->_aProfileInfo || !$this->_oProfile) {
         return;
     }
     // select view profile submenu
     $oMenuSubmenu = BxDolMenu::getObjectInstance('sys_site_submenu');
     if ($oMenuSubmenu) {
         $oMenuSubmenu->setObjectSubmenu('bx_persons_view_submenu', array('title' => $this->_oProfile->getDisplayName(), 'link' => $this->_oProfile->getUrl(), 'icon' => $this->_oProfile->getIcon()));
     }
     // add replaceable markers
     $this->addMarkers($this->_aProfileInfo);
     // every profile field can be used as marker
     $this->addMarkers(array('profile_id' => $this->_oProfile->id()));
     // profile id field is also suported
     $this->addMarkers(array('display_name' => $this->_oProfile->getDisplayName()));
     // profile display name is also suported
 }
示例#14
0
 public function init()
 {
     //--- Check Actions ---//
     if (($sAction = bx_get('mod_action')) !== false) {
         $sAction = bx_process_input($sAction);
         $aResult = array('code' => 1, 'message' => _t('_adm_mod_err_cannot_process_action'));
         switch ($sAction) {
             case 'activate':
                 $sValue = bx_process_input(bx_get('mod_value'));
                 if (empty($sValue)) {
                     break;
                 }
                 $aResult = $this->activate($sValue);
                 break;
         }
         echo json_encode($aResult);
         exit;
     }
     $this->aModule = $this->oDb->getModuleByName($this->sModule);
     if (empty($this->aModule) || !is_array($this->aModule)) {
         BxDolStudioTemplate::getInstance()->displayPageNotFound();
     }
     $this->sPageRssHelpUrl = $this->aModule['help_url'];
     $this->sPageRssHelpId = $this->aModule['name'];
     $this->addMarkers(array('module_name' => $this->aModule['name'], 'module_uri' => $this->aModule['uri'], 'module_title' => $this->aModule['title']));
     $this->addAction(array('type' => 'switcher', 'name' => 'activate', 'caption' => '_adm_txt_pca_active', 'checked' => (int) $this->aModule['enabled'] == 1, 'onchange' => "javascript:" . $this->getPageJsObject() . ".activate('" . $this->sModule . "', this)"), false);
 }
示例#15
0
 function init()
 {
     if (($sAction = bx_get('bp_action')) === false) {
         return;
     }
     $sAction = bx_process_input($sAction);
     $aResult = array('code' => 1, 'message' => _t('_adm_bp_err_cannot_process_action'));
     switch ($sAction) {
         case 'reorder':
             if (empty($this->aPageRebuild) || !is_array($this->aPageRebuild)) {
                 break;
             }
             $bResult = false;
             for ($i = 1; $i <= $this->aPageRebuild['layout_cells_number']; $i++) {
                 $aItems = bx_get('bp_items_' . $i);
                 $iItems = count($aItems);
                 for ($j = 0; $j < $iItems; $j++) {
                     $bResult |= $this->oDb->updateBlock((int) $aItems[$j], array('cell_id' => $i, 'order' => $j));
                 }
             }
             $aResult = $bResult ? array('code' => 0, 'message' => _t('_adm_bp_scs_save')) : array('code' => 1, 'message' => _t('_adm_bp_err_nothing_changed'));
             break;
         default:
             $sMethod = 'action' . $this->getClassName($sAction);
             if (method_exists($this, $sMethod)) {
                 $aResult = $this->{$sMethod}();
             }
     }
     echo json_encode($aResult);
     exit;
 }
 function __construct($sPage = "")
 {
     parent::__construct('builder_menus');
     $this->oDb = new BxDolStudioNavigationQuery();
     $this->sPage = BX_DOL_STUDIO_NAV_TYPE_DEFAULT;
     if (is_string($sPage) && !empty($sPage)) {
         $this->sPage = $sPage;
     }
     //--- Check actions ---//
     if (($sAction = bx_get('nav_action')) !== false) {
         $sAction = bx_process_input($sAction);
         $aResult = array('code' => 1, 'message' => _t('_adm_nav_err_cannot_process_action'));
         switch ($sAction) {
             case 'get-page-by-type':
                 $sValue = bx_process_input(bx_get('nav_value'));
                 if (empty($sValue)) {
                     break;
                 }
                 $this->sPage = $sValue;
                 $aResult = array('code' => 0, 'content' => $this->getPageCode());
                 break;
             default:
                 $sMethod = 'action' . $this->getClassName($sAction);
                 if (method_exists($this, $sMethod)) {
                     $aResult = $this->{$sMethod}();
                 }
         }
         echo json_encode($aResult);
         exit;
     }
 }
示例#17
0
 protected function getPermissions()
 {
     $sPage = bx_get('prm_page');
     $sPage = $sPage !== false ? bx_process_input($sPage) : '';
     bx_import('Permissions', $this->aModule);
     $oContent = new BxDevPermissions(array('page' => $sPage, 'url' => sprintf($this->sUrl, $this->sModule, BX_DEV_TOOLS_PERMISSIONS)));
     return $this->oModule->_oTemplate->displayPageContent($this->sPage, $oContent);
 }
示例#18
0
 function actionGetSets()
 {
     if (($sModule = bx_get('nav_module')) === false) {
         return array('code' => 2, 'message' => _t('_adm_nav_err_missing_params'));
     }
     $sModule = bx_process_input($sModule);
     return array('code' => 0, 'message' => '', 'content' => $this->getItemsObject()->getSetsSelector($sModule));
 }
示例#19
0
 function makeDefault()
 {
     $sValue = bx_get('dsg_value');
     if ($sValue === false) {
         return false;
     }
     $sValue = bx_process_input($sValue);
     return $this->oDb->setParam('template', $sValue);
 }
示例#20
0
 public function __construct($aObject, $oTemplate = false)
 {
     parent::__construct($aObject, $oTemplate);
     $iContentId = bx_process_input(bx_get('id'), BX_DATA_INT);
     $this->_aContentInfo = $this->_oModule->_oDb->getContentInfoById($iContentId);
     if ($this->_aContentInfo) {
         $this->addMarkers(array('content_id' => (int) $iContentId));
     }
 }
 protected function getCurrentOnclick($aAdditionalParams = array(), $bReplacePagesParams = true)
 {
     // always add UnitView as additional param
     $sUnitView = bx_process_input(bx_get($this->sUnitViewParamName));
     if ($sUnitView && isset($this->aUnitViews[$sUnitView])) {
         $aAdditionalParams = array_merge(array($this->sUnitViewParamName => $sUnitView), $aAdditionalParams);
     }
     return parent::getCurrentOnclick($aAdditionalParams, $bReplacePagesParams);
 }
示例#22
0
 /**
  * Check captcha.
  */
 public function check()
 {
     require_once BX_DIRECTORY_PATH_PLUGINS . 'recaptcha/recaptchalib.php';
     $oResp = recaptcha_check_answer($this->_sKeyPrivate, $_SERVER["REMOTE_ADDR"], bx_process_input(bx_get('recaptcha_challenge_field')), bx_process_input(bx_get('recaptcha_response_field')));
     if (!$oResp->is_valid) {
         $this->_error = $oResp->error;
         return false;
     }
     return true;
 }
 public function __construct($aOptions, $oTemplate = false)
 {
     parent::__construct($aOptions, $oTemplate);
     $this->oDb = new BxDolStudioNavigationQuery();
     $sSet = bx_get('set');
     if (!empty($sSet)) {
         $this->sSet = bx_process_input($sSet);
     }
     $this->_aQueryAppend['set'] = $this->sSet;
 }
 public function __construct($aObject, $oTemplate = false)
 {
     parent::__construct($aObject, $oTemplate);
     $CNF =& $this->_oModule->_oConfig->CNF;
     $aInformers = array();
     // get profile info
     $iProfileId = bx_process_input(bx_get('profile_id'), BX_DATA_INT);
     $iContentId = bx_process_input(bx_get('id'), BX_DATA_INT);
     if ($iProfileId) {
         $this->_oProfile = BxDolProfile::getInstance($iProfileId);
     }
     if (!$this->_oProfile && $iContentId) {
         $this->_oProfile = BxDolProfile::getInstanceByContentAndType($iContentId, $this->MODULE);
     }
     if ($this->_oProfile) {
         $this->_aProfileInfo = $this->_oProfile->getInfo();
         $this->_aContentInfo = $this->_oModule->_oDb->getContentInfoById($this->_aProfileInfo['content_id']);
     }
     if (!$this->_aContentInfo || !$this->_oProfile) {
         return;
     }
     // select view profile submenu
     $oMenuSubmenu = BxDolMenu::getObjectInstance('sys_site_submenu');
     $oMenuSubmenu->setObjectSubmenu($CNF['OBJECT_MENU_SUBMENU_VIEW_ENTRY'], array('title' => $this->_oProfile->getDisplayName(), 'link' => $this->_oProfile->getUrl(), 'icon' => $CNF['ICON']));
     // add replaceable markers
     $this->addMarkers($this->_aProfileInfo);
     // every content field can be used as marker
     $this->addMarkers(array('profile_id' => $this->_oProfile->id()));
     // profile id field
     $this->addMarkers(array('display_name' => $this->_oProfile->getDisplayName()));
     // profile display name
     $this->addMarkers(array('profile_link' => $this->_oProfile->getUrl()));
     // profile link
     // display message if profile isn't active
     if (bx_get_logged_profile_id() == $this->_oProfile->id() && !empty($CNF['INFORMERS']['status'])) {
         $sStatus = $this->_aContentInfo['profile_status'];
         if (isset($CNF['INFORMERS']['status']['map'][$sStatus])) {
             $aInformers[] = array('name' => $CNF['INFORMERS']['status']['name'], 'msg' => _t($CNF['INFORMERS']['status']['map'][$sStatus]), 'type' => BX_INFORMER_ALERT);
         }
     }
     // display message if it is possible to switch to this profile
     $oProfile = $this->_aContentInfo ? BxDolProfile::getInstanceByContentTypeAccount($this->_aContentInfo['id'], $this->MODULE) : false;
     if ($oProfile) {
         $oProfile->checkSwitchToProfile($this->_oTemplate);
     }
     // add informers
     if ($aInformers) {
         $oInformer = BxDolInformer::getInstance($this->_oTemplate);
         if ($oInformer) {
             foreach ($aInformers as $a) {
                 $oInformer->add($a['name'], $this->_replaceMarkers($a['msg']), $a['type']);
             }
         }
     }
 }
示例#25
0
 protected function _responseInner($oAlert)
 {
     $this->_oModule->_iOwnerId = (int) $oAlert->aExtras['owner_id'];
     $sMedia = strtolower(str_replace('bx_', '', $oAlert->sUnit));
     $aMediaInfo = $this->_oModule->_oTemplate->getCommonMedia($sMedia, $oAlert->iObject);
     $iId = $this->_oModule->_oDb->insertEvent(array('owner_id' => $this->_oModule->_iOwnerId, 'type' => $this->_oModule->_oConfig->getPrefix('common_post') . $sMedia, 'action' => '', 'object_id' => $this->_oModule->_getUserId(), 'object_privacy_view' => $this->_getPrivacyView($oAlert->aExtras), 'content' => serialize(array('type' => $sMedia, 'id' => $oAlert->iObject)), 'title' => bx_process_input($aMediaInfo['title']), 'description' => bx_process_input($aMediaInfo['description'])));
     if (!empty($iId)) {
         $this->_oModule->onPost($iId);
     }
     echo $this->_oModule->_oTemplate->_wrapInTagJsCode("parent." . $this->_oModule->_sJsPostObject . "._getPost(null, " . $iId . ");");
 }
 public function __construct($aOptions, $oTemplate = false)
 {
     parent::__construct($aOptions, $oTemplate);
     $CNF =& $this->_oModule->_oConfig->CNF;
     $this->_sFilter1Name = 'filter1';
     $this->_aFilter1Values = array('active' => $CNF['T']['filter_item_active'], 'hidden' => $CNF['T']['filter_item_hidden']);
     $sFilter1 = bx_get($this->_sFilter1Name);
     if (!empty($sFilter1)) {
         $this->_sFilter1Value = bx_process_input($sFilter1);
         $this->_aQueryAppend['filter1'] = $this->_sFilter1Value;
     }
 }
示例#27
0
 public function __construct($aObject, $oTemplate = false)
 {
     $this->MODULE = 'bx_albums';
     parent::__construct($aObject, $oTemplate);
     $sURI = bx_process_input(bx_get('i'));
     if ($sURI == 'view-album-media') {
         $aMediaInfo = $this->_oModule->_oDb->getMediaInfoById((int) bx_get('id'));
         $this->_aContentInfo = $aMediaInfo ? $this->_oModule->_oDb->getContentInfoById($aMediaInfo['content_id']) : false;
         if ($this->_aContentInfo) {
             $this->addMarkers(array('content_id' => (int) $aMediaInfo['content_id']));
         }
     }
 }
示例#28
0
 function update($iContentId, $aValsToAdd = array(), &$aTrackTextFieldsChanges = null)
 {
     $CNF =& $this->_oModule->_oConfig->CNF;
     if (CHECK_ACTION_RESULT_ALLOWED === $this->_oModule->checkAllowedSetThumb()) {
         $aThumb = bx_process_input(bx_get($CNF['FIELD_THUMB']), BX_DATA_INT);
         $aValsToAdd[$CNF['FIELD_THUMB']] = 0;
         if (!empty($aThumb) && is_array($aThumb) && ($iFileThumb = array_pop($aThumb))) {
             $aValsToAdd[$CNF['FIELD_THUMB']] = $iFileThumb;
         }
     }
     $iRet = parent::update($iContentId, $aValsToAdd, $aTrackTextFieldsChanges);
     $this->_processFiles($this->getCleanValue($CNF['FIELD_PHOTO']), $iContentId, false);
     return $iRet;
 }
 public function __construct($aOptions, $oTemplate = false)
 {
     parent::__construct($aOptions, $oTemplate);
     $this->oDb = new BxDolStudioFormsQuery();
     $sModule = bx_get('module');
     if (!empty($sModule)) {
         $this->sModule = bx_process_input($sModule);
         $this->_aQueryAppend['module'] = $this->sModule;
     }
     $sList = bx_get('list');
     if (!empty($sList)) {
         $this->sList = bx_process_input($sList);
         $this->_aQueryAppend['list'] = $this->sList;
     }
 }
示例#30
0
 function exists($sId = '')
 {
     if (empty($sId) && isset($_COOKIE[BX_DOL_SESSION_COOKIE])) {
         $sId = bx_process_input($_COOKIE[BX_DOL_SESSION_COOKIE]);
     }
     $mixedSession = array();
     if (($mixedSession = $this->oDb->exists($sId)) !== false) {
         $this->sId = $mixedSession['id'];
         $this->iUserId = (int) $mixedSession['user_id'];
         $this->aData = unserialize($mixedSession['data']);
         return true;
     } else {
         return false;
     }
 }