source: extensions/piclens/admin/functions.inc.php @ 21238

Last change on this file since 21238 was 21238, checked in by plg, 11 years ago

compatibility with Piwigo 2.5: replace functions mysql_* with pwg_db_* equivalent

switch version to "auto"

use the new $template->add_index_button function

File size: 1.0 KB
Line 
1<?php
2/*
3 * Plugin Name: CoolIris-Piclens
4 * File :  fonctions.php 
5 */
6
7
8
9function get_html_exts_selection(
10  $exts,
11  $fieldname,
12  $selecteds = array()
13  )
14{
15  global $conf;
16  if (count ($exts) == 0 )
17  {
18    return '';
19  }
20  $output = '<div id="'.$fieldname.'">';
21  $id = 1;
22  foreach ($exts as $ext)
23  {
24    $output.=
25
26      '<input type="checkbox" name="'.$fieldname.'[]"'
27      .' id="ext_'.$id++.'"'
28      .' value="'.$ext['tn_ext'].'"'
29      ;
30
31    if (in_array($ext['tn_ext'], $selecteds))
32    {
33      $output.= ' checked="checked"';
34    }
35
36    $output.=
37      '><label>'
38      .'&nbsp;<b>'. $ext['tn_ext'].'</b>&nbsp;'
39      .'</label>'
40      ."\n"
41      ;
42  }
43  $output.= '</div>';
44
45  return $output;
46}
47
48
49function get_all_exts()
50{
51$query = '
52  SELECT DISTINCT(tn_ext)
53  FROM '.IMAGES_TABLE.'
54  ORDER BY tn_ext;';
55
56$result = pwg_query($query);
57
58$ext = array();
59  while ($row = pwg_db_fetch_assoc($result))
60  {
61    if (empty($row['tn_ext']))
62                $row['tn_ext']='!NULL!';
63    array_push($ext, $row);
64  }
65
66  return $ext;
67}
68
69?>
Note: See TracBrowser for help on using the repository browser.