Ejemplo n.º 1
0
        /**
         * Show a notice highlighting bad template files
         */
        public function template_file_check_notice()
        {
            if ($this->template_path == $this->original_path) {
                return;
            }
            $core_templates = $this->scan_template_files($this->original_path);
            $outdated = false;
            foreach ($core_templates as $file) {
                $developer_theme_file = false;
                if (file_exists($this->template_path . $file)) {
                    $developer_theme_file = $this->template_path . $file;
                }
                if ($developer_theme_file) {
                    $core_version = AvadaRedux_Helpers::get_template_version($this->original_path . $file);
                    $developer_version = AvadaRedux_Helpers::get_template_version($developer_theme_file);
                    if ($core_version && $developer_version && version_compare($developer_version, $core_version, '<')) {
                        ?>
							<div id="message" class="error avadaredux-message">
								<p><?php 
                        _e('<strong>Your panel has bundled outdated copies of AvadaRedux Framework template files</strong> &#8211; if you encounter functionality issues this could be the reason. Ensure you update or remove them.', 'avadaredux-framework');
                        ?>
</p>
							</div>
							<?php 
                        return;
                    }
                }
            }
        }
Ejemplo n.º 2
0
 public static function getExtensions($opt_name = "", $key = "")
 {
     if (empty($opt_name)) {
         AvadaRedux::getAllExtensions();
         if (empty($key)) {
             return self::$extension_paths;
         } else {
             if (isset(self::$extension_paths[$key])) {
                 return self::$extension_paths[$key];
             }
         }
     } else {
         if (empty(self::$uses_extensions[$opt_name])) {
             AvadaRedux::getInstanceExtensions($opt_name);
         }
         if (empty(self::$uses_extensions[$opt_name])) {
             return false;
         }
         $instanceExtensions = array();
         foreach (self::$uses_extensions[$opt_name] as $extension) {
             $class_file = end(self::$extensions[$extension]);
             $name = str_replace('.php', '', basename($extension));
             $extension_class = 'AvadaReduxFramework_Extension_' . $name;
             $instanceExtensions[$extension] = array('path' => $class_file, 'class' => $extension_class, 'version' => AvadaRedux_Helpers::get_template_version($class_file));
         }
         return $instanceExtensions;
     }
     return false;
 }