22 parent::__construct($oConfig,
$oDb);
25 function unit ($aData, $sTemplateName, &$oVotingView, $isShort =
false)
27 if (
null == $this->_oMain)
30 if (!$this->_oMain->isAllowedView ($aData)) {
31 $aVars = array (
'extra_css_class' =>
'ch_groups_unit');
36 if ($aData[
'thumb']) {
37 $a = array (
'ID' => $aData[
'author_id'],
'Avatar' => $aData[
'thumb']);
39 $sImage = $aImage[
'no_image'] ?
'' : $aImage[
'file'];
44 'thumb_url' => $sImage ? $sImage : $this->
getImageUrl(
'no-image-thumb.png'),
45 'group_url' => CH_WSB_URL_ROOT . $this->_oConfig->getBaseUri() .
'view/' . $aData[
'uri'],
46 'group_title' => $aData[
'title'],
48 'fans_count' => $aData[
'fans_count'],
49 'country_city' => $this->_oMain->_formatLocation($aData),
50 'snippet_text' => $this->_oMain->_formatSnippetText($aData),
51 'ch_if:full' => array (
52 'condition' => !$isShort,
55 'author_url' => $aData[
'author_id'] ?
getProfileLink($aData[
'author_id']) :
'javascript:void(0);',
57 'rate' => $oVotingView ? $oVotingView->getJustVotingElement(0, $aData[
'id'], $aData[
'rate']) :
' ',
70 'description' => $aDataEntry[
'desc'],
77 $sRet =
'<table class="ch_groups_fields">';
80 foreach (
$oForm->aInputs
as $k => $a) {
81 if (!isset($a[
'display']) || !$aDataEntry[$k])
continue;
82 $sRet .=
'<tr><td class="ch_groups_field_name ch-def-font-grayed ch-def-padding-sec-right" valign="top">' . $a[
'caption'] .
'</td><td class="ch_groups_field_value">';
83 if (is_string($a[
'display']) && is_callable(array($this, $a[
'display'])))
84 $sRet .= call_user_func_array(array($this, $a[
'display']), array($aDataEntry[$k]));
85 else if (0 === strcasecmp($k,
'country'))
86 $sRet .=
_t(
$GLOBALS[
'aPreValues'][
'Country'][$aDataEntry[$k]][
'LKey']);
88 $sRet .= $aDataEntry[$k];
89 $sRet .=
'</td></tr>';