/home/lnzliplg/www/core.tar
build-modules.php 0000644 00000001741 15172746154 0010041 0 ustar 00 <?php
namespace ElementsKit_Lite\Core;
use ElementsKit_Lite\Libs\Framework\Attr;
defined( 'ABSPATH' ) || exit;
/**
* Module registrar.
*
* Call assosiated classes of every modules.
*
* @since 1.0.0
* @access public
*/
class Build_Modules {
private $modules;
use \ElementsKit_Lite\Traits\Singleton;
/**
* Hold the module list.
*
* @since 1.0.0
* @access public
* @static
*/
public function __construct() {
$this->modules = \ElementsKit_Lite\Config\Module_List::instance()->get_list( 'active' );
foreach ( $this->modules as $module_slug => $module ) {
if ( isset( $module['path'] ) ) {
include_once $module['path'] . 'init.php';
}
// make the class name and call it.
$class_name = (
isset( $module['base_class_name'] )
? $module['base_class_name']
: '\ElementsKit_Lite\Modules\\' . \ElementsKit_Lite\Utils::make_classname( $module_slug ) . '\Init'
);
if ( class_exists( $class_name ) ) {
new $class_name();
}
}
}
}
editor-promotion.php 0000644 00000004753 15172746154 0010614 0 ustar 00 <?php
namespace ElementsKit_Lite\Core;
defined('ABSPATH') || exit;
class Editor_Promotion {
use \ElementsKit_Lite\Traits\Singleton;
public function init() {
// Enqueue promotion scripts
add_action('elementor/editor/before_enqueue_scripts', [$this, 'enqueue_editor_scripts']);
}
/**
* Get promotion widgets data
*/
private function get_promotion_widgets_data() {
$widget_list = \ElementsKit_Lite\Config\Widget_List::instance()->get_list('all');
$promotion_data = [];
foreach ($widget_list as $slug => $widget) {
if (isset($widget['package']) && $widget['package'] === 'pro-disabled') {
$promotion_data[] = [
'name' => 'ekit-' . $slug,
'title' => isset($widget['title']) ? $widget['title'] : ucwords(str_replace('-', ' ', $slug)),
'icon' => isset($widget['icon']) ? $widget['icon'] : 'eicon-star',
'categories' => ['elementskit'],
'promotion' => [
'title' => sprintf(__('%s Widget', 'elementskit-lite'), isset($widget['title']) ? $widget['title'] : ucwords(str_replace('-', ' ', $slug))),
'description' => sprintf(
__( 'Unlock the %s widget and dozens of powerful ElementsKit Pro features to design faster, smarter, and more flexible websites.', 'elementskit-lite'),
isset($widget['title']) ? $widget['title'] : ucwords(str_replace('-', ' ', $slug))
),
'upgrade_url' => 'https://wpmet.com/plugin/elementskit/pricing/',
'upgrade_text' => __('Upgrade Now', 'elementskit-lite'),
],
];
}
}
return $promotion_data;
}
/**
* Enqueue editor scripts for promotion
*/
public function enqueue_editor_scripts() {
$promotion_widgets = $this->get_promotion_widgets_data();
wp_enqueue_script(
'elementskit-editor-promotion',
\ElementsKit_Lite::widget_url() . 'init/assets/js/editor-promotion.js',
['elementor-editor', 'elementor-common'],
\ElementsKit_Lite::version(),
true
);
wp_localize_script(
'elementskit-editor-promotion',
'ekitPromotion',
[
'promotionWidgets' => $promotion_widgets,
'upgradeUrl' => 'https://wpmet.com/plugin/elementskit/pricing/',
'debug' => true,
'i18n' => [
'proFeature' => __('Pro Feature', 'elementskit-lite'),
'upgradeNow' => __('Upgrade Now', 'elementskit-lite'),
'learnMore' => __('Learn More', 'elementskit-lite'),
],
]
);
// Enqueue styles
wp_enqueue_style(
'elementskit-editor-promotion',
\ElementsKit_Lite::widget_url() . 'init/assets/css/editor-promotion.css',
[],
\ElementsKit_Lite::version()
);
}
}
activation-actions.php 0000644 00000001636 15172746154 0011076 0 ustar 00 <?php
namespace ElementsKit_Lite\Core;
use ElementsKit_Lite\Libs\Framework\Classes\Onboard_Status;
defined( 'ABSPATH' ) || exit;
class Activation_Actions {
private $key = 'elementskit-lite__plugin_activated';
private $has_key = false;
public function init() {
if ( ! is_admin() ) {
return;
}
$this->process_key();
if ( $this->has_key === false ) {
return;
}
// call activation job classes or methods here.
$this->flush_rewrite_rules();
$this->redirect_to_onboard();
}
private function process_key() {
if ( ! empty( get_option( $this->key ) ) ) {
$this->has_key = true;
delete_option( $this->key );
}
}
private function flush_rewrite_rules() {
// all CPTs must be declared completely before flushing rewrite rules. otherwise, it won't work as expected.
flush_rewrite_rules();
}
private function redirect_to_onboard() {
// Onboard_Status::redirect_onboard();
}
}
handler-api.php 0000644 00000002144 15172746154 0007456 0 ustar 00 <?php
namespace ElementsKit_Lite\Core;
class Handler_Api {
public $prefix = '';
public $param = '';
public $request = null;
public function __construct() {
$this->config();
$this->init();
}
public function config() {
}
public function init() {
add_action(
'rest_api_init',
function () {
register_rest_route(
untrailingslashit( 'elementskit/v1/' . $this->prefix ),
'/(?P<action>\w+)/' . ltrim( $this->param, '/' ),
array(
'methods' => \WP_REST_Server::ALLMETHODS,
'callback' => array( $this, 'callback' ),
'permission_callback' => '__return_true',
// all permissions are implimented inside the callback action
)
);
}
);
}
public function callback( $request ) {
$this->request = $request;
$action_class = strtolower( $this->request->get_method() ) . '_' . $this->request['action'];
if ( method_exists( $this, $action_class ) ) {
return $this->{$action_class}();
} else {
return new \WP_Error( 'invalid_action', esc_html__( 'Invalid action', 'elementskit-lite' ), array( 'status' => 400 ) );
}
}
}
build-inline-scripts.php 0000644 00000001764 15172746154 0011341 0 ustar 00 <?php
namespace ElementsKit_Lite\Core;
defined( 'ABSPATH' ) || exit;
/**
* Inline script registrar.
*
* Returns all necessary inline js & css.
*
* @since 1.0.0
* @access public
*/
class Build_Inline_Scripts {
use \ElementsKit_Lite\Traits\Singleton;
public function __construct() {
// Frontend + Admin scripts
add_action( 'wp_print_scripts', array( $this, 'print_inline_script' ) );
}
/**
* Get common inline JavaScript.
*
* @return string
*/
public function common_js() {
ob_start(); ?>
var elementskit = {
resturl: '<?php echo defined( 'ICL_SITEPRESS_VERSION' ) ? esc_url(home_url('/wp-json/elementskit/v1/')) : esc_url(get_rest_url() . 'elementskit/v1/'); ?>',
}
<?php
$output = ob_get_contents();
ob_end_clean();
return $output;
}
/**
* Print inline JavaScript.
*
* @return void
*/
public function print_inline_script() {
printf(
"<script type='text/javascript'>%s</script>",
\ElementsKit_Lite\Utils::render( $this->common_js() )
);
}
}
build-widgets.php 0000644 00000005174 15172746154 0010043 0 ustar 00 <?php
namespace ElementsKit_Lite\Core;
use ElementsKit_Lite\Libs\Framework\Attr;
defined( 'ABSPATH' ) || exit;
class Build_Widgets {
/**
* Collection of default widgets.
*
* @since 1.0.0
* @access private
*/
private $widgets;
use \ElementsKit_Lite\Traits\Singleton;
public function __construct() {
new \ElementsKit_Lite\Widgets\Init\Enqueue_Scripts();
$this->widgets = \ElementsKit_Lite\Config\Widget_List::instance()->get_list( 'full' );
// check if the widget is exists
foreach ( $this->widgets as $widget ) {
$this->add_widget( $widget );
}
add_action( 'elementor/widgets/register', array( $this, 'register_widget' ) );
}
public function add_widget( $widget_config ) {
$widget_dir = (
isset( $widget_config['path'] )
? $widget_config['path']
: \ElementsKit_Lite::widget_dir() . $widget_config['slug'] . '/'
);
$widget_file_path = $widget_dir . $widget_config['slug'] . '.php';
$widget_handler_file_path = $widget_dir . $widget_config['slug'] . '-handler.php';
if (!file_exists($widget_file_path) && !file_exists($widget_handler_file_path)) {
return;
}
include $widget_file_path;
include $widget_handler_file_path;
$base_class_name = (
( isset( $widget_config['base_class_name'] ) )
? $widget_config['base_class_name']
: '\Elementor\ElementsKit_Widget_' . \ElementsKit_Lite\Utils::make_classname( $widget_config['slug'] )
);
$handler = $base_class_name . '_Handler';
$handler_class = new $handler();
if ( $handler_class->scripts() != false ) {
add_action( 'wp_enqueue_scripts', array( $handler_class, 'scripts' ) );
}
if ( $handler_class->styles() != false ) {
add_action( 'wp_enqueue_scripts', array( $handler_class, 'styles' ) );
}
if ( $handler_class->inline_css() != false ) {
wp_add_inline_style( 'elementskit-init-css', $handler_class->inline_css() );
}
if ( $handler_class->inline_js() != false ) {
wp_add_inline_script( 'elementskit-init-js', $handler_class->inline_js() );
}
if ( $handler_class->register_api() != false ) {
if ( \file_exists( $handler_class->register_api() ) ) {
include_once $handler_class->register_api();
$api = $base_class_name . '_Api';
new $api();
}
}
if ( $handler_class->wp_init() != false ) {
add_action( 'init', array( $handler_class, 'wp_init' ) );
}
}
public function register_widget( $widgets_manager ) {
foreach ( $this->widgets as $widget_slug => $widget ) {
$class_name = '\Elementor\ElementsKit_Widget_' . \ElementsKit_Lite\Utils::make_classname( $widget_slug );
if ( class_exists( $class_name ) ) {
$widgets_manager->register( new $class_name() );
}
}
}
}
handler-widget.php 0000644 00000001323 15172746154 0010166 0 ustar 00 <?php
namespace ElementsKit_Lite\Core;
class Handler_Widget {
public function wp_init() {
return false;
}
static function get_name() {
return false;
}
static function get_title() {
return false;
}
static function get_icon() {
return false;
}
static function get_categories() {
return false;
}
static function get_dir() {
return false;
}
static function get_url() {
return false;
}
public function register_api() {
return false;
}
public function inline_js() {
return false;
}
public function inline_css() {
return false;
}
public function sass() {
return false;
}
public function scripts() {
return false;
}
public function styles() {
return false;
}
}
config-list.php 0000644 00000003247 15172746154 0007515 0 ustar 00 <?php
namespace ElementsKit_Lite\Core;
abstract class Config_List {
use \ElementsKit_Lite\Traits\Singleton;
private $full_list = array();
private $active_list = array();
protected $optional_list = array();
protected $required_list = array();
protected $type;
public function __construct() {
$this->set_optional_list();
$this->set_required_list();
$this->set_full_list();
$this->set_active_list();
}
public function get_list( $data = 'full', $module = null ) {
if ( $module != null ) {
return ( $this->{$data . '_list'}[ $module ] ?? false );
}
// Return all items including pro-disabled for promotion purposes
if ( $data === 'all' ) {
return $this->full_list;
}
return $this->{$data . '_list'};
}
public function is_active( $item ) {
$item = ( $this->active_list[ $item ] ?? array() );
return empty( $item['package'] ) ? false : ( ( $item['package'] == 'free' || $item['package'] == 'pro' ) );
}
private function set_active_list() {
$database_list = \ElementsKit_Lite\Libs\Framework\Attr::instance()->utils->get_option( $this->type . '_list', array() );
foreach ( $this->full_list as $key => $item ) {
if ( isset( $database_list[ $key ]['status'] ) && $database_list[ $key ]['status'] == 'inactive' && ! key_exists( $key, $this->required_list ) ) {
continue;
}
if ( isset( $item['package'] ) && $item['package'] == 'pro-disabled' ) {
continue;
}
$this->active_list[ $key ] = $item;
}
}
private function set_full_list() {
$this->full_list = array_merge( $this->required_list, $this->optional_list );
}
abstract protected function set_required_list();
abstract protected function set_optional_list();
}
__pycache__/helper.cpython-36.pyc 0000644 00000000256 15173152700 0012665 0 ustar 00 3
��g$ � @ s d Z dZdS )zThe helper maxnamelen� N)�__doc__ZHELPER_MAXNAMELEN� r r �/usr/lib/python3.6/helper.py�<module> s __pycache__/ebtables.cpython-36.opt-1.pyc 0000644 00000016336 15173152700 0014134 0 ustar 00 3
��g�$ � @ s& d gZ ddlZddlmZ ddlmZ ddlmZm Z m
Z
ddlmZ ddl
mZ ddlmZmZ ddlZd gd
ddgd
ddgd�Zi Zi Zi Zx�ej� D ]tZg ee<