Changeset 5935 for extensions/AMetaData/amd_aip.class.inc.php
- Timestamp:
- Apr 21, 2010, 9:27:51 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/AMetaData/amd_aip.class.inc.php
r5226 r5935 23 23 24 24 include_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');25 include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCTabSheet.class.inc.php'); 26 include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCAjax.class.inc.php'); 27 include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/genericjs.class.inc.php'); 28 28 29 29 … … 32 32 { 33 33 protected $tabsheet; 34 protected $ajax;35 34 36 35 /** … … 45 44 parent::__construct($prefixeTable, $filelocation); 46 45 47 $this->load _config();48 $this->init _events();46 $this->loadConfig(); 47 $this->initEvents(); 49 48 50 49 $this->tabsheet = new tabsheet(); 51 50 $this->tabsheet->add('metadata', 52 51 l10n('g003_metadata'), 53 $this-> page_link.'&fAMD_tabsheet=metadata');52 $this->getAdminLink().'&fAMD_tabsheet=metadata'); 54 53 $this->tabsheet->add('help', 55 54 l10n('g003_help'), 56 $this->page_link.'&fAMD_tabsheet=help'); 57 $this->ajax = new Ajax(); 55 $this->getAdminLink().'&fAMD_tabsheet=help'); 58 56 } 59 57 … … 91 89 $template->assign($this->tabsheet->get_titlename(), "[".$selected_tab['caption']."]"); 92 90 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; 94 92 $template_plugin["AMD_PAGE"] = $_REQUEST['fAMD_tabsheet']; 95 93 $template_plugin["PATH"] = AMD_PATH; … … 111 109 /** 112 110 * 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')); 117 117 } 118 118 … … 191 191 break; 192 192 } 193 $this->ajax->return_result($result);193 GPCAjax::returnResult($result); 194 194 } 195 195 } … … 511 511 $template->set_filename('body_page', dirname(__FILE__).'/admin/amd_metadata.tpl'); 512 512 513 $statTabsheet = new tabsheet('statTabsheet', $this->tabsheet->get_titlename());513 $statTabsheet = new GPCTabSheet('statTabsheet', $this->tabsheet->get_titlename(), 'tabsheet2 gcBorder', 'itab2'); 514 514 $statTabsheet->select($tab); 515 515 $statTabsheet->add('database', 516 516 l10n('g003_database'), 517 $this-> page_link.'&fAMD_tabsheet=metadata&fAMD_page=database');517 $this->getAdminLink().'&fAMD_tabsheet=metadata&fAMD_page=database'); 518 518 $statTabsheet->add('select', 519 519 l10n('g003_select'), 520 $this-> page_link.'&fAMD_tabsheet=metadata&fAMD_page=select');520 $this->getAdminLink().'&fAMD_tabsheet=metadata&fAMD_page=select'); 521 521 $statTabsheet->add('display', 522 522 l10n('g003_display'), 523 $this-> page_link.'&fAMD_tabsheet=metadata&fAMD_page=display');523 $this->getAdminLink().'&fAMD_tabsheet=metadata&fAMD_page=display'); 524 524 $statTabsheet->assign(); 525 525 … … 549 549 protected function displayMetaDataSelect() 550 550 { 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>";*/ 552 556 553 557 $template->set_filename('sheet_page', 554 dirname($this-> filelocation).'/admin/amd_metadata_select.tpl');558 dirname($this->getFileLocation()).'/admin/amd_metadata_select.tpl'); 555 559 556 560 $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'] 563 567 ); 564 568 … … 581 585 //$local_tpl = new Template(AMD_PATH."admin/", ""); 582 586 $template->set_filename('sheet_page', 583 dirname($this-> filelocation).'/admin/amd_metadata_display.tpl');587 dirname($this->getFileLocation()).'/admin/amd_metadata_display.tpl'); 584 588 585 589 586 590 $datas=array( 587 'urlRequest' => $this-> page_link,591 'urlRequest' => $this->getAdminLink(), 588 592 'selectedTags' => Array(), 589 593 'groups' => Array(), … … 688 692 689 693 $datas=array( 690 'urlRequest' => $this-> page_link,691 'NumberOfItemsPerRequest' => $this-> my_config['amd_NumberOfItemsPerRequest'],694 'urlRequest' => $this->getAdminLink(), 695 'NumberOfItemsPerRequest' => $this->config['amd_NumberOfItemsPerRequest'], 692 696 ); 693 697 … … 711 715 $template->set_filename('body_page', dirname(__FILE__).'/admin/amd_help.tpl'); 712 716 713 $statTabsheet = new tabsheet('statTabsheet', $this->tabsheet->get_titlename());717 $statTabsheet = new GPCTabSheet('statTabsheet', $this->tabsheet->get_titlename(), 'tabsheet2 gcBorder', 'itab2'); 714 718 $statTabsheet->select($tab); 715 719 $statTabsheet->add('exif', 716 720 l10n('g003_help_tab_exif'), 717 $this-> page_link.'&fAMD_tabsheet=help&fAMD_page=exif');721 $this->getAdminLink().'&fAMD_tabsheet=help&fAMD_page=exif'); 718 722 $statTabsheet->add('iptc', 719 723 l10n('g003_help_tab_iptc'), 720 $this-> page_link.'&fAMD_tabsheet=help&fAMD_page=iptc');724 $this->getAdminLink().'&fAMD_tabsheet=help&fAMD_page=iptc'); 721 725 $statTabsheet->add('xmp', 722 726 l10n('g003_help_tab_xmp'), 723 $this-> page_link.'&fAMD_tabsheet=help&fAMD_page=xmp');727 $this->getAdminLink().'&fAMD_tabsheet=help&fAMD_page=xmp'); 724 728 $statTabsheet->add('magic', 725 729 l10n('g003_help_tab_magic'), 726 $this-> page_link.'&fAMD_tabsheet=help&fAMD_page=magic');730 $this->getAdminLink().'&fAMD_tabsheet=help&fAMD_page=magic'); 727 731 $statTabsheet->assign(); 728 732 … … 811 815 812 816 $returned=""; 813 $this-> my_config['amd_NumberOfItemsPerRequest']=$nbOfItems;814 $this->save _config();817 $this->config['amd_NumberOfItemsPerRequest']=$nbOfItems; 818 $this->saveConfig(); 815 819 816 820 $sql="SELECT ait.imageId FROM ".$this->tables['images']." ait"; … … 982 986 private function ajax_amd_showStatsGetListTags($orderType, $filterType, $excludeUnusedTag, $selectedTagOnly) 983 987 { 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(); 989 995 990 996 $local_tpl = new Template(AMD_PATH."admin/", ""); 991 997 $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'); 993 999 994 1000 $numOfPictures=$this->getNumOfPictures(); … … 1058 1064 } 1059 1065 1066 $local_tpl->assign('themeconf', Array('name' => $template->get_themeconf('name'))); 1060 1067 $local_tpl->assign('datas', $datas); 1061 1068 … … 1070 1077 private function ajax_amd_showStatsGetListImages($tagId, $orderType) 1071 1078 { 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(); 1074 1083 1075 1084 $local_tpl = new Template(AMD_PATH."admin/", ""); 1076 1085 $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'); 1078 1087 1079 1088 … … 1113 1122 if(count($datas)>0) 1114 1123 { 1124 $local_tpl->assign('themeconf', Array('name' => $template->get_themeconf('name'))); 1115 1125 $local_tpl->assign('datas', $datas); 1116 1126 return($local_tpl->parse('body_page', true)); … … 1153 1163 { 1154 1164 $sql="DELETE FROM ".$this->tables['selected_tags']." st 1155 USING phpwebgallery_amd_used_tagsut1156 LEFT JOIN phpwebgallery_amd_selected_tagsst1165 USING ".$this->tables['used_tags']." ut 1166 LEFT JOIN ".$this->tables['selected_tags']." st 1157 1167 ON ut.tagID = st.tagId 1158 1168 WHERE ut.numId = $numId;"; … … 1174 1184 private function ajax_amd_groupGetTagList($id) 1175 1185 { 1186 global $template; 1187 1176 1188 if($id!="") 1177 1189 { … … 1213 1225 $local_tpl = new Template(AMD_PATH."admin/", ""); 1214 1226 $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'))); 1216 1229 $local_tpl->assign('datas', $datas); 1217 1230 return($local_tpl->parse('body_page', true)); … … 1299 1312 { 1300 1313 $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'); 1302 1315 $template->assign('datas', $datas); 1303 1316 $template->assign('group', $id); … … 1432 1445 $local_tpl = new Template(AMD_PATH."admin/", ""); 1433 1446 $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'); 1435 1448 1436 1449 $datasLang=array( … … 1490 1503 //$local_tpl = new Template(AMD_PATH."admin/", ""); 1491 1504 $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'); 1493 1506 1494 1507
Note: See TracChangeset
for help on using the changeset viewer.