Files
grzanieplus.pl/plugins/sfAssetsLibraryPlugin/modules/stAssetImageConfiguration/actions/components.class.php
2025-03-12 17:06:23 +01:00

66 lines
2.2 KiB
PHP

<?php
class stAssetImageConfigurationComponents extends sfComponents
{
public function executeImageCropper()
{
if (!isset($this->asset) && !isset($this->trigger))
{
return sfView::NONE;
}
$image_types = sfAssetsLibraryTools::getCropImageTypes($this->for);
if (!$image_types)
{
return sfView::NONE;
}
if (!isset($this->namespace))
{
$this->namespace = uniqid();
}
$this->id = 'crop_overlay_'.$this->namespace;
$this->image_types = $image_types;
}
public function executeListMenu()
{
$i18n = $this->getContext()->getI18n();
$this->items = array();
$this->items["stAssetImageConfiguration/watermark"] = $i18n->__("Znak wodny", null, 'stAssetImageConfiguration');
$this->items["stAssetImageConfiguration/product"] = $i18n->__('Produkty', null, 'stAssetImageConfiguration');
$this->items["stAssetImageConfiguration/category"] = $i18n->__('Kategorie', null, 'stAssetImageConfiguration');
$this->items["stAssetImageConfiguration/producer"] = $i18n->__('Producenci', null, 'stAssetImageConfiguration');
$this->items["stAssetImageConfiguration/slide"] = $i18n->__('Banery', null, 'stAssetImageConfiguration');
$this->items["stAssetImageConfiguration/blog"] = $i18n->__('Blog', null, 'stAssetImageConfiguration');
$this->items["stAssetImageConfiguration/general"] = $i18n->__('Konfiguracja', null, 'stAssetImageConfiguration');
if (!$this->items)
{
return sfView::NONE;
}
$this->processMenuItems();
$this->selected_item_path = $this->getUser()->getAttribute('selected', false, 'soteshop/component/menu');
}
protected function processMenuItems()
{
$internal_uri = sfRouting::getInstance()->getCurrentInternalUri();
$controller = $this->getController();
$url = $controller->genUrl($internal_uri);
foreach ($this->items as $route => $name)
{
if ($url == $controller->genUrl($route))
{
$this->getUser()->setAttribute('selected', $url, 'soteshop/component/menu');
}
}
}
}