public function render_styling_settings_page()
 {
     echo '<div class="wrap" style="opacity:0">';
     echo '<h2>' . __('Theme Styling', 'fw') . '</h2><br/>';
     $this->form->render();
     echo '</div>';
 }
 /**
  * Render from items
  *
  * @param string $form_id
  * @param array $form
  * @param string $form_type
  * @param string $submit_button
  *
  * @return string
  */
 public final function render_form($form_id, $form, $form_type, $submit_button = null)
 {
     if (empty($form['json'])) {
         return '';
     }
     ob_start();
     $this->frontend_form->render(array('builder_value' => json_decode($form['json'], true), 'form_type' => $form_type, 'form_id' => $form_id, 'submit' => $submit_button));
     return ob_get_clean();
 }
Esempio n. 3
0
 public function _print_settings_page()
 {
     echo '<div class="wrap">';
     echo '<h2>' . __('Theme Settings', 'fw') . '</h2><br/>';
     $this->settings_form->render();
     echo '</div>';
 }
Esempio n. 4
0
 public function _print_settings_page()
 {
     echo '<div class="wrap">';
     if (fw()->theme->get_config('settings_form_side_tabs')) {
         // this is needed for flash messages (admin notices) to be displayed properly
         echo '<h2 class="fw-hidden"></h2>';
     } else {
         $title = __('Theme Settings', 'fw');
         // Extract page title from menu title
         do {
             global $menu, $submenu;
             foreach ($menu as $_menu) {
                 if ($_menu[2] === $this->_get_settings_page_slug()) {
                     $title = $_menu[0];
                     break 2;
                 }
             }
             foreach ($submenu as $_menu) {
                 foreach ($_menu as $_submenu) {
                     if ($_submenu[2] === $this->_get_settings_page_slug()) {
                         $title = $_submenu[0];
                         break 3;
                     }
                 }
             }
         } while (false);
         echo '<h2>' . esc_html($title) . '</h2><br/>';
     }
     $this->settings_form->render();
     echo '</div>';
 }
Esempio n. 5
0
 public function _print_settings_page()
 {
     echo '<div class="wrap">';
     if (fw()->theme->get_config('settings_form_side_tabs')) {
         // this is needed for flash messages (admin notices) to be displayed properly
         echo '<h2 class="fw-hidden"></h2>';
     } else {
         echo '<h2>' . __('Theme Settings', 'fw') . '</h2><br/>';
     }
     $this->settings_form->render();
     echo '</div>';
 }
 private function display_extension_settings_page($extension_name, $data)
 {
     if (!fw()->extensions->get($extension_name)) {
         return sprintf(__('Extension "%s" does not exist or is not active.', 'fw'), fw_htmlspecialchars($extension_name));
     }
     $extension = fw()->extensions->get($extension_name);
     if (!$extension->get_settings_options()) {
         return sprintf(__('%s extension does not have settings.', 'fw'), $extension->manifest->get_name());
     }
     echo '<div id="fw-extension-settings">';
     echo $this->extension_settings_form->render(array('extension' => $extension));
     echo '</div>';
 }
Esempio n. 7
0
 public function _print_settings_page()
 {
     echo '<div class="wrap">';
     $this->settings_form->render();
     echo '</div>';
 }
Esempio n. 8
0
 function _action_theme_display_form_errors()
 {
     $form = FW_Form::get_submitted();
     if (!$form || $form->is_valid()) {
         return;
     }
     wp_enqueue_script('fw-theme-show-form-errors', get_template_directory_uri() . '/js/form-errors.js', array('jquery'), '1.0', true);
     wp_localize_script('fw-theme-show-form-errors', '_localized_form_errors', array('errors' => $form->get_errors(), 'form_id' => $form->get_id()));
 }
Esempio n. 9
0
 /**
  * Get submitted form instance (or false if no form is currently submitted)
  * @return FW_Form|false
  */
 public static function get_submitted()
 {
     if (is_null(self::$submitted_id)) {
         // method called first time, search for submitted form
         do {
             foreach (self::$forms as $form) {
                 if ($form->is_submitted()) {
                     self::$submitted_id = $form->get_id();
                     break 2;
                 }
             }
             self::$submitted_id = false;
         } while (false);
     }
     if (is_string(self::$submitted_id)) {
         return self::$forms[self::$submitted_id];
     } else {
         return false;
     }
 }