示例#1
0
function pmai_admin_notices()
{
    // notify user if history folder is not writable
    if (!class_exists('PMXI_Plugin')) {
        ?>
		<div class="error"><p>
			<?php 
        printf(__('<b>%s Plugin</b>: WP All Import must be installed. Free edition of WP All Import at <a href="http://wordpress.org/plugins/wp-all-import/" target="_blank">http://wordpress.org/plugins/wp-all-import/</a> and the paid edition at <a href="http://www.wpallimport.com/">http://www.wpallimport.com/</a>', 'PMAI_Plugin'), PMAI_Plugin::getInstance()->getName());
        ?>
		</p></div>
		<?php 
        deactivate_plugins(PMAI_ROOT_DIR . '/wpai-acf-add-on.php');
    }
    if (class_exists('PMXI_Plugin') and (version_compare(PMXI_VERSION, '4.1.1') < 0 and PMXI_EDITION == 'paid' or version_compare(PMXI_VERSION, '3.2.3') <= 0 and PMXI_EDITION == 'free')) {
        ?>
		<div class="error"><p>
			<?php 
        printf(__('<b>%s Plugin</b>: Please update your WP All Import to the latest version', 'pmai_plugin'), PMAI_Plugin::getInstance()->getName());
        ?>
		</p></div>
		<?php 
        deactivate_plugins(PMAI_ROOT_DIR . '/wpai-acf-add-on.php');
    }
    if (!class_exists('acf')) {
        ?>
		<div class="error"><p>
			<?php 
        printf(__('<b>%s Plugin</b>: <a target="_blank" href="http://wordpress.org/plugins/advanced-custom-fields/">Advanced Custom Fields</a> must be installed', 'pmai_plugin'), PMAI_Plugin::getInstance()->getName());
        ?>
		</p></div>
		<?php 
        deactivate_plugins(PMAI_ROOT_DIR . '/wpai-acf-add-on.php');
    }
    $input = new PMAI_Input();
    $messages = $input->get('pmai_nt', array());
    if ($messages) {
        is_array($messages) or $messages = array($messages);
        foreach ($messages as $type => $m) {
            in_array((string) $type, array('updated', 'error')) or $type = 'updated';
            ?>
			<div class="<?php 
            echo $type;
            ?>
"><p><?php 
            echo $m;
            ?>
</p></div>
			<?php 
        }
    }
}
示例#2
0
文件: admin.php 项目: ryan2407/Vision
 /**
  * @see Controller::render()
  */
 protected function render($viewPath = NULL)
 {
     // assume template file name depending on calling function
     if (is_null($viewPath)) {
         $trace = debug_backtrace();
         $viewPath = str_replace('_', '/', preg_replace('%^' . preg_quote(PMAI_Plugin::PREFIX, '%') . '%', '', strtolower($trace[1]['class']))) . '/' . $trace[1]['function'];
     }
     // render contextual help automatically
     $viewHelpPath = $viewPath;
     // append file extension if not specified
     if (!preg_match('%\\.php$%', $viewHelpPath)) {
         $viewHelpPath .= '.php';
     }
     $viewHelpPath = preg_replace('%\\.php$%', '-help.php', $viewHelpPath);
     $fileHelpPath = PMAI_Plugin::ROOT_DIR . '/views/' . $viewHelpPath;
     if (is_file($fileHelpPath)) {
         // there is help file defined
         ob_start();
         include $fileHelpPath;
         add_contextual_help(PMAI_Plugin::getInstance()->getAdminCurrentScreen()->id, ob_get_clean());
     }
     parent::render($viewPath);
 }
示例#3
0
function pmxi_admin_notices()
{
    // notify user if history folder is not writable
    $uploads = wp_upload_dir();
    // compare woocommerce add-on version
    if (class_exists('PMWI_Plugin') and (defined('PMWI_VERSION') and version_compare(PMWI_VERSION, '2.1.4') < 0 and PMWI_EDITION == 'paid' or defined('PMWI_FREE_VERSION') and version_compare(PMWI_FREE_VERSION, '1.2.2') < 0 and PMWI_EDITION == 'free')) {
        ?>
		<div class="error"><p>
			<?php 
        printf(__('<b>%s Plugin</b>: Please update your WP All Import WooCommerce add-on to the latest version', 'pmwi_plugin'), PMWI_Plugin::getInstance()->getName());
        ?>
		</p></div>
		<?php 
        if (defined('PMWI_EDITION') and PMWI_EDITION == 'paid') {
            deactivate_plugins(PMWI_ROOT_DIR . '/wpai-woocommerce-add-on.php');
        } else {
            if (defined('PMWI_FREE_ROOT_DIR')) {
                deactivate_plugins(PMWI_FREE_ROOT_DIR . '/plugin.php');
            } else {
                deactivate_plugins(PMWI_ROOT_DIR . '/plugin.php');
            }
        }
    }
    // compare ACF add-on
    if (class_exists('PMAI_Plugin') and defined('PMAI_VERSION') and version_compare(PMAI_VERSION, '3.0.0-beta1') < 0 and PMAI_EDITION == 'paid') {
        ?>
		<div class="error"><p>
			<?php 
        printf(__('<b>%s Plugin</b>: Please update your WP All Import ACF add-on to the latest version', 'pmwi_plugin'), PMAI_Plugin::getInstance()->getName());
        ?>
		</p></div>
		<?php 
        if (defined('PMAI_EDITION') and PMAI_EDITION == 'paid') {
            deactivate_plugins(PMAI_ROOT_DIR . '/wpai-acf-add-on.php');
        }
    }
    // compare Linkcloak add-on
    if (class_exists('PMLCA_Plugin') and defined('PMLCA_VERSION') and version_compare(PMLCA_VERSION, '1.0.0-beta1') < 0 and PMLCA_EDITION == 'paid') {
        ?>
		<div class="error"><p>
			<?php 
        printf(__('<b>%s Plugin</b>: Please update your WP All Import Linkcloak add-on to the latest version', 'pmwi_plugin'), PMLCA_Plugin::getInstance()->getName());
        ?>
		</p></div>
		<?php 
        if (defined('PMLCA_EDITION') and PMLCA_EDITION == 'paid') {
            deactivate_plugins(PMLCA_ROOT_DIR . '/wpai-linkcloak-add-on.php');
        }
    }
    // compare User add-on
    if (class_exists('PMUI_Plugin') and defined('PMUI_VERSION') and version_compare(PMUI_VERSION, '1.0.0-beta1') < 0 and PMUI_EDITION == 'paid') {
        ?>
		<div class="error"><p>
			<?php 
        printf(__('<b>%s Plugin</b>: Please update your WP All Import User add-on to the latest version', 'pmwi_plugin'), PMUI_Plugin::getInstance()->getName());
        ?>
		</p></div>
		<?php 
        if (defined('PMUI_EDITION') and PMUI_EDITION == 'paid') {
            deactivate_plugins(PMUI_ROOT_DIR . '/wpai-user-add-on.php');
        }
    }
    // compare WPML add-on
    if (class_exists('PMLI_Plugin') and defined('PMLI_VERSION') and version_compare(PMLI_VERSION, '1.0.0-beta1') < 0 and PMLI_EDITION == 'paid') {
        ?>
		<div class="error"><p>
			<?php 
        printf(__('<b>%s Plugin</b>: Please update your WP All Import WPML add-on to the latest version', 'pmwi_plugin'), PMLI_Plugin::getInstance()->getName());
        ?>
		</p></div>
		<?php 
        if (defined('PMLI_EDITION') and PMLI_EDITION == 'paid') {
            deactivate_plugins(PMLI_ROOT_DIR . '/plugin.php');
        }
    }
    $input = new PMXI_Input();
    $messages = $input->get('pmxi_nt', array());
    if ($messages) {
        is_array($messages) or $messages = array($messages);
        foreach ($messages as $type => $m) {
            in_array((string) $type, array('updated', 'error')) or $type = 'updated';
            ?>
			<div class="<?php 
            echo $type;
            ?>
"><p><?php 
            echo $m;
            ?>
</p></div>
			<?php 
        }
    }
    $warnings = $input->get('warnings', array());
    if ($warnings) {
        is_array($warnings) or $warnings = explode(',', $warnings);
        foreach ($warnings as $code) {
            switch ($code) {
                case 1:
                    $m = __('<strong>Warning:</strong> your title is blank.', 'pmxi_plugin');
                    break;
                case 2:
                    $m = __('<strong>Warning:</strong> your content is blank.', 'pmxi_plugin');
                    break;
                case 3:
                    $m = __('<strong>Warning:</strong> You must <a href="http://www.wpallimport.com/upgrade-to-pro/?utm_source=free-plugin&utm_medium=in-plugin&utm_campaign=images" target="_blank">upgrade to the Pro edition of WP All Import</a> to import images. The settings you configured in the images section will be ignored.', 'pmxi_plugin');
                    break;
                case 4:
                    $m = __('<strong>Warning:</strong> You must <a href="http://www.wpallimport.com/upgrade-to-pro/?utm_source=free-plugin&utm_medium=in-plugin&utm_campaign=custom-fields" target="_blank">upgrade to the Pro edition of WP All Import</a> to import data to Custom Fields. The settings you configured in the Custom Fields section will be ignored.', 'pmxi_plugin');
                    break;
                default:
                    $m = false;
                    break;
            }
            if ($m) {
                ?>
			<div class="error"><p><?php 
                echo $m;
                ?>
</p></div>
			<?php 
            }
        }
    }
    wp_all_import_addon_notifications();
}
示例#4
0
				'acf' => array(),
				'fields' => array(),
				'is_multiple_field_value' => array(),				
				'multiple_value' => array(),
				'fields_delimiter' => array(),				

				'is_update_acf' => 1,
				'update_acf_logic' => 'full_update',						
				'acf_list' => array(),
				'acf_only_list' => array(),
				'acf_except_list' => array()
			);
		}
	}

	PMAI_Plugin::getInstance();

	// retrieve our license key from the DB
	$wpai_acf_addon_options = get_option('PMXI_Plugin_Options');
	
	if (!empty($wpai_acf_addon_options['info_api_url'])){
		// setup the updater
		$updater = new PMAI_Updater( $wpai_acf_addon_options['info_api_url'], __FILE__, array( 
				'version' 	=> PMAI_VERSION,		// current version number
				'license' 	=> false, // license key (used get_option above to retrieve from DB)
				'item_name' => PMAI_Plugin::getEddName(), 	// name of this plugin
				'author' 	=> 'Soflyy'  // author of this plugin
			)
		);
	}
}
示例#5
0
文件: list.php 项目: ryan2407/Vision
 public function __construct()
 {
     parent::__construct();
     $this->setTable(PMAI_Plugin::getInstance()->getTablePrefix() . 'imports');
 }
function pmxi_admin_notices()
{
    // notify user if history folder is not writable
    $uploads = wp_upload_dir();
    // compare woocommerce add-on version
    if (class_exists('PMWI_Plugin') and (defined('PMWI_VERSION') and version_compare(PMWI_VERSION, '2.1.3 RC5') < 0 and PMWI_EDITION == 'paid' or defined('PMWI_FREE_VERSION') and version_compare(PMWI_FREE_VERSION, '1.2.1') <= 0 and PMWI_EDITION == 'free')) {
        ?>
		<div class="error"><p>
			<?php 
        printf(__('<b>%s Plugin</b>: Please update your WP All Import WooCommerce add-on to the latest version', 'pmwi_plugin'), PMWI_Plugin::getInstance()->getName());
        ?>
		</p></div>
		<?php 
        if (defined('PMWI_EDITION') and PMWI_EDITION == 'paid') {
            deactivate_plugins(PMWI_ROOT_DIR . '/wpai-woocommerce-add-on.php');
        } else {
            if (defined('PMWI_FREE_ROOT_DIR')) {
                deactivate_plugins(PMWI_FREE_ROOT_DIR . '/plugin.php');
            } else {
                deactivate_plugins(PMWI_ROOT_DIR . '/plugin.php');
            }
        }
    }
    // compare ACF add-on
    if (class_exists('PMAI_Plugin') and defined('PMAI_VERSION') and version_compare(PMAI_VERSION, '3.0.0-beta1') < 0 and PMAI_EDITION == 'paid') {
        ?>
		<div class="error"><p>
			<?php 
        printf(__('<b>%s Plugin</b>: Please update your WP All Import ACF add-on to the latest version', 'pmwi_plugin'), PMAI_Plugin::getInstance()->getName());
        ?>
		</p></div>
		<?php 
        if (defined('PMAI_EDITION') and PMAI_EDITION == 'paid') {
            deactivate_plugins(PMAI_ROOT_DIR . '/wpai-acf-add-on.php');
        }
    }
    // compare Linkcloak add-on
    if (class_exists('PMLCA_Plugin') and defined('PMLCA_VERSION') and version_compare(PMLCA_VERSION, '1.0.0-beta1') < 0 and PMLCA_EDITION == 'paid') {
        ?>
		<div class="error"><p>
			<?php 
        printf(__('<b>%s Plugin</b>: Please update your WP All Import Linkcloak add-on to the latest version', 'pmwi_plugin'), PMLCA_Plugin::getInstance()->getName());
        ?>
		</p></div>
		<?php 
        if (defined('PMLCA_EDITION') and PMLCA_EDITION == 'paid') {
            deactivate_plugins(PMLCA_ROOT_DIR . '/wpai-linkcloak-add-on.php');
        }
    }
    // compare User add-on
    if (class_exists('PMUI_Plugin') and defined('PMUI_VERSION') and version_compare(PMUI_VERSION, '1.0.0-beta1') < 0 and PMUI_EDITION == 'paid') {
        ?>
		<div class="error"><p>
			<?php 
        printf(__('<b>%s Plugin</b>: Please update your WP All Import User add-on to the latest version', 'pmwi_plugin'), PMUI_Plugin::getInstance()->getName());
        ?>
		</p></div>
		<?php 
        if (defined('PMUI_EDITION') and PMUI_EDITION == 'paid') {
            deactivate_plugins(PMUI_ROOT_DIR . '/wpai-user-add-on.php');
        }
    }
    // compare WPML add-on
    if (class_exists('PMLI_Plugin') and defined('PMLI_VERSION') and version_compare(PMLI_VERSION, '1.0.0-beta1') < 0 and PMLI_EDITION == 'paid') {
        ?>
		<div class="error"><p>
			<?php 
        printf(__('<b>%s Plugin</b>: The WPML Add-On Plugin is no longer compatible with this version of WP All Import - please contact support@wpallimport.com and we will supply the latest version of WP All Import that is compatible with the WPML Add-On.', 'pmwi_plugin'), PMLI_Plugin::getInstance()->getName());
        ?>
		</p></div>
		<?php 
        if (defined('PMLI_EDITION') and PMLI_EDITION == 'paid') {
            deactivate_plugins(PMLI_ROOT_DIR . '/plugin.php');
        }
    }
    $input = new PMXI_Input();
    $messages = $input->get('pmxi_nt', array());
    if ($messages) {
        is_array($messages) or $messages = array($messages);
        foreach ($messages as $type => $m) {
            in_array((string) $type, array('updated', 'error')) or $type = 'updated';
            ?>
			<div class="<?php 
            echo $type;
            ?>
"><p><?php 
            echo $m;
            ?>
</p></div>
			<?php 
        }
    }
    $warnings = $input->get('warnings', array());
    if ($warnings) {
        is_array($warnings) or $warnings = explode(',', $warnings);
        foreach ($warnings as $code) {
            switch ($code) {
                case 1:
                    $m = __('<strong>Warning:</strong> your title is blank.', 'wp_all_import_plugin');
                    break;
                case 2:
                    $m = __('<strong>Warning:</strong> your content is blank.', 'wp_all_import_plugin');
                    break;
                default:
                    $m = false;
                    break;
            }
            if ($m) {
                ?>
			<div class="error"><p><?php 
                echo $m;
                ?>
</p></div>
			<?php 
            }
        }
    }
    wp_all_import_addon_notifications();
}