allow intl for image object
This commit is contained in:
@@ -98,9 +98,8 @@ class CouponController extends BaseAdminController
|
||||
{
|
||||
$this->checkAuth(AdminResources::COUPON, array(), AccessManager::VIEW);
|
||||
|
||||
// Database request repeated in the loop but cached
|
||||
$search = CouponQuery::create();
|
||||
$coupon = $search->findOneById($couponId);
|
||||
|
||||
$coupon = CouponQuery::create()->findPk($couponId);
|
||||
|
||||
if ($coupon === null) {
|
||||
return $this->pageNotFound();
|
||||
|
||||
@@ -823,6 +823,7 @@ class FileController extends BaseAdminController
|
||||
protected function createImageEventInstance($parentType, $model, $data)
|
||||
{
|
||||
$imageCreateEvent = new ImageCreateOrUpdateEvent($parentType, null);
|
||||
$model->setLocale($data['locale']);
|
||||
|
||||
if (isset($data['title'])) {
|
||||
$model->setTitle($data['title']);
|
||||
@@ -840,6 +841,8 @@ class FileController extends BaseAdminController
|
||||
$model->setPostscriptum($data['postscriptum']);
|
||||
}
|
||||
|
||||
|
||||
|
||||
$imageCreateEvent->setModelImage($model);
|
||||
|
||||
return $imageCreateEvent;
|
||||
|
||||
@@ -57,6 +57,8 @@ class ImageCreateOrUpdateEvent extends ActionEvent
|
||||
/** @var string Parent name */
|
||||
protected $parentName = null;
|
||||
|
||||
protected $locale;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
@@ -70,6 +72,26 @@ class ImageCreateOrUpdateEvent extends ActionEvent
|
||||
$this->parentId = $parentId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $locale
|
||||
*/
|
||||
public function setLocale($locale)
|
||||
{
|
||||
$this->locale = $locale;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function getLocale()
|
||||
{
|
||||
return $this->locale;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Set Image to save
|
||||
*
|
||||
|
||||
@@ -130,6 +130,12 @@ abstract class ImageModification extends BaseForm
|
||||
)
|
||||
)
|
||||
)
|
||||
->add("locale", "text", array(
|
||||
"constraints" => array(
|
||||
new NotBlank()
|
||||
),
|
||||
"label_attr" => array("for" => "locale_create")
|
||||
))
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user