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_aip.class.inc.php

    r5226 r5935  
    2323
    2424include_once('amd_root.class.inc.php');
    25 include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php');
    26 include_once(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/ajax.class.inc.php');
    27 include_once(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/genericjs.class.inc.php');
     25include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCTabSheet.class.inc.php');
     26include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCAjax.class.inc.php');
     27include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/genericjs.class.inc.php');
    2828
    2929
     
    3232{
    3333  protected $tabsheet;
    34   protected $ajax;
    3534
    3635  /**
     
    4544    parent::__construct($prefixeTable, $filelocation);
    4645
    47     $this->load_config();
    48     $this->init_events();
     46    $this->loadConfig();
     47    $this->initEvents();
    4948
    5049    $this->tabsheet = new tabsheet();
    5150    $this->tabsheet->add('metadata',
    5251                          l10n('g003_metadata'),
    53                           $this->page_link.'&fAMD_tabsheet=metadata');
     52                          $this->getAdminLink().'&fAMD_tabsheet=metadata');
    5453    $this->tabsheet->add('help',
    5554                          l10n('g003_help'),
    56                           $this->page_link.'&fAMD_tabsheet=help');
    57     $this->ajax = new Ajax();
     55                          $this->getAdminLink().'&fAMD_tabsheet=help');
    5856  }
    5957
     
    9189    $template->assign($this->tabsheet->get_titlename(), "[".$selected_tab['caption']."]");
    9290
    93     $template_plugin["AMD_VERSION"] = "<i>".$this->plugin_name."</i> ".l10n('g003_version').AMD_VERSION;
     91    $template_plugin["AMD_VERSION"] = "<i>".$this->getPluginName()."</i> ".l10n('g003_version').AMD_VERSION;
    9492    $template_plugin["AMD_PAGE"] = $_REQUEST['fAMD_tabsheet'];
    9593    $template_plugin["PATH"] = AMD_PATH;
     
    111109  /**
    112110   * initialize events call for the plugin
    113    */
    114   public function init_events()
    115   {
    116     add_event_handler('loc_end_page_header', array(&$this->css, 'apply_CSS'));
     111   *
     112   * don't inherits from its parent => it's normal
     113   */
     114  public function initEvents()
     115  {
     116    add_event_handler('loc_end_page_header', array(&$this->css, 'applyCSS'));
    117117  }
    118118
     
    191191          break;
    192192      }
    193       $this->ajax->return_result($result);
     193      GPCAjax::returnResult($result);
    194194    }
    195195  }
     
    511511    $template->set_filename('body_page', dirname(__FILE__).'/admin/amd_metadata.tpl');
    512512
    513     $statTabsheet = new tabsheet('statTabsheet', $this->tabsheet->get_titlename());
     513    $statTabsheet = new GPCTabSheet('statTabsheet', $this->tabsheet->get_titlename(), 'tabsheet2 gcBorder', 'itab2');
    514514    $statTabsheet->select($tab);
    515515    $statTabsheet->add('database',
    516516                          l10n('g003_database'),
    517                           $this->page_link.'&amp;fAMD_tabsheet=metadata&amp;fAMD_page=database');
     517                          $this->getAdminLink().'&amp;fAMD_tabsheet=metadata&amp;fAMD_page=database');
    518518    $statTabsheet->add('select',
    519519                          l10n('g003_select'),
    520                           $this->page_link.'&amp;fAMD_tabsheet=metadata&amp;fAMD_page=select');
     520                          $this->getAdminLink().'&amp;fAMD_tabsheet=metadata&amp;fAMD_page=select');
    521521    $statTabsheet->add('display',
    522522                          l10n('g003_display'),
    523                           $this->page_link.'&amp;fAMD_tabsheet=metadata&amp;fAMD_page=display');
     523                          $this->getAdminLink().'&amp;fAMD_tabsheet=metadata&amp;fAMD_page=display');
    524524    $statTabsheet->assign();
    525525
     
    549549  protected function displayMetaDataSelect()
    550550  {
    551     global $template;
     551    global $template, $theme, $themes, $themeconf;
     552    /*echo "A".print_r($theme, true)."<br>";
     553    echo "B".print_r($themes, true)."<br>";
     554    echo "C".print_r($themeconf, true)."<br>";
     555    echo "D".print_r($template->smarty->[], true)."<br>";*/
    552556
    553557    $template->set_filename('sheet_page',
    554                   dirname($this->filelocation).'/admin/amd_metadata_select.tpl');
     558                  dirname($this->getFileLocation()).'/admin/amd_metadata_select.tpl');
    555559
    556560    $datas=array(
    557       'urlRequest' => $this->page_link,
    558       'config_GetListTags_OrderType' => $this->my_config['amd_GetListTags_OrderType'],
    559       'config_GetListTags_FilterType' => $this->my_config['amd_GetListTags_FilterType'],
    560       'config_GetListTags_ExcludeUnusedTag' => $this->my_config['amd_GetListTags_ExcludeUnusedTag'],
    561       'config_GetListTags_SelectedTagOnly' => $this->my_config['amd_GetListTags_SelectedTagOnly'],
    562       'config_GetListImages_OrderType' => $this->my_config['amd_GetListImages_OrderType']
     561      'urlRequest' => $this->getAdminLink(),
     562      'config_GetListTags_OrderType' => $this->config['amd_GetListTags_OrderType'],
     563      'config_GetListTags_FilterType' => $this->config['amd_GetListTags_FilterType'],
     564      'config_GetListTags_ExcludeUnusedTag' => $this->config['amd_GetListTags_ExcludeUnusedTag'],
     565      'config_GetListTags_SelectedTagOnly' => $this->config['amd_GetListTags_SelectedTagOnly'],
     566      'config_GetListImages_OrderType' => $this->config['amd_GetListImages_OrderType']
    563567    );
    564568
     
    581585    //$local_tpl = new Template(AMD_PATH."admin/", "");
    582586    $template->set_filename('sheet_page',
    583                   dirname($this->filelocation).'/admin/amd_metadata_display.tpl');
     587                  dirname($this->getFileLocation()).'/admin/amd_metadata_display.tpl');
    584588
    585589
    586590    $datas=array(
    587       'urlRequest' => $this->page_link,
     591      'urlRequest' => $this->getAdminLink(),
    588592      'selectedTags' => Array(),
    589593      'groups' => Array(),
     
    688692
    689693    $datas=array(
    690       'urlRequest' => $this->page_link,
    691       'NumberOfItemsPerRequest' => $this->my_config['amd_NumberOfItemsPerRequest'],
     694      'urlRequest' => $this->getAdminLink(),
     695      'NumberOfItemsPerRequest' => $this->config['amd_NumberOfItemsPerRequest'],
    692696    );
    693697
     
    711715    $template->set_filename('body_page', dirname(__FILE__).'/admin/amd_help.tpl');
    712716
    713     $statTabsheet = new tabsheet('statTabsheet', $this->tabsheet->get_titlename());
     717    $statTabsheet = new GPCTabSheet('statTabsheet', $this->tabsheet->get_titlename(), 'tabsheet2 gcBorder', 'itab2');
    714718    $statTabsheet->select($tab);
    715719    $statTabsheet->add('exif',
    716720                          l10n('g003_help_tab_exif'),
    717                           $this->page_link.'&amp;fAMD_tabsheet=help&amp;fAMD_page=exif');
     721                          $this->getAdminLink().'&amp;fAMD_tabsheet=help&amp;fAMD_page=exif');
    718722    $statTabsheet->add('iptc',
    719723                          l10n('g003_help_tab_iptc'),
    720                           $this->page_link.'&amp;fAMD_tabsheet=help&amp;fAMD_page=iptc');
     724                          $this->getAdminLink().'&amp;fAMD_tabsheet=help&amp;fAMD_page=iptc');
    721725    $statTabsheet->add('xmp',
    722726                          l10n('g003_help_tab_xmp'),
    723                           $this->page_link.'&amp;fAMD_tabsheet=help&amp;fAMD_page=xmp');
     727                          $this->getAdminLink().'&amp;fAMD_tabsheet=help&amp;fAMD_page=xmp');
    724728    $statTabsheet->add('magic',
    725729                          l10n('g003_help_tab_magic'),
    726                           $this->page_link.'&amp;fAMD_tabsheet=help&amp;fAMD_page=magic');
     730                          $this->getAdminLink().'&amp;fAMD_tabsheet=help&amp;fAMD_page=magic');
    727731    $statTabsheet->assign();
    728732
     
    811815
    812816    $returned="";
    813     $this->my_config['amd_NumberOfItemsPerRequest']=$nbOfItems;
    814     $this->save_config();
     817    $this->config['amd_NumberOfItemsPerRequest']=$nbOfItems;
     818    $this->saveConfig();
    815819
    816820    $sql="SELECT ait.imageId FROM ".$this->tables['images']." ait";
     
    982986  private function ajax_amd_showStatsGetListTags($orderType, $filterType, $excludeUnusedTag, $selectedTagOnly)
    983987  {
    984     $this->my_config['amd_GetListTags_OrderType'] = $orderType;
    985     $this->my_config['amd_GetListTags_FilterType'] = $filterType;
    986     $this->my_config['amd_GetListTags_ExcludeUnusedTag'] = $excludeUnusedTag;
    987     $this->my_config['amd_GetListTags_SelectedTagOnly'] = $selectedTagOnly;
    988     $this->save_config();
     988    global $template;
     989
     990    $this->config['amd_GetListTags_OrderType'] = $orderType;
     991    $this->config['amd_GetListTags_FilterType'] = $filterType;
     992    $this->config['amd_GetListTags_ExcludeUnusedTag'] = $excludeUnusedTag;
     993    $this->config['amd_GetListTags_SelectedTagOnly'] = $selectedTagOnly;
     994    $this->saveConfig();
    989995
    990996    $local_tpl = new Template(AMD_PATH."admin/", "");
    991997    $local_tpl->set_filename('body_page',
    992                   dirname($this->filelocation).'/admin/amd_metadata_select_iListTags.tpl');
     998                  dirname($this->getFileLocation()).'/admin/amd_metadata_select_iListTags.tpl');
    993999
    9941000    $numOfPictures=$this->getNumOfPictures();
     
    10581064    }
    10591065
     1066    $local_tpl->assign('themeconf', Array('name' => $template->get_themeconf('name')));
    10601067    $local_tpl->assign('datas', $datas);
    10611068
     
    10701077  private function ajax_amd_showStatsGetListImages($tagId, $orderType)
    10711078  {
    1072     $this->my_config['amd_GetListImages_OrderType'] = $orderType;
    1073     $this->save_config();
     1079    global $template;
     1080
     1081    $this->config['amd_GetListImages_OrderType'] = $orderType;
     1082    $this->saveConfig();
    10741083
    10751084    $local_tpl = new Template(AMD_PATH."admin/", "");
    10761085    $local_tpl->set_filename('body_page',
    1077                   dirname($this->filelocation).'/admin/amd_metadata_select_iListImages.tpl');
     1086                  dirname($this->getFileLocation()).'/admin/amd_metadata_select_iListImages.tpl');
    10781087
    10791088
     
    11131122    if(count($datas)>0)
    11141123    {
     1124      $local_tpl->assign('themeconf', Array('name' => $template->get_themeconf('name')));
    11151125      $local_tpl->assign('datas', $datas);
    11161126      return($local_tpl->parse('body_page', true));
     
    11531163    {
    11541164      $sql="DELETE FROM ".$this->tables['selected_tags']." st
    1155               USING phpwebgallery_amd_used_tags ut
    1156                 LEFT JOIN phpwebgallery_amd_selected_tags st
     1165              USING ".$this->tables['used_tags']." ut
     1166                LEFT JOIN ".$this->tables['selected_tags']." st
    11571167                  ON ut.tagID = st.tagId
    11581168              WHERE ut.numId = $numId;";
     
    11741184  private function ajax_amd_groupGetTagList($id)
    11751185  {
     1186    global $template;
     1187
    11761188    if($id!="")
    11771189    {
     
    12131225          $local_tpl = new Template(AMD_PATH."admin/", "");
    12141226          $local_tpl->set_filename('body_page',
    1215                         dirname($this->filelocation).'/admin/amd_metadata_display_groupListTagSelect.tpl');
     1227                        dirname($this->getFileLocation()).'/admin/amd_metadata_display_groupListTagSelect.tpl');
     1228          $local_tpl->assign('themeconf', Array('name' => $template->get_themeconf('name')));
    12161229          $local_tpl->assign('datas', $datas);
    12171230          return($local_tpl->parse('body_page', true));
     
    12991312        {
    13001313          $template->set_filename('list_page',
    1301                         dirname($this->filelocation).'/admin/amd_metadata_display_groupListTagOrder.tpl');
     1314                        dirname($this->getFileLocation()).'/admin/amd_metadata_display_groupListTagOrder.tpl');
    13021315          $template->assign('datas', $datas);
    13031316          $template->assign('group', $id);
     
    14321445    $local_tpl = new Template(AMD_PATH."admin/", "");
    14331446    $local_tpl->set_filename('body_page',
    1434                   dirname($this->filelocation).'/admin/amd_metadata_display_groupEdit.tpl');
     1447                  dirname($this->getFileLocation()).'/admin/amd_metadata_display_groupEdit.tpl');
    14351448
    14361449    $datasLang=array(
     
    14901503    //$local_tpl = new Template(AMD_PATH."admin/", "");
    14911504    $template->set_filename('group_list',
    1492                   dirname($this->filelocation).'/admin/amd_metadata_display_groupList.tpl');
     1505                  dirname($this->getFileLocation()).'/admin/amd_metadata_display_groupList.tpl');
    14931506
    14941507
Note: See TracChangeset for help on using the changeset viewer.