19 parent::__construct($oConfig,
$oDb);
23 function pageCode ($aPage = array(), $aPageCont = array(), $aCss = array(), $aJs = array(), $bAdminMode =
false, $isSubActions =
true)
26 foreach ($aPage
as $sKey => $sValue)
29 if (!
empty($aPageCont)) {
30 foreach ($aPageCont
as $sKey => $sValue)
31 $GLOBALS[
'_page_cont'][$aPage[
'name_index']][$sKey] = $sValue;
39 $aVars = array (
'BaseUri' => CH_WSB_URL_ROOT . $this->_oConfig->getBaseUri());
40 $GLOBALS[
'oTopMenu']->setCustomSubActions(
$aVars, $this->_oConfig->getMainPrefix() .
'_title',
false);
67 'caption' =>
_t(
'_Date'),
73 $aForm[
'category'] = array(
76 'caption' =>
_t(
'_Category'),
83 'caption' =>
_t(
'_Tags'),
96 $sUrlPref = CH_WSB_URL_ROOT . $this->_oConfig->getBaseUri();
98 'form_attrs' => array(
'id' => $this->_oConfig->getMainPrefix() .
'_upload_form'),
99 'params'=> array(
'remove_form'=>
true),
103 return array(
$oForm->getCode(), array(), array(),
false);
108 $iFile = (int)$iFile;
109 $sCode =
'<center>' .
_t(
'_rating not enabled') .
'</center>';
111 if ($oVotingView->isEnabled())
112 $sCode = $oVotingView->getBigVoting ();
118 $aIdent = array(
'fileId' => (
int)$iFile);
119 return $this->_oDb->getFileInfo($aIdent,
true, array(
'medID',
'Type'));
124 if (!is_array($aCode))
129 <div
class=
"searchContentBlock">
135 foreach ($aCode
as $sKey => $sValue)
136 $sCode = str_replace(
'__' . $sKey .
'__', $sValue,
$sCode);
137 if (strlen($sWrapperId) > 0)
138 $sCode =
'<div id="' . $sWrapperId .
'">' .
$sCode .
'</div>';
145 $iNumber = (int)$iNumber;
148 $sLinkPref = $this->_oConfig->getBaseUri() .
'albums/my/';
149 $sLinkAdd = $sLinkPref .
'add_objects/' . $sAlbumUri .
'/owner/' . $sNickName;
150 $sLinkBrowse = $sLinkPref .
'manage_objects/' . $sAlbumUri .
'/owner/' . $sNickName;
151 $sLangPref =
'_' . $this->_oConfig->getMainPrefix();
153 'fileStatCount' =>
_t($sLangPref .
'_count_info', $iNumber, $sLinkBrowse),
154 'fileStatAdd' =>
_t($sLangPref .
'_add_info', $sLinkAdd),
162 $iNumber = (int)$iNumber;
163 $sLinkPref = $this->_oConfig->getBaseUri() .
'albums/my/';
164 $sLinkAdd = $sLinkPref .
'add/';
165 $sLinkBrowse = $sLinkPref .
'manage/';
166 $sLangPref =
'_' . $this->_oConfig->getMainPrefix() .
'_albums_';
168 'fileStatCount' =>
_t($sLangPref .
'count_info', $iNumber, $sLinkBrowse),
169 'fileStatAdd' =>
_t($sLangPref .
'add_info', $sLinkAdd),
177 require_once(CH_DIRECTORY_PATH_INC .
'shared_sites.inc.php');
180 foreach ($aSites
as $sName => $aValue) {
183 'url' => $aValue[
'url'],
187 return $this->
parseHtmlByName(
'popup_share.html', array(
'ch_repeat:sites' => $aUnits));
193 'form_attrs' => array(
194 'id' =>
'searchForm',
197 'enctype' =>
'multipart/form-data',
204 'caption' =>
_t(
'_Keyword')
206 'ownerName' => array(
209 'caption' =>
_t(
'_Member'),
210 'attrs' => array(
'id'=>
'ownerName')
215 'caption' =>
_t(
'_With status'),
217 'any'=>
_t(
'_' . $this->_oConfig->getMainPrefix() .
'_any'),
218 'approved' =>
_t(
'_' . $this->_oConfig->getMainPrefix() .
'_approved'),
219 'disapproved'=>
_t(
'_' . $this->_oConfig->getMainPrefix() .
'_disapproved'),
220 'pending'=>
_t(
'_' . $this->_oConfig->getMainPrefix() .
'_pending')
226 'value' =>
_t(
'_Search')
230 if (!
empty($aRedInputs) && is_array($aRedInputs))
231 $aForm[
'inputs'] = array_merge(
$aForm[
'inputs'], $aRedInputs);
232 if (!
empty($aRedForm) && is_array($aRedForm))
233 $aForm[
'form_attrs'] = array_merge(
$aForm[
'form_attrs'], $aRedForm);
241 'site_admin_url' => CH_WSB_URL_ADMIN,
242 'site_plugins' => CH_WSB_URL_PLUGINS,
243 'users_processing' => CH_WSB_URL_ROOT . $this->_oConfig->getBaseUri() .
'administration/',
252 $aUnits[
'time'] = (int)$iTime * 1000;
253 if ($aUnits[
'time'] <= 0)
254 $aUnits[
'time'] = 1000;
257 <script language=
"javascript" type=
"text/javascript">
258 setTimeout(
function() {
259 window.location =
'__url__';
269 $iAllWidth = $iWishWidth > 0 ? $iWishWidth : (int)
getParam(
'main_div_width');
270 $iDestWidth =
getBlockWidth($iAllWidth, $iUnitWidth, $iUnitCount);
273 'ch_if:dest_width' => array(
274 'condition' => $iDestWidth > 0,
275 'content' => array(
'width' => $iDestWidth)
285 $aValue[
'link'] = $sUrlPrefix . $aValue[
'link'];
287 'ch_if:active' => array(
288 'condition' => $aValue[
'active'] ==
true,
291 'ch_if:not_active' => array(
292 'condition' => $aValue[
'active'] ==
false,
297 $aUnit[
'ch_repeat:menu'] = $aUnits;
306 'href' => $aItem[
'href'],
308 'selected' => $aItem[
'active'] ==
true ?
'selected' :
''
313 'ch_repeat:options' => $aUnits,
314 'head_key' =>
_t($sHeadKey),
315 'block_id' => $iBoxId
326 <title>__title__</title>
327 <media:description>__title__</media:description>
328 <link>__link__</link>
329 <media:thumbnail url=
"__thumb__"/>
330 <media:content <?=$sItemType?> url=
"__main__"/>
333 $sTempl = ob_get_clean();
335 if (is_array($aUnits) && !
empty($aUnits)) {
336 foreach ($aUnits
as $aData) {
337 $aData[
'link'] = CH_WSB_URL_ROOT . $this->_oConfig->getBaseUri() .
'view/' . $aData[
'uri'];
338 if (!isset($aData[
'main']))
339 $aData[
'main'] = $aData[
'file'];
356 <rss
version=
"2.0" xmlns:media=
"http://search.yahoo.com/mrss/" xmlns:atom=
"http://www.w3.org/2005/Atom">
364 return '<?xml version="1.0" encoding="utf-8" standalone="yes"?>' .
$sCode;
370 'form_attrs' => array(
'id' => $this->_oConfig->getMainPrefix() .
'_album_view_form'),
371 'params'=> array(
'remove_form' =>
true),
376 'caption' =>
_t(
'_Location'),
378 'description' => array(
381 'caption' =>
_t(
'_Description'),
386 'caption' =>
_t(
'_Date'),
390 $aForm[
'inputs'] = array_filter(
$aForm[
'inputs'],
function($aInput) {
391 return !!$aInput[
'value'];
394 return array(
$oForm->getCode(), array(), array(),
false);
404 'form_attrs' => array(
405 'id' => $this->_oConfig->getMainPrefix() .
'_upload_form',
407 'action' => $this->_oConfig->getBaseUri() .
'albums/my/add'
411 'submit_name' =>
'submit',
413 'checker_helper' =>
'ChSupportCheckerHelper',
417 'type' =>
'block_header',
418 'caption' =>
_t(
'_Info'),
423 'caption' =>
_t(
'_Title'),
427 'params' => array(3, 128),
428 'error' =>
_t(
'_td_err_incorrect_length'),
433 'name' =>
'location',
434 'caption' =>
_t(
'_Location'),
436 'description' => array(
437 'type' =>
'textarea',
438 'name' =>
'description',
439 'caption' =>
_t(
'_Description'),
441 'allow_view' => array(),
445 'value' => $this->_oDb->iViewer,
450 'value' =>
_t(
'_Submit'),
454 if (is_array($aReInputs) && !
empty($aReInputs))
455 $aForm[
'inputs'] = array_merge(
$aForm[
'inputs'], $aReInputs);
456 if (is_array($aReForm) && !
empty($aReForm))
457 $aForm[
'form_attrs'] = array_merge(
$aForm[
'form_attrs'], $aReForm);
464 if (is_array($aReInputs) && !
empty($aReInputs)) {
465 foreach ($aReInputs
as $sKey => $aValue) {
466 if (array_key_exists($sKey,
$aForm[
'inputs']))
467 $aForm[
'inputs'][$sKey] = array_merge(
$aForm[
'inputs'][$sKey], $aValue);
469 $aForm[
'inputs'][$sKey] = $aValue;
478 $sBaseUrl = CH_WSB_URL_ROOT . $this->_oConfig->getBaseUri();
482 $sConten =
"var oChWsbFiles = new ChWsbFiles({sBaseUrl: '" . $sBaseUrl .
"'});";