| Server IP : 89.39.208.18 / Your IP : 216.73.217.74 Web Server : LiteSpeed System : User : ( ) PHP Version : 7.4.33 Disable Function : eval,./,ln,passthru,dl,system,exec,popen,shell_exec,posix_getpwuid,posix_uname,ftp_exec,posix_uname,posix_getpwuid,posix_kill,posix_mkfifo,posix_setpgid,posix_setsid,posix_setuid,get_current_user,getmyuid,getmygid,listen,chgrp,apache_note,apache_setenv,apache_child_terminate,closelog,debugger_off,debugge_on,ini_restore,netscript,escapeshellarg,cmd,backtick,virtual,show_sourc,show_source,pclose,pcntl_exec,datasec,old_offset,ctrl_dir,ini_alter,leak,listen,chgrp,apache_setenv,define_syslog_variables,root,diskfreespace,disk_free_space,disk_total_space,posix_kill,getmyuid,getmygid,apache_child_terminate,php_ini_scanned_files,ls,ps_aux,chown,getrusage,posixc,posame,chgrp,posix_setuid,posix_setsid,posix_setgid,apache_note,apache_setenv,x_getuid,e_ini_file,nfo,SQL,mysql_li,t_dbs,filegroup,highlight_file,ilegetcontents,get_dir,popen,popens,pfsockopen,dos_conv,apache_get_modules,crack_check,crack_closedict,rar_open,bzopen,bzread,bzwrite,shellcode,posix_isatty,posix_getservbyname,escapeshellarg,hypot,pg_host,pos,posix_access,inurl,posix_times,posix_mknod,pclose,ps_fill,symlink,id,escapeshellcmd,php_uname,phpinfo MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /home3/././mahyarcake/www/wp-content/plugins/powerpack-elements/modules/query-control/ |
Upload File : |
<?php
namespace PowerpackElements\Modules\QueryControl;
use PowerpackElements\Base\Module_Base;
use PowerpackElements\Controls\Control_Query as Query;
// Elementor Classes
use Elementor\Widget_Base;
use Elementor\Controls_Manager;
use Elementor\Core\Common\Modules\Ajax\Module as Ajax;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
/**
* \Modules\QueryControl\Module
*
* @since 1.4.13.1
*/
class Module extends Module_Base {
/**
* Module constructor.
*
* @since 1.4.13.1
* @param array $args
*/
public function __construct() {
parent::__construct();
// ACF 5 and up
if ( class_exists( '\acf' ) && function_exists( 'acf_get_field_groups' ) ) {
$this->add_component( 'acf', new Types\Acf() );
}
// Pods
if ( function_exists( 'pods' ) ) {
$this->add_component( 'pods', new Types\Pods() );
}
// Toolset
if ( function_exists( 'wpcf_admin_fields_get_groups' ) ) {
$this->add_component( 'toolset', new Types\Toolset() );
}
$this->add_component( 'posts', new Types\Posts() );
$this->add_component( 'terms', new Types\Terms() );
$this->add_component( 'authors', new Types\Authors() );
$this->add_component( 'users', new Types\Users() );
$this->add_component( 'templates', new Types\Templates() );
$this->add_component( 'templates-all', new Types\Templates_All() );
$this->add_component( 'templates-page', new Types\Templates_Page() );
$this->add_component( 'templates-section', new Types\Templates_Section() );
$this->add_component( 'templates-widget', new Types\Templates_Widget() );
$this->add_actions();
}
/**
* Get Name
*
* Get the name of the module
*
* @since 1.4.13.1
* @return string
*/
public function get_name() {
return 'query-control';
}
/**
* Add Actions
*
* Registeres actions to Elementor hooks
*
* @since 1.4.13.1
* @return void
*/
protected function add_actions() {
add_action( 'elementor/ajax/register_actions', [ $this, 'register_ajax_actions' ] );
}
/**
* Calls function depending on ajax query data
*
* @since 1.4.13.1
* @return array
*/
public function ajax_call_filter_autocomplete( array $data ) {
if ( empty( $data['query_type'] ) || empty( $data['q'] ) ) {
throw new \Exception( 'Bad Request' );
}
$results = $this->get_component( $data['query_type'] )->get_autocomplete_values( $data );
return [
'results' => $results,
];
}
/**
* Calls function to get value titles depending on ajax query type
*
* @since 1.4.13.1
* @return array
*/
public function ajax_call_control_value_titles( array $request ) {
$results = $this->get_component( $request['query_type'] )->get_value_titles( $request );
return $results;
}
/**
* Register Elementor Ajax Actions
*
* @since 1.4.13.1
* @return array
*/
public function register_ajax_actions( $ajax_manager ) {
$ajax_manager->register_ajax_action( 'pp_query_control_value_titles', [ $this, 'ajax_call_control_value_titles' ] );
$ajax_manager->register_ajax_action( 'pp_query_control_filter_autocomplete', [ $this, 'ajax_call_filter_autocomplete' ] );
}
}