update
This commit is contained in:
67
inc/Hura8/Components/Banner/Controller/bBannerController.php
Normal file
67
inc/Hura8/Components/Banner/Controller/bBannerController.php
Normal file
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
|
||||
namespace Hura8\Components\Banner\Controller;
|
||||
|
||||
use Hura8\Components\Banner\Model\BannerLocationModel;
|
||||
use Hura8\Components\Banner\Model\BannerModel;
|
||||
use Hura8\System\Controller\aEntityBaseController;
|
||||
|
||||
class bBannerController extends aEntityBaseController
|
||||
{
|
||||
|
||||
static $image_folder = "media/banner";
|
||||
|
||||
static $template_banners = array(
|
||||
//"index" => "Toàn bộ website" ,
|
||||
"header" => "Đầu trang" ,
|
||||
"homepage" => "Trang chủ" ,
|
||||
"column_left" => "Cột trái" ,
|
||||
"column_right" => "Cột phải" ,
|
||||
"footer" => "Chân trang" ,
|
||||
"product_detail"=> "Chi tiết sản phẩm" ,
|
||||
"product_list" => "Danh sách & Danh mục sản phẩm" ,
|
||||
"collection_list" => "Bộ sưu tập" ,
|
||||
"article_home" => "Trang chủ tin tức" ,
|
||||
"brand_detail" => "Chi tiết thương hiệu",
|
||||
);
|
||||
|
||||
|
||||
protected $objBannerModel;
|
||||
protected $objBannerLocationModel;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->objBannerModel = new BannerModel();
|
||||
$this->objBannerLocationModel = new BannerLocationModel();
|
||||
|
||||
parent::__construct($this->objBannerModel);
|
||||
}
|
||||
|
||||
|
||||
protected function formatItemInList(array $item_info)
|
||||
{
|
||||
return self::formatFile($item_info);
|
||||
}
|
||||
|
||||
protected function formatItemInfo(array $item_info)
|
||||
{
|
||||
return self::formatFile($item_info);
|
||||
}
|
||||
|
||||
|
||||
public static function formatFile(array $item_info)
|
||||
{
|
||||
|
||||
if($item_info['file_url']) {
|
||||
$item_info['display_file'] = STATIC_DOMAIN ."/". static::$image_folder ."/". $item_info['file_url'];
|
||||
}else if($item_info['file_external_url']) {
|
||||
$item_info['display_file'] = $item_info['file_external_url'];
|
||||
}
|
||||
|
||||
$item_info['html_code'] = "<a href=\"/ad.php?id=".$item_info['tracking_id']."\" target='_blank' rel='nofollow'><img border='0' src=\"".$item_info['display_file']."\" alt=\"".htmlspecialchars($item_info['title'])."\" /></a>";
|
||||
|
||||
return $item_info;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user