| Server IP : 89.108.64.180 / Your IP : 216.73.217.92 Web Server : Apache/2.4.41 (Ubuntu) System : Linux 89-108-64-180.cloudvps.regruhosting.ru 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 User : www-root ( 1010) PHP Version : 8.0.30 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/www-root/data/www/fl-brief.agast.ru/wp-content/plugins/quform/library/Quform/ |
Upload File : |
<?php
/**
* @copyright Copyright (c) 2009-2022 ThemeCatcher (https://www.themecatcher.net)
*/
class Quform_Shortcode
{
/**
* @var Quform_Form_Controller
*/
protected $controller;
/**
* @var Quform_Options
*/
protected $options;
/**
* @param Quform_Form_Controller $controller
* @param Quform_Options $options
*/
public function __construct(Quform_Form_Controller $controller, Quform_Options $options)
{
$this->controller = $controller;
$this->options = $options;
}
/**
* Handle the [quform] shortcode to display a form
*
* @param array $attributes The shortcode attributes
* @return string The form HTML
*/
public function form($attributes)
{
$options = shortcode_atts(array(
'id' => '',
'values' => '',
'show_title' => '1',
'show_description' => '1'
), $attributes);
$options['show_title'] = $options['show_title'] == '1';
$options['show_description'] = $options['show_description'] == '1';
$output = $this->controller->form($options);
if ($this->options->get('rawFix')) {
$output = '[raw]' . $output . '[/raw]';
}
return $output;
}
/**
* Handle the [quform_popup] shortcode to display a form
*
* @param array $attributes The shortcode attributes
* @param string $content The content between shortcode tags
* @return string The form HTML
*/
public function popup($attributes, $content = '')
{
$options = shortcode_atts(array(
'id' => '',
'values' => '',
'options' => '',
'width' => '',
'show_title' => '1',
'show_description' => '1'
), $attributes);
$options['show_title'] = $options['show_title'] == '1';
$options['show_description'] = $options['show_description'] == '1';
$options['popup'] = true;
$options['content'] = $content;
$output = $this->controller->form($options);
if ($this->options->get('rawFix')) {
$output = '[raw]' . $output . '[/raw]';
}
return $output;
}
/**
* Handle the [quform_entry_limit] shortcode to display the entry limit
*
* @param array $attributes The shortcode attributes
* @return string The maximum number of entries
*/
public function entryLimit($attributes) {
$options = shortcode_atts(array(
'id' => '',
), $attributes);
return esc_html($this->controller->getEntryLimit((int) $options['id']));
}
/**
* Handle the [quform_entry_count] shortcode to display the count of entries
*
* @param array $attributes The shortcode attributes
* @return string The count of entries
*/
public function entryCount($attributes) {
$options = shortcode_atts(array(
'id' => '',
), $attributes);
return esc_html($this->controller->getEntryCount((int) $options['id']));
}
/**
* Handle the [quform_entries_remaining] shortcode to display the number of remaining entries
*
* @param array $attributes The shortcode attributes
* @return string The number of remaining entries
*/
public function entriesRemaining($attributes) {
$options = shortcode_atts(array(
'id' => '',
), $attributes);
return esc_html($this->controller->getEntriesRemaining((int) $options['id']));
}
}