|
|
@@ -1,1099 +0,0 @@
|
|
|
-<?xml version="1.0" encoding="UTF-8"?>
|
|
|
-<pmd-cpd>
|
|
|
- <duplication lines="41" tokens="98">
|
|
|
- <file path="/var/lib/jenkins/workspace/UNA-Pipe/studio/classes/BxDolStudioFormsQuery.php" line="831"/>
|
|
|
- <file path="/var/lib/jenkins/workspace/UNA-Pipe/studio/classes/BxDolStudioFormsQuery.php" line="882"/>
|
|
|
- <codefragment> function getSearchFields($aParams, &$aItems, $bReturnCount = true)
|
|
|
- {
|
|
|
- $aMethod = array('name' => 'getAll', 'params' => array(0 => 'query'));
|
|
|
- $sSelectClause = $sFromClause = $sJoinClause = $sWhereClause = $sGroupClause = $sOrderClause = $sLimitClause = "";
|
|
|
-
|
|
|
- if(!isset($aParams['order']) || empty($aParams['order']))
|
|
|
- $sOrderClause = "ORDER BY `tfld`.`order` ASC";
|
|
|
-
|
|
|
- switch($aParams['type']) {
|
|
|
- case 'by_id':
|
|
|
- $aMethod['name'] = 'getRow';
|
|
|
- $aMethod['params'][1] = array(
|
|
|
- 'id' => $aParams['id']
|
|
|
- );
|
|
|
-
|
|
|
- $sWhereClause = " AND `tfld`.`id`=:id ";
|
|
|
- break;
|
|
|
-
|
|
|
- case 'by_object':
|
|
|
- $aMethod['params'][1] = array(
|
|
|
- 'object' => $aParams['object']
|
|
|
- );
|
|
|
-
|
|
|
- $sWhereClause = "AND `tfld`.`object`=:object";
|
|
|
- break;
|
|
|
-
|
|
|
- case 'counter_by_modules':
|
|
|
- $aMethod['name'] = 'getPairs';
|
|
|
- $aMethod['params'][1] = 'module';
|
|
|
- $aMethod['params'][2] = 'counter';
|
|
|
- $sSelectClause = ", COUNT(*) AS `counter`";
|
|
|
- $sGroupClause = "GROUP BY `tfld`.`module`";
|
|
|
- $sOrderClause = "";
|
|
|
- break;
|
|
|
-
|
|
|
- case 'all':
|
|
|
- break;
|
|
|
- }
|
|
|
-
|
|
|
- $aMethod['params'][0] = "SELECT " . ($bReturnCount ? "SQL_CALC_FOUND_ROWS" : "") . "
|
|
|
- `tfld`.*" . $sSelectClause . "
|
|
|
-</codefragment>
|
|
|
- </duplication>
|
|
|
- <duplication lines="41" tokens="96">
|
|
|
- <file path="/var/lib/jenkins/workspace/UNA-Pipe/modules/boonex/shopify/classes/BxShopifyDb.php" line="15"/>
|
|
|
- <file path="/var/lib/jenkins/workspace/UNA-Pipe/modules/boonex/snipcart/classes/BxSnipcartDb.php" line="15"/>
|
|
|
- <codefragment>class BxShopifyDb extends BxBaseModTextDb
|
|
|
-{
|
|
|
- function __construct(&$oConfig)
|
|
|
- {
|
|
|
- parent::__construct($oConfig);
|
|
|
- }
|
|
|
-
|
|
|
- public function getSettings($aParams = array())
|
|
|
- {
|
|
|
- $CNF = &$this->_oConfig->CNF;
|
|
|
-
|
|
|
- $aMethod = array('name' => 'getAll', 'params' => array(0 => 'query'));
|
|
|
- $sWhereClause = $sOrderByClause = "";
|
|
|
-
|
|
|
- $sSelectClause = "*";
|
|
|
- switch($aParams['type']) {
|
|
|
- case 'id':
|
|
|
- $aMethod['name'] = 'getRow';
|
|
|
- $aMethod['params'][1] = array(
|
|
|
- 'id' => $aParams['id']
|
|
|
- );
|
|
|
-
|
|
|
- $sWhereClause .= " AND `id`=:id";
|
|
|
- break;
|
|
|
-
|
|
|
- case 'author':
|
|
|
- $aMethod['name'] = 'getRow';
|
|
|
- $aMethod['params'][1] = array(
|
|
|
- 'author' => $aParams['author']
|
|
|
- );
|
|
|
-
|
|
|
- $sWhereClause .= " AND `author`=:author";
|
|
|
- break;
|
|
|
-
|
|
|
- case 'all':
|
|
|
- break;
|
|
|
- }
|
|
|
-
|
|
|
- $aMethod['params'][0] = "SELECT " . $sSelectClause . " FROM `" . $CNF['TABLE_SETTINGS'] . "` WHERE 1 " . $sWhereClause;
|
|
|
-
|
|
|
- return call_user_func_array(array($this, $aMethod['name']), $aMethod['params']);
|
|
|
-</codefragment>
|
|
|
- </duplication>
|
|
|
- <duplication lines="38" tokens="110">
|
|
|
- <file path="/var/lib/jenkins/workspace/UNA-Pipe/modules/boonex/resources/classes/BxResourcesModule.php" line="226"/>
|
|
|
- <file path="/var/lib/jenkins/workspace/UNA-Pipe/modules/boonex/tasks/classes/BxTasksModule.php" line="733"/>
|
|
|
- <codefragment> public function isAllowView($iContextId)
|
|
|
- {
|
|
|
- if(!($oContext = BxDolProfile::getInstance($iContextId)) || $oContext->checkAllowedProfileView($iContextId) !== CHECK_ACTION_RESULT_ALLOWED)
|
|
|
- return false;
|
|
|
-
|
|
|
- return true;
|
|
|
- }
|
|
|
-
|
|
|
- public function isAllowAdd($iContextId)
|
|
|
- {
|
|
|
- if(!($oContext = BxDolProfile::getInstance($iContextId)) || $oContext->checkAllowedPostInProfile($iContextId) !== CHECK_ACTION_RESULT_ALLOWED)
|
|
|
- return false;
|
|
|
-
|
|
|
- return true;
|
|
|
- }
|
|
|
-
|
|
|
- public function isAllowManageByContext($iContextId)
|
|
|
- {
|
|
|
- if(isAdmin())
|
|
|
- return true;
|
|
|
-
|
|
|
- $oProfileContext = BxDolProfile::getInstance($iContextId);
|
|
|
- if(BxDolService::call($oProfileContext->getModule(), 'is_admin', array($iContextId)))
|
|
|
- return true;
|
|
|
-
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
- public function isAllowManage($mixedContent)
|
|
|
- {
|
|
|
- $CNF = &$this->_oConfig->CNF;
|
|
|
-
|
|
|
- $aContentInfo = !is_array($mixedContent) ? $this->_oDb->getContentInfoById((int)$mixedContent) : $mixedContent;
|
|
|
- if($this->checkAllowedEdit($aContentInfo) === CHECK_ACTION_RESULT_ALLOWED)
|
|
|
- return true;
|
|
|
-
|
|
|
- if($this->isAllowManageByContext(abs($aContentInfo[$CNF['FIELD_ALLOW_VIEW_TO']])))
|
|
|
- return true;
|
|
|
-</codefragment>
|
|
|
- </duplication>
|
|
|
- <duplication lines="34" tokens="84">
|
|
|
- <file path="/var/lib/jenkins/workspace/UNA-Pipe/modules/boonex/ads/classes/BxAdsMenuView.php" line="27"/>
|
|
|
- <file path="/var/lib/jenkins/workspace/UNA-Pipe/modules/boonex/market/classes/BxMarketMenuView.php" line="27"/>
|
|
|
- <codefragment> parent::__construct($aObject, $oTemplate);
|
|
|
-
|
|
|
- $this->_aJsCodes = array();
|
|
|
-
|
|
|
- $this->addMarkers(array(
|
|
|
- 'js_object' => $this->_oModule->_oConfig->getJsObject('entry')
|
|
|
- ));
|
|
|
- }
|
|
|
-
|
|
|
- public function getCode ()
|
|
|
- {
|
|
|
- return parent::getCode() . $this->getJsCode();
|
|
|
- }
|
|
|
-
|
|
|
- public function getJsCode()
|
|
|
- {
|
|
|
- if(empty($this->_aJsCodes) || !is_array($this->_aJsCodes))
|
|
|
- return '';
|
|
|
-
|
|
|
- return implode('', $this->_aJsCodes);
|
|
|
- }
|
|
|
-
|
|
|
- protected function _isVisible ($a)
|
|
|
- {
|
|
|
- $CNF = &$this->_oModule->_oConfig->CNF;
|
|
|
-
|
|
|
- if(!parent::_isVisible($a))
|
|
|
- return false;
|
|
|
-
|
|
|
- $oPayment = BxDolPayments::getInstance();
|
|
|
-
|
|
|
- $bResult = false;
|
|
|
- switch ($a['name']) {
|
|
|
- case 'add-to-cart':
|
|
|
-</codefragment>
|
|
|
- </duplication>
|
|
|
- <duplication lines="33" tokens="122">
|
|
|
- <file path="/var/lib/jenkins/workspace/UNA-Pipe/modules/boonex/classes/classes/BxClssModule.php" line="229"/>
|
|
|
- <file path="/var/lib/jenkins/workspace/UNA-Pipe/modules/boonex/stream/classes/BxStrmModule.php" line="215"/>
|
|
|
- <codefragment> public function serviceGetTimelinePost($aEvent, $aBrowseParams = array())
|
|
|
- {
|
|
|
- $CNF = &$this->_oConfig->CNF;
|
|
|
-
|
|
|
- $aResult = parent::serviceGetTimelinePost($aEvent, $aBrowseParams);
|
|
|
- if(empty($aResult) || !is_array($aResult) || empty($aResult['date']))
|
|
|
- return $aResult;
|
|
|
-
|
|
|
- $aContentInfo = $this->_oDb->getContentInfoById($aEvent['object_id']);
|
|
|
- if($aContentInfo[$CNF['FIELD_PUBLISHED']] > $aResult['date'])
|
|
|
- $aResult['date'] = $aContentInfo[$CNF['FIELD_PUBLISHED']];
|
|
|
-
|
|
|
- return $aResult;
|
|
|
- }
|
|
|
-
|
|
|
- public function serviceCheckAllowedCommentsPost($iContentId, $sObjectComments)
|
|
|
- {
|
|
|
- $CNF = &$this->_oConfig->CNF;
|
|
|
- $aContentInfo = $this->_oDb->getContentInfoById($iContentId);
|
|
|
- if ($aContentInfo && 1 == $aContentInfo[$CNF['FIELD_CMTS_SETTINGS']])
|
|
|
- return false;
|
|
|
-
|
|
|
- return parent::serviceCheckAllowedCommentsPost($iContentId, $sObjectComments);
|
|
|
- }
|
|
|
-
|
|
|
- public function serviceCheckAllowedCommentsView($iContentId, $sObjectComments)
|
|
|
- {
|
|
|
- $CNF = &$this->_oConfig->CNF;
|
|
|
- $aContentInfo = $this->_oDb->getContentInfoById($iContentId);
|
|
|
- if (1 == $aContentInfo[$CNF['FIELD_CMTS_SETTINGS']])
|
|
|
- return false;
|
|
|
-
|
|
|
- return parent::serviceCheckAllowedCommentsView($iContentId, $sObjectComments);
|
|
|
-</codefragment>
|
|
|
- </duplication>
|
|
|
- <duplication lines="32" tokens="97">
|
|
|
- <file path="/var/lib/jenkins/workspace/UNA-Pipe/modules/base/text/classes/BxBaseModTextGridCommon.php" line="26"/>
|
|
|
- <file path="/var/lib/jenkins/workspace/UNA-Pipe/modules/boonex/timeline/classes/BxTimelineGridCommon.php" line="26"/>
|
|
|
- <codefragment> $this->_sManageType = BX_DOL_MANAGE_TOOLS_COMMON;
|
|
|
- }
|
|
|
-
|
|
|
- protected function _getCellSwitcher ($mixedValue, $sKey, $aField, $aRow)
|
|
|
- {
|
|
|
- if(!$this->_switcherState2Checked($aRow['status_admin']))
|
|
|
- return parent::_getCellDefault('', $sKey, $aField, $aRow);
|
|
|
-
|
|
|
- return parent::_getCellSwitcher ($mixedValue, $sKey, $aField, $aRow);
|
|
|
- }
|
|
|
-
|
|
|
- protected function _getCellStatusAdmin($mixedValue, $sKey, $aField, $aRow)
|
|
|
- {
|
|
|
- $CNF = &$this->_oModule->_oConfig->CNF;
|
|
|
-
|
|
|
- if(!empty($CNF['T']['filter_item_' . $mixedValue]))
|
|
|
- $mixedValue = $CNF['T']['filter_item_' . $mixedValue];
|
|
|
- else
|
|
|
- $mixedValue = '_undefined';
|
|
|
-
|
|
|
- return parent::_getCellDefault(_t($mixedValue), $sKey, $aField, $aRow);
|
|
|
- }
|
|
|
-
|
|
|
- protected function _isRowDisabled($aRow)
|
|
|
- {
|
|
|
- if(parent::_isRowDisabled($aRow))
|
|
|
- return true;
|
|
|
-
|
|
|
- return !$this->_switcherState2Checked($aRow['status_admin']);
|
|
|
- }
|
|
|
-
|
|
|
- protected function _getDataSql($sFilter, $sOrderField, $sOrderDir, $iStart, $iPerPage)
|
|
|
-</codefragment>
|
|
|
- </duplication>
|
|
|
- <duplication lines="31" tokens="90">
|
|
|
- <file path="/var/lib/jenkins/workspace/UNA-Pipe/modules/boonex/posts/classes/BxPostsSearchResult.php" line="52"/>
|
|
|
- <file path="/var/lib/jenkins/workspace/UNA-Pipe/modules/boonex/videos/classes/BxVideosSearchResult.php" line="52"/>
|
|
|
- <codefragment> $this->oModule = $this->getMain();
|
|
|
-
|
|
|
- $CNF = &$this->oModule->_oConfig->CNF;
|
|
|
-
|
|
|
- $sSearchFields = getParam($CNF['PARAM_SEARCHABLE_FIELDS']);
|
|
|
- $this->aCurrent['searchFields'] = !empty($sSearchFields) ? explode(',', $sSearchFields) : '';
|
|
|
-
|
|
|
- $oProfileAuthor = null;
|
|
|
-
|
|
|
- switch ($sMode) {
|
|
|
- case 'author':
|
|
|
- if(!$this->_updateCurrentForAuthor($sMode, $aParams, $oProfileAuthor))
|
|
|
- $this->isError = true;
|
|
|
- break;
|
|
|
-
|
|
|
- case 'context':
|
|
|
- if(!$this->_updateCurrentForContext($sMode, $aParams, $oProfileAuthor))
|
|
|
- $this->isError = true;
|
|
|
- break;
|
|
|
-
|
|
|
- case 'followed_contexts':
|
|
|
- if(!$this->_updateCurrentForFollowedContexts($sMode, $aParams, $oProfileAuthor))
|
|
|
- $this->isError = true;
|
|
|
- break;
|
|
|
-
|
|
|
- case 'favorite':
|
|
|
- if(!$this->_updateCurrentForFavorite($sMode, $aParams, $oProfileAuthor))
|
|
|
- $this->isError = true;
|
|
|
- break;
|
|
|
-
|
|
|
- case 'recent':
|
|
|
-</codefragment>
|
|
|
- </duplication>
|
|
|
- <duplication lines="31" tokens="88">
|
|
|
- <file path="/var/lib/jenkins/workspace/UNA-Pipe/modules/boonex/google_connect/classes/BxGoogleConModule.php" line="38"/>
|
|
|
- <file path="/var/lib/jenkins/workspace/UNA-Pipe/modules/boonex/linkedin_connect/classes/BxLinkedinModule.php" line="38"/>
|
|
|
- <codefragment> $sUrl = bx_append_url_params($this->_oConfig->sOauthUrl . '/auth', array(
|
|
|
- 'response_type' => 'code',
|
|
|
- 'client_id' => $this->_oConfig->sApiID,
|
|
|
- 'redirect_uri' => $this->_oConfig->sPageHandle,
|
|
|
- 'scope' => $this->_oConfig->sScope,
|
|
|
- 'state' => $this->_genToken(),
|
|
|
- ));
|
|
|
- $this->_redirect($sUrl);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- function actionHandle()
|
|
|
- {
|
|
|
- require_once(BX_DIRECTORY_PATH_INC . 'design.inc.php');
|
|
|
-
|
|
|
- // check CSRF token
|
|
|
- if ($this->_getToken() != bx_get('state')) {
|
|
|
- $this->_oTemplate->getPage(_t('_Error'), MsgBox(_t('_sys_connect_state_invalid')));
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- // check code
|
|
|
- $sCode = bx_get('code');
|
|
|
- if (!$sCode || bx_get('error')) {
|
|
|
- $sErrorDescription = bx_get('error_description') ? bx_get('error_description') : _t('_error occured');
|
|
|
- $this->_oTemplate->getPage(_t('_Error'), MsgBox($sErrorDescription));
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- // make request for token
|
|
|
- $s = bx_file_get_contents($this->_oConfig->sApiUrl . '/oauth2/v4/token', array(
|
|
|
-</codefragment>
|
|
|
- </duplication>
|
|
|
- <duplication lines="29" tokens="98">
|
|
|
- <file path="/var/lib/jenkins/workspace/UNA-Pipe/modules/boonex/albums/classes/BxAlbumsModule.php" line="785"/>
|
|
|
- <file path="/var/lib/jenkins/workspace/UNA-Pipe/modules/boonex/stories/classes/BxStoriesModule.php" line="117"/>
|
|
|
- <codefragment> public function actionGetSiblingMedia($iMediaId, $mixedContext)
|
|
|
- {
|
|
|
- $aSiblings = false;
|
|
|
- $sErrorMsg = false;
|
|
|
- if (!($aMediaInfo = $this->_oDb->getMediaInfoById((int)$iMediaId)))
|
|
|
- $sErrorMsg = _t('_sys_txt_error_occured');
|
|
|
-
|
|
|
- if (empty($sErrorMsg) && !($aContentInfo = $this->_oDb->getContentInfoById($aMediaInfo['content_id'])))
|
|
|
- $sErrorMsg = _t('_sys_txt_error_occured');
|
|
|
-
|
|
|
- if (empty($sErrorMsg) && (CHECK_ACTION_RESULT_ALLOWED !== ($sMsg = $this->checkAllowedView($aContentInfo))))
|
|
|
- $sErrorMsg = $sMsg;
|
|
|
-
|
|
|
- if (empty($sErrorMsg)) {
|
|
|
- $aSiblings = array (
|
|
|
- 'next' => $this->_oTemplate->getNextPrevMedia($aMediaInfo, true, $mixedContext),
|
|
|
- 'prev' => $this->_oTemplate->getNextPrevMedia($aMediaInfo, false, $mixedContext),
|
|
|
- );
|
|
|
- }
|
|
|
-
|
|
|
- $a = $sErrorMsg ? array('error' => $sErrorMsg) : array('next' => $aSiblings['next'], 'prev' => $aSiblings['prev']);
|
|
|
-
|
|
|
- $s = json_encode($a);
|
|
|
-
|
|
|
- header('Content-type: text/html; charset=utf-8');
|
|
|
- echo $s;
|
|
|
- }
|
|
|
-
|
|
|
- public function actionRssMedia ()
|
|
|
-</codefragment>
|
|
|
- </duplication>
|
|
|
- <duplication lines="29" tokens="78">
|
|
|
- <file path="/var/lib/jenkins/workspace/UNA-Pipe/modules/boonex/courses/classes/BxCoursesModule.php" line="466"/>
|
|
|
- <file path="/var/lib/jenkins/workspace/UNA-Pipe/modules/boonex/market/classes/BxMarketModule.php" line="1361"/>
|
|
|
- <codefragment> public function checkAllowedHide($aDataEntry, $isPerformAction = false)
|
|
|
- {
|
|
|
- $CNF = &$this->_oConfig->CNF;
|
|
|
-
|
|
|
- if($aDataEntry[$CNF['FIELD_STATUS']] != 'active')
|
|
|
- return CHECK_ACTION_RESULT_NOT_ALLOWED;
|
|
|
-
|
|
|
- // moderator and owner always have access
|
|
|
- if ($aDataEntry[$CNF['FIELD_AUTHOR']] == $this->_iProfileId || $this->_isModerator($isPerformAction))
|
|
|
- return CHECK_ACTION_RESULT_ALLOWED;
|
|
|
-
|
|
|
- return CHECK_ACTION_RESULT_NOT_ALLOWED;
|
|
|
- }
|
|
|
-
|
|
|
- public function checkAllowedUnhide($aDataEntry, $isPerformAction = false)
|
|
|
- {
|
|
|
- $CNF = &$this->_oConfig->CNF;
|
|
|
-
|
|
|
- if($aDataEntry[$CNF['FIELD_STATUS']] == 'active')
|
|
|
- return CHECK_ACTION_RESULT_NOT_ALLOWED;
|
|
|
-
|
|
|
- // moderator and owner always have access
|
|
|
- if ($aDataEntry[$CNF['FIELD_AUTHOR']] == $this->_iProfileId || $this->_isModerator($isPerformAction))
|
|
|
- return CHECK_ACTION_RESULT_ALLOWED;
|
|
|
-
|
|
|
- return CHECK_ACTION_RESULT_NOT_ALLOWED;
|
|
|
- }
|
|
|
-
|
|
|
- public function getNodeLevelByParent($aParentInfo)
|
|
|
-</codefragment>
|
|
|
- </duplication>
|
|
|
- <duplication lines="29" tokens="80">
|
|
|
- <file path="/var/lib/jenkins/workspace/UNA-Pipe/modules/base/connect/classes/BxBaseModConnectModule.php" line="477"/>
|
|
|
- <file path="/var/lib/jenkins/workspace/UNA-Pipe/modules/boonex/google_connect/classes/BxGoogleConModule.php" line="89"/>
|
|
|
- <codefragment> $s = bx_file_get_contents($this->_oConfig->sApiUrl . 'api/me', array(), 'get', array(
|
|
|
- 'Authorization: Bearer ' . $sAccessToken,
|
|
|
- ));
|
|
|
-
|
|
|
- // handle error
|
|
|
- if (!$s || NULL === ($aResponse = json_decode($s, true)) || !$aResponse || isset($aResponse['error'])) {
|
|
|
- $sErrorDescription = isset($aResponse['error_description']) ? $aResponse['error_description'] : _t('_error occured');
|
|
|
- $this->_oTemplate->getPage(_t('_Error'), MsgBox($sErrorDescription));
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- $aRemoteProfileInfo = $aResponse;
|
|
|
-
|
|
|
- if ($aRemoteProfileInfo) {
|
|
|
-
|
|
|
- // check if user logged in before
|
|
|
- $iLocalProfileId = $this->_oDb->getProfileId($aRemoteProfileInfo['id']);
|
|
|
-
|
|
|
- if ($iLocalProfileId && $oProfile = BxDolProfile::getInstance($iLocalProfileId)) {
|
|
|
- // user already exists
|
|
|
- $this->setLogged($oProfile ->id());
|
|
|
- }
|
|
|
- else {
|
|
|
- // register new user
|
|
|
- $this->_createProfile($aRemoteProfileInfo);
|
|
|
- }
|
|
|
- }
|
|
|
- else {
|
|
|
- $this->_oTemplate->getPage(_t('_Error'), MsgBox(_t('_sys_connect_profile_error_info')));
|
|
|
-</codefragment>
|
|
|
- </duplication>
|
|
|
- <duplication lines="29" tokens="104">
|
|
|
- <file path="/var/lib/jenkins/workspace/UNA-Pipe/modules/boonex/events/classes/BxEventsSearchResult.php" line="256"/>
|
|
|
- <file path="/var/lib/jenkins/workspace/UNA-Pipe/modules/boonex/events/classes/BxEventsSearchResult.php" line="291"/>
|
|
|
- <codefragment> $this->aCurrent['title'] = _t('_bx_events_page_title_browse_upcoming');
|
|
|
-
|
|
|
- // $this->aCurrent['restriction_sql'] = BxDolDb::getInstance()->prepareAsString(" AND `date_max` IS NOT NULL AND (`date_max` = 0 OR `date_max` > ?) ", time());
|
|
|
-
|
|
|
- // TODO: remake to use date_max (commented line above) in the future
|
|
|
- $this->aCurrent['join']['intervals'] = array (
|
|
|
- 'type' => 'LEFT',
|
|
|
- 'table' => 'bx_events_intervals',
|
|
|
- 'table_alias' => 'ei',
|
|
|
- 'mainField' => 'id',
|
|
|
- 'mainTable' => 'bx_events_data',
|
|
|
- 'onField' => 'event_id',
|
|
|
- 'groupTable' => 'bx_events_data',
|
|
|
- 'groupField' => 'id',
|
|
|
- 'groupHaving' => BxDolDb::getInstance()->prepareAsString(" (`date_end` > ? OR MIN(`repeat_stop`) = 0 OR MAX(`repeat_stop`) > ?) ", time(), time()),
|
|
|
- 'joinFields' => ['MIN(`repeat_stop`) AS `repeat_min`, ', 'MAX(`repeat_stop`) AS `repeat_max`, '],
|
|
|
- );
|
|
|
-
|
|
|
- if(!empty($aParams['date_start_from']))
|
|
|
- $this->aCurrent['restriction']['date_start_from']['value'] = $aParams['date_start_from'];
|
|
|
- if(!empty($aParams['date_start_to']))
|
|
|
- $this->aCurrent['restriction']['date_start_to']['value'] = $aParams['date_start_to'];
|
|
|
- $this->aCurrent['sorting'] = 'upcoming';
|
|
|
- if(!empty($aParams['per_page']))
|
|
|
- $this->aCurrent['paginate']['perPage'] = is_numeric($aParams['per_page']) ? (int)$aParams['per_page'] : (int)getParam($aParams['per_page']);
|
|
|
- $this->sBrowseUrl = 'page.php?i=events-upcoming';
|
|
|
- break;
|
|
|
-
|
|
|
- case 'upcoming_connected':
|
|
|
-</codefragment>
|
|
|
- </duplication>
|
|
|
- <duplication lines="28" tokens="96">
|
|
|
- <file path="/var/lib/jenkins/workspace/UNA-Pipe/studio/template/scripts/BxBaseStudioFormsFields.php" line="407"/>
|
|
|
- <file path="/var/lib/jenkins/workspace/UNA-Pipe/studio/template/scripts/BxBaseStudioNavigationItems.php" line="529"/>
|
|
|
- <codefragment> if($this->sDisplay == '')
|
|
|
- $isDisabled = true;
|
|
|
-
|
|
|
- return parent::_getActionDefault($sType, $sKey, $a, false, $isDisabled, $aRow);
|
|
|
- }
|
|
|
-
|
|
|
- protected function _getActionEdit ($sType, $sKey, $a, $isSmall = false, $isDisabled = false, $aRow = array())
|
|
|
- {
|
|
|
- if($sType == 'single' && !$this->_isEditable($aRow))
|
|
|
- return '';
|
|
|
-
|
|
|
- return parent::_getActionDefault($sType, $sKey, $a, false, $isDisabled, $aRow);
|
|
|
- }
|
|
|
-
|
|
|
- protected function _getActionDelete ($sType, $sKey, $a, $isSmall = false, $isDisabled = false, $aRow = array())
|
|
|
- {
|
|
|
- if($sType == 'single' && !$this->_isDeletable($aRow))
|
|
|
- return '';
|
|
|
-
|
|
|
- return parent::_getActionDefault($sType, $sKey, $a, false, $isDisabled, $aRow);
|
|
|
- }
|
|
|
-
|
|
|
- protected function _getActionShowTo ($sType, $sKey, $a, $isSmall = false, $isDisabled = false, $aRow = array())
|
|
|
- {
|
|
|
- return '';
|
|
|
- }
|
|
|
-
|
|
|
- protected function _getActionsDisabledBehavior($aRow)
|
|
|
-</codefragment>
|
|
|
- </duplication>
|
|
|
- <duplication lines="28" tokens="92">
|
|
|
- <file path="/var/lib/jenkins/workspace/UNA-Pipe/modules/boonex/albums/classes/BxAlbumsSearchResult.php" line="61"/>
|
|
|
- <file path="/var/lib/jenkins/workspace/UNA-Pipe/modules/boonex/glossary/classes/BxGlsrSearchResult.php" line="51"/>
|
|
|
- <file path="/var/lib/jenkins/workspace/UNA-Pipe/modules/boonex/market/classes/BxMarketSearchResult.php" line="54"/>
|
|
|
- <file path="/var/lib/jenkins/workspace/UNA-Pipe/modules/boonex/polls/classes/BxPollsSearchResult.php" line="54"/>
|
|
|
- <file path="/var/lib/jenkins/workspace/UNA-Pipe/modules/boonex/reviews/classes/BxReviewsSearchResult.php" line="52"/>
|
|
|
- <file path="/var/lib/jenkins/workspace/UNA-Pipe/modules/boonex/shopify/classes/BxShopifySearchResult.php" line="52"/>
|
|
|
- <file path="/var/lib/jenkins/workspace/UNA-Pipe/modules/boonex/snipcart/classes/BxSnipcartSearchResult.php" line="52"/>
|
|
|
- <file path="/var/lib/jenkins/workspace/UNA-Pipe/modules/boonex/stream/classes/BxStrmSearchResult.php" line="52"/>
|
|
|
- <file path="/var/lib/jenkins/workspace/UNA-Pipe/modules/boonex/tasks/classes/BxTasksSearchResult.php" line="51"/>
|
|
|
- <codefragment> $this->oModule = $this->getMain();
|
|
|
-
|
|
|
- $CNF = &$this->oModule->_oConfig->CNF;
|
|
|
-
|
|
|
- $sSearchFields = getParam($CNF['PARAM_SEARCHABLE_FIELDS']);
|
|
|
- $this->aCurrent['searchFields'] = !empty($sSearchFields) ? explode(',', $sSearchFields) : '';
|
|
|
-
|
|
|
- $oProfileAuthor = null;
|
|
|
-
|
|
|
- switch ($sMode) {
|
|
|
-
|
|
|
- case 'author':
|
|
|
- if(!$this->_updateCurrentForAuthor($sMode, $aParams, $oProfileAuthor))
|
|
|
- $this->isError = true;
|
|
|
- break;
|
|
|
-
|
|
|
- case 'context':
|
|
|
- if(!$this->_updateCurrentForContext($sMode, $aParams, $oProfileAuthor))
|
|
|
- $this->isError = true;
|
|
|
- break;
|
|
|
-
|
|
|
- case 'favorite':
|
|
|
- if(!$this->_updateCurrentForFavorite($sMode, $aParams, $oProfileAuthor))
|
|
|
- $this->isError = true;
|
|
|
- break;
|
|
|
-
|
|
|
- case 'public':
|
|
|
- $this->sBrowseUrl = BxDolPermalinks::getInstance()->permalink($CNF['URL_HOME']);
|
|
|
-</codefragment>
|
|
|
- </duplication>
|
|
|
- <duplication lines="27" tokens="89">
|
|
|
- <file path="/var/lib/jenkins/workspace/UNA-Pipe/modules/boonex/resources/classes/BxResourcesFormEntry.php" line="67"/>
|
|
|
- <file path="/var/lib/jenkins/workspace/UNA-Pipe/modules/boonex/tasks/classes/BxTasksFormEntry.php" line="94"/>
|
|
|
- <codefragment> if(isset($CNF['FIELD_ADDED']) && empty($aValsToAdd[$CNF['FIELD_ADDED']])) {
|
|
|
- $iAdded = 0;
|
|
|
- if(isset($this->aInputs[$CNF['FIELD_ADDED']]))
|
|
|
- $iAdded = $this->getCleanValue($CNF['FIELD_ADDED']);
|
|
|
-
|
|
|
- if(empty($iAdded))
|
|
|
- $iAdded = time();
|
|
|
-
|
|
|
- $aValsToAdd[$CNF['FIELD_ADDED']] = $iAdded;
|
|
|
- }
|
|
|
-
|
|
|
- if(empty($aValsToAdd[$CNF['FIELD_PUBLISHED']])) {
|
|
|
- $iPublished = 0;
|
|
|
- if(isset($this->aInputs[$CNF['FIELD_PUBLISHED']]))
|
|
|
- $iPublished = $this->getCleanValue($CNF['FIELD_PUBLISHED']);
|
|
|
-
|
|
|
- if(empty($iPublished))
|
|
|
- $iPublished = time();
|
|
|
-
|
|
|
- $aValsToAdd[$CNF['FIELD_PUBLISHED']] = $iPublished;
|
|
|
- }
|
|
|
-
|
|
|
- $aValsToAdd[$CNF['FIELD_STATUS']] = $aValsToAdd[$CNF['FIELD_PUBLISHED']] > $aValsToAdd[$CNF['FIELD_ADDED']] ? 'awaiting' : 'active';
|
|
|
-
|
|
|
- $iContentId = parent::insert ($aValsToAdd, $isIgnore);
|
|
|
- if(!empty($iContentId))
|
|
|
- $this->processFiles($CNF['FIELD_COVER'], $iContentId, true);
|
|
|
-</codefragment>
|
|
|
- </duplication>
|
|
|
- <duplication lines="27" tokens="71">
|
|
|
- <file path="/var/lib/jenkins/workspace/UNA-Pipe/modules/boonex/albums/classes/BxAlbumsModule.php" line="62"/>
|
|
|
- <file path="/var/lib/jenkins/workspace/UNA-Pipe/modules/boonex/stories/classes/BxStoriesModule.php" line="155"/>
|
|
|
- <codefragment> public function serviceEntityAllActions ($mixedContent = false, $aParams = array())
|
|
|
- {
|
|
|
- if(!empty($mixedContent)) {
|
|
|
- if(!is_array($mixedContent))
|
|
|
- $mixedContent = array((int)$mixedContent, array());
|
|
|
- }
|
|
|
- else {
|
|
|
- $mixedContent = $this->_getContent();
|
|
|
- if($mixedContent === false)
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
- list($iContentId, $aContentInfo) = $mixedContent;
|
|
|
-
|
|
|
- $aMedias = $this->_oDb->getMediaListByContentId($iContentId);
|
|
|
- if(!empty($aMedias) && is_array($aMedias)) {
|
|
|
- $aMedia = array_shift($aMedias);
|
|
|
- if(!empty($aMedia['file_id']))
|
|
|
- $aParams = array_merge(array(
|
|
|
- 'entry_thumb' => $aMedia['file_id']
|
|
|
- ), $aParams);
|
|
|
- }
|
|
|
-
|
|
|
- return parent::serviceEntityAllActions(array($iContentId, $aContentInfo), $aParams);
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
-</codefragment>
|
|
|
- </duplication>
|
|
|
- <duplication lines="27" tokens="101">
|
|
|
- <file path="/var/lib/jenkins/workspace/UNA-Pipe/modules/boonex/albums/classes/BxAlbumsModule.php" line="732"/>
|
|
|
- <file path="/var/lib/jenkins/workspace/UNA-Pipe/modules/boonex/stories/classes/BxStoriesModule.php" line="91"/>
|
|
|
- <codefragment> $sContent = BxTemplStudioFunctions::getInstance()->transBox('bx-albums-edit-media-popup', $this->_oTemplate->parseHtmlByName('media-edit.html', array(
|
|
|
- 'form_id' => $oForm->aFormAttrs['id'],
|
|
|
- 'form' => $oForm->getCode(true)
|
|
|
- )));
|
|
|
-
|
|
|
- echoJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))));
|
|
|
- }
|
|
|
-
|
|
|
- public function actionDeleteMedia($iMediaId)
|
|
|
- {
|
|
|
- $CNF = &$this->_oConfig->CNF;
|
|
|
-
|
|
|
- $sUploader = reset($CNF['OBJECT_UPLOADERS']);
|
|
|
- $aMediaInfo = $this->_oDb->getMediaInfoById($iMediaId);
|
|
|
- if(!$sUploader || empty($aMediaInfo) || !is_array($aMediaInfo))
|
|
|
- return echoJson([]);
|
|
|
-
|
|
|
- $oUploader = BxDolUploader::getObjectInstance($sUploader, $CNF['OBJECT_STORAGE'], '');
|
|
|
- if($oUploader === false)
|
|
|
- return echoJson(['msg' => _t('_sys_txt_error_occured')]);
|
|
|
-
|
|
|
- $oUploader->deleteGhost($aMediaInfo['file_id'], bx_get_logged_profile_id());
|
|
|
-
|
|
|
- return echoJson(['redirect' => bx_absolute_url(BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $aMediaInfo['content_id']))]);
|
|
|
- }
|
|
|
-
|
|
|
- public function actionMoveMedia($iMediaId)
|
|
|
-</codefragment>
|
|
|
- </duplication>
|
|
|
- <duplication lines="27" tokens="73">
|
|
|
- <file path="/var/lib/jenkins/workspace/UNA-Pipe/modules/boonex/ads/classes/BxAdsFormSourcesDetails.php" line="87"/>
|
|
|
- <file path="/var/lib/jenkins/workspace/UNA-Pipe/modules/boonex/payment/classes/BxPaymentFormDetails.php" line="111"/>
|
|
|
- <codefragment> 'func' => $aInput['check_type'],
|
|
|
- 'params' => $aInput['check_params'],
|
|
|
- 'error' => _t($aInput['check_error']),
|
|
|
- ]
|
|
|
- ];
|
|
|
-
|
|
|
- //--- Make some field dependent actions ---//
|
|
|
- switch($aInput['type']) {
|
|
|
- case 'select':
|
|
|
- if(empty($aInput['extra']))
|
|
|
- break;
|
|
|
-
|
|
|
- $aAddon = ['values' => []];
|
|
|
-
|
|
|
- if(BxDolService::isSerializedService($aInput['extra']))
|
|
|
- $aAddon['values'] = BxDolService::callSerialized($aInput['extra']);
|
|
|
- else {
|
|
|
- $aPairs = explode(',', $aInput['extra']);
|
|
|
- foreach($aPairs as $sPair) {
|
|
|
- $aPair = explode('|', $sPair);
|
|
|
- $aAddon['values'][] = ['key' => $aPair[0], 'value' => _t($aPair[1])];
|
|
|
- }
|
|
|
- }
|
|
|
- break;
|
|
|
-
|
|
|
- case 'checkbox':
|
|
|
- $this->aInputs[$aInput['name']]['value'] = '1';
|
|
|
-</codefragment>
|
|
|
- </duplication>
|
|
|
- <duplication lines="26" tokens="98">
|
|
|
- <file path="/var/lib/jenkins/workspace/UNA-Pipe/modules/boonex/elasticsearch/classes/BxElsModule.php" line="305"/>
|
|
|
- <file path="/var/lib/jenkins/workspace/UNA-Pipe/modules/boonex/elasticsearch/classes/BxElsModule.php" line="357"/>
|
|
|
- <codefragment> public function serviceAdd($iContentId, $mixedContentInfo, $sIndex = '')
|
|
|
- {
|
|
|
- if(is_array($mixedContentInfo)) {
|
|
|
- $sMethod = 'getObjectInstanceByAlert' . bx_gen_method_name($mixedContentInfo['alert_type']);
|
|
|
- $mixedContentInfo = BxDolContentInfo::$sMethod($mixedContentInfo['unit'], $mixedContentInfo['action']);
|
|
|
- }
|
|
|
-
|
|
|
- if(!($mixedContentInfo instanceof BxDolContentInfo))
|
|
|
- return false;
|
|
|
-
|
|
|
- $CNF = &$this->_oConfig->CNF;
|
|
|
-
|
|
|
- if(empty($sIndex))
|
|
|
- $sIndex = $this->_oConfig->getIndex();
|
|
|
-
|
|
|
- $aInfo = array(
|
|
|
- $CNF['FIELD_AUTHOR'] => $mixedContentInfo->getContentAuthor($iContentId),
|
|
|
- $CNF['FIELD_ADDED'] => $mixedContentInfo->getContentDateAdded($iContentId),
|
|
|
- $CNF['FIELD_CHANGED'] => $mixedContentInfo->getContentDateChanged($iContentId),
|
|
|
- $CNF['FIELD_LINK'] => $mixedContentInfo->getContentLink($iContentId),
|
|
|
- $CNF['FIELD_TITLE'] => $mixedContentInfo->getContentTitle($iContentId),
|
|
|
- $CNF['FIELD_TEXT'] => $mixedContentInfo->getContentText($iContentId),
|
|
|
- );
|
|
|
- $aInfo = array_merge($aInfo, $mixedContentInfo->getContentInfo($iContentId));
|
|
|
-
|
|
|
- $mixedResult = $this->_oApi->indexData($sIndex, $mixedContentInfo->getName(), $iContentId, $this->_prepareToIndex($aInfo));
|
|
|
-</codefragment>
|
|
|
- </duplication>
|
|
|
- <duplication lines="25" tokens="110">
|
|
|
- <file path="/var/lib/jenkins/workspace/UNA-Pipe/modules/boonex/albums/classes/BxAlbumsTemplate.php" line="311"/>
|
|
|
- <file path="/var/lib/jenkins/workspace/UNA-Pipe/modules/boonex/stories/classes/BxStoriesTemplate.php" line="281"/>
|
|
|
- <codefragment> $iVideoDuration = $oModule->getMediaDuration($aFileInfo);
|
|
|
- $sVideoDuration = _t_format_duration($iVideoDuration);
|
|
|
-
|
|
|
- $sVideoUrl = $oStorage->getFileUrlById($aMediaInfo['file_id']);
|
|
|
- $aVideoFile = $oStorage->getFile($aMediaInfo['file_id']);
|
|
|
-
|
|
|
- $sVideoUrlHd = '';
|
|
|
- if (!empty($aVideoFile['dimensions']) && $aTranscodersVideo['mp4_hd']->isProcessHD($aVideoFile['dimensions']))
|
|
|
- $sVideoUrlHd = $aTranscodersVideo['mp4_hd']->getFileUrl($aMediaInfo['file_id']);
|
|
|
-
|
|
|
- $aTmplVarsVideo = array (
|
|
|
- 'title_attr' => $sMediaTitleAttr,
|
|
|
- 'title' => $sMediaTitle,
|
|
|
- 'url' => bx_append_url_params($sUrl, array('autoplay' => 1)),
|
|
|
- 'url_img' => $isVideo ? $aTranscodersVideo['poster']->getFileUrl($aMediaInfo['file_id']) : '',
|
|
|
- 'video' => $isVideo && $aTranscodersVideo ? BxTemplFunctions::getInstance()->videoPlayer(
|
|
|
- $aTranscodersVideo['poster']->getFileUrl($aMediaInfo['file_id']),
|
|
|
- $aTranscodersVideo['mp4']->getFileUrl($aMediaInfo['file_id']),
|
|
|
- $sVideoUrlHd, $mixedAttrs, 'max-height:' . $CNF['OBJECT_VIDEO_TRANSCODER_HEIGHT']
|
|
|
- ) : '',
|
|
|
- 'duration' => $sVideoDuration,
|
|
|
- 'bx_if:show_duration' => array(
|
|
|
- 'condition' => $iVideoDuration > 0,
|
|
|
- 'content' => array(
|
|
|
- 'duration' => $sVideoDuration
|
|
|
-</codefragment>
|
|
|
- </duplication>
|
|
|
- <duplication lines="25" tokens="77">
|
|
|
- <file path="/var/lib/jenkins/workspace/UNA-Pipe/modules/boonex/ads/classes/BxAdsSearchResult.php" line="61"/>
|
|
|
- <file path="/var/lib/jenkins/workspace/UNA-Pipe/modules/boonex/albums/classes/BxAlbumsSearchResult.php" line="65"/>
|
|
|
- <codefragment> $sSearchFields = getParam($CNF['PARAM_SEARCHABLE_FIELDS']);
|
|
|
- $this->aCurrent['searchFields'] = !empty($sSearchFields) ? explode(',', $sSearchFields) : '';
|
|
|
-
|
|
|
- $oProfileAuthor = null;
|
|
|
-
|
|
|
- switch ($sMode) {
|
|
|
- case 'author':
|
|
|
- if(!$this->_updateCurrentForAuthor($sMode, $aParams, $oProfileAuthor))
|
|
|
- $this->isError = true;
|
|
|
- break;
|
|
|
-
|
|
|
- case 'context':
|
|
|
- if(!$this->_updateCurrentForContext($sMode, $aParams, $oProfileAuthor))
|
|
|
- $this->isError = true;
|
|
|
- break;
|
|
|
-
|
|
|
- case 'favorite':
|
|
|
- if(!$this->_updateCurrentForFavorite($sMode, $aParams, $oProfileAuthor))
|
|
|
- $this->isError = true;
|
|
|
- break;
|
|
|
-
|
|
|
- case 'public':
|
|
|
- $this->sBrowseUrl = BxDolPermalinks::getInstance()->permalink($CNF['URL_HOME']);
|
|
|
- $this->aCurrent['title'] = _t('_bx_ads_page_title_browse_recent');
|
|
|
- $this->aCurrent['rss']['link'] = 'modules/?r=ads/rss/' . $sMode;
|
|
|
-</codefragment>
|
|
|
- </duplication>
|
|
|
- <duplication lines="24" tokens="74">
|
|
|
- <file path="/var/lib/jenkins/workspace/UNA-Pipe/template/scripts/BxBaseFavorite.php" line="62"/>
|
|
|
- <file path="/var/lib/jenkins/workspace/UNA-Pipe/template/scripts/BxBaseFeature.php" line="55"/>
|
|
|
- <codefragment> public function getJsObjectName()
|
|
|
- {
|
|
|
- return $this->_sJsObjName;
|
|
|
- }
|
|
|
-
|
|
|
- public function getJsScript($bDynamicMode = false)
|
|
|
- {
|
|
|
- $aParams = array(
|
|
|
- 'sObjName' => $this->_sJsObjName,
|
|
|
- 'sSystem' => $this->getSystemName(),
|
|
|
- 'iAuthorId' => $this->_getAuthorId(),
|
|
|
- 'iObjId' => $this->getId(),
|
|
|
- 'sRootUrl' => BX_DOL_URL_ROOT,
|
|
|
- 'sStylePrefix' => $this->_sStylePrefix,
|
|
|
- 'aHtmlIds' => $this->_aHtmlIds
|
|
|
- );
|
|
|
- $sCode = "var " . $this->_sJsObjName . " = new " . $this->_sJsObjClass . "(" . json_encode($aParams) . ");";
|
|
|
-
|
|
|
- return $this->_oTemplate->_wrapInTagJsCode($sCode);
|
|
|
- }
|
|
|
-
|
|
|
- public function getJsClick()
|
|
|
- {
|
|
|
- return $this->getJsObjectName() . '.favorite(this)';
|
|
|
-</codefragment>
|
|
|
- </duplication>
|
|
|
- <duplication lines="24" tokens="94">
|
|
|
- <file path="/var/lib/jenkins/workspace/UNA-Pipe/modules/base/text/classes/BxBaseModTextFormEntry.php" line="265"/>
|
|
|
- <file path="/var/lib/jenkins/workspace/UNA-Pipe/modules/boonex/ads/classes/BxAdsFormEntry.php" line="343"/>
|
|
|
- <codefragment> 'name' => $this->aInputs[$CNF['FIELD_COVER']]['name'],
|
|
|
- 'content_id' => $this->aInputs[$CNF['FIELD_COVER']]['content_id'],
|
|
|
- 'editor_id' => isset($CNF['FIELD_TEXT_ID']) ? $CNF['FIELD_TEXT_ID'] : '',
|
|
|
- 'thumb_id' => isset($CNF['FIELD_THUMB']) && isset($aContentInfo[$CNF['FIELD_THUMB']]) ? $aContentInfo[$CNF['FIELD_THUMB']] : 0,
|
|
|
- 'name_thumb' => isset($CNF['FIELD_THUMB']) ? $CNF['FIELD_THUMB'] : ''
|
|
|
- ];
|
|
|
- }
|
|
|
-
|
|
|
- protected function _getPhotoGhostTmplVars($aContentInfo = [])
|
|
|
- {
|
|
|
- $CNF = &$this->_oModule->_oConfig->CNF;
|
|
|
-
|
|
|
- return [
|
|
|
- 'name' => $this->aInputs[$CNF['FIELD_PHOTO']]['name'],
|
|
|
- 'content_id' => (int)$this->aInputs[$CNF['FIELD_PHOTO']]['content_id'],
|
|
|
- 'editor_id' => isset($CNF['FIELD_TEXT_ID']) ? $CNF['FIELD_TEXT_ID'] : '',
|
|
|
- 'bx_if:set_thumb' => [
|
|
|
- 'condition' => false,
|
|
|
- 'content' => []
|
|
|
- ],
|
|
|
- ];
|
|
|
- }
|
|
|
-
|
|
|
- protected function _getVideoGhostTmplVars($aContentInfo = [])
|
|
|
-</codefragment>
|
|
|
- </duplication>
|
|
|
- <duplication lines="23" tokens="72">
|
|
|
- <file path="/var/lib/jenkins/workspace/UNA-Pipe/modules/boonex/albums/classes/BxAlbumsSearchResultMedia.php" line="153"/>
|
|
|
- <file path="/var/lib/jenkins/workspace/UNA-Pipe/modules/boonex/stories/classes/BxStoriesSearchResultMedia.php" line="112"/>
|
|
|
- <codefragment> $this->addCustomConditions($CNF, $oProfileAuthor, $sMode, $aParams);
|
|
|
- }
|
|
|
-
|
|
|
- function getAlterOrder()
|
|
|
- {
|
|
|
- $CNF = &$this->oModule->_oConfig->CNF;
|
|
|
-
|
|
|
- $sTable = $this->aCurrent['table'];
|
|
|
- $sWay = $this->sOrderDirection;
|
|
|
-
|
|
|
- $aSql = array();
|
|
|
- switch ($this->aCurrent['sorting']) {
|
|
|
- case 'order':
|
|
|
- $aSql['order'] = " ORDER BY `" . $sTable . "`.`order` " . $sWay . ", `" . $sTable . "`.`id` " . $sWay . " ";
|
|
|
- break;
|
|
|
-
|
|
|
- case 'order_by_ghosts':
|
|
|
- $aSql['order'] = " ORDER BY `g`.`order` " . $sWay . ", `" . $sTable . "`.`id` " . $sWay . " ";
|
|
|
- break;
|
|
|
-
|
|
|
- case 'last':
|
|
|
- $aSql['order'] = " ORDER BY `f`.`added` " . $sWay . ", `" . $sTable . "`.`id` " . $sWay . " ";
|
|
|
- break;
|
|
|
-</codefragment>
|
|
|
- </duplication>
|
|
|
- <duplication lines="23" tokens="90">
|
|
|
- <file path="/var/lib/jenkins/workspace/UNA-Pipe/modules/boonex/albums/classes/BxAlbumsFormMedia.php" line="26"/>
|
|
|
- <file path="/var/lib/jenkins/workspace/UNA-Pipe/modules/boonex/stories/classes/BxStoriesFormMedia.php" line="26"/>
|
|
|
- <codefragment> $this->_oModule = BxDolModule::getInstance($this->_sModule);
|
|
|
-
|
|
|
- parent::__construct($aInfo, $oTemplate);
|
|
|
- }
|
|
|
-
|
|
|
- public function initChecker($aValues = array (), $aSpecificValues = array())
|
|
|
- {
|
|
|
- if(!empty($this->_aMediaInfo) && is_array($this->_aMediaInfo))
|
|
|
- $aValues = $this->_aMediaInfo;
|
|
|
-
|
|
|
- parent::initChecker($aValues, $aSpecificValues);
|
|
|
- }
|
|
|
-
|
|
|
- public function initForm($aAction, $iMediaId)
|
|
|
- {
|
|
|
- $CNF = &$this->_oModule->_oConfig->CNF;
|
|
|
-
|
|
|
- $this->_iMediaId = $iMediaId;
|
|
|
- $this->_aMediaInfo = $this->_oModule->_oDb->getMediaInfoById($iMediaId);
|
|
|
-
|
|
|
- $this->aFormAttrs['action'] = BX_DOL_URL_ROOT . $this->_oModule->_oConfig->getBaseUri() . $aAction . '_media/' . $iMediaId;
|
|
|
-
|
|
|
- if(isset($this->aInputs['content_id'])) {
|
|
|
-</codefragment>
|
|
|
- </duplication>
|
|
|
- <duplication lines="23" tokens="75">
|
|
|
- <file path="/var/lib/jenkins/workspace/UNA-Pipe/modules/boonex/market/classes/BxMarketScore.php" line="14"/>
|
|
|
- <file path="/var/lib/jenkins/workspace/UNA-Pipe/modules/boonex/market/classes/BxMarketVoteStars.php" line="14"/>
|
|
|
- <codefragment> protected $MODULE;
|
|
|
- protected $_oModule;
|
|
|
-
|
|
|
- function __construct($sSystem, $iId, $iInit = 1)
|
|
|
- {
|
|
|
- $this->MODULE = 'bx_market';
|
|
|
- $this->_oModule = BxDolModule::getInstance($this->MODULE);
|
|
|
-
|
|
|
- parent::__construct($sSystem, $iId, $iInit);
|
|
|
- }
|
|
|
-
|
|
|
- public function isAllowedVote($isPerformAction = false)
|
|
|
- {
|
|
|
- $CNF = &$this->_oModule->_oConfig->CNF;
|
|
|
-
|
|
|
- if($this->getObjectAuthorId() == $this->_getAuthorId())
|
|
|
- return false;
|
|
|
-
|
|
|
- $oPrivacy = BxDolPrivacy::getObjectInstance($CNF['OBJECT_PRIVACY_VOTE']);
|
|
|
- if($oPrivacy && !$oPrivacy->check($this->_iId))
|
|
|
- return false;
|
|
|
-
|
|
|
- return parent::isAllowedVote($isPerformAction);
|
|
|
-</codefragment>
|
|
|
- </duplication>
|
|
|
- <duplication lines="23" tokens="78">
|
|
|
- <file path="/var/lib/jenkins/workspace/UNA-Pipe/modules/boonex/events/classes/BxEventsMenuSnippetMeta.php" line="18"/>
|
|
|
- <file path="/var/lib/jenkins/workspace/UNA-Pipe/modules/boonex/jobs/classes/BxJobsMenuSnippetMeta.php" line="18"/>
|
|
|
- <codefragment> parent::__construct($aObject, $oTemplate);
|
|
|
-
|
|
|
- unset($this->_aConnectionToFunctionCheck['sys_profiles_friends']);
|
|
|
- }
|
|
|
-
|
|
|
- protected function _getMenuItemDateStart($aItem)
|
|
|
- {
|
|
|
- $CNF = &$this->_oModule->_oConfig->CNF;
|
|
|
-
|
|
|
- if ($this->_aContentInfo[$CNF['FIELD_DATE_START']])
|
|
|
- return $this->getUnitMetaItemText(bx_time_js($this->_aContentInfo[$CNF['FIELD_DATE_START']], BX_FORMAT_DATE_TIME, true));
|
|
|
- else
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
- protected function _getMenuItemDateEnd($aItem)
|
|
|
- {
|
|
|
- $CNF = &$this->_oModule->_oConfig->CNF;
|
|
|
-
|
|
|
- if ($this->_aContentInfo[$CNF['FIELD_DATE_END']])
|
|
|
- return $this->getUnitMetaItemText(bx_time_js($this->_aContentInfo[$CNF['FIELD_DATE_END']], BX_FORMAT_DATE_TIME, true));
|
|
|
- else
|
|
|
- return false;
|
|
|
-</codefragment>
|
|
|
- </duplication>
|
|
|
- <duplication lines="22" tokens="84">
|
|
|
- <file path="/var/lib/jenkins/workspace/UNA-Pipe/modules/boonex/albums/classes/BxAlbumsFormEntry.php" line="20"/>
|
|
|
- <file path="/var/lib/jenkins/workspace/UNA-Pipe/modules/boonex/stories/classes/BxStoriesFormEntry.php" line="21"/>
|
|
|
- <codefragment> parent::__construct($aInfo, $oTemplate);
|
|
|
-
|
|
|
- $CNF = &$this->_oModule->_oConfig->CNF;
|
|
|
-
|
|
|
- if (isset($CNF['FIELD_PHOTO']) && isset($this->aInputs[$CNF['FIELD_PHOTO']]))
|
|
|
- $this->aInputs[$CNF['FIELD_PHOTO']]['init_reordering'] = true;
|
|
|
- }
|
|
|
-
|
|
|
- public function processFiles ($sFieldFile, $iContentId = 0, $isAssociateWithContent = false)
|
|
|
- {
|
|
|
- return parent::_processFilesInAlbumsAndStories($sFieldFile, $iContentId, $isAssociateWithContent);
|
|
|
- }
|
|
|
-
|
|
|
- protected function _associalFileWithContent($oStorage, $iFileId, $iProfileId, $iContentId, $sPictureField = '')
|
|
|
- {
|
|
|
- parent::_associalFileWithContent($oStorage, $iFileId, $iProfileId, $iContentId, $sPictureField);
|
|
|
-
|
|
|
- $CNF = &$this->_oModule->_oConfig->CNF;
|
|
|
-
|
|
|
- $oTranscoder = BxDolTranscoderImage::getObjectInstance($CNF['OBJECT_IMAGES_TRANSCODER_BIG']);
|
|
|
-
|
|
|
- $aInfo = bx_get_image_exif_and_size($oStorage, $oTranscoder, $iFileId);
|
|
|
-</codefragment>
|
|
|
- </duplication>
|
|
|
- <duplication lines="21" tokens="71">
|
|
|
- <file path="/var/lib/jenkins/workspace/UNA-Pipe/modules/boonex/albums/classes/BxAlbumsModule.php" line="819"/>
|
|
|
- <file path="/var/lib/jenkins/workspace/UNA-Pipe/modules/boonex/stories/classes/BxStoriesModule.php" line="265"/>
|
|
|
- <codefragment> public function getMediaDuration($aMediaInfo)
|
|
|
- {
|
|
|
- $CNF = &$this->_oConfig->CNF;
|
|
|
-
|
|
|
- if(empty($aMediaInfo) || !is_array($aMediaInfo))
|
|
|
- return 0;
|
|
|
-
|
|
|
- $sField = 'duration';
|
|
|
- if(!empty($aMediaInfo[$sField]))
|
|
|
- return (int)$aMediaInfo[$sField];
|
|
|
-
|
|
|
- $iMedia = $aMediaInfo['id'];
|
|
|
- $sMedia = BxDolTranscoderImage::getObjectInstance($CNF['OBJECT_VIDEOS_TRANSCODERS']['mp4'])->getFileUrl($iMedia);
|
|
|
- if(empty($sMedia))
|
|
|
- return 0;
|
|
|
-
|
|
|
- $iDuration = (int)BxDolTranscoderVideo::getDuration($sMedia);
|
|
|
- if(!empty($iDuration))
|
|
|
- $this->_oDb->updateMedia(array($sField => $iDuration), array('id' => $iMedia));
|
|
|
-
|
|
|
- return $iDuration;
|
|
|
-</codefragment>
|
|
|
- </duplication>
|
|
|
- <duplication lines="21" tokens="84">
|
|
|
- <file path="/var/lib/jenkins/workspace/UNA-Pipe/modules/boonex/acl/classes/BxAclFormPrice.php" line="68"/>
|
|
|
- <file path="/var/lib/jenkins/workspace/UNA-Pipe/modules/boonex/donations/classes/BxDonationsFormType.php" line="46"/>
|
|
|
- <codefragment> public function getCode($bDynamicMode = false)
|
|
|
- {
|
|
|
- $sJs = $this->_oModule->_oTemplate->addJs(array('form.js'), $bDynamicMode);
|
|
|
-
|
|
|
- $sCode = '';
|
|
|
- if($bDynamicMode)
|
|
|
- $sCode .= $sJs;
|
|
|
-
|
|
|
- $sCode .= $this->_oModule->_oTemplate->getJsCode('form');
|
|
|
- $sCode .= parent::getCode($bDynamicMode);
|
|
|
-
|
|
|
- return $sCode;
|
|
|
- }
|
|
|
-
|
|
|
- /*
|
|
|
- public function initChecker ($aValues = array (), $aSpecificValues = array())
|
|
|
- {
|
|
|
- $CNF = &$this->_oModule->_oConfig->CNF;
|
|
|
-
|
|
|
- $bValues = $aValues && !empty($aValues[$CNF['FIELD_ID']]);
|
|
|
-
|
|
|
-</codefragment>
|
|
|
- </duplication>
|
|
|
- <duplication lines="21" tokens="79">
|
|
|
- <file path="/var/lib/jenkins/workspace/UNA-Pipe/modules/base/groups/classes/BxBaseModGroupsGridPricesManage.php" line="145"/>
|
|
|
- <file path="/var/lib/jenkins/workspace/UNA-Pipe/modules/base/groups/classes/BxBaseModGroupsGridQuestionsManage.php" line="102"/>
|
|
|
- <codefragment> 'form_id' => $oForm->getId(),
|
|
|
- 'form' => $oForm->getCode(true),
|
|
|
- 'object' => $this->_sObject,
|
|
|
- 'action' => $sAction
|
|
|
- ]));
|
|
|
-
|
|
|
- echoJson(['popup' => ['html' => $sContent, 'options' => ['closeOnOuterClick' => false]]]);
|
|
|
- }
|
|
|
-
|
|
|
- public function performActionEdit()
|
|
|
- {
|
|
|
- $CNF = &$this->_oModule->_oConfig->CNF;
|
|
|
-
|
|
|
- $sAction = 'edit';
|
|
|
-
|
|
|
- if(($mixedResult = $this->_oModule->checkAllowedEdit($this->_aGroupContentInfo)) !== CHECK_ACTION_RESULT_ALLOWED)
|
|
|
- return $this->_bIsApi ? [bx_api_get_msg($mixedResult)] : echoJson(['msg' => $mixedResult]);
|
|
|
-
|
|
|
- $aIds = $this->_getIds();
|
|
|
- if($aIds === false)
|
|
|
- return $this->_bIsApi ? [] : echoJson([]);
|
|
|
-</codefragment>
|
|
|
- </duplication>
|
|
|
- <duplication lines="20" tokens="98">
|
|
|
- <file path="/var/lib/jenkins/workspace/UNA-Pipe/modules/boonex/payment/classes/BxPaymentProviderChargebeeV3.php" line="202"/>
|
|
|
- <file path="/var/lib/jenkins/workspace/UNA-Pipe/modules/boonex/payment/classes/BxPaymentProviderStripeV3.php" line="224"/>
|
|
|
- <codefragment> $sOrderId = bx_process_input($aData['order_id']);
|
|
|
- $sCustomerId = bx_process_input($aData['customer_id']);
|
|
|
- $iPendingId = bx_process_input($aData['pending_id'], BX_DATA_INT);
|
|
|
- if(empty($iPendingId))
|
|
|
- return array('code' => 1, 'message' => $this->_sLangsPrefix . 'err_wrong_data');
|
|
|
-
|
|
|
- $sRedirect = bx_process_input($aData['redirect']);
|
|
|
-
|
|
|
- $aPending = $this->_oModule->_oDb->getOrderPending(array('type' => 'id', 'id' => $iPendingId));
|
|
|
- if(!empty($aPending['order']) || !empty($aPending['error_code']) || !empty($aPending['error_msg']) || (int)$aPending['processed'] != 0)
|
|
|
- return array('code' => 3, 'message' => $this->_sLangsPrefix . 'err_already_processed');
|
|
|
-
|
|
|
- $oCustomer = $this->retrieveCustomer($sCustomerId);
|
|
|
- if($oCustomer === false)
|
|
|
- return array('code' => 4, 'message' => $this->_sLangsPrefix . 'err_cannot_perform');
|
|
|
-
|
|
|
- $sOrder = '';
|
|
|
- $aResult = [
|
|
|
- 'code' => BX_PAYMENT_RESULT_SUCCESS,
|
|
|
- 'message' => '',
|
|
|
-</codefragment>
|
|
|
- </duplication>
|
|
|
- <duplication lines="19" tokens="124">
|
|
|
- <file path="/var/lib/jenkins/workspace/UNA-Pipe/modules/boonex/resources/classes/BxResourcesFormEntry.php" line="39"/>
|
|
|
- <file path="/var/lib/jenkins/workspace/UNA-Pipe/modules/boonex/tasks/classes/BxTasksFormEntry.php" line="57"/>
|
|
|
- <codefragment> public function initChecker ($aValues = array (), $aSpecificValues = array())
|
|
|
- {
|
|
|
- $CNF = &$this->_oModule->_oConfig->CNF;
|
|
|
-
|
|
|
- $bValues = $aValues && !empty($aValues['id']);
|
|
|
-
|
|
|
- $aContentInfo = $bValues ? $this->_oModule->_oDb->getContentInfoById($aValues['id']) : false;
|
|
|
- if(!empty($aContentInfo) && is_array($aContentInfo))
|
|
|
- $this->setContextId(abs($aContentInfo[$CNF['FIELD_ALLOW_VIEW_TO']]));
|
|
|
-
|
|
|
- if($this->aParams['display'] == $CNF['OBJECT_FORM_ENTRY_DISPLAY_EDIT'] && isset($CNF['FIELD_PUBLISHED']) && isset($this->aInputs[$CNF['FIELD_PUBLISHED']]))
|
|
|
- if($bValues && in_array($aValues[$CNF['FIELD_STATUS']], array('active', 'hidden')))
|
|
|
- unset($this->aInputs[$CNF['FIELD_PUBLISHED']]);
|
|
|
-
|
|
|
- if(($sKey = 'FIELD_COVER') && isset($CNF[$sKey], $this->aInputs[$CNF[$sKey]])) {
|
|
|
- if($bValues)
|
|
|
- $this->aInputs[$CNF['FIELD_COVER']]['content_id'] = $aValues['id'];
|
|
|
-
|
|
|
- $this->aInputs[$CNF['FIELD_COVER']]['ghost_template'] = $this->_oModule->_oTemplate->parseHtmlByName($this->_sGhostTemplateCover, $this->_getCoverGhostTmplVars($aContentInfo));
|
|
|
-</codefragment>
|
|
|
- </duplication>
|
|
|
- <duplication lines="18" tokens="76">
|
|
|
- <file path="/var/lib/jenkins/workspace/UNA-Pipe/modules/boonex/persons/classes/BxPersonsSearchResult.php" line="71"/>
|
|
|
- <file path="/var/lib/jenkins/workspace/UNA-Pipe/modules/boonex/workspaces/classes/BxWorkspacesSearchResult.php" line="68"/>
|
|
|
- <codefragment> $this->oModule = $this->getMain();
|
|
|
-
|
|
|
- $CNF = &$this->oModule->_oConfig->CNF;
|
|
|
-
|
|
|
- $sSearchFields = getParam($CNF['PARAM_SEARCHABLE_FIELDS']);
|
|
|
- $this->aCurrent['searchFields'] = !empty($sSearchFields) ? explode(',', $sSearchFields) : '';
|
|
|
-
|
|
|
- $this->_setAccountConfirmationConditions($aParams);
|
|
|
-
|
|
|
- switch ($sMode) {
|
|
|
-
|
|
|
- case 'connections':
|
|
|
- if ($this->_setConnectionsConditions($aParams)) {
|
|
|
- $oProfile = BxDolProfile::getInstance($aParams['profile']);
|
|
|
- $oProfile2 = isset($aParams['profile2']) ? BxDolProfile::getInstance($aParams['profile2']) : null;
|
|
|
-
|
|
|
- if (isset($aParams['type']) && $aParams['type'] == 'common' && $oProfile && $oProfile2)
|
|
|
- $this->aCurrent['title'] = _t('_bx_persons_page_title_browse_connections_mutual', $oProfile->getDisplayName(), $oProfile2->getDisplayName());
|
|
|
-</codefragment>
|
|
|
- </duplication>
|
|
|
-</pmd-cpd>
|