| @@ 7-37 (lines=31) @@ | ||
| 4 | ||
| 5 | use Modules\Entitizer, Template; |
|
| 6 | ||
| 7 | class Menuitem extends Entitizer\Utils\Handler { |
|
| 8 | ||
| 9 | use Entitizer\Common\Menuitem; |
|
| 10 | ||
| 11 | # Handler configuration |
|
| 12 | ||
| 13 | protected static $controller = 'Modules\Entitizer\Controller\Menuitem'; |
|
| 14 | ||
| 15 | protected static $link = '/admin/content/menuitems'; |
|
| 16 | ||
| 17 | protected static $naming = 'text', $naming_new = ''; |
|
| 18 | ||
| 19 | protected static $form_class = 'Modules\Entitizer\Form\Menuitem'; |
|
| 20 | ||
| 21 | protected static $message_success_save = 'MENUITEM_SUCCESS_SAVE'; |
|
| 22 | ||
| 23 | protected static $message_error_remove = 'MENUITEM_ERROR_REMOVE'; |
|
| 24 | ||
| 25 | protected static $view = 'Blocks\Entitizer\Menuitems\Main'; |
|
| 26 | ||
| 27 | # Add additional data for specific entity |
|
| 28 | ||
| 29 | protected function processEntity(Template\Asset\Block $contents) { |
|
| 30 | ||
| 31 | if ((0 === $this->parent->id) || ('' === $this->parent->link)) { |
|
| 32 | ||
| 33 | $contents->block('parent')->block('browse')->disable(); |
|
| 34 | ||
| 35 | } else $contents->block('parent')->block('browse')->link = $this->parent->link; |
|
| 36 | } |
|
| 37 | } |
|
| 38 | } |
|
| 39 | ||
| @@ 7-37 (lines=31) @@ | ||
| 4 | ||
| 5 | use Modules\Entitizer, Template; |
|
| 6 | ||
| 7 | class Page extends Entitizer\Utils\Handler { |
|
| 8 | ||
| 9 | use Entitizer\Common\Page; |
|
| 10 | ||
| 11 | # Handler configuration |
|
| 12 | ||
| 13 | protected static $controller = 'Modules\Entitizer\Controller\Page'; |
|
| 14 | ||
| 15 | protected static $link = '/admin/content/pages'; |
|
| 16 | ||
| 17 | protected static $naming = 'title', $naming_new = ''; |
|
| 18 | ||
| 19 | protected static $form_class = 'Modules\Entitizer\Form\Page'; |
|
| 20 | ||
| 21 | protected static $message_success_save = 'PAGE_SUCCESS_SAVE'; |
|
| 22 | ||
| 23 | protected static $message_error_remove = 'PAGE_ERROR_REMOVE'; |
|
| 24 | ||
| 25 | protected static $view = 'Blocks\Entitizer\Pages\Main'; |
|
| 26 | ||
| 27 | # Add additional data for specific entity |
|
| 28 | ||
| 29 | protected function processEntity(Template\Asset\Block $contents) { |
|
| 30 | ||
| 31 | if ((0 === $this->parent->id) || !$this->parent->visibility) { |
|
| 32 | ||
| 33 | $contents->block('parent')->block('browse')->disable(); |
|
| 34 | ||
| 35 | } else $contents->block('parent')->block('browse')->link = $this->parent->link; |
|
| 36 | } |
|
| 37 | } |
|
| 38 | } |
|
| 39 | ||