Exemplo n.º 1
0
 public function handleSave(Form $form)
 {
     if ($form['recursively']->value) {
         $form->data->setPermissionRecursively();
     }
     parent::handleSave($form);
 }
Exemplo n.º 2
0
 public function handleSave(Form $form)
 {
     if ($form['user']['password_new']->value) {
         $form->data->user->setPassword($form['user']['password']->value);
     }
     parent::handleSave($form);
 }
Exemplo n.º 3
0
 public function handleSave(Form $form)
 {
     $bank = $form['bank']->value;
     if ($bank && isset($form['drivers'][$bank->code])) {
         $form->data->options = $form['drivers'][$bank->code]->values;
     }
     parent::handleSave($form);
 }
Exemplo n.º 4
0
 public function handleSave(Form $form)
 {
     if ($this->user->isLoggedIn()) {
         $form->data->route->author = $this->user->identity;
     } else {
         $form->data->author = $form['author']->getValue();
     }
     parent::handleSave($form);
 }
Exemplo n.º 5
0
 public function handleSave(Form $form)
 {
     /** @var $entity CategoryEntity */
     $entity = $form->data;
     $data = $form->getValues();
     $sort = json_decode($data['sort'], TRUE);
     foreach ($entity->getItems() as $photo) {
         if (($pos = array_search($photo->id, $sort)) !== false) {
             $photo->position = $pos;
         }
     }
     parent::handleSave($form);
 }
Exemplo n.º 6
0
 public function handleSave(Form $form)
 {
     /** @var $entity CategoryEntity */
     $entity = $form->data;
     $data = $form->getValues();
     foreach ($data['_photos'] as $fileEntity) {
         if ($fileEntity) {
             $entity->items[] = $photoEntity = new ItemEntity($form->data->extendedPage);
             $photoEntity->route->setPhoto($fileEntity);
             $photoEntity->route->setParent($entity->route);
             $photoEntity->setCategory($entity);
         }
     }
     parent::handleSave($form);
 }
Exemplo n.º 7
0
 public function handleSave(Form $form)
 {
     /** @var TagEntity $entity */
     $entity = $form->data;
     $a = $entity->getLocale();
     foreach ($this->getLanguageRepository()->findBy(array(), array('id' => 'ASC'), NULL, 1) as $language) {
         $entity->setLocale($language);
         if ($form['lang_' . $language->id]->value) {
             $entity->name = $form['languages'][$language->id]['name']->value;
             $entity->route->notation = $form['languages'][$language->id]['notation']->value;
         } else {
             $entity->name = NULL;
             $entity->route->notation = NULL;
         }
     }
     $entity->setLocale($a);
     $entity->name = $form['name']->value;
     $entity->route->notation = $form['notation']->value;
     parent::handleSave($form);
 }
Exemplo n.º 8
0
 public function handleSave(Form $form)
 {
     $form->data->removeResetKey();
     parent::handleSave($form);
 }
Exemplo n.º 9
0
 public function handleSave(Form $form)
 {
     if (!$form['gps']->value) {
         $form->data->latitude = NULL;
         $form->data->longitude = NULL;
     }
     parent::handleSave($form);
 }
Exemplo n.º 10
0
 public function handleSave(Form $form)
 {
     $form->data->page->published = $form->data->page->mainRoute->published;
     parent::handleSave($form);
 }
Exemplo n.º 11
0
 public function handleSave(Form $form)
 {
     if ($form->data->page->{$this->getSecuredColumnName()}) {
         /** @var ExtendedPageEntity $entity */
         $entity = $form->data;
         $entity->getPage()->getPermissions()->clear();
         $form->mapper->entityManager->flush($entity);
         if (isset($form->values['permissions'])) {
             foreach ($form->values['permissions'] as $key => $permission) {
                 $class = $this->getPermissionEntityName();
                 $permissionEntity = new $class();
                 $permissionEntity->setName($key);
                 $permissionEntity->setPage($entity->getPage());
                 $permissionEntity->setAll($permission['all']);
                 foreach ($permission['permissions'] as $id) {
                     $permissionEntity->roles[$id] = $this->getRoleRepository()->find($id);
                 }
                 $entity->getPage()->{$this->getPermissionColumnName()}[$key] = $permissionEntity;
             }
         }
     }
     parent::handleSave($form);
 }