Пример #1
0
 /**
  * Returns an array of all module core filed
  *
  * @return array Array of module core files
  */
 public static function get_modules()
 {
     $lsx = Lsx_Options::get_single('lsx');
     $absolute_path = untrailingslashit(LSX_PATH . 'modules');
     $modules = array();
     $default_headers = array('Name' => 'Module Name', 'ModuleURI' => 'Module URI', 'Version' => 'Version', 'Description' => 'Description', 'Author' => 'Author', 'AuthorURI' => 'Author URI', 'TextDomain' => 'Text Domain', 'DomainPath' => 'Domain Path');
     if ($dir = @opendir($absolute_path)) {
         while (false !== ($file = readdir($dir))) {
             if ('.' == substr($file, 0, 1)) {
                 continue;
             }
             if (!is_file($file) && file_exists($absolute_path . '/' . $file . '/' . 'module.php')) {
                 // modules must be in a folder
                 $module = get_file_data($absolute_path . '/' . $file . '/' . 'module.php', $default_headers, 'module');
                 //$absolute_path . '/' . $file . '/' . 'module.php';
                 $module['Internal'] = true;
                 $module['file'] = $absolute_path . '/' . $file . '/' . 'module.php';
                 $modules[] = $module;
             }
         }
         closedir($dir);
     }
     // do activation
     $modules = apply_filters('lsx_get_modules', $modules);
     foreach ($modules as $module) {
         //if( !empty( $lsx['active_module'][ $file ] ) || empty( $module['Internal'] ) ){
         if (file_exists($module['file'])) {
             include_once $module['file'];
         }
         //}
     }
     return $modules;
 }
Пример #2
0
<?php

$lsx = Lsx_Options::get_single('lsx');
$modules = Lsx::get_modules();
?>
<div class="wrap" id="lsx-main-canvas">
	<span class="wp-baldrick spinner" style="float: none; display: block;" data-target="#lsx-main-canvas" data-callback="lsx_canvas_init" data-type="json" data-request="#lsx-live-config" data-event="click" data-template="#main-ui-template" data-autoload="true"></span>
</div>

<div class="clear"></div>

<input type="hidden" class="clear" autocomplete="off" id="lsx-live-config" style="width:100%;" value="<?php 
echo esc_attr(json_encode($lsx));
?>
">

<script type="text/html" id="main-ui-template">
	<?php 
// pull in the join table card template
include LSX_PATH . 'includes/templates/main-ui.php';
?>
	
</script>





 /**
  * Create a new item
  *
  * @uses "wp_ajax_lsx_create_lsx"  action
  *
  * @since 0.0.1
  */
 public function create_new_lsx()
 {
     $new = Lsx_Options::create($_POST['name'], $_POST['slug']);
     if (is_array($new)) {
         wp_send_json_success($new);
     } else {
         wp_send_json_error($_POST);
     }
 }
Пример #4
0
 /**
  * Initialize the plugin by setting localization, filters, and administration functions.
  *
  * @since 1.0.0
  *
  * @access private
  */
 private function __construct()
 {
     // Load plugin text domain
     add_action('init', array($this, 'load_plugin_textdomain'));
     // Activate plugin when new blog is added
     add_action('wpmu_new_blog', array($this, 'activate_new_site'));
     // activate property post type
     add_action('init', array($this, 'register_post_types'));
     //Settings
     add_action('lsx_settings_module_templates', array($this, 'display_settings_fields'));
     add_action('lsx_settings_module_tabs', array($this, 'display_settings_tab'));
     // Load admin style sheet and JavaScript.
     add_action('admin_enqueue_scripts', array($this, 'enqueue_admin_stylescripts'));
     // Load front style sheet and JavaScript.
     add_action('wp_enqueue_scripts', array($this, 'enqueue_front_stylescripts'));
     //Populate the data for the meta plate
     add_filter('metaplate_data', array($this, 'build_metaplate_data'), 11, 2);
     //Template Redirect
     add_filter('template_include', array($this, 'post_type_archive_template_include'), 99);
     add_filter('template_include', array($this, 'post_type_single_template_include'), 99);
     $options = Lsx_Options::get_single('lsx');
     //if( false !== $options && is_array($options['lsx-tours']) ){
     if (isset($options['lsx-tours']['enquire_form']) && '' != $options['lsx-tours']['enquire_form']) {
         $this->enquire_form = $options['lsx-tours']['enquire_form'];
     }
     if (isset($options['lsx-tours']['booking_form']) && '' != $options['lsx-tours']['booking_form']) {
         $this->booking_form = $options['lsx-tours']['booking_form'];
     }
     if (isset($options['lsx-tours']['google_api_key']) && '' != $options['lsx-tours']['google_api_key']) {
         $this->google_api_key = $options['lsx-tours']['google_api_key'];
     }
     //}
 }