/[drupal]/contributions/themes/BlueSquare/template.php
ViewVC logotype

Contents of /contributions/themes/BlueSquare/template.php

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download) (as text)
Fri Jul 25 04:15:12 2008 UTC (16 months ago) by ciberwing
Branch: MAIN
CVS Tags: DRUPAL-6--1-0, DRUPAL-6--1-1, DRUPAL-6--1-2, HEAD
Branch point for: DRUPAL-6--1
File MIME type: text/x-php
BlueSquare Theme
1 <?php
2 function phptemplate_tinymce_theme($init, $textarea_name, $theme_name, $is_running) {
3 static $access, $integrated;
4
5 if (!isset($access)) {
6 $access = function_exists('imce_access') && imce_access();
7 }
8
9 $init = theme_tinymce_theme($init, $textarea_name, $theme_name, $is_running);
10
11 if ($init && $access) {
12 $init['file_browser_callback'] = 'imceImageBrowser';
13 if (!isset($integrated)) {
14 $integrated = TRUE;
15 drupal_add_js("
16 function imceImageBrowser(field_name, url, type, win) {
17 tinyOpenerWin = win, tinyTargetField = field_name;
18 if (typeof tinyImceWin == 'undefined' || tinyImceWin.closed) {
19 tinyImceWin = window.open(Drupal.settings.basePath +'?q=imce', '', 'width=760,height=560,resizable=1');
20 tinyImceWin['imceOnLoad'] = function () {
21 tinyImceWin.imce.highlight(url.substr(url.lastIndexOf('/')+1));
22 tinyImceWin.imce.setSendTo(Drupal.t('Send to @app', {'@app': 'TinyMCE'}), function(file) {
23 window.focus();
24 tinyOpenerWin.focus();
25 $('#width', tinyOpenerWin.document).val(file.width);
26 $('#height', tinyOpenerWin.document).val(file.height);
27 $('#'+ tinyTargetField, tinyOpenerWin.document).val(file.url).focus();
28 });
29 }
30 }
31 else {
32 tinyImceWin.imce.highlight(url.substr(url.lastIndexOf('/')+1));
33 }
34 tinyImceWin.focus();
35 }
36 ", 'inline');
37 }
38 }
39
40 return $init;
41 }
42 ?>

  ViewVC Help
Powered by ViewVC 1.1.2