Changeset 5959 for extensions/AMetaData


Ignore:
Timestamp:
Apr 25, 2010, 1:22:40 AM (14 years ago)
Author:
grum
Message:

Some changes on release 0.4b

Location:
extensions/AMetaData
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • extensions/AMetaData/admin/amd_help.tpl

    r5191 r5959  
    11{$statTabsheet}
    22
    3 <h3>{'g003_metadata'|@translate}&nbsp;{$data.title}</h3>
     3<h2>{'g003_metadata'|@translate}&nbsp;{$data.title}</h2>
    44
    55<div id="helpBody">
  • extensions/AMetaData/admin/amd_metadata_database.tpl

    r5935 r5959  
    11{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"}
    32{known_script id="jquery.ui.dialog" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.dialog.packed.js"}
    4 
    53
    64{literal}
    75<script type="text/javascript">
     6var processAnalyze = {
     7      step:0,
     8      lists:new Array(),
     9      timeStart:0,
     10      timeEnd:0
     11    }
    812
    913  function init()
     
    4549  function doAnalyze()
    4650  {
    47     $("body").css("cursor", "wait");
    48 
    4951    mode="all";
    5052    modeLabel="";
     
    7274
    7375
    74     doAnalyze="<br><form id='iDialogProgress' class='formtable'>"+
     76    doAnalyzeDialog="<br><form id='iDialogProgress' class='formtable'>"+
    7577      "<div id='iprogressbar_contener' class='gcBorderInput'>"+
    7678      "<span id='iprogressbar_bg' class='gcBgInput' style='width:0%;'>&nbsp;</span>"+
     
    9294        title: '{/literal}{"g003_updating_metadata"|@translate}{literal}&nbsp;('+modeLabel+')',
    9395      }
    94     ).html(doAnalyze);
     96    ).html(doAnalyzeDialog);
    9597
    9698    NumberOfItemsPerRequest=$("#iamd_NumberOfItemsPerRequest").val();
     
    100102        type: "POST",
    101103        url: "{/literal}{$datas.urlRequest}{literal}",
    102         async: false,
     104        async: true,
    103105        data: { ajaxfct:"makeStatsGetList", selectMode:mode, numOfItems:NumberOfItemsPerRequest },
    104106        success: function(msg)
    105107          {
    106             doStep_getList(msg);
     108            processAnalyze.step=0;
     109            processAnalyze.lists=msg.split(";");
     110            processAnalyze.timeStart=new Date();
     111            doStep_processList();
    107112          },
    108113        error: function()
     
    124129  }
    125130
    126   function doStep_getList(data)
    127   {
    128     timeStart = new Date();
    129     list=data.split(";");
    130     for(i=0;i<list.length-1;i++)
     131  function doStep_processList()
     132  {
     133    if(processAnalyze.step < processAnalyze.lists.length)
    131134    {
    132135      tmp = $.ajax({
    133136        type: "POST",
    134137        url: "{/literal}{$datas.urlRequest}{literal}",
    135         async: false,
    136         data: { ajaxfct:"makeStatsDoAnalyze", imagesList:list[i] }
    137        }).responseText;
    138 
    139       pct=100*(i+1)/list.length;
     138        async: true,
     139        data: { ajaxfct:"makeStatsDoAnalyze", imagesList:processAnalyze.lists[processAnalyze.step] },
     140        success: function(msg)
     141          {
     142            processAnalyze.step++;
     143            doStep_processList();
     144          },
     145       });
     146
     147      pct=100*(processAnalyze.step+1)/processAnalyze.lists.length;
    140148      $("#iprogressbar_bg").css("width", pct+"%");
    141149      $("#iprogressbar_fg").html(Math.round(pct)+"%");
    142150    }
    143 
    144     tmp = $.ajax({
    145       type: "POST",
    146       url: "{/literal}{$datas.urlRequest}{literal}",
    147       async: false,
    148       data: { ajaxfct:"makeStatsConsolidation" }
    149      }).responseText;
    150 
    151 
    152     timeEnd = new Date();
    153     timeElapsed=timeEnd.getTime()-timeStart.getTime();
    154 
    155 
    156     $("#dialog")
    157     .dialog("destroy")
    158     .html("")
    159     .get(0).removeAttribute('style');
    160 
    161     $("#dialog")
    162     .dialog(
    163       {
    164         resizable: false,
    165         width:480,
    166         height:120,
    167         modal: true,
    168         draggable:true,
    169         dialogClass: 'gcBgTabSheet gcBorder',
    170         title: '{/literal}{"g003_updating_metadata"|@translate}{literal}',
    171         dialogClass: 'gcBgTabSheet gcBorder',
    172         open: function(event, ui)
     151    else
     152    {
     153      // list completely processed
     154
     155      tmp = $.ajax({
     156        type: "POST",
     157        url: "{/literal}{$datas.urlRequest}{literal}",
     158        async: false,
     159        data: { ajaxfct:"makeStatsConsolidation" }
     160       }).responseText;
     161
     162
     163      processAnalyze.timeEnd = new Date();
     164      timeElapsed=processAnalyze.timeEnd.getTime()-processAnalyze.timeStart.getTime();
     165
     166
     167      $("#dialog")
     168      .dialog("destroy")
     169      .html("")
     170      .get(0).removeAttribute('style');
     171
     172      $("#dialog")
     173      .dialog(
    173174        {
    174           bH=$("div.ui-dialog-buttonpane").get(0).clientHeight;
    175           $("#dialog").css('height', (this.clientHeight-bH)+"px");
    176         },
    177         buttons:
    178         {
    179           '{/literal}{"g003_ok"|@translate}{literal}':
    180             function()
    181             {
    182               $(this).dialog('destroy').html("").get(0).removeAttribute('style');
    183             }
     175          resizable: false,
     176          width:480,
     177          height:120,
     178          modal: true,
     179          draggable:true,
     180          dialogClass: 'gcBgTabSheet gcBorder',
     181          title: '{/literal}{"g003_updating_metadata"|@translate}{literal}',
     182          dialogClass: 'gcBgTabSheet gcBorder',
     183          open: function(event, ui)
     184          {
     185            bH=$("div.ui-dialog-buttonpane").get(0).clientHeight;
     186            $("#dialog").css('height', (this.clientHeight-bH)+"px");
     187          },
     188          buttons:
     189          {
     190            '{/literal}{"g003_ok"|@translate}{literal}':
     191              function()
     192              {
     193                $(this).dialog('destroy').html("").get(0).removeAttribute('style');
     194              }
     195          }
    184196        }
    185       }
    186     )
    187     .html("<br>{/literal}{'g003_analyze_is_finished'|@translate}{literal}&nbsp;("+displayTime(timeElapsed/1000)+")");
    188 
    189     getStatus();
    190     $("body").css("cursor", "default");
     197      )
     198      .html("<br>{/literal}{'g003_analyze_is_finished'|@translate}{literal}&nbsp;("+displayTime(timeElapsed/1000)+")");
     199
     200      getStatus();
     201    }
    191202  }
    192203
     
    196207{/literal}
    197208
    198 <h3>{'g003_status_of_database'|@translate}</h3>
     209<h2>{'g003_status_of_database'|@translate}</h2>
    199210
    200211<div id="dialog"></div>
  • extensions/AMetaData/admin/amd_metadata_display.tpl

    r5935 r5959  
    359359
    360360
    361 <h3>{'g003_display_management'|@translate}</h3>
     361<h2>{'g003_display_management'|@translate}</h2>
    362362
    363363<div class="addGroup">
  • extensions/AMetaData/admin/amd_metadata_select.tpl

    r5935 r5959  
    202202
    203203
    204 <h3>{'g003_select_metadata'|@translate}</h3>
     204<h2>{'g003_select_metadata'|@translate}</h2>
    205205
    206206<form>
  • extensions/AMetaData/amd.css

    r5935 r5959  
    1 
    2 .formtable, .formtable P { text-align:left; display:block; }
    3 .formtable tr { vertical-align:top; }
    4 .littlefont { font-size:90%; }
    5 .littlefont td { padding:1px; }
    6 table.littlefont th { padding:3px; text-align:left;}
    7 table.littlefont td { padding:1px 3px; }
    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;  }
    111#iHeaderListTags { width:100%; border:1px solid; border-collapse: collapse; margin-top:3px; }
    122#iListTags { width:100%; border:1px solid; height:280px; border-top:0px; overflow:auto; position:relative; left:-1px;}
     
    199#iListImages.clear table tr:hover, table.clear tr:hover { color: #D54E21; background:#dbe8f3; cursor:default; }
    2010#iHeaderListImages { width:100%; border-bottom:1px solid; }
    21 .nfo ul { margin-top:0em; margin-bottom:1em; }
    22 .warning { color:#ffffff; background:#dd0000; margin-bottom:8px; margin-top:8px; padding:8px; }
    23 .warning p, .nfo p { margin-top:0.5em; margin-bottom:0em; }
    24 .warning ul { margin-top:0em; margin-bottom:0.5em; }
    25 .pctBarroma { height:6px; background:#FF7700; }
    26 .pctBarclear { height:6px; background:#005E89; }
    27 li.groupItems { border:1px solid #666666; margin-bottom:5px; padding:0 5px; width:90%; cursor:move; padding:4px; }
    2811div.addGroup { padding-left:40px; text-align:left; }
    2912#iGroups { list-style: none; }
    30 
    31 .ui-dialog { border-width:1px; border-style:solid; }
    32 .ui-dialog-buttonpane { padding:4px; }
    33 .ui-dialog-buttonpane button { margin-right:8px; }
    34 .ui-dialog-titlebar { font-weight:bold; }
    35 .ui-dialog-title-dialog { text-align: left; }
    36 .ui-dialog-titlebar-close { float: right; }
    37 .ui-dialog-content { overflow:auto; }
    38 .ui-dialog-container { }
    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; }
    4213
    4314.tagListOrder { list-style: none; padding:0px; margin-right:8px; margin-left:35px; }
     
    4617.editGroupListButton { margin-left:8px; position:absolute; z-index:1000; }
    4718table.tagListOrderItem { width:100%; border-collapse:collapse; }
    48 .dialogForm { text-align:left; margin:8px; }
     19
    4920#ianalyzestatus { margin:8px; padding:8px; }
    5021#ianalyzestatus ul { margin:0px; padding:0 0 0 20px; }
    5122#iamd_nb_item_per_request_display { display:inline-block; width:70px; }
    5223#iamd_nb_item_per_request_slider { display:inline-block; width:350px; }
    53 #iDialogProgress { margin:16px 8px 8px; }
    5424#helpBody { text-align: left; padding-top:30px; }
    5525#helpBody ul { padding:0px; margin:0px; }
    5626#helpBody li { margin-left:30px; }
    57 #iDialogProgress p { text-align: center; margin-top: 8px; margin-bottom: 0pt; }
    5827
    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_aip.class.inc.php

    r5935 r5959  
    115115  {
    116116    add_event_handler('loc_end_page_header', array(&$this->css, 'applyCSS'));
     117    GPCCss::applyGpcCss();
    117118  }
    118119
     
    603604    if($result)
    604605    {
    605       while($row=mysql_fetch_assoc($result))
     606      while($row=pwg_db_fetch_assoc($result))
    606607      {
    607608        if($row['groupId']==-1)
     
    633634    if($result)
    634635    {
    635       while($row=mysql_fetch_assoc($result))
     636      while($row=pwg_db_fetch_assoc($result))
    636637      {
    637638        $datas['groups'][]=Array(
     
    732733
    733734    $data=Array(
    734       'sheetContent' => $this->BBtoHTML($lang['g003_help_'.$tab]),
     735      'sheetContent' => GPCCore::BBtoHTML($lang['g003_help_'.$tab]),
    735736      'title' => l10n('g003_help_tab_'.$tab),
    736737    );
     
    740741    $template->assign_var_from_handle('AMD_BODY_PAGE', 'body_page');
    741742  }
    742 
    743 
    744 
    745   /**
    746    * convert (light) BB tag to HTML tag
    747    *
    748    * all BB codes are not recognized, only :
    749    *  - [ul] [/ul]
    750    *  - [li] [/li]
    751    *  - [b] [/b]
    752    *  - [i] [/i]
    753    *  - [url] [/url]
    754    *  - carriage return is replaced by a <br>
    755    *
    756    * @param String $text : text to convert
    757    * @return String : BB to HTML text
    758    */
    759   protected function BBtoHTML($text)
    760   {
    761     $patterns = Array(
    762       '/\[li\](.*?)\[\/li\]\n*/im',
    763       '/\[b\](.*?)\[\/b\]/ism',
    764       '/\[i\](.*?)\[\/i\]/ism',
    765       '/\[url\]([\w]+?:\/\/[^ \"\n\r\t<]*?)\[\/url\]/ism',
    766       '/\[url=([\w]+?:\/\/[^ \"\n\r\t<]*?)\](.*?)\[\/url\]/ism',
    767       '/\n{0,1}\[ul\]\n{0,1}/im',
    768       '/\n{0,1}\[\/ul\]\n{0,1}/im',
    769       '/\n/im',
    770     );
    771     $replacements = Array(
    772       '<li>\1</li>',
    773       '<b>\1</b>',
    774       '<i>\1</i>',
    775       '<a href="\1">\1</a>',
    776       '<a href="\1">\2</a>',
    777       '<ul>',
    778       '</ul>',
    779       '<br>',
    780     );
    781 
    782     return(preg_replace($patterns, $replacements, $text));
    783   }
    784 
    785 
    786743
    787744
     
    827784
    828785      $sql.=" LEFT JOIN ".CADDIE_TABLE." ct ON ait.imageId = ct.element_id
    829             WHERE ct.user_id = ".$user['id'].";";
     786            WHERE ct.user_id = ".$user['id']." ";
     787
     788      if($mode=="caddieAdd") $sql.=" AND ait.analyzed='n'";
    830789    }
    831790
     
    841800    {
    842801      $i=0;
    843       while($row=mysql_fetch_row($result))
     802      while($row=pwg_db_fetch_row($result))
    844803      {
    845804        $returned.=$row[0];
     
    876835    $returned="";
    877836
    878     if(count($list)>0)
     837    if(count($list)>0 and trim($imagesList)!='')
    879838    {
    880839      // $path = path of piwigo's on the server filesystem
     
    885844      if($result)
    886845      {
    887         while($row=mysql_fetch_assoc($result))
     846        while($row=pwg_db_fetch_assoc($result))
    888847        {
    889848          /*
     
    938897    if($result)
    939898    {
    940       while($row=mysql_fetch_row($result))
     899      while($row=pwg_db_fetch_row($result))
    941900      {
    942901        $numOfPictures=$row[0];
     
    951910    if($result)
    952911    {
    953       while($row=mysql_fetch_row($result))
     912      while($row=pwg_db_fetch_row($result))
    954913      {
    955914        $numOfPicturesNotAnalyzed=$row[0];
     
    962921    if($result)
    963922    {
    964       while($row=mysql_fetch_row($result))
     923      while($row=pwg_db_fetch_row($result))
    965924      {
    966925        $numOfPicturesWithoutTags=$row[0];
     
    10511010    if($result)
    10521011    {
    1053       while($row=mysql_fetch_assoc($result))
     1012      while($row=pwg_db_fetch_assoc($result))
    10541013      {
    10551014        $datas[]=array(
     
    11101069    if($result)
    11111070    {
    1112       while($row=mysql_fetch_assoc($result))
     1071      while($row=pwg_db_fetch_assoc($result))
    11131072      {
    11141073        $datas[]=array(
     
    11481107      if($result)
    11491108      {
    1150         if(mysql_num_rows($result)==0)
     1109        if(pwg_db_num_rows($result)==0)
    11511110        {
    11521111          $sql="INSERT INTO ".$this->tables['selected_tags']."
     
    11971156      {
    11981157        $datas=Array();
    1199         while($row=mysql_fetch_assoc($result))
     1158        while($row=pwg_db_fetch_assoc($result))
    12001159        {
    12011160          if($row['groupId']==$id)
     
    12981257      {
    12991258        $datas=Array();
    1300         while($row=mysql_fetch_assoc($result))
     1259        while($row=pwg_db_fetch_assoc($result))
    13011260        {
    13021261          $datas[]=Array(
     
    14101369      $sql="INSERT INTO ".$this->tables['groups']." VALUES('', 9999)";
    14111370      $result=pwg_query($sql);
    1412       $groupId=mysql_insert_id();
     1371      $groupId=pwg_db_insert_id();
    14131372    }
    14141373
     
    14701429      if($result)
    14711430      {
    1472         while($row=mysql_fetch_assoc($result))
     1431        while($row=pwg_db_fetch_assoc($result))
    14731432        {
    14741433          if(array_key_exists($row['lang'], $datasLang['language_list']))
     
    15191478    if($result)
    15201479    {
    1521       while($row=mysql_fetch_assoc($result))
     1480      while($row=pwg_db_fetch_assoc($result))
    15221481      {
    15231482        $datas['groups'][]=Array(
  • extensions/AMetaData/amd_install.class.inc.php

    r5935 r5959  
    164164      if($result)
    165165      {
    166         while($row=mysql_fetch_assoc($result))
     166        while($row=pwg_db_fetch_assoc($result))
    167167        {
    168168          $listToAnalyze[0][]=$row;
     
    190190        if($result)
    191191        {
    192           while($row=mysql_fetch_assoc($result))
     192          while($row=pwg_db_fetch_assoc($result))
    193193          {
    194194            $listToAnalyze[0][]=$row;
  • extensions/AMetaData/amd_pip.class.inc.php

    r5935 r5959  
    6969    if($result)
    7070    {
    71       while($row=mysql_fetch_assoc($result))
     71      while($row=pwg_db_fetch_assoc($result))
    7272      {
    7373        $filename=$row['path'];
     
    105105    if($result)
    106106    {
    107       while($row=mysql_fetch_assoc($result))
     107      while($row=pwg_db_fetch_assoc($result))
    108108      {
    109109        $tagsList[$row['tagId']]=$row['gName'];
  • extensions/AMetaData/amd_root.class.inc.php

    r5935 r5959  
    115115    if($result)
    116116    {
    117       while($row=mysql_fetch_row($result))
     117      while($row=pwg_db_fetch_row($result))
    118118      {
    119119        $numOfPictures=$row[0];
     
    141141      $path=dirname(dirname(dirname(__FILE__)));
    142142
    143       while($row=mysql_fetch_assoc($result))
     143      while($row=pwg_db_fetch_assoc($result))
    144144      {
    145145        $this->analyzeImageFile($path."/".$row['path'], $row['imageId']);
     
    215215      {
    216216        $numId=-1;
    217         while($row=mysql_fetch_assoc($result))
     217        while($row=pwg_db_fetch_assoc($result))
    218218        {
    219219          $numId=$row['numId'];
     
    268268    if($result)
    269269    {
    270       while($row=mysql_fetch_assoc($result))
     270      while($row=pwg_db_fetch_assoc($result))
    271271      {
    272272        $this->config['amd_AllPicturesAreAnalyzed']=($row['nb']==0)?'y':'n';
  • extensions/AMetaData/main.inc.php

    r5935 r5959  
    2323| release | date       |
    2424| 0.0     | 2010/01/21 | * start coding
     25|         |            |
    2526| 0.1b    | 2010/03/21 | * beta release
     27|         |            |
    2628| 0.2b    | 2010/03/23 | * beta release
     29|         |            |
    2730| 0.3b    | 2010/04/11 | * beta release
    28 | 0.4b    | 2010/04/18 | * beta release for Piwigo 2.1
    2931|         |            |
    30 |         |            |
    31 |         |            |
     32| 0.4b    | 2010/04/24 | * beta release for Piwigo 2.1
     33|         |            | * uses some GPC 3.1.0 functions
     34|         |            | * optimize ajax request to fill the metadata database
     35|         |            | * replace all the 'mysql_*' functions with 'pwg_db_*'
     36|         |            |   functions
     37|         |            | * update some html/css
    3238|         |            |
    3339|         |            |
  • extensions/AMetaData/maintain.inc.php

    r5935 r5959  
    3535 * -------------------------------------------------------------------------- */
    3636$gpc_installed=false;
    37 $gpcNeeded="3.0.0";
     37$gpcNeeded="3.1.0";
    3838if(file_exists(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/CommonPlugin.class.inc.php'))
    3939{
    4040  @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))
     41  // need GPC release greater or equal than 3.1.0
     42  if(CommonPlugin::checkGPCRelease(3,1,0))
    4343  {
    4444    @include_once("amd_install.class.inc.php");
Note: See TracChangeset for help on using the changeset viewer.