Dotclear

source: admin/popup_web_media.php @ 399:16dff9759f10

Revision 399:16dff9759f10, 3.2 KB checked in by Tomtom33 <tbouron@…>, 14 years ago (diff)

Finished web media integration with oembed

Line 
1<?php
2# -- BEGIN LICENSE BLOCK ---------------------------------------
3#
4# This file is part of Dotclear 2.
5#
6# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
7# Licensed under the GPL version 2.0 license.
8# See LICENSE file or
9# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
10#
11# -- END LICENSE BLOCK -----------------------------------------
12
13require dirname(__FILE__).'/../inc/admin/prepend.php';
14
15dcPage::check('usage,contentadmin');
16
17dcPage::openPopup(__('Add a web media'),
18     dcPage::jsOEmbed().
19     dcPage::jsLoad('js/tiny_mce/tiny_mce_popup.js').
20     dcPage::jsLoad('js/tiny_mce/plugins/dcControls/js/popup_web_media.js').
21     '<style type="text/css">
22     #src {
23          padding-left: 25px;
24          background: transparent url(images/menu/search.png) no-repeat 5px center;
25     }
26     #src.loading {
27          background-color: #ccc;
28     }
29     #src.error {
30          background: #ff9999 url(images/check-off.png) no-repeat 5px center;
31     }
32     #src.success {
33          background: #99ff99 url(images/check-on.png) no-repeat 5px center;
34     }
35     </style>'
36);
37
38$align = array(
39     'none' => array(__('None'),1),
40     'left' => array(__('Left'),0),
41     'right' => array(__('Right'),0),
42     'center' => array(__('Center'),0)
43);
44$v_insert = array(
45     'media' => array(__('Full media'),1),
46     'thumbnail' => array(__('Media thumbnail'),0),
47     'link' => array(__('Media link'),0),
48);
49
50echo
51'<h2>'.__('Add a web media').'</h2>'.
52
53'<form id="video-insert-form" action="#" method="get">'.
54'<p><label class="required"><abbr title="'.__('Required field').'">*</abbr> '.__('Source URL:').'</label>'.
55form::field('src',85,512,'').'&nbsp;'.
56'<a class="button" href="#" id="webmedia-insert-search">'.__('search').'</a> - '.
57'<strong><a class="button" href="#" id="webmedia-insert-ok">'.__('insert').'</a></strong> - '.
58'<a class="button reset" href="#" id="webmedia-insert-cancel">'.__('cancel').'</a></p>'.
59
60'<div class="two-cols" style="display:none;"><div class="col">'.
61'<p><label class="required"><abbr title="'.__('Width').'">*</abbr> '.__('Width:').'</label>'.
62form::field('width',35,4,'').'</p>'.
63'<p><label class="required"><abbr title="'.__('Height').'">*</abbr> '.__('Height:').'</label>'.
64form::field('height',35,4,'').'</label></p>'.
65'<p><label for="alt">'.__('Alternative text:').' '.
66form::field('alt',35,512,'').'</label></p>'.
67'<p><label for="title">'.__('Title:').' '.
68form::field('title',35,512,'').'</label></p>'.
69'<p><label class="required"><abbr title="'.__('Required field').'">*</abbr> '.__('Insertion').' '.
70'</label></p>'.
71'<p>';
72foreach ($v_insert as $k => $v) {
73     echo '<label class="classic">'.
74     form::radio(array('insertion'),$k,$v[1]).' '.$v[0].'</label><br /> ';
75}
76echo
77'</p>'.
78'<p><label class="required"><abbr title="'.__('Required field').'">*</abbr> '.__('Alignment').' '.
79'</label></p>'.
80'<p>';
81foreach ($align as $k => $v) {
82     echo '<label class="classic">'.
83     form::radio(array('alignment'),$k,$v[1]).' '.$v[0].'</label><br /> ';
84}
85echo
86'</p>'."\n".
87'</div><div class="col preview">'.
88'</div></div>'.
89'</form>'.
90
91'<script type="text/javascript">'."\n".
92'//<![CDATA['."\n".
93'$(\'input[name="src"]\').get(0).focus();'."\n".
94'//]]>'."\n".
95'</script>'."\n";
96
97dcPage::closePopup();
98
99?>
Note: See TracBrowser for help on using the repository browser.

Sites map