Dotclear

source: plugins/pixearch/tpl/popup_search.html @ 656

Revision 656, 2.2 KB checked in by hadrien, 14 years ago (diff)

Ajout du plugin Pixearch

Line 
1<h2>
2     <?php echo __('Pixearch') ?>
3</h2>
4<form action="" method="post" accept-charset="utf-8" id="pixearchForm">
5     <div id="search" class="multi-part" title="<?php echo __('Search images'); ?>">
6          <fieldset>
7               <legend><?php echo __('Search images'); ?></legend>
8               <p class="label">
9                    <label class="classic">
10                         <?php echo __('Search'); ?> :
11                         <?php echo form::field(
12                              'pixearch_query',
13                              50,
14                              null,
15                              $query
16                         ); ?>
17                    </label>
18               </p>
19               <p class="label">
20                    <?php echo __('on'); ?> :
21                    <?php
22                    $sources = array(
23                         'flickr',
24                         'photobucket',
25                         'deviantart',
26                         'picasa'
27                    );   
28                    $sourceFound = false;
29                    foreach ($sources as $k => $s)
30                    {
31                    ?>
32                    <label class="classic">
33                         <?php
34                         if(${$s.'ApiKey'})
35                         {
36                              echo form::radio(
37                                   array(
38                                        'source'
39                                   ),
40                                   $s,
41                                   $source == $s
42                              );
43                              if ($source == $s)
44                              {
45                                   $sourceFound = true;
46                              }
47                         }
48                         else
49                         {
50                              if (!$sourceFound)
51                              {
52                                   $source = $sources[$k + 1];
53                              }
54                              echo '<input type="radio" name="source" disabled="disabled" />';
55                         }
56                         ?>
57                         <?php echo __($s);
58                         if (!${$s.'ApiKey'})
59                         {
60                              echo ' <em>(<a href="plugin.php?p=pixearch&amp;popup=1&amp;config">' .
61                              __('Not configured') . '</a>)</em>';
62                         }
63                         ?>
64                    </label>
65                    <?php
66                    }
67                    ?>
68               </p>
69               <p class="classic">
70                    <input type="hidden" name="p" value="pixearch" />
71                    <?php echo $core->formNonce(); ?>
72                    <input type="submit" name="saveconfig" value="<?php echo __('Search'); ?>" />
73               </p>
74          </fieldset>
75<?php
76
77//------------------------------------------------------------------------------
78// Search results
79//------------------------------------------------------------------------------
80
81if (!empty($query))
82{
83     // Résultats de recherche
84     switch ($source)
85     {
86          case 'photobucket':
87               $searchEngine = new PxSPhotoBucket(
88                    $photobucketApiKey,
89                    $photobucketSecret
90               );
91               break;
92          case 'deviantart':
93               $searchEngine = new PxSDeviantArt();
94               break;
95          case 'picasa':
96               $searchEngine = new PxSPicasa();
97               break;
98          case 'flickr':
99          default:
100               $searchEngine = new PxSFlickr(
101                    $flickrApiKey
102               );
103     }
104     
105     include(dirname(__FILE__) . '/popup_results.html');
106}
107?>
108     </div>
Note: See TracBrowser for help on using the repository browser.

Sites map