Ignore:
Timestamp:
Apr 21, 2010, 9:27:51 PM (14 years ago)
Author:
grum
Message:

Update plugin for Piwigo 2.1

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/AMetaData/amd_root.class.inc.php

    r5790 r5935  
    2121if (!defined('PHPWG_ROOT_PATH')) { die('Hacking attempt!'); }
    2222
    23 include_once(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/common_plugin.class.inc.php');
    24 include_once(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/css.class.inc.php');
     23include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/CommonPlugin.class.inc.php');
     24include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCCss.class.inc.php');
    2525
    2626include_once('amd_jpegmetadata.class.inc.php');
     
    2828include_once(JPEG_METADATA_DIR."TagDefinitions/XmpTags.class.php");
    2929
    30 class AMD_root extends common_plugin
     30class AMD_root extends CommonPlugin
    3131{
    3232  protected $css;   //the css object
     
    3636  {
    3737    global $user;
    38     $this->plugin_name="AMetaData";
    39     $this->plugin_name_files="amd";
     38    $this->setPluginName("AMetaData");
     39    $this->setPluginNameFiles("amd");
    4040    parent::__construct($prefixeTable, $filelocation);
    4141
    4242    $tableList=array('used_tags', 'images_tags', 'images', 'selected_tags', 'groups_names', 'groups');
    43     $this->set_tables_list($tableList);
    44 
    45     $this->css = new css(dirname($this->filelocation).'/'.$this->plugin_name_files.".css");
     43    $this->setTablesList($tableList);
     44
     45    $this->css = new GPCCss(dirname($this->getFileLocation()).'/'.$this->getPluginNameFiles().".css");
    4646    $this->jpegMD=new AMD_JpegMetaData();
    4747
     
    6464  --------------------------------------------------------------------------- */
    6565
    66   /* this function initialize var $my_config with default values */
    67   public function init_config()
    68   {
    69     $this->my_config=array(
     66  /* this function initialize var $config with default values */
     67  public function initConfig()
     68  {
     69    $this->config=array(
    7070      'amd_NumberOfItemsPerRequest' => 25,
    7171      'amd_GetListTags_OrderType' => "tag",
     
    7979  }
    8080
    81   public function load_config()
    82   {
    83     parent::load_config();
    84   }
    85 
    86   public function init_events()
    87   {
    88     parent::init_events();
     81  public function loadConfig()
     82  {
     83    parent::loadConfig();
     84  }
     85
     86  public function initEvents()
     87  {
     88    parent::initEvents();
    8989
    9090
    9191    if(!isset($_REQUEST['ajaxfct']) and
    92        $this->my_config['amd_FillDataBaseContinuously']=='y' and
    93        $this->my_config['amd_AllPicturesAreAnalyzed']=='n')
     92       $this->config['amd_FillDataBaseContinuously']=='y' and
     93       $this->config['amd_AllPicturesAreAnalyzed']=='n')
    9494    {
    9595      /* do analyze for a random picture only if :
     
    270270      while($row=mysql_fetch_assoc($result))
    271271      {
    272         $this->my_config['amd_AllPicturesAreAnalyzed']=($row['nb']==0)?'y':'n';
    273       }
    274 
    275     }
    276     $this->save_config();
     272        $this->config['amd_AllPicturesAreAnalyzed']=($row['nb']==0)?'y':'n';
     273      }
     274
     275    }
     276    $this->saveConfig();
    277277  }
    278278
Note: See TracChangeset for help on using the changeset viewer.