Файл: concrete5.7.5.6/concrete/src/View/DialogView.php
Строк: 72
<?php
namespace ConcreteCoreView;
use ConcreteCoreAssetAsset;
use View as ConcreteView;
use ConcreteCoreAssetCssAsset;
use ConcreteCoreAssetJavascriptAsset;
use ConcreteCoreAssetJavascriptInlineAsset;
use User;
class DialogView extends ConcreteView {
protected function onBeforeGetContents() {
$this->markHeaderAssetPosition();
}
public function outputAssetIntoView($item) {
$str = '';
if ($item instanceof CssAsset) {
$str .= '<script type="text/javascript">';
$str .= 'ccm_addHeaderItem("' . $item->getAssetURL() . '", "CSS")';
$str .= '</script>';
} else if ($item instanceof JavascriptInlineAsset) {
$str .= '<script type="text/javascript">';
$str .= $item->getAssetURL();
$str .= '</script>';
} else if ($item instanceof JavascriptAsset) {
$str .= '<script type="text/javascript">';
$str .= 'ccm_addHeaderItem("' . $item->getAssetURL() . '", "JAVASCRIPT")';
$str .= '</script>';
} else {
$str = $item;
}
print $str . "n";
}
public function getScopeItems() {
$items = parent::getScopeItems();
$u = new User();
$items['u'] = $u;
return $items;
}
protected function getAssetsToOutput()
{
$ouput = parent::getAssetsToOutput();
$return = array();
foreach($ouput as $position => $assets) {
foreach($assets as $asset) {
if ($asset instanceof Asset) {
$asset->setAssetPosition(Asset::ASSET_POSITION_HEADER);
$asset->setAssetSupportsMinification(false);
$asset->setAssetSupportsCombination(false);
}
$return[$position][] = $asset;
}
}
return $return;
}
/*
protected function onAfterGetContents() {
// now that we have the contents of the tool,
// we make sure any require assets get moved into the header
// since that's the only place they work in the AJAX output.
$r = Request::getInstance();
$assets = $r->getRequiredAssetsToOutput();
foreach($assets as $asset) {
$asset->setAssetPosition(Asset::ASSET_POSITION_HEADER);
$asset->setAssetSupportsMinification(false);
$asset->setAssetSupportsCombination(false);
$this->addOutputAsset($asset);
}
}
*/
}