Dotclear

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

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

Ajout du plugin Pixearch

Line 
1<div id="insert" class="multi-part" title="<?php echo __('Insert picture'); ?>">
2     <fieldset>
3          <legend><?php echo __('Insert picture'); ?></legend>
4          <?php
5         
6         
7          try
8          {
9               $pict = new $pictureClass(
10                    $_GET['picture_id']
11               );
12               // Display photo
13               ?>
14               <h3>
15                    <?php echo __('Image size'); ?>
16               </h3>
17               <div style="float: right; margin: 0 10px;">
18                    <img src="<?php echo $pict->sizes[$pict->defaultSize]; ?>" id="preview" />
19               </div>
20               <p class="label">
21                    <?php
22                    foreach ($pict->sizes as $name => $size)
23                    {
24                         ?>
25                         <label class="classic changeSize">
26                              <?php echo form::radio(
27                                   array(
28                                        'pixearch_uri'
29                                   ),
30                                   $size,
31                                   $name == $pict->defaultSize
32                              ); ?>
33                              <?php echo __($name) . ' <span style="display: inline;font-style: italic; color: gray;">--</span>'; ?>
34                         </label>
35                         <br />
36                         <?php
37                    }
38                    ?>
39<script type="text/javascript" charset="utf-8">
40//<![CDATA[
41$(function()
42{
43     $('label.changeSize input').each(
44          function()
45          {
46               this.onclick = function()
47               {
48                    $('label.changeSize input').each(
49                         function()
50                         {
51                              if (this.loading)
52                              {
53                                   this.loading.destroy();
54                              }
55                         }
56                    );
57                    var preview =
58                         document.getElementById(
59                              'preview'
60                         )
61                    preview.src = this.value;
62                    this.loading = new Image();
63                    this.parentNode.startLoading = new Date();
64                    this.parentNode.loadingTime = this.parentNode.getElementsByTagName(
65                         'span'
66                    )[0];
67                    this.loading.src =
68                         'index.php?pf=pixearch/img/loader.gif';
69                    this.loading.style.verticalAlign =
70                         'middle';
71                    this.parentNode.appendChild(
72                         this.loading
73                    );
74                    this.loading.destroy = function()
75                    {
76                         try
77                         {
78                              var label = this.parentNode;
79                              label.removeChild(
80                                   this
81                              );
82                              label.loadingTime.innerHTML =
83                                   ((new Date() - label.startLoading) / 1000) +
84                                        '<?php echo ' ' . __('seconds'); ?>';
85                         } catch(e){};
86                         delete this;
87                    }
88                    preview.loading = this.loading;
89                    preview.onload = function()
90                    {
91                         this.loading.destroy();
92                    }
93               }
94               if (this.checked)
95               {
96                    this.onclick();
97               }
98          }
99     );
100});
101//]]>
102</script>
103               </p>
104               <h3>
105                    <?php echo __('Image alignment'); ?>
106               </h3>
107               <p class="label">
108                    <?php
109                    $i_align = array(
110                         'none' => array(__('None'),0),
111                         'left' => array(__('Left'),0),
112                         'right' => array(__('Right'),0),
113                         'center' => array(__('Center'),1)
114                    );
115                    foreach ($i_align as $k => $v) {
116                         echo '<label class="classic">'.
117                         form::radio(
118                              array(
119                                   'pixearch_align'
120                              ),
121                              $k,
122                              $v[1]
123                         ) . ' ' . $v[0] . '</label><br /> ';
124                    }
125                    ?>
126               </p>
127               <h3>
128                    <?php echo __('Image insertion'); ?>
129               </h3>
130               <p class="label">
131                    <label class="classic">
132                         <?php
133                         echo form::radio(
134                              array(
135                                   'pixearch_insert'
136                              ),
137                              '0',
138                              false
139                         )
140                         ?>
141                         <?php echo __('Image only'); ?>
142                    </label>
143                    <br />
144                    <label class="classic">
145                         <?php
146                         echo form::radio(
147                              array(
148                                   'pixearch_insert'
149                              ),
150                              $pict->page,
151                              true
152                         )
153                         ?>
154                         <?php echo __('Image with link'); ?>
155                    </label>
156               </p>
157               <?php
158          }
159          catch (Exception $e)
160          {
161               ?>
162               <div class="error">
163                    <strong><?php echo __('Errors'); ?> :</strong>
164                    <ul>
165                         <li><?php echo __($e->getMessage()); ?></li>
166                    </ul>
167               </div>
168               <?php
169          }
170          ?>
171          <input type="hidden" name="pixearch_title" value="<?php echo $pict->title; ?>" />
172          <input type="reset" value="<?php echo __('cancel'); ?>" id="media-insert-cancel" />
173          <input type="submit" value="<?php echo __('insert'); ?>" id="media-insert-ok" />
174     </fieldset>
175</div>
Note: See TracBrowser for help on using the repository browser.

Sites map