/**
  * Handle the WpLoginScreenSettings post settings
  */
 public function handleWpLoginScreenSettingsSection()
 {
     if ($this->isMethod('POST') && $this->settingsForm->hasRequest()) {
         $this->removeCache('wpLoginScreenSettingsSection');
         $this->settingsForm->bind(filter_input_array(INPUT_POST));
         if ($this->settingsForm->isValid()) {
             $wpLoginScreen = $this->settingsForm->getData();
             $this->om->set($this->container->getSlug() . '.login', $wpLoginScreen);
             $this->om->set($this->container->getSlug() . '.login.success', 'Settings were updated with success');
         }
         if ($this->isAjaxRequest()) {
             $this->renderJson(array('view' => $this->wpLoginScreenSettingsSection()), true);
             exit;
         }
     }
 }
 /**
  * Handle the shortcode genrator section.
  * if request is made via ajax, a json encoded string is echoed
  *
  * @return string  
  */
 public function handleGeneratorSection()
 {
     if ($this->isMethod('POST') && $this->generator->hasRequest()) {
         $this->removeCache('generatorSection');
         $this->generator->bind(filter_input_array(INPUT_POST));
         if ($this->generator->isValid()) {
             $loginButton = $this->generator->getData();
             $this->setListenerResponse($this->render($this->container->getRoot()->getRootPath() . '/Resources/views/admin/generator.html.php', array('phpCode' => $this->loginButtonManager->generatePhpCode($loginButton), 'shortcode' => $this->loginButtonManager->generateShorcode($loginButton))));
         }
         if ($this->isAjaxRequest()) {
             $this->renderJson(array('view' => $this->generatorSection()), true);
             exit;
         }
     }
 }
Example #3
0
 /**
  * 
  * @param \PopCode\Framework\Form\AbstractForm $form
  * @return string
  */
 public static function createLabel(\PopCode\Framework\Form\AbstractForm $form)
 {
     $html = '<label for="' . $form->getId() . '" ' . self::processAttrs($form->getFormType()->getLabelAttrs()) . '>' . $form->_($form->getFormType()->getLabel()) . ($form->getformType()->getRequired() ? ' *' : null) . '</label>';
     return $html;
 }