- Модуль: disk
- Путь к файлу: ~/bitrix/modules/disk/lib/uf/controller.php
- Класс: BitrixDiskUfController
- Вызов: Controller::processActionShowViewHtml
protected function processActionShowViewHtml($pathToView, $mode = '', $print = '', $preview = '', $sizeType = '', $printUrl = '', $autostart = 'Y', $width = null, $height = null)
{
$attachedModel = $this->getAttachedModel();
$file = $attachedModel->getFile();
if(!$file->getView()->getId())
{
$this->end();
}
$printParam = $iframe = 'N';
if($mode === 'iframe')
{
$iframe = 'Y';
if($print === 'Y')
{
$printParam = 'Y';
}
}
$elementId = 'bx_ajaxelement_' . $file->getId() . '_' . randString(4);
$version = $attachedModel->getVersion();
if($version)
{
$view = $version->getView();
}
else
{
$view = $file->getView();
}
$html = $view->render(array(
'PATH' => $pathToView,
'IFRAME' => $iframe,
'ID' => $elementId,
'PRINT' => $printParam,
'PREVIEW' => $preview,
'SIZE_TYPE' => $sizeType,
'PRINT_URL' => $printUrl,
'AUTOSTART' => ($autostart !== 'Y' ? 'N' : 'Y'),
'WIDTH' => $width,
'HEIGHT' => $height,
));
if($iframe == 'Y')
{
echo $html;
}
else
{
$result = array('html' => $html, 'innerElementId' => $elementId);
$result = array_merge($result, $view->getJsViewerAdditionalJsonParams());
$this->sendJsonResponse($result);
}
$this->end();
}