Plugin Directory

Changeset 992038


Ignore:
Timestamp:
09/17/2014 04:27:38 PM (12 years ago)
Author:
vthierry
Message:

add an admin notice, if install problem

Location:
advanced-custom-fields-rendering/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • advanced-custom-fields-rendering/trunk/acf_rendering.php

    r972233 r992038  
    44 * Plugin URI: http://www-sop.inria.fr/science-participative/wp-plugins/acf_rendering.zip
    55 * Description: Adds rendering capabilities to Advanced Custom Fields. It allows to display the custom field values before or after the post page, and as HTML meta tags.
    6  * Version: v1.0
     6 * Version: v1.1
    77 * Author: Thierry.Vieville@inria.fr
    88 * Author URI: http://www-sop.inria.fr/members/Thierry.Vieville
     
    1515    register_activation_hook( __FILE__, array($this, 'install' ));
    1616    register_deactivation_hook( __FILE__, array($this, 'uninstall' ));
     17    add_action('admin_notices', array($this, 'install_failed_message'));
     18
    1719    add_action('wp_head', array($this, 'acf_rendering_html_header'));
    1820    add_filter('the_content', array($this, 'acf_rendering_html_body'), 20, 1); 
     21
    1922    // Only available in English and French at that time
    2023    load_textdomain('acf', plugin_dir_path( __FILE__ ). '/lang/acfr-' . get_locale() . '.mo');
    2124  }
    22 
    2325  // Installing/Uninstalling the advanced-custom-fields patches
    2426  function install() {
    25     copy(plugin_dir_path( __FILE__ ). '/acf-patch/field_group.php', plugin_dir_path( __FILE__ ). '../advanced-custom-fields/core/controllers/field_group.php');
    26     copy(plugin_dir_path( __FILE__ ). '/acf-patch/meta_box_rendering.php', plugin_dir_path( __FILE__ ). '../advanced-custom-fields/core/views/meta_box_rendering.php');
     27    $ok1 = copy(plugin_dir_path( __FILE__ ). '/acf-patch/field_group.php', plugin_dir_path( __FILE__ ). '../advanced-custom-fields/core/controllers/field_group.php');
     28    $ok2 = copy(plugin_dir_path( __FILE__ ). '/acf-patch/meta_box_rendering.php', plugin_dir_path( __FILE__ ). '../advanced-custom-fields/core/views/meta_box_rendering.php');
     29    update_option("acf_rendering_install_failed", !($ok1 && $ok2));
    2730  }
    2831  function uninstall() {
    2932    copy(plugin_dir_path( __FILE__ ). '/acf-patch/field_group.php.ori', plugin_dir_path( __FILE__ ). '../advanced-custom-fields/core/controllers/field_group.php');
    3033  }
    31 
     34  function install_failed_message() {
     35    if (get_option("acf_rendering_install_failed"))
     36      echo "<div class='error'><p>Sorry, your system forbids file update between plugins, <b>acf_rendering</b> will not work (desactivate the extension)</p></div>";
     37  }
     38  private $install_failed = false;
    3239  // Returns the HTML body meta-data rendering
    3340  function acf_rendering_html_body($content) {
  • advanced-custom-fields-rendering/trunk/readme.txt

    r968129 r992038  
    5656== Changelog ==
    5757
     58= 1.1 =
     59
     60Add an admin notice if the system forbids file update between plugins
     61
    5862= 1.0 =
    5963
     
    6165
    6266== Upgrade Notice ==
     67
     68= 1.1 =
     69
     70Add an admin notice if the system forbids file update between plugins
    6371
    6472= 1.0 =
Note: See TracChangeset for help on using the changeset viewer.