* */ /** * Используется для вывода списка опросов в форме редактирования объекта * * @package application.blocks * @since 2.0 */ class BlockPollFormItems extends Block { /** * Запуск обработки */ public function Exec() { $this->SetTemplate('components/poll/poll.manage.list.tpl'); $sTargetType = $this->GetParam('target_type'); $sTargetId = $this->GetParam('target_id'); $sTargetTmp = $this->Session_GetCookie('poll_target_tmp_' . $sTargetType) ? $this->Session_GetCookie('poll_target_tmp_' . $sTargetType) : $this->GetParam('target_tmp'); $aFilter = array('target_type' => $sTargetType, '#order' => array('id' => 'asc')); if ($sTargetId) { $sTargetTmp = null; if (!$this->Poll_CheckTarget($sTargetType, $sTargetId)) { return false; } $aFilter['target_id'] = $sTargetId; } else { $sTargetId = null; if (!$sTargetTmp or !$this->Poll_IsAllowTargetType($sTargetType)) { return false; } $aFilter['target_tmp'] = $sTargetTmp; } $aPollItems = $this->Poll_GetPollItemsByFilter($aFilter); $this->Viewer_Assign('aPollItems', $aPollItems); } }