Changeset 5935
- Timestamp:
- Apr 21, 2010, 9:27:51 PM (14 years ago)
- Location:
- extensions/AMetaData
- Files:
-
- 1 added
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/AMetaData/admin/amd_admin.tpl
r4905 r5935 1 <div class="titrePage"> 2 <h2 style="position:absolute;right:0px;top:32px;height:auto;font-size:12px;font-weight:normal;">:: {$plugin.AMD_VERSION} ::</h2> 3 <h2>{'amd_title_page'|@translate} <span style="font-size:-1;font-weight:normal;">{$TABSHEET_TITLE}</span></h2> 4 5 </div> 1 <h2 style="float:right;top:-24px;position:relative;height:auto;font-size:12px;font-weight:normal;">{$plugin.AMD_VERSION}</h2> 6 2 7 3 {$AMD_BODY_PAGE} -
extensions/AMetaData/admin/amd_metadata.tpl
r4905 r5935 1 {known_script id="jquery.ui" src=$ROOT_URL|@cat:"template-common/lib/ui/ui.core.packed.js"} 2 {known_script id="jquery.ui" src=$ROOT_URL|@cat:"template-common/lib/ui/ui.core.packed.js"} 3 {known_script id="jquery.ui.sortable" src=$ROOT_URL|@cat:"template-common/lib/ui/ui.sortable.packed.js"} 4 {known_script id="jquery.ui.dialog" src=$ROOT_URL|@cat:"template-common/lib/ui/ui.dialog.packed.js"} 1 {known_script id="jquery.ui" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.core.packed.js"} 2 {known_script id="jquery.ui.sortable" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.sortable.packed.js"} 3 {known_script id="jquery.ui.dialog" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.dialog.packed.js"} 5 4 6 5 {$statTabsheet} 7 {$sheetContent} 6 <div id="pageTabContent"> 7 {$sheetContent} 8 </div> 8 9 -
extensions/AMetaData/admin/amd_metadata_database.tpl
r5191 r5935 1 {known_script id="jquery.ui" src=$ROOT_URL|@cat:"template-common/lib/ui/ui.core.packed.js"} 2 {known_script id="jquery.ui.slider" src=$ROOT_URL|@cat:"template-common/lib/ui/ui.slider.packed.js"} 3 {known_script id="jquery.ui.dialog" src=$ROOT_URL|@cat:"template-common/lib/ui/ui.dialog.packed.js"} 1 {known_script id="jquery.ui" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.core.packed.js"} 2 {known_script id="jquery.ui.slider" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.slider.packed.js"} 3 {known_script id="jquery.ui.dialog" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.dialog.packed.js"} 4 4 5 5 6 {literal} 6 <style>7 .ui-slider {8 width:350px;9 height:10px;10 border:1px solid;11 margin-left:10px;12 }13 .ui-slider-handle {14 width:12px;15 height:12px;16 position:relative;17 top:-2px;18 border:1px solid;19 background:#cccccc;20 }21 </style>22 23 7 <script type="text/javascript"> 24 8 … … 89 73 90 74 doAnalyze="<br><form id='iDialogProgress' class='formtable'>"+ 91 "<div id='iprogressbar_contener'>"+ 92 "<span id='iprogressbar_bg' style='width:0%;'> </span>"+ 93 "<span id='iprogressbar_fg'>0%</span>"+ 94 "</div>{/literal}{'g003_analyze_in_progress'|@translate}{literal}</form>"; 75 "<div id='iprogressbar_contener' class='gcBorderInput'>"+ 76 "<span id='iprogressbar_bg' class='gcBgInput' style='width:0%;'> </span>"+ 77 "<span id='iprogressbar_fg' class='gcLink'>0%</span>"+ 78 "</div><p>{/literal}{'g003_analyze_in_progress'|@translate}{literal}"+ 79 "<br><img src='./plugins/GrumPluginClasses/icons/processing.gif'>" 80 "</p></form>"; 95 81 96 82 $("#dialog") … … 102 88 height:120, 103 89 modal: true, 104 draggable:false, 90 draggable:true, 91 dialogClass: 'gcBgTabSheet gcBorder', 105 92 title: '{/literal}{"g003_updating_metadata"|@translate}{literal} ('+modeLabel+')', 106 overlay:107 {108 backgroundColor: '#000',109 opacity: 0.5,110 }111 93 } 112 94 ).html(doAnalyze); … … 184 166 height:120, 185 167 modal: true, 186 draggable:false, 168 draggable:true, 169 dialogClass: 'gcBgTabSheet gcBorder', 187 170 title: '{/literal}{"g003_updating_metadata"|@translate}{literal}', 188 overlay: 189 { 190 backgroundColor: '#000', 191 opacity: 0.5 192 }, 171 dialogClass: 'gcBgTabSheet gcBorder', 193 172 open: function(event, ui) 194 173 { … … 205 184 } 206 185 } 207 ).html("<br>{/literal}{'g003_analyze_is_finished'|@translate}{literal} ("+displayTime(timeElapsed/1000)+")"); 186 ) 187 .html("<br>{/literal}{'g003_analyze_is_finished'|@translate}{literal} ("+displayTime(timeElapsed/1000)+")"); 208 188 209 189 getStatus(); -
extensions/AMetaData/admin/amd_metadata_display.tpl
r5088 r5935 2 2 3 3 {literal} 4 <style> 5 .ui-widget-overlay { 6 background:#000000; 7 opacity:0.88; 8 filter:alpha(opacity:88); 9 } 10 </style> 11 4 12 <script type="text/javascript"> 5 13 … … 159 167 modal: true, 160 168 draggable:true, 169 dialogClass: 'gcBgTabSheet gcBorder', 161 170 title: "{/literal}{'g003_deleting_a_group'|@translate}{literal}", 162 overlay:163 {164 backgroundColor: '#000',165 opacity: 0.5166 },167 171 buttons: 168 172 { … … 222 226 modal: true, 223 227 draggable:true, 228 dialogClass: 'gcBgTabSheet gcBorder', 224 229 title: dialogTitle, 225 overlay:226 {227 backgroundColor: '#000',228 opacity: 0.5229 },230 230 buttons: 231 231 { … … 294 294 modal: true, 295 295 draggable:true, 296 dialogClass: 'gcBgTabSheet gcBorder', 296 297 title: '{/literal}{"g003_add_delete_tags"|@translate}{literal}', 297 overlay:298 {299 backgroundColor: '#000',300 opacity: 0.5301 },302 298 open: function(event, ui) 303 299 { … … 330 326 } 331 327 ).responseText; 328 332 329 $(this).dialog('destroy').html("").get(0).removeAttribute('style'); 333 330 loadGroupTags(groupId); … … 341 338 } 342 339 ) 343 .html( 344 $.ajax( 345 { 346 type: "POST", 347 url: "{/literal}{$datas.urlRequest}{literal}", 348 async: false, 349 data: { ajaxfct:"groupGetTagList", id:groupId } 350 } 351 ).responseText 340 .html("<br>{/literal}{'g003_loading'|@translate}{literal}<br><img src='./plugins/GrumPluginClasses/icons/processing.gif'>"); 341 342 $.ajax( 343 { 344 type: "POST", 345 url: "{/literal}{$datas.urlRequest}{literal}", 346 async: true, 347 data: { ajaxfct:"groupGetTagList", id:groupId }, 348 success: 349 function(msg) 350 { 351 $("#dialog").html(msg); 352 } 353 } 352 354 ); 353 355 } -
extensions/AMetaData/admin/amd_metadata_display_groupList.tpl
r4905 r5935 1 1 {foreach from=$datas.groups key=name item=data} 2 <li id="iGroupId{$data.id}" class="groupItems ">2 <li id="iGroupId{$data.id}" class="groupItems gcBgPage"> 3 3 <img src="{$themeconf.admin_icon_dir}/cat_move.png" class="button drag_button" alt="{'Drag to re-order'|@translate}" title="{'Drag to re-order'|@translate}"/> 4 4 <input type="hidden" id="iGroupName{$data.id}" value="{$data.name}"> -
extensions/AMetaData/admin/amd_metadata_display_groupListTagOrder.tpl
r4905 r5935 1 1 {foreach from=$datas key=name item=data} 2 <li id="g{$group}t{$data.numId}" >2 <li id="g{$group}t{$data.numId}" class="gcBgTabSheet"> 3 3 <table class="tagListOrderItem"> 4 4 <tr> … … 8 8 <td style="width:35px;text-align:right;">{$data.nbItems}</td> 9 9 <td style="width:50px;text-align:right;">{$data.pct}%</td> 10 <td style="width:104px;"><span class="pctBar " style="display:inline-block;width:{$data.pct}px;"></td>10 <td style="width:104px;"><span class="pctBar{$themeconf.name}" style="display:inline-block;width:{$data.pct}px;"></td> 11 11 </tr> 12 12 </table> -
extensions/AMetaData/admin/amd_metadata_display_groupListTagSelect.tpl
r4905 r5935 9 9 10 10 11 <table class="littlefont listTags " style="width:100%;">11 <table class="littlefont listTags {$themeconf.name}" style="width:100%;"> 12 12 {foreach from=$datas key=name item=data} 13 13 <tr> -
extensions/AMetaData/admin/amd_metadata_select.tpl
r5226 r5935 1 1 {literal} 2 <style> 3 .ui-widget-overlay { 4 background:#000000; 5 opacity:0.88; 6 filter:alpha(opacity:88); 7 } 8 </style> 9 10 2 11 <script type="text/javascript"> 3 12 … … 16 25 height:computedHeight, 17 26 modal: true, 18 draggable:false, 27 draggable:true, 28 dialogClass: 'gcBgTabSheet gcBorder', 19 29 title: '{/literal}{"g003_metadata_detail"|@translate}{literal}', 20 overlay:21 {22 backgroundColor: '#000',23 opacity: 0.524 },25 30 open: function(event, ui) 26 31 { … … 43 48 function loadTagList() 44 49 { 45 $("body").css("cursor", "wait");46 50 order=$('#iSelectOrderTagList').val(); 47 51 filter=$("#iSelectFilterTagList").val(); … … 51 55 displayTagListOrder(); 52 56 53 $("#iListTags").html( 54 $.ajax({ 57 $("#iListTags").html("<br>{/literal}{'g003_loading'|@translate}{literal}<br><img src='./plugins/GrumPluginClasses/icons/processing.gif'>"); 58 59 $.ajax( 60 { 55 61 type: "POST", 56 62 url: "{/literal}{$datas.urlRequest}{literal}", 57 async: false, 58 data: { ajaxfct:"showStatsGetListTags", orderType:order, filterType:filter, excludeUnusedTag:unusedTag, selectedTagOnly:selectedOnly } 59 }).responseText 60 ); 61 $("#iListTagsNb").html( 62 "{/literal}{'g003_number_of_filtered_metadata'|@translate}{literal} "+$("#iListTags table tr").length 63 ); 64 65 //onclick="updateTagSelect('iNumId{$data.numId}', '')" 66 $("input.cbiListTags") 67 .bind('click', 68 function(event) 69 { 70 event.stopPropagation(); 71 updateTagSelect($(this).get(0).id, ''); 72 } 73 ); 74 75 $("a.cbiListTags") 76 .bind('click', 77 function(event) 78 { 79 event.stopPropagation(); 80 loadTagDetail($(this).get(0).id.substr(7)); 81 } 82 ); 83 84 85 86 87 $("body").css("cursor", "default"); 63 async: true, 64 data: { ajaxfct:"showStatsGetListTags", orderType:order, filterType:filter, excludeUnusedTag:unusedTag, selectedTagOnly:selectedOnly }, 65 success: 66 function(msg) 67 { 68 $("#iListTags").html(msg); 69 70 $("#iListTagsNb").html( 71 "{/literal}{'g003_number_of_filtered_metadata'|@translate}{literal} "+$("#iListTags table tr").length 72 ); 73 74 //onclick="updateTagSelect('iNumId{$data.numId}', '')" 75 $("input.cbiListTags") 76 .bind('click', 77 function(event) 78 { 79 event.stopPropagation(); 80 updateTagSelect($(this).get(0).id, ''); 81 } 82 ); 83 84 $("a.cbiListTags") 85 .bind('click', 86 function(event) 87 { 88 event.stopPropagation(); 89 loadTagDetail($(this).get(0).id.substr(7)); 90 } 91 ); 92 } 93 } 94 ); 95 88 96 } 89 97 … … 94 102 globalTagId=tag; 95 103 order=$('#iSelectOrderImageList').val(); 96 $("#iListImages").html("<br>{/literal}{'g003_loading'|@translate}{literal} ");104 $("#iListImages").html("<br>{/literal}{'g003_loading'|@translate}{literal}<br><img src='./plugins/GrumPluginClasses/icons/processing.gif'>"); 97 105 $("#iHeaderListImagesTagName").html("["+tag+"]"); 98 106 … … 117 125 function updateTagSelect(numId, mode) 118 126 { 119 $("body").css("cursor", "wait");120 127 121 128 if(mode=='switch') … … 134 141 }).responseText 135 142 ); 136 $("body").css("cursor", "default"); 143 137 144 } 138 145 … … 168 175 { 169 176 // by label 177 /* not fully implemented 170 178 $("#iHLTOrderTag").html(""); 171 179 $("#iHLTOrderLabel").html("↑"); 172 180 $("#iHLTOrderNum").html(""); 181 */ 173 182 } 174 183 } … … 224 233 <tr> 225 234 <th style="width:35%;min-width:340px;"><span id="iHLTOrderTag"></span><a onclick="sortTagList('tag');">{'g003_TagId'|@translate}</a></th> 226 <th><span id="iHLTOrderLabel"></span><a onclick="sortTagList('label');">{'g003_TagLabel'|@translate}</a></th> 235 {* <th><span id="iHLTOrderLabel"></span><a onclick="sortTagList('label');">{'g003_TagLabel'|@translate}</a></th> *} 236 <th>{'g003_TagLabel'|@translate}</th> 227 237 <th width="80px"><span id="iHLTOrderNum"></span><a onclick="sortTagList('num');">{'g003_NumOfImage'|@translate}</a></th> 228 238 <th width="40px">{'g003_Pct'|@translate}</th> … … 230 240 </tr> 231 241 </table> 232 <div id='iListTags' >242 <div id='iListTags' class="{$themeconf.name}"> 233 243 </div> 234 244 <div id="iListTagsNb"></div> … … 249 259 </table> 250 260 251 <div id='iListImages' >261 <div id='iListImages' class="{$themeconf.name}"> 252 262 <div style="width:100%;text-align:center;padding-top:20px;">{'g003_no_items_selected'|@translate}</div> 253 263 </div> -
extensions/AMetaData/admin/amd_metadata_select_iListImages.tpl
r4905 r5935 6 6 <td width="40px">{$data.pct}</td> 7 7 <td width="110px"> 8 <div class="pctBar " style="width:{$data.pct}px;"></div>8 <div class="pctBar{$themeconf.name}" style="width:{$data.pct}px;"></div> 9 9 </td> 10 10 -
extensions/AMetaData/admin/amd_metadata_select_iListTags.tpl
r5088 r5935 10 10 <td width="40px">{$data.pct}</td> 11 11 <td width="110px"> 12 <div class="pctBar " style="width:{$data.pct}px;"></div>12 <div class="pctBar{$themeconf.name}" style="width:{$data.pct}px;"></div> 13 13 </td> 14 14 </tr> -
extensions/AMetaData/admin/plugin_admin.php
r4905 r5935 28 28 $main_plugin_object = get_plugin_data($plugin_id); 29 29 30 $plugin_ai = new AMD_AIP($prefixeTable, $main_plugin_object->get _filelocation());30 $plugin_ai = new AMD_AIP($prefixeTable, $main_plugin_object->getFileLocation()); 31 31 $plugin_ai->manage(); 32 32 -
extensions/AMetaData/amd.css
r5191 r5935 6 6 table.littlefont th { padding:3px; text-align:left;} 7 7 table.littlefont td { padding:1px 3px; } 8 #iprogressbar_contener { border:1px solid #606060; margin:0px; padding:0px; display:block; height:20px;}9 #iprogressbar_bg { background:#606060;display:block; z-index:100; position:relative; height:20px; }10 #iprogressbar_fg { color:#FF3363;width:100%; text-align:center; display: block; z-index:200; position:relative; top:-18px; }8 #iprogressbar_contener { margin:0px; padding:0px; display:block; height:20px; border-width:1px; border-style:solid;} 9 #iprogressbar_bg { display:block; z-index:100; position:relative; height:20px; } 10 #iprogressbar_fg { width:100%; text-align:center; display: block; z-index:200; position:relative; top:-18px; } 11 11 #iHeaderListTags { width:100%; border:1px solid; border-collapse: collapse; margin-top:3px; } 12 #iListTags { width:100%; border:1px solid; height:280px; border-top:0px; overflow:auto; }12 #iListTags { width:100%; border:1px solid; height:280px; border-top:0px; overflow:auto; position:relative; left:-1px;} 13 13 #iListImages { width:100%; border-bottom:1px solid; overflow:auto;} 14 14 #iListTagsNb, #iListImagesNb { width:99%; text-align:right; margin-bottom:8px; padding:2px; font-size:80%; } 15 15 #iListTags table, #iListImages table, table.listTags { width:100%; text-align:left; border-collapse: collapse; } 16 #iListTags table tr:hover { cursor:pointer; background:#303030; } 17 #iListImages table tr:hover, table.listTags tr:hover { background:#303030; cursor:default; } 16 #iListTags.roma table tr:hover { cursor:pointer; background:#303030; } 17 #iListImages.roma table tr:hover, table.roma tr:hover { background:#303030; cursor:default; } 18 #iListTags.clear table tr:hover { cursor:pointer; color: #D54E21; background:#dbe8f3; } 19 #iListImages.clear table tr:hover, table.clear tr:hover { color: #D54E21; background:#dbe8f3; cursor:default; } 18 20 #iHeaderListImages { width:100%; border-bottom:1px solid; } 19 21 .nfo ul { margin-top:0em; margin-bottom:1em; } … … 21 23 .warning p, .nfo p { margin-top:0.5em; margin-bottom:0em; } 22 24 .warning ul { margin-top:0em; margin-bottom:0.5em; } 23 .pctBar { height:6px; background:#FF7700; } 25 .pctBarroma { height:6px; background:#FF7700; } 26 .pctBarclear { height:6px; background:#005E89; } 24 27 li.groupItems { border:1px solid #666666; margin-bottom:5px; padding:0 5px; width:90%; cursor:move; padding:4px; } 25 28 div.addGroup { padding-left:40px; text-align:left; } 26 29 #iGroups { list-style: none; } 27 .ui-dialog { background: #222222; border:2px solid #FF3363; } 30 31 .ui-dialog { border-width:1px; border-style:solid; } 28 32 .ui-dialog-buttonpane { padding:4px; } 29 33 .ui-dialog-buttonpane button { margin-right:8px; } 30 .ui-dialog-titlebar { background:#111111;font-weight:bold; }34 .ui-dialog-titlebar { font-weight:bold; } 31 35 .ui-dialog-title-dialog { text-align: left; } 32 36 .ui-dialog-titlebar-close { float: right; } … … 34 38 .ui-dialog-container { } 35 39 .ui-dialog-titlebar-close { display:none; } 40 41 .ui-widget-overlay { background:#000000; opacity:0.5; filter:alpha(opacity:50); position:absolute; top:0px; left:0px; } 42 36 43 .tagListOrder { list-style: none; padding:0px; margin-right:8px; margin-left:35px; } 37 .tagListOrder li { border:none; background:#333333;padding:1px; margin-bottom:2px; width:100%; }44 .tagListOrder li { border:none; padding:1px; margin-bottom:2px; width:100%; } 38 45 .groupTags { padding-top:8px; } 39 46 .editGroupListButton { margin-left:8px; position:absolute; z-index:1000; } 40 47 table.tagListOrderItem { width:100%; border-collapse:collapse; } 41 48 .dialogForm { text-align:left; margin:8px; } 42 #ianalyzestatus { background: #333333;margin:8px; padding:8px; }49 #ianalyzestatus { margin:8px; padding:8px; } 43 50 #ianalyzestatus ul { margin:0px; padding:0 0 0 20px; } 44 51 #iamd_nb_item_per_request_display { display:inline-block; width:70px; } … … 48 55 #helpBody ul { padding:0px; margin:0px; } 49 56 #helpBody li { margin-left:30px; } 57 #iDialogProgress p { text-align: center; margin-top: 8px; margin-bottom: 0pt; } 50 58 59 .tabsheet2 { 60 display:table; 61 font-family:verdana,arial,helvetica,sans-serif; font-size:8px; 62 list-style-image:none; padding: 0 0 0 10px; position:relative; text-decoration:none; 63 white-space:nowrap; margin: 0 0 0 -6px;top:-21px;border-bottom:1px solid; 64 width:100%; 65 } 66 .tabsheet2 li { float:left; margin:0 0 0 0; overflow:hidden; text-align:right; border-width:1px; position:relative; } 67 .tabsheet2 a { 68 display:block; font-size:11px; border:0; 69 font-weight:bold; overflow:hidden; padding:2px 6px; 70 text-align:right; text-decoration:none; margin: 0; } 71 .tabsheet2 a:first-letter { text-transform:capitalize; } 72 73 .tabsheet2 li:hover, .tabsheet2 li.selected_tab { 74 padding-top:6px; border-bottom:5px solid; 75 } 76 /* .tabsheet a:hover */ 77 .tabsheet2 a span { display:block; font-size:10px; margin-right:2px; padding:0 3px 0 1px; } 78 -
extensions/AMetaData/amd_aim.class.inc.php
r4905 r5935 34 34 initialize events call for the plugin 35 35 */ 36 function init _events()36 function initEvents() 37 37 { 38 parent::init _events();39 add_event_handler('get_admin_plugin_menu_links', array(&$this, 'plugin _admin_menu') );38 parent::initEvents(); 39 add_event_handler('get_admin_plugin_menu_links', array(&$this, 'pluginAdminMenu') ); 40 40 } 41 41 -
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 -
extensions/AMetaData/amd_install.class.inc.php
r5790 r5935 30 30 { 31 31 parent::__construct($prefixeTable, $filelocation); 32 $this->tablef= new manage_tables($this->tables);32 $this->tablef= new GPCTables($this->tables); 33 33 } 34 34 … … 46 46 { 47 47 global $user, $lang; 48 49 $this->initConfig(); 50 $this->loadConfig(); 51 $this->config['installed']=AMD_VERSION2; 52 $this->saveConfig(); 48 53 49 54 $tables_def=array( … … 90 95 //$table_def array 91 96 $tables_def = create_table_add_character_set($tables_def); 92 $result=$this->tablef->create _tables($tables_def);97 $result=$this->tablef->create($tables_def); 93 98 unset($tables_def); 94 99 … … 121 126 public function uninstall() 122 127 { 123 $this->delete _config();124 $this->tablef->drop _tables();128 $this->deleteConfig(); 129 $this->tablef->drop(); 125 130 } 126 131 … … 142 147 foreach(AMD_JpegMetaData::getTagList(Array('filter' => AMD_JpegMetaData::TAGFILTER_IMPLEMENTED, 'xmp' => true, 'maker' => true, 'iptc' => true)) as $key => $val) 143 148 { 144 $sql="INSERT INTO ".$this->tables['used_tags']." VALUES('', '".$key."', '".(($val['translatable'])?'y':'n')."', '".$val['name']."', 0, '". L10n::get($val['name'])."');";149 $sql="INSERT INTO ".$this->tables['used_tags']." VALUES('', '".$key."', '".(($val['translatable'])?'y':'n')."', '".$val['name']."', 0, '".addslashes(L10n::get($val['name']))."');"; 145 150 pwg_query($sql); 146 151 } … … 154 159 LEFT JOIN ".IMAGES_TABLE." ti ON ti.id = tc.element_id 155 160 WHERE tc.user_id = ".$user['id']." 161 AND ti.id IS NOT NULL 156 162 ORDER BY RAND() LIMIT 25;"; 157 163 $result=pwg_query($sql); … … 207 213 } 208 214 209 $this->init_config(); 210 $this->load_config(); 211 $this->save_config(); 215 $this->initConfig(); 216 $this->loadConfig(); 217 $this->config['installed']=AMD_VERSION2; //update the installed release number 218 $this->saveConfig(); 212 219 } 213 220 -
extensions/AMetaData/amd_pip.class.inc.php
r5790 r5935 22 22 23 23 include_once('amd_root.class.inc.php'); 24 include_once(PHPWG_PLUGINS_PATH.' grum_plugins_classes-2/ajax.class.inc.php');24 include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCAjax.class.inc.php'); 25 25 26 26 class AMD_PIP extends AMD_root 27 27 { 28 protected $ajax;29 30 28 function AMD_PIP($prefixeTable, $filelocation) 31 29 { 32 30 parent::__construct($prefixeTable, $filelocation); 33 $this->ajax = new Ajax();34 31 35 $this->load _config();36 $this->init _events();32 $this->loadConfig(); 33 $this->initEvents(); 37 34 } 38 35 … … 46 43 initialize events call for the plugin 47 44 */ 48 public function init _events()45 public function initEvents() 49 46 { 50 parent::init _events();47 parent::initEvents(); 51 48 add_event_handler('loc_begin_picture', array(&$this, 'loadMetadata')); 52 49 } … … 162 159 163 160 if($analyzed=='n' and 164 $this-> my_config['amd_FillDataBaseContinuously']=='y' and165 $this-> my_config['amd_AllPicturesAreAnalyzed']=='n')161 $this->config['amd_FillDataBaseContinuously']=='y' and 162 $this->config['amd_AllPicturesAreAnalyzed']=='n') 166 163 { 167 164 /* if picture is not analyzed, do analyze -
extensions/AMetaData/amd_root.class.inc.php
r5790 r5935 21 21 if (!defined('PHPWG_ROOT_PATH')) { die('Hacking attempt!'); } 22 22 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');23 include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/CommonPlugin.class.inc.php'); 24 include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCCss.class.inc.php'); 25 25 26 26 include_once('amd_jpegmetadata.class.inc.php'); … … 28 28 include_once(JPEG_METADATA_DIR."TagDefinitions/XmpTags.class.php"); 29 29 30 class AMD_root extends common_plugin30 class AMD_root extends CommonPlugin 31 31 { 32 32 protected $css; //the css object … … 36 36 { 37 37 global $user; 38 $this-> plugin_name="AMetaData";39 $this-> plugin_name_files="amd";38 $this->setPluginName("AMetaData"); 39 $this->setPluginNameFiles("amd"); 40 40 parent::__construct($prefixeTable, $filelocation); 41 41 42 42 $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"); 46 46 $this->jpegMD=new AMD_JpegMetaData(); 47 47 … … 64 64 --------------------------------------------------------------------------- */ 65 65 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( 70 70 'amd_NumberOfItemsPerRequest' => 25, 71 71 'amd_GetListTags_OrderType' => "tag", … … 79 79 } 80 80 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(); 89 89 90 90 91 91 if(!isset($_REQUEST['ajaxfct']) and 92 $this-> my_config['amd_FillDataBaseContinuously']=='y' and93 $this-> my_config['amd_AllPicturesAreAnalyzed']=='n')92 $this->config['amd_FillDataBaseContinuously']=='y' and 93 $this->config['amd_AllPicturesAreAnalyzed']=='n') 94 94 { 95 95 /* do analyze for a random picture only if : … … 270 270 while($row=mysql_fetch_assoc($result)) 271 271 { 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(); 277 277 } 278 278 -
extensions/AMetaData/main.inc.php
r5791 r5935 2 2 /* 3 3 Plugin Name: Advanced MetaData 4 Version: 0. 3b4 Version: 0.4b 5 5 Description: An advanced metadata manager 6 Plugin URI: http://p hpwebgallery.net/ext/extension_view.php?eid=3647 Author: Piwigo team8 Author URI: http://p iwigo.org6 Plugin URI: http://piwigo.org/ext/extension_view.php?eid=364 7 Author: grum@piwigo.org 8 Author URI: http://photos.grum.fr/ 9 9 */ 10 10 … … 26 26 | 0.2b | 2010/03/23 | * beta release 27 27 | 0.3b | 2010/04/11 | * beta release 28 | 0.4b | 2010/04/18 | * beta release for Piwigo 2.1 28 29 | | | 29 30 | | | … … 46 47 47 48 // pour faciliter le debug - make debug easier :o) 48 ini_set('error_reporting', E_ALL);49 ini_set('display_errors', true);49 // ini_set('error_reporting', E_ALL); 50 // ini_set('display_errors', true); 50 51 51 52 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); … … 54 55 define('AMD_PATH' , PHPWG_PLUGINS_PATH . AMD_DIR . '/'); 55 56 56 define('AMD_VERSION' , '0.3b'); //=> ne pas oublier la version dans l'entête !!57 include_once('amd_version.inc.php'); // => Don't forget to update this file !! 57 58 58 59 global $prefixeTable, $page; … … 64 65 include_once("amd_aim.class.inc.php"); 65 66 $obj = new AMD_AIM($prefixeTable, __FILE__); 66 $obj->init _events();67 $obj->initEvents(); 67 68 set_plugin_data($plugin['id'], $obj); 68 69 } -
extensions/AMetaData/maintain.inc.php
r4905 r5935 20 20 //ini_set('display_errors', true); 21 21 22 include_once('amd_version.inc.php'); // => Don't forget to update this file !! 23 24 22 25 defined('AMD_DIR') || define('AMD_DIR' , basename(dirname(__FILE__))); 23 26 defined('AMD_PATH') || define('AMD_PATH' , PHPWG_PLUGINS_PATH . AMD_DIR . '/'); 24 @include_once(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/tables.class.inc.php'); 27 include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCCore.class.inc.php'); 28 include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCTables.class.inc.php'); 25 29 26 30 27 global $gpc_installed, $ lang; //needed for plugin manager compatibility31 global $gpc_installed, $gpcNeeded, $lang; //needed for plugin manager compatibility 28 32 29 33 /* ----------------------------------------------------------------------------- 30 AMD needs the Grum Plugin Classe31 ----------------------------------------------------------------------------- */34 * AMD needs the Grum Plugin Classe 35 * -------------------------------------------------------------------------- */ 32 36 $gpc_installed=false; 33 if(file_exists(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/common_plugin.class.inc.php')) 37 $gpcNeeded="3.0.0"; 38 if(file_exists(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/CommonPlugin.class.inc.php')) 34 39 { 35 @include_once(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/main.inc.php'); 36 // need GPC release greater or equal than 2.0.4 37 38 if(checkGPCRelease(2,0,4)) 40 @include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/CommonPlugin.class.inc.php'); 41 // need GPC release greater or equal than 3.0.0 42 if(CommonPlugin::checkGPCRelease(3,0,0)) 39 43 { 40 44 @include_once("amd_install.class.inc.php"); … … 45 49 function gpcMsgError(&$errors) 46 50 { 47 array_push($errors, sprintf(l10n('Grum Plugin Classes is not installed (release >= %s)'), "2.0.4")); 51 global $gpcNeeded; 52 $msg=sprintf(l10n('To install this plugin, you need to install Grum Plugin Classes %s before'), $gpcNeeded); 53 if(is_array($errors)) 54 { 55 array_push($errors, $msg); 56 } 57 else 58 { 59 $errors=Array($msg); 60 } 48 61 } 49 62 // ----------------------------------------------------------------------------- … … 55 68 function plugin_install($plugin_id, $plugin_version, &$errors) 56 69 { 57 global $prefixeTable, $gpc_installed ;70 global $prefixeTable, $gpc_installed, $gpcNeeded; 58 71 if($gpc_installed) 59 72 { 60 73 $amd=new AMD_install($prefixeTable, __FILE__); 61 74 $result=$amd->install(); 75 GPCCore::register($amd->getPluginName(), AMD_VERSION, $gpcNeeded); 62 76 } 63 77 else … … 81 95 function plugin_uninstall($plugin_id) 82 96 { 83 global $prefixeTable, $gpc_installed ;97 global $prefixeTable, $gpc_installed, $gpcNeeded; 84 98 if($gpc_installed) 85 99 { 86 100 $amd=new AMD_install($prefixeTable, __FILE__); 87 101 $result=$amd->uninstall(); 102 GPCCore::unregister($amd->getPluginName()); 88 103 } 89 104 else
Note: See TracChangeset
for help on using the changeset viewer.