Merge lp:~dangarner/xibo/embedded-html-module-102 into lp:xibo/1.0
- embedded-html-module-102
- Merge into halley
Proposed by
Dan Garner
Status: | Merged | ||||
---|---|---|---|---|---|
Merged at revision: | not available | ||||
Proposed branch: | lp:~dangarner/xibo/embedded-html-module-102 | ||||
Merge into: | lp:xibo/1.0 | ||||
Diff against target: | None lines | ||||
To merge this branch: | bzr merge lp:~dangarner/xibo/embedded-html-module-102 | ||||
Related bugs: |
|
||||
Related blueprints: |
Embed raw HTML
(Low)
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Dan Garner | Approve | ||
Review via email: mp+7708@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Revision history for this message
Dan Garner (dangarner) : | # |
review:
Approve
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file '.bzrignore' | |||
2 | --- .bzrignore 2009-03-07 23:21:15 +0000 | |||
3 | +++ .bzrignore 2009-06-20 10:05:53 +0000 | |||
4 | @@ -1,3 +1,4 @@ | |||
5 | 1 | server/settings.php | 1 | server/settings.php |
6 | 2 | .project | 2 | .project |
7 | 3 | server/.project | 3 | server/.project |
8 | 4 | Thumbs.db | ||
9 | 4 | 5 | ||
10 | === modified file 'client/dotNET/Region.cs' | |||
11 | --- client/dotNET/Region.cs 2009-06-17 21:57:35 +0000 | |||
12 | +++ client/dotNET/Region.cs 2009-06-20 10:05:53 +0000 | |||
13 | @@ -124,6 +124,10 @@ | |||
14 | 124 | media = new Rss(options); | 124 | media = new Rss(options); |
15 | 125 | break; | 125 | break; |
16 | 126 | 126 | ||
17 | 127 | case "embedded": | ||
18 | 128 | media = new Text(options); | ||
19 | 129 | break; | ||
20 | 130 | |||
21 | 127 | default: | 131 | default: |
22 | 128 | //do nothing | 132 | //do nothing |
23 | 129 | SetNextMediaNode(); | 133 | SetNextMediaNode(); |
24 | @@ -200,6 +204,7 @@ | |||
25 | 200 | options.scrollSpeed = 1; | 204 | options.scrollSpeed = 1; |
26 | 201 | options.updateInterval = 6; | 205 | options.updateInterval = 6; |
27 | 202 | options.uri = ""; | 206 | options.uri = ""; |
28 | 207 | options.direction = "none"; | ||
29 | 203 | 208 | ||
30 | 204 | // Get a media node | 209 | // Get a media node |
31 | 205 | bool validNode = false; | 210 | bool validNode = false; |
32 | @@ -305,6 +310,10 @@ | |||
33 | 305 | { | 310 | { |
34 | 306 | options.documentTemplate = raw.InnerText; | 311 | options.documentTemplate = raw.InnerText; |
35 | 307 | } | 312 | } |
36 | 313 | else if (raw.Name == "embedHtml") | ||
37 | 314 | { | ||
38 | 315 | options.text = raw.InnerText; | ||
39 | 316 | } | ||
40 | 308 | } | 317 | } |
41 | 309 | 318 | ||
42 | 310 | // That should cover all the new options | 319 | // That should cover all the new options |
43 | 311 | 320 | ||
44 | === modified file 'client/dotNET/Rss.cs' | |||
45 | --- client/dotNET/Rss.cs 2009-06-18 18:36:21 +0000 | |||
46 | +++ client/dotNET/Rss.cs 2009-06-20 10:39:40 +0000 | |||
47 | @@ -83,7 +83,7 @@ | |||
48 | 83 | 83 | ||
49 | 84 | try | 84 | try |
50 | 85 | { | 85 | { |
52 | 86 | webBrowser.DocumentText = String.Format("<html><head><script type='text/javascript'>{0}</script><style type='text/css'>p, h1, h2, h3, h4, h5 {{ margin:2px; font-size:{1}em; }}</style></head><body></body></html>", Properties.Resources.textRender, options.scaleFactor.ToString()); | 86 | webBrowser.DocumentText = String.Format("<html><head><meta http-equiv='Content-Type' content='text/html; charset=UTF-8' /><script type='text/javascript'>{0}</script><style type='text/css'>p, h1, h2, h3, h4, h5 {{ margin:2px; font-size:{1}em; }}</style></head><body></body></html>", Properties.Resources.textRender, options.scaleFactor.ToString()); |
53 | 87 | } | 87 | } |
54 | 88 | catch (Exception e) | 88 | catch (Exception e) |
55 | 89 | { | 89 | { |
56 | @@ -133,7 +133,7 @@ | |||
57 | 133 | 133 | ||
58 | 134 | try | 134 | try |
59 | 135 | { | 135 | { |
61 | 136 | System.IO.StreamReader sr = new System.IO.StreamReader(data, true); | 136 | System.IO.StreamReader sr = new System.IO.StreamReader(data, Encoding.UTF8); |
62 | 137 | rssContents = sr.ReadToEnd(); | 137 | rssContents = sr.ReadToEnd(); |
63 | 138 | 138 | ||
64 | 139 | StreamWriter sw = new StreamWriter(File.Open(rssFilePath, FileMode.Create, FileAccess.Write, FileShare.Read)); | 139 | StreamWriter sw = new StreamWriter(File.Open(rssFilePath, FileMode.Create, FileAccess.Write, FileShare.Read)); |
65 | 140 | 140 | ||
66 | === modified file 'client/dotNET/Text.cs' | |||
67 | --- client/dotNET/Text.cs 2008-12-19 23:34:13 +0000 | |||
68 | +++ client/dotNET/Text.cs 2009-06-20 10:39:40 +0000 | |||
69 | @@ -55,11 +55,12 @@ | |||
70 | 55 | 55 | ||
71 | 56 | try | 56 | try |
72 | 57 | { | 57 | { |
74 | 58 | webBrowser.DocumentText = String.Format("<html><head><script type='text/javascript'>{0}</script><style type='text/css'>p, h1, h2, h3, h4, h5 {{ margin:2px; font-size:{1}em; }}</style></head><body></body></html>", Properties.Resources.textRender, options.scaleFactor.ToString()); | 58 | webBrowser.DocumentText = String.Format("<html><head><meta http-equiv='Content-Type' content='text/html; charset=UTF-8' /><script type='text/javascript'>{0}</script><style type='text/css'>p, h1, h2, h3, h4, h5 {{ margin:2px; font-size:{1}em; }}</style></head><body></body></html>", Properties.Resources.textRender, options.scaleFactor.ToString()); |
75 | 59 | } | 59 | } |
76 | 60 | catch (Exception e) | 60 | catch (Exception e) |
77 | 61 | { | 61 | { |
79 | 62 | MessageBox.Show(e.Message); | 62 | System.Diagnostics.Trace.WriteLine(e.Message); |
80 | 63 | return; | ||
81 | 63 | } | 64 | } |
82 | 64 | 65 | ||
83 | 65 | webBrowser.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(webBrowser_DocumentCompleted); | 66 | webBrowser.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(webBrowser_DocumentCompleted); |
84 | 66 | 67 | ||
85 | === modified file 'client/dotNET/bin/Release/XiboClient.XmlSerializers.dll' | |||
86 | 67 | Binary files client/dotNET/bin/Release/XiboClient.XmlSerializers.dll 2009-06-18 18:36:21 +0000 and client/dotNET/bin/Release/XiboClient.XmlSerializers.dll 2009-06-20 10:39:40 +0000 differ | 68 | Binary files client/dotNET/bin/Release/XiboClient.XmlSerializers.dll 2009-06-18 18:36:21 +0000 and client/dotNET/bin/Release/XiboClient.XmlSerializers.dll 2009-06-20 10:39:40 +0000 differ |
87 | === modified file 'client/dotNET/bin/Release/XiboClient.exe' | |||
88 | 68 | Binary files client/dotNET/bin/Release/XiboClient.exe 2009-06-18 18:36:21 +0000 and client/dotNET/bin/Release/XiboClient.exe 2009-06-20 10:39:40 +0000 differ | 69 | Binary files client/dotNET/bin/Release/XiboClient.exe 2009-06-18 18:36:21 +0000 and client/dotNET/bin/Release/XiboClient.exe 2009-06-20 10:39:40 +0000 differ |
89 | === modified file 'client/dotNET/bin/Release/XiboClient.pdb' | |||
90 | 69 | Binary files client/dotNET/bin/Release/XiboClient.pdb 2009-06-18 18:36:21 +0000 and client/dotNET/bin/Release/XiboClient.pdb 2009-06-20 10:39:40 +0000 differ | 70 | Binary files client/dotNET/bin/Release/XiboClient.pdb 2009-06-18 18:36:21 +0000 and client/dotNET/bin/Release/XiboClient.pdb 2009-06-20 10:39:40 +0000 differ |
91 | === added file 'server/install/database/6.sql' | |||
92 | --- server/install/database/6.sql 1970-01-01 00:00:00 +0000 | |||
93 | +++ server/install/database/6.sql 2009-06-20 09:34:43 +0000 | |||
94 | @@ -0,0 +1,16 @@ | |||
95 | 1 | INSERT INTO `module` ( | ||
96 | 2 | `ModuleID` , | ||
97 | 3 | `Module` , | ||
98 | 4 | `Enabled` , | ||
99 | 5 | `RegionSpecific` , | ||
100 | 6 | `Description` , | ||
101 | 7 | `ImageUri` , | ||
102 | 8 | `SchemaVersion` | ||
103 | 9 | ) | ||
104 | 10 | VALUES ( | ||
105 | 11 | NULL , 'Embedded', '1', '1', 'Embedded HTML', 'img/forms/webpage.gif', '1' | ||
106 | 12 | ); | ||
107 | 13 | |||
108 | 14 | UPDATE `version` SET `app_ver` = '1.0.2'; | ||
109 | 15 | UPDATE `setting` SET `value` = 0 WHERE `setting` = 'PHONE_HOME_DATE'; | ||
110 | 16 | UPDATE `version` SET `DBVersion` = '6'; | ||
111 | 0 | \ No newline at end of file | 17 | \ No newline at end of file |
112 | 1 | 18 | ||
113 | === modified file 'server/lib/pages/layout.class.php' | |||
114 | --- server/lib/pages/layout.class.php 2009-04-27 19:28:08 +0000 | |||
115 | +++ server/lib/pages/layout.class.php 2009-06-20 09:34:43 +0000 | |||
116 | @@ -1435,7 +1435,7 @@ | |||
117 | 1435 | while ($modulesItem = $enabledModules->GetNextModule()) | 1435 | while ($modulesItem = $enabledModules->GetNextModule()) |
118 | 1436 | { | 1436 | { |
119 | 1437 | $mod = Kit::ValidateParam($modulesItem['Module'], _STRING); | 1437 | $mod = Kit::ValidateParam($modulesItem['Module'], _STRING); |
121 | 1438 | $caption = 'Add ' . $mod; | 1438 | $caption = '+ ' . $mod; |
122 | 1439 | $mod = strtolower($mod); | 1439 | $mod = strtolower($mod); |
123 | 1440 | $title = Kit::ValidateParam($modulesItem['Description'], _STRING); | 1440 | $title = Kit::ValidateParam($modulesItem['Description'], _STRING); |
124 | 1441 | $img = Kit::ValidateParam($modulesItem['ImageUri'], _STRING); | 1441 | $img = Kit::ValidateParam($modulesItem['ImageUri'], _STRING); |
125 | @@ -1445,7 +1445,7 @@ | |||
126 | 1445 | $buttons .= <<<HTML | 1445 | $buttons .= <<<HTML |
127 | 1446 | <div class="regionicons"> | 1446 | <div class="regionicons"> |
128 | 1447 | <a class="XiboFormButton" title="$title" href="$uri"> | 1447 | <a class="XiboFormButton" title="$title" href="$uri"> |
130 | 1448 | <img class="dash_button" src="$img" /> | 1448 | <img class="dash_button moduleButtonImage" src="$img" /> |
131 | 1449 | <span class="dash_text">$caption</span></a> | 1449 | <span class="dash_text">$caption</span></a> |
132 | 1450 | </div> | 1450 | </div> |
133 | 1451 | HTML; | 1451 | HTML; |
134 | @@ -1456,7 +1456,7 @@ | |||
135 | 1456 | <div id="buttons"> | 1456 | <div id="buttons"> |
136 | 1457 | <div class="regionicons"> | 1457 | <div class="regionicons"> |
137 | 1458 | <a class="XiboFormButton" href="index.php?p=content&q=LibraryAssignForm&layoutid=$this->layoutid®ionid=$regionid" title="Library"> | 1458 | <a class="XiboFormButton" href="index.php?p=content&q=LibraryAssignForm&layoutid=$this->layoutid®ionid=$regionid" title="Library"> |
139 | 1459 | <img class="region_button" src="img/forms/library.gif"/> | 1459 | <img class="region_button moduleButtonImage" src="img/forms/library.gif"/> |
140 | 1460 | <span class="region_text">Library</span></a> | 1460 | <span class="region_text">Library</span></a> |
141 | 1461 | </div> | 1461 | </div> |
142 | 1462 | $buttons | 1462 | $buttons |
143 | 1463 | 1463 | ||
144 | === added file 'server/modules/embedded.module.php' | |||
145 | --- server/modules/embedded.module.php 1970-01-01 00:00:00 +0000 | |||
146 | +++ server/modules/embedded.module.php 2009-06-20 10:05:53 +0000 | |||
147 | @@ -0,0 +1,251 @@ | |||
148 | 1 | <?php | ||
149 | 2 | /* | ||
150 | 3 | * Xibo - Digitial Signage - http://www.xibo.org.uk | ||
151 | 4 | * Copyright (C) 2009 Daniel Garner | ||
152 | 5 | * | ||
153 | 6 | * This file is part of Xibo. | ||
154 | 7 | * | ||
155 | 8 | * Xibo is free software: you can redistribute it and/or modify | ||
156 | 9 | * it under the terms of the GNU Affero General Public License as published by | ||
157 | 10 | * the Free Software Foundation, either version 3 of the License, or | ||
158 | 11 | * any later version. | ||
159 | 12 | * | ||
160 | 13 | * Xibo is distributed in the hope that it will be useful, | ||
161 | 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
162 | 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
163 | 16 | * GNU Affero General Public License for more details. | ||
164 | 17 | * | ||
165 | 18 | * You should have received a copy of the GNU Affero General Public License | ||
166 | 19 | * along with Xibo. If not, see <http://www.gnu.org/licenses/>. | ||
167 | 20 | */ | ||
168 | 21 | class embedded extends Module | ||
169 | 22 | { | ||
170 | 23 | |||
171 | 24 | public function __construct(database $db, user $user, $mediaid = '', $layoutid = '', $regionid = '') | ||
172 | 25 | { | ||
173 | 26 | // Must set the type of the class | ||
174 | 27 | $this->type = 'embedded'; | ||
175 | 28 | |||
176 | 29 | // Must call the parent class | ||
177 | 30 | parent::__construct($db, $user, $mediaid, $layoutid, $regionid); | ||
178 | 31 | } | ||
179 | 32 | |||
180 | 33 | /** | ||
181 | 34 | * Return the Add Form as HTML | ||
182 | 35 | * @return | ||
183 | 36 | */ | ||
184 | 37 | public function AddForm() | ||
185 | 38 | { | ||
186 | 39 | $db =& $this->db; | ||
187 | 40 | $user =& $this->user; | ||
188 | 41 | |||
189 | 42 | // Would like to get the regions width / height | ||
190 | 43 | $layoutid = $this->layoutid; | ||
191 | 44 | $regionid = $this->regionid; | ||
192 | 45 | $rWidth = Kit::GetParam('rWidth', _REQUEST, _STRING); | ||
193 | 46 | $rHeight = Kit::GetParam('rHeight', _REQUEST, _STRING); | ||
194 | 47 | |||
195 | 48 | $form = <<<FORM | ||
196 | 49 | <form class="XiboForm" method="post" action="index.php?p=module&mod=$this->type&q=Exec&method=AddMedia"> | ||
197 | 50 | <input type="hidden" name="layoutid" value="$layoutid"> | ||
198 | 51 | <input type="hidden" id="iRegionId" name="regionid" value="$regionid"> | ||
199 | 52 | <table> | ||
200 | 53 | <tr> | ||
201 | 54 | <td><label for="duration" title="The duration in seconds this webpage should be displayed">Duration<span class="required">*</span></label></td> | ||
202 | 55 | <td><input id="duration" name="duration" type="text"></td> | ||
203 | 56 | </tr> | ||
204 | 57 | <tr> | ||
205 | 58 | <td colspan="2"> | ||
206 | 59 | <label for="embedHtml" title="The HTML you want to Embed in this Layout.">Embed HTML<span class="required">*</span></label><br /> | ||
207 | 60 | <textarea id="embedHtml" name="embedHtml"></textarea> | ||
208 | 61 | </td> | ||
209 | 62 | </tr> | ||
210 | 63 | <tr> | ||
211 | 64 | <td></td> | ||
212 | 65 | <td> | ||
213 | 66 | <input id="btnSave" type="submit" value="Save" /> | ||
214 | 67 | <input class="XiboFormButton" id="btnCancel" type="button" title="Return to the Region Options" href="index.php?p=layout&layoutid=$layoutid®ionid=$regionid&q=RegionOptions" value="Cancel" /> | ||
215 | 68 | </td> | ||
216 | 69 | </tr> | ||
217 | 70 | </table> | ||
218 | 71 | </form> | ||
219 | 72 | FORM; | ||
220 | 73 | |||
221 | 74 | $this->response->html = $form; | ||
222 | 75 | $this->response->dialogTitle = 'Add Embedded HTML'; | ||
223 | 76 | $this->response->dialogSize = true; | ||
224 | 77 | $this->response->dialogWidth = '650px'; | ||
225 | 78 | $this->response->dialogHeight = '450px'; | ||
226 | 79 | |||
227 | 80 | return $this->response; | ||
228 | 81 | } | ||
229 | 82 | |||
230 | 83 | /** | ||
231 | 84 | * Return the Edit Form as HTML | ||
232 | 85 | * @return | ||
233 | 86 | */ | ||
234 | 87 | public function EditForm() | ||
235 | 88 | { | ||
236 | 89 | $db =& $this->db; | ||
237 | 90 | |||
238 | 91 | $layoutid = $this->layoutid; | ||
239 | 92 | $regionid = $this->regionid; | ||
240 | 93 | $mediaid = $this->mediaid; | ||
241 | 94 | |||
242 | 95 | // Get the embedded HTML out of RAW | ||
243 | 96 | $rawXml = new DOMDocument(); | ||
244 | 97 | $rawXml->loadXML($this->GetRaw()); | ||
245 | 98 | |||
246 | 99 | Debug::LogEntry($db, 'audit', 'Raw XML returned: ' . $this->GetRaw()); | ||
247 | 100 | |||
248 | 101 | // Get the HTML Node out of this | ||
249 | 102 | $textNodes = $rawXml->getElementsByTagName('embedHtml'); | ||
250 | 103 | $textNode = $textNodes->item(0); | ||
251 | 104 | $embedHtml = $textNode->nodeValue; | ||
252 | 105 | |||
253 | 106 | //Output the form | ||
254 | 107 | $form = <<<FORM | ||
255 | 108 | <form class="XiboForm" method="post" action="index.php?p=module&mod=$this->type&q=Exec&method=EditMedia"> | ||
256 | 109 | <input type="hidden" name="layoutid" value="$layoutid"> | ||
257 | 110 | <input type="hidden" name="mediaid" value="$mediaid"> | ||
258 | 111 | <input type="hidden" id="iRegionId" name="regionid" value="$regionid"> | ||
259 | 112 | <table> | ||
260 | 113 | <tr> | ||
261 | 114 | <td><label for="duration" title="The duration in seconds this webpage should be displayed (may be overridden on each layout)">Duration<span class="required">*</span></label></td> | ||
262 | 115 | <td><input id="duration" name="duration" value="$this->duration" type="text"></td> | ||
263 | 116 | </tr> | ||
264 | 117 | <tr> | ||
265 | 118 | <td colspan="2"> | ||
266 | 119 | <label for="embedHtml" title="The HTML you want to Embed in this Layout.">Embed HTML<span class="required">*</span></label><br /> | ||
267 | 120 | <textarea id="embedHtml" name="embedHtml">$embedHtml</textarea> | ||
268 | 121 | </td> | ||
269 | 122 | </tr> | ||
270 | 123 | <tr> | ||
271 | 124 | <td></td> | ||
272 | 125 | <td> | ||
273 | 126 | <input id="btnSave" type="submit" value="Save" /> | ||
274 | 127 | <input class="XiboFormButton" id="btnCancel" type="button" title="Return to the Region Options" href="index.php?p=layout&layoutid=$layoutid®ionid=$regionid&q=RegionOptions" value="Cancel" /> | ||
275 | 128 | </td> | ||
276 | 129 | </tr> | ||
277 | 130 | </table> | ||
278 | 131 | </form> | ||
279 | 132 | FORM; | ||
280 | 133 | |||
281 | 134 | $this->response->html = $form; | ||
282 | 135 | $this->response->dialogTitle = 'Edit Embedded HTML'; | ||
283 | 136 | $this->response->dialogSize = true; | ||
284 | 137 | $this->response->dialogWidth = '650px'; | ||
285 | 138 | $this->response->dialogHeight = '450px'; | ||
286 | 139 | |||
287 | 140 | return $this->response; | ||
288 | 141 | } | ||
289 | 142 | |||
290 | 143 | /** | ||
291 | 144 | * Add Media to the Database | ||
292 | 145 | * @return | ||
293 | 146 | */ | ||
294 | 147 | public function AddMedia() | ||
295 | 148 | { | ||
296 | 149 | $db =& $this->db; | ||
297 | 150 | |||
298 | 151 | $layoutid = $this->layoutid; | ||
299 | 152 | $regionid = $this->regionid; | ||
300 | 153 | $mediaid = $this->mediaid; | ||
301 | 154 | |||
302 | 155 | //Other properties | ||
303 | 156 | $embedHtml = Kit::GetParam('embedHtml', _POST, _HTMLSTRING); | ||
304 | 157 | $duration = Kit::GetParam('duration', _POST, _INT, 0); | ||
305 | 158 | |||
306 | 159 | $url = "index.php?p=layout&layoutid=$layoutid®ionid=$regionid&q=RegionOptions"; | ||
307 | 160 | |||
308 | 161 | //Validate the URL? | ||
309 | 162 | if ($embedHtml == "") | ||
310 | 163 | { | ||
311 | 164 | $this->response->SetError('Please enter some HTML to embed.'); | ||
312 | 165 | $this->response->keepOpen = true; | ||
313 | 166 | return $this->response; | ||
314 | 167 | } | ||
315 | 168 | |||
316 | 169 | if ($duration == 0) | ||
317 | 170 | { | ||
318 | 171 | $this->response->SetError('You must enter a duration.'); | ||
319 | 172 | $this->response->keepOpen = true; | ||
320 | 173 | return $this->response; | ||
321 | 174 | } | ||
322 | 175 | |||
323 | 176 | // Required Attributes | ||
324 | 177 | $this->mediaid = md5(uniqid()); | ||
325 | 178 | $this->duration = $duration; | ||
326 | 179 | |||
327 | 180 | // Any Options | ||
328 | 181 | $this->SetRaw('<embedHtml><![CDATA[' . $embedHtml . ']]></embedHtml>'); | ||
329 | 182 | |||
330 | 183 | // Should have built the media object entirely by this time | ||
331 | 184 | // This saves the Media Object to the Region | ||
332 | 185 | $this->UpdateRegion(); | ||
333 | 186 | |||
334 | 187 | //Set this as the session information | ||
335 | 188 | setSession('content', 'type', $this->type); | ||
336 | 189 | |||
337 | 190 | // We want to load a new form | ||
338 | 191 | $this->response->loadForm = true; | ||
339 | 192 | $this->response->loadFormUri= $url; | ||
340 | 193 | |||
341 | 194 | return $this->response; | ||
342 | 195 | } | ||
343 | 196 | |||
344 | 197 | /** | ||
345 | 198 | * Edit Media in the Database | ||
346 | 199 | * @return | ||
347 | 200 | */ | ||
348 | 201 | public function EditMedia() | ||
349 | 202 | { | ||
350 | 203 | $db =& $this->db; | ||
351 | 204 | |||
352 | 205 | $layoutid = $this->layoutid; | ||
353 | 206 | $regionid = $this->regionid; | ||
354 | 207 | $mediaid = $this->mediaid; | ||
355 | 208 | |||
356 | 209 | //Other properties | ||
357 | 210 | $embedHtml = Kit::GetParam('embedHtml', _POST, _HTMLSTRING); | ||
358 | 211 | $duration = Kit::GetParam('duration', _POST, _INT, 0); | ||
359 | 212 | |||
360 | 213 | $url = "index.php?p=layout&layoutid=$layoutid®ionid=$regionid&q=RegionOptions"; | ||
361 | 214 | |||
362 | 215 | //Validate the URL? | ||
363 | 216 | if ($embedHtml == "") | ||
364 | 217 | { | ||
365 | 218 | $this->response->SetError('Please enter some HTML to embed.'); | ||
366 | 219 | $this->response->keepOpen = true; | ||
367 | 220 | return $this->response; | ||
368 | 221 | } | ||
369 | 222 | |||
370 | 223 | if ($duration == 0) | ||
371 | 224 | { | ||
372 | 225 | $this->response->SetError('You must enter a duration.'); | ||
373 | 226 | $this->response->keepOpen = true; | ||
374 | 227 | return $this->response; | ||
375 | 228 | } | ||
376 | 229 | |||
377 | 230 | // Required Attributes | ||
378 | 231 | $this->duration = $duration; | ||
379 | 232 | |||
380 | 233 | // Any Options | ||
381 | 234 | $this->SetRaw('<embedHtml><![CDATA[' . $embedHtml . ']]></embedHtml>'); | ||
382 | 235 | |||
383 | 236 | // Should have built the media object entirely by this time | ||
384 | 237 | // This saves the Media Object to the Region | ||
385 | 238 | $this->UpdateRegion(); | ||
386 | 239 | |||
387 | 240 | //Set this as the session information | ||
388 | 241 | setSession('content', 'type', $this->type); | ||
389 | 242 | |||
390 | 243 | // We want to load a new form | ||
391 | 244 | $this->response->loadForm = true; | ||
392 | 245 | $this->response->loadFormUri= $url; | ||
393 | 246 | |||
394 | 247 | return $this->response; | ||
395 | 248 | } | ||
396 | 249 | } | ||
397 | 250 | |||
398 | 251 | ?> | ||
399 | 0 | \ No newline at end of file | 252 | \ No newline at end of file |
400 | 1 | 253 | ||
401 | === modified file 'server/template/css/presentation.css' | |||
402 | --- server/template/css/presentation.css 2009-01-04 12:59:11 +0000 | |||
403 | +++ server/template/css/presentation.css 2009-06-20 09:34:43 +0000 | |||
404 | @@ -1153,6 +1153,21 @@ | |||
405 | 1153 | margin-left:9px; | 1153 | margin-left:9px; |
406 | 1154 | } | 1154 | } |
407 | 1155 | 1155 | ||
408 | 1156 | .timebar_embedded_left{ | ||
409 | 1157 | background:url(../../img/forms/green_bar.gif) no-repeat; | ||
410 | 1158 | background-position:top left; | ||
411 | 1159 | height:59px; | ||
412 | 1160 | width:9px; | ||
413 | 1161 | float:left; | ||
414 | 1162 | } | ||
415 | 1163 | |||
416 | 1164 | .timebar_embedded_right{ | ||
417 | 1165 | background:url(../../img/forms/green_bar.gif) no-repeat; | ||
418 | 1166 | background-position:top right; | ||
419 | 1167 | height:59px; | ||
420 | 1168 | margin-left:9px; | ||
421 | 1169 | } | ||
422 | 1170 | |||
423 | 1156 | .timebar_text_left{ | 1171 | .timebar_text_left{ |
424 | 1157 | background:url(../../img/forms/yellow_bar.gif) no-repeat; | 1172 | background:url(../../img/forms/yellow_bar.gif) no-repeat; |
425 | 1158 | background-position:top left; | 1173 | background-position:top left; |
426 | 1159 | 1174 | ||
427 | === modified file 'server/template/css/xibo.css' | |||
428 | --- server/template/css/xibo.css 2009-03-22 17:58:21 +0000 | |||
429 | +++ server/template/css/xibo.css 2009-06-20 09:34:43 +0000 | |||
430 | @@ -41,3 +41,12 @@ | |||
431 | 41 | .ReportFault ol li { | 41 | .ReportFault ol li { |
432 | 42 | display: list-item; | 42 | display: list-item; |
433 | 43 | } | 43 | } |
434 | 44 | |||
435 | 45 | .moduleButtonImage { | ||
436 | 46 | width: 65px; | ||
437 | 47 | } | ||
438 | 48 | |||
439 | 49 | #embedHtml { | ||
440 | 50 | width: 500px; | ||
441 | 51 | height: 310px; | ||
442 | 52 | } |