Linux cesa-www-main 6.1.0-49-cloud-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.174-1 (2026-05-26) x86_64
Apache/2.4.68 (Debian)
Server IP : 10.218.0.2 & Your IP : 216.73.217.117
Domains :
Cant Read [ /etc/named.conf ]
User : www-data
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
var /
www /
v3.cesa.co.za /
src /
ContentBundle /
Admin /
Delete
Unzip
Name
Size
Permission
Date
Action
.htaccess
237
B
-r-xr-xr-x
2026-08-17 03:12
FormAdmin.php
6.27
KB
-rwxrwxr-x
2026-05-18 12:51
FormCompletedAdmin.php
3.92
KB
-rwxrwxr-x
2026-05-18 12:51
FormItemAdmin.php
9.15
KB
-rwxrwxr-x
2026-05-18 12:51
FormItemListAdmin.php
6.33
KB
-rwxrwxr-x
2026-05-18 12:51
FormItemTypeAdmin.php
3.1
KB
-rwxrwxr-x
2026-05-18 12:51
FormTypeAdmin.php
2.31
KB
-rwxrwxr-x
2026-05-18 12:51
php_errors.log
1.87
KB
-rwxrwxr-x
2026-04-02 12:06
Save
Rename
<?php namespace App\ContentBundle\Admin; use Sonata\AdminBundle\Admin\AbstractAdmin; use Sonata\AdminBundle\Admin\AdminInterface; use Sonata\AdminBundle\Datagrid\ListMapper; use Sonata\AdminBundle\Show\ShowMapper; use Sonata\AdminBundle\Datagrid\DatagridMapper; use Sonata\AdminBundle\Datagrid\ProxyQueryInterface; use Sonata\AdminBundle\Form\FormMapper; use Sonata\AdminBundle\Form\Type\CollectionType; use Sonata\AdminBundle\Route\RouteCollectionInterface; use Symfony\Component\Form\Extension\Core\Type\NumberType; use Symfony\Component\Security\Core\Authentication\Token\Storage\UsageTrackingTokenStorage; use Knp\Menu\ItemInterface; use App\ContentBundle\Entity\Form; use App\ContentBundle\Entity\FormItem; /** * Form Item Admin * * @author Otto Saayman <otto@igotafrica.com> * @package ContentBundle * @subpackage Admin * @version 0.0.1 */ class FormItemAdmin extends AbstractAdmin { /** * Security Context * @var \Symfony\Component\Security\Core\SecurityContextInterface */ protected $securityContext; /** * Entity manager * @var \Doctrine\ORM\EntityManager */ protected $em; /** * Container * @var $container */ protected $container; protected $formObject; protected $formItemObject; protected function generateBaseRouteName(bool $isChildAdmin = false): string { return 'form_item'; } protected function generateBaseRoutePattern(bool $isChildAdmin = false): string { return 'form_item'; } public function setSecurityContext(UsageTrackingTokenStorage $securityContext) { $this->securityContext = $securityContext; } /** * @param \Doctrine\ORM\EntityManager $em */ public function setEntityManager($em) { $this->em = $em; } /** * @return null */ public function setContainer($container) { $this->container = $container; } public function getFormObject() { if (is_object($this->formObject)) { return $this->formObject; } $formRepository = $this->em->getRepository(Form::class); if (strlen($this->getRequest()->get('form_id')) > 0) { $this->formObject = $formRepository->find($this->getRequest()->get('form_id')); } if (!is_object($this->formObject)) { $this->formObject = new Form(); } return $this->formObject; } public function getFormItemObject() { if (is_object($this->formItemObject)) { return $this->formItemObject; } $formRepository = $this->em->getRepository(FormItem::class); if (strlen($this->getRequest()->get('id')) > 0) { $this->formItemObject = $formRepository->find($this->getRequest()->get('id')); } if (!is_object($this->formItemObject)) { $this->formItemObject = new FormItem(); } return $this->formItemObject; } public function configureQuery(ProxyQueryInterface $query): ProxyQueryInterface { $this->getFormObject(); $query = $this->getModelManager()->createQuery($this->getClass(), 'fi'); if (strlen($this->formObject->getId()) > 0) { $query->join('fi.forms', 'ftfi'); $query->join('ftfi.form', 'f'); $query->where('f.id=:formId')->setParameter("formId", $this->formObject->getId()); $query->orderBy('ftfi.order_by'); } else { $query->orderBy('fi.prompt'); } return $query; } protected function configureFormFields(FormMapper $formMapper): void { $formItem = $this->getFormItemObject(); $orderBy = 1; if (is_object($formItem)) { $orderBy = $formItem->getOrderBy($this->getFormObject()); } $formMapper ->add('prompt', null, array('label' => 'Prompt')) ->add('date_col', null, array('label' => 'Session Date')) ->add('time_col', null, array('label' => 'Session Time')) ->add('presenter_name', null, array('label' => 'Presenter Name')) ->add('form_item_type', null, array('label' => 'Item Type')) ->add('description', null, array('label' => 'Description')) ->add('sentence_part', null, array('label' => 'Sentence Part')) ->add('default_value', null, array('label' => 'Default')) ->add('is_required', null, array('label' => 'Required')) ->add('max_value', null, array('label' => 'Maximum Value')) ->add('min_value', null, array('label' => 'Minimum Value')) ->add('is_active', null, array('label' => 'Active')) ->add('additional_comments', null, array('label' => 'Additional Comments')) // ->add('form_item_list', CollectionType::class, array('label' => 'Items for List', 'mapped' => false)) ->add('order_by', NumberType::class, array('label' => 'Order By', 'mapped' => false, 'data' => $orderBy)) ; } protected function configureDatagridFilters(DatagridMapper $datagridMapper): void { $datagridMapper ->add('prompt'); } protected function configureListFields(ListMapper $listMapper): void { $listMapper ->addIdentifier('prompt') ->add('date_col') ->add('time_col') ->add('presenter_name') ->add('form_item_type') ->add('description') ->add('is_required') ->add('is_active') ->add('additional_comments') ->add('_action', 'actions', array( 'actions' => array( 'show' => array(), 'edit' => array(), 'delete' => array(), ) )) ; } protected function configureShowFields(ShowMapper $showMapper): void { $showMapper ->add('prompt', null, array('label' => 'Prompt')) ->add('form_item_type', null, array('label' => 'Item Type')) ->add('description', null, array('label' => 'Description')) ->add('sentence_part', null, array('label' => 'Sentence Part')) ->add('default_value', null, array('label' => 'Default')) ->add('is_required', null, array('label' => 'Required')) ->add('max_value', null, array('label' => 'Maximum Value')) ->add('min_value', null, array('label' => 'Minimum Value')) ->add('is_active', null, array('label' => 'Active')) ->add('form_item_list', null, array('label' => 'Items for List')) ; } public function configurePersistentParameters(): array { if (!$this->getRequest()) { return array(); } return array( 'form_id' => $this->getRequest()->get('form_id', ''), ); } /** * @param App\ContentBundle\Entity\FormItem $formItem */ public function postUpdate($formItem): void { $this->postUpdatePersist($formItem); } /** * @param App\ContentBundle\Entity\Categories $formItem */ public function postPersist($formItem): void { $this->postUpdatePersist($formItem); } /** * @param App\ContentBundle\Entity\Categories $formItem */ public function postUpdatePersist($formItem) { $formItemValues = $this->getRequest()->get($this->getUniqid()); $this->container->get('form_item_form.manager')->linkItemToForm($this->getFormObject(), $formItem, $formItemValues['order_by']); } protected function configureRoutes(RouteCollectionInterface $collection): void { $collection->add('edit_form', 'edit_form', array('_controller' => 'App\ContentBundle\Controller\FormAdminController::editAction', '_sonata_admin' => 'content.admin.form')); $collection->add('form_item_list', 'form_item_list', array('_controller' => 'App\ContentBundle\Controller\FormItemListAdminController::listAction', '_sonata_admin' => 'content.admin.form_item_list')); } protected function configureTabMenu(ItemInterface $menu, string $action, ?AdminInterface $childAdmin = null): void { $admin = $this->isChild() ? $this->getParent() : $this; $form = $this->getFormObject(); $formItem = $this->getFormItemObject(); if (is_object($form)) { $menu->addChild( 'Back to Form', array('uri' => $admin->generateUrl('edit_form', array('id' => $form->getId()))) ); $menu->addChild( 'List Items', array('uri' => $admin->generateUrl('form_item_list', array('form_id' => $form->getId(), 'form_item_id' => $formItem->getId()))) ); } } public function configureBatchActions(array $actions): array { if ($this->hasRoute('edit') && $this->hasAccess('edit') && $this->hasRoute('delete') && $this->hasAccess('delete')) { $actions['duplicate'] = array( 'ask_confirmation' => true, 'label' => 'Duplicate', 'controller' => 'App\ContentBundle\Controller\CRUDController::batchActionDuplicate', ); } return $actions; } }