getType() == AdspiritBannerModel::TYPE_SCRIPT) {
if ($model->isResponsive()) {
/**
*
*/
$bannerCode = "
{$this->getHeadingCode($model)}
";
} else {
$bannerCode = "
{$this->getHeadingCode($model)}
";
}
} else if ($model->getType() == AdspiritBannerModel::TYPE_IFRAME) {
if ($model->isResponsive()) {
throw new Exception('Responsive is not allowed with type iframe');
} else {
$bannerCode =
"
{$this->getHeadingCode($model)}
";
}
} else if ($model->getType() == AdspiritBannerModel::TYPE_ASYNC) {
if ($model->isResponsive()) {
/**
*
*
*
*
*/
$bannerCode =
"
{$this->getHeadingCode($model)}
";
/* $bannerCode = '
';*/
} else {
$bannerCode =
"
{$this->getHeadingCode($model)}
";
}
self::$asyncJsScript = "";
} else {
throw new Exception('type not found');
}
return $bannerCode;
}
private function getTextAlignCode(AdspiritBannerModel $model)
{
$alignment = $model->getAlignment();
if ($alignment != AdspiritBannerModel::ALIGNMENT_NONE) {
if ($alignment == AdspiritBannerModel::ALIGNMENT_LEFT) {
$align = "left";
} else if ($alignment == AdspiritBannerModel::ALIGNMENT_RIGHT) {
$align = "right";
} else if ($alignment == AdspiritBannerModel::ALIGNMENT_CENTER) {
$align = "center";
} else {
throw new Exception('alignment not found');
}
return "text-align: $align ;";
}
}
private function getHeadingCode(AdspiritBannerModel $model)
{
$heading = $model->getHeading();
if ($heading) {
return "$heading
";
}
return '';
}
}