Creates a form to create a RemoteApp entity.

@param RemoteApp $oRemoteApp The entity

@return \Symfony\Component\Form\Form The form
975793
private function createCreateForm(RemoteApp $oRemoteApp)
        {

            $form = $this->createForm(new RemoteAppType(), $oRemoteApp, array(
                'action' => $this->generateUrl('remote_app_create'),
                'method' => 'POST',
            ));

            $form->add('submit', 'submit', array('label' => 'Create'));

            return $form;
        }
320349
private function _makeCall($oRemoteApp)
        {

            // get class
            $this->getContainer()->get('API');
            // do call
            Api::$_container = $this->getContainer();
            $aReturn = Api::call('getData', array(
                array(
                    'log'    => $oRemoteApp->getIncludelog(),
                    'format' => 'json'
                )
            ), $oRemoteApp->getFullApiUrl(), $oRemoteApp->getPublicKey(), $oRemoteApp);

            // build json response
            $sStatuscode = $aReturn['statuscode'];
            $aReturn     = json_decode($aReturn['result'], true);
            if (!isset($aReturn['status'])) {
                $aReturn['status'] = true;
            }
            $aReturn['statuscode'] = $sStatuscode;

            if($sStatuscode != 200) {
                $this->getContainer()->get('logger')->error("ERROR in ".__FILE__." on line ".__LINE__." - ".json_encode($aReturn), array("Method"    => __METHOD__,
                                                                     "RemoteApp" => $oRemoteApp->getName(),
                                                                     "RemoteURL" => $oRemoteApp->getFullApiUrl()
                ));
            }

            return $aReturn;
        }
386603
public function createAction()
    {
        // Load form
        $entityClass = $this->getModuleNamespace() . '\Entity\\' . $this->getEntityName();
        $entity      = new $entityClass();
        $form        = $this->getForm('Create' . $this->getEntityName());
        $form->bind($entity);

        // Implement Post/Redirect/Get pattern
        $prg = $this->prg();
        if ($prg instanceof Response) {
            return $prg;
        } else if (false !== $prg) {

            // Set form data
            $form->setData($prg);

            // Create account
            $result = $this->getService()->create();
            if ($result) {
                return $this->redirect()->toRoute($this->indexRoute);
            }
        }

        // Set up view model
        $viewModel = new ViewModel(array(
            'entityName' => $this->getEntityName(),
            'form'       => $form,
        ));
        $viewModel->setTemplate('infinity-base/crud/create');

        return $viewModel;
    }
757367
protected function createRemoteManager(InputInterface $input, OutputInterface $output)
    {
        list($user, $host) = $this->getUserAndHost($input);

        return new RemoteManager(
            $this->getProjectPathRemote($input, $host),
            new SSHClient(
                $user,
                $host,
                $input->getOption('key'),
                $input->getOption('password') ? (new SymfonyStyle($input, $output))->askHidden('Please enter password') : null,
                $input->getOption('port')
            )
        );
    }
848432
public function createAnonymousClient($applicationId, $applicationSecret)
    {
        return $this->createCommand()
            ->setRequest($this->client->post('client'))
            ->setBodyEntity(array(
                'application_id' => $applicationId,
                'application_secret' => $applicationSecret,
            ), 'urlencoded')
            ->setResponseClass('Maba\OAuthCommerceClient\Entity\SignatureCredentials')
        ;
    }
270477
public function prune($remoteApp = null)
    {
        if ($remoteApp) {
            $this->addUsingAlias(RemoteAppPeer::ID, $remoteApp->getId(), Criteria::NOT_EQUAL);
        }

        return $this;
    }
1340221
public function createEntityManager(Application $app)
    {
        $ems = new Pimple;

        foreach ($app['ems.options'] as $name => $options) {
            $ems[$name] = $ems->share(
                function () use ($app, $name, $options) {
                    if (false === isset($options['db'])) {
                        $options['db'] = $name;
                    }

                    if (isset($app['dbs'][$options['db']])) {
                        $em = EntityManager::create(
                            $app['dbs'][$options['db']],
                            $app['ems.config'][$name],
                            $app['dbs.event_manager'][$options['db']]
                        );
                    } else {
                        $em = EntityManager::create(
                            $app['db'],
                            $app['ems.config'][$name],
                            $app['db.event_manager']
                        );
                    }

                    if ($options['flush_on_terminate']) {
                        $app['dispatcher']->addListener(
                            SilexEvents::FINISH,
                            function () use ($em) {
                                $em->flush();
                                // @codeCoverageIgnoreStart
                            }
                            // @codeCoverageIgnoreEnd
                        );
                    }

                    return $em;
                }
            );
        }

        return $ems;
    }
450961
public function createApp($hub, $title, $maxUsers = null, $noAutoKickUser = null)
    {
        $params['hub'] = $hub;
        $params['title'] = $title;
        if (!empty($maxUsers)) {
            $params['maxUsers'] = $maxUsers;
        }
        if (!empty($noAutoKickUser)) {
            $params['noAutoKickUser'] = $noAutoKickUser;
        }
        $body = json_encode($params);
        $ret = $this->post($this->baseURL, $body);
        return $ret;
    }
997228
private function createPaymentForm(OrderPaymentInterface $payment, $action, $cancelPath)
    {
        $form = $this->createForm('ekyna_order_order_payment', $payment, [
            'action' => $action,
            'method' => 'POST',
            'attr' => [
                'class' => 'form-horizontal form-with-tabs',
            ],
            'admin_mode' => true,
        ]);
        $form->add('actions', 'form_actions', [
            'buttons' => [
                'save' => [
                    'type' => 'submit', 'options' => [
                        'button_class' => 'primary',
                        'label' => 'ekyna_core.button.save',
                        'attr' => [
                            'icon' => 'ok',
                        ],
                    ],
                ],
                'cancel' => [
                    'type' => 'button', 'options' => [
                        'label' => 'ekyna_core.button.cancel',
                        'button_class' => 'default',
                        'as_link' => true,
                        'attr' => [
                            'class' => 'form-cancel-btn',
                            'icon' => 'remove',
                            'href' => $cancelPath,
                        ],
                    ],
                ],
            ],
        ]);

        return $form;
    }
498607
private function createCreateForm(Episode $entity)
    {
        $form = $this->createForm(EpisodeType::class, $entity, array(
            'action' => $this->generateUrl('oktolab_episode_create'),
            'method' => 'POST',
        ));

        $form->add(
            'submit',
            SubmitType::class,
            [
                'label' => 'oktolab_media.new_episode_create_button',
                'attr' => ['class' => 'btn btn-primary']
            ]
        );

        return $form;
    }
632426
public function create($entity, $record = null, $child = null)
    {
        if (!$record && !$child && ($entityObject = Entity::fromYamlFile($entity))) {
            $form = new Form($entityObject, null, Session::get('errors'));

            return $form->view();
        } elseif (($parentEntity = Entity::fromYamlFile($entity)) && ($entityObject = Entity::fromYamlFile($child))) {
            // Get parent's record
            $parentRecord = $parentEntity->class::findOrFail($record);

            $form = new Form($entityObject, null, Session::get('errors'), $parentEntity, $parentRecord);

            return $form->view();
        } else {
            abort(404);
        }
    }
766289
private function createCreateForm(GalleryItem $entity)
    {
        $form = $this->createForm(new GalleryItemType(), $entity, array(
            'action' => $this->generateUrl('admin_galleryitem_create'),
            'method' => 'POST',
        ));

        $form->add('submit', 'submit', array('label' => 'Create'));

        return $form;
    }
1283548
public function create_scan_form($params = null)
    {
        $requestor = new Requestor($this->_apiKey);
        $url = $this->instanceUrl() . '/scan_form';

        list($response, $apiKey) = $requestor->request('post', $url, $params);

        return Util::convertToEasyPostObject($response, $apiKey);
    }
846372
private function createCreateForm(Collection $entity)
    {
        $form = $this->createForm($this->get('amulen.classification.form.collection'), $entity, array(
            'action' => $this->generateUrl('admin_collection_create'),
            'method' => 'POST',
        ));

        $form->add('submit', 'submit', array('label' => 'Create'));

        return $form;
    }
764298
function createApplication() {
  var app = connect();
  utils.merge(app, proto);
  app.request = { __proto__: req };
  app.response = { __proto__: res };
  app.init();
  return app;
}
992752
public function generateInitialApiZipAction($id)
        {



            /** @var RemoteApp $oRemoteApp */
            $oRemoteApp = RemoteAppQuery::create()->findOneById($id);
            if (!$this->check4Client($oRemoteApp->getCustomerId())) {
                throw new AccessDeniedException();
            }

            if ($oRemoteApp === null) {
                throw $this->createNotFoundException('Unable to find RemoteApp entity.');
            }

            // get lico url
            $sLico = SystemSettings::get("lico");


            // build url and make call
            $lico       = $sLico . "/api/generate/module/" . base64_encode($this->_getSiteURL()) . "/" . base64_encode($oRemoteApp->getDomain());
            $sData      = @file_get_contents($lico);
            $sPublicKey = "";
            foreach ($http_response_header as $sHead) {
                if (stristr($sHead, "pk:")) {
                    $sPublicKey = substr($sHead, strpos($sHead, "-"));
                    $oRemoteApp->setPublicKey($sPublicKey);
                    $oRemoteApp->save();
                }
            }

            // unzip file ,add private key and rezip for download
            if (!empty($sPublicKey) && !empty($sData)) {

                // unzip enerated module to add public control key
                $aFiles = UnzipFile::read($sData);

                $sAppPath = $this->getParameter('kernel.root_dir');
                $sVendorPath = $sAppPath."/../vendor/slashworks/control-bundle/src/Slashworks/";
                $sKeyPath = $sVendorPath."AppBundle/Resources/private/api/keys/server/";
                // add control key
                $aFiles[] = array(
                    "name"  => "control.key",
                    "dir"   => "server/private",
                    "mtime" => time(),
                    "data"  => file_get_contents($sKeyPath . "public.key")
                );

                $oZip      = new Zip();
                Zip::$temp = $sVendorPath . "/AppBundle/Resources/private/tmp/";
                foreach ($aFiles as $aFile) {
                    $oZip->addFile($aFile['data'], $aFile['dir'] . "/" . $aFile['name']);
                }

                $sFileName = "swControl";
                $oZip->sendZip($sFileName . "_api.zip", "application/zip", $sFileName . ".zip");
            } else {
                $aData = json_decode($sData, true);
                if (empty($aData)) {
                    $this->get('logger')->error($this->get("translator")->trans("license.update.failed_lico"), array("Method" => __METHOD__, "RemoteApp" => $oRemoteApp->getName(), "RemoteURL" => $oRemoteApp->getFullApiUrl()));
                    $sHtml = "<script>alert('" . $this->get("translator")->trans("license.update.failed_lico") . "');</script>";
                } else {
                    if (isset($aData['message'])) {
                        $this->get('logger')->error( $aData['message'], array("Method" => __METHOD__, "RemoteApp" => $oRemoteApp->getName(), "RemoteURL" => $oRemoteApp->getFullApiUrl()));
                        $sHtml = "<script>alert('" . $aData['message'] . "');</script>";
                    } else {
                        $this->get('logger')->error($this->get("translator")->trans("license.update.failed_lico"), array("Method" => __METHOD__, "RemoteApp" => $oRemoteApp->getName(), "RemoteURL" => $oRemoteApp->getFullApiUrl()));
                        $sHtml = "<script>alert('" . $this->get("translator")->trans("license.update.failed_lico") . "');</script>";
                    }
                }
                echo $sHtml;
            }
            die();
        }
1044118
public function formAction()
    {
        $repository = $this->repositories->get('Applications/Application');
        
        $mode  = $this->params()->fromQuery('mode', 'new');
        $appId = $this->params()->fromQuery('id');
        /* @var \Applications\Entity\Application $application */
        $application = $repository->find($appId);

        $viewModel = new ViewModel();
        if ('edit' == $mode) {
            $comment = $repository->findComment($appId);
        } else {
            $comment = new Comment();
            $comment->setUser($this->auth()->getUser());
        }
        
        $this->acl($application, 'read');
        
        $form = $this->formManager->get('Applications/CommentForm');
        $form->bind($comment);
        
        if ($this->getRequest()->isPost()) {
            $form->setData($_POST);
            
            if ($form->isValid()) {
                if ('new' == $mode) {
                    $application = $repository->find($appId);
                    $application->getComments()->add($comment);
                    $application->changeStatus(
                        $application->getStatus(),
                        sprintf(
                                    /* @translate */ 'Application was rated by %s',
                                     $this->auth()->getUser()->getInfo()->getDisplayName()
                    )
                        );
                }
                $viewModel->setVariable('isSaved', true);
            }
        }
       
        $viewModel->setVariables(
            array(
            'mode' => $mode,
            'identifier' => $appId,
            'commentForm' => $form,
            )
        );
        return $viewModel;
    }