2 require_once('config_tinybrowser.php');
4 if(isset($tinybrowser['language']) && file_exists('langs/'.$tinybrowser['language'].'.php'))
6 require_once('langs/'.$tinybrowser['language'].'.php');
10 require_once('langs/en.php'); // Falls back to English
12 require_once('fns_tinybrowser.php');
14 // Check session, if it exists
15 if(session_id() != '')
17 if(!isset($_SESSION[$tinybrowser['sessioncheck']]))
24 if(!$tinybrowser['allowupload'])
30 // Assign get variables
31 $validtypes = array('image','media','file');
32 $typenow = ((isset($_GET['type']) && in_array($_GET['type'],$validtypes)) ? $_GET['type'] : 'image');
33 $foldernow = str_replace(array('../','..\\','./','.\\'),'',($tinybrowser['allowfolders'] && isset($_REQUEST['folder']) ? urldecode($_REQUEST['folder']) : ''));
34 $passfolder = '&folder='.urlencode($foldernow);
35 $passfeid = (isset($_GET['feid']) && $_GET['feid']!='' ? '&feid='.$_GET['feid'] : '');
36 $passupfeid = (isset($_GET['feid']) && $_GET['feid']!='' ? $_GET['feid'] : '');
39 $uploadpath = urlencode($tinybrowser['path'][$typenow].$foldernow);
41 // Assign directory structure to array
43 dirtree($uploaddirs,$tinybrowser['filetype'][$typenow],$tinybrowser['docroot'],$tinybrowser['path'][$typenow]);
45 // determine file dialog file types
46 switch ($_GET['type'])
49 $filestr = TB_TYPEIMG;
52 $filestr = TB_TYPEMEDIA;
55 $filestr = TB_TYPEFILE;
58 $fileexts = str_replace(",",";",$tinybrowser['filetype'][$_GET['type']]);
59 $filelist = $filestr.' ('.$tinybrowser['filetype'][$_GET['type']].')';
61 // Initalise alert array
66 $goodqty = (isset($_GET['goodfiles']) ? $_GET['goodfiles'] : 0);
67 $badqty = (isset($_GET['badfiles']) ? $_GET['badfiles'] : 0);
68 $dupqty = (isset($_GET['dupfiles']) ? $_GET['dupfiles'] : 0);
72 $notify['type'][]='success';
73 $notify['message'][]=sprintf(TB_MSGUPGOOD, $goodqty);
77 $notify['type'][]='failure';
78 $notify['message'][]=sprintf(TB_MSGUPBAD, $badqty);
82 $notify['type'][]='failure';
83 $notify['message'][]=sprintf(TB_MSGUPDUP, $dupqty);
85 if(isset($_GET['permerror']))
87 $notify['type'][]='failure';
88 $notify['message'][]=sprintf(TB_MSGUPFAIL, $tinybrowser['docroot'].$tinybrowser['path'][$typenow]);
91 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
92 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
94 <title>TinyBrowser :: <?php echo TB_UPLOAD; ?></title>
95 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
96 <meta http-equiv="Pragma" content="no-cache" />
98 if($passfeid == '' && $tinybrowser['integration']=='tinymce')
100 ?><link rel="stylesheet" type="text/css" media="all" href="<?php echo $tinybrowser['tinymcecss']; ?>" /><?php
104 ?><link rel="stylesheet" type="text/css" media="all" href="css/stylefull_tinybrowser.css" /><?php
107 <link rel="stylesheet" type="text/css" media="all" href="css/style_tinybrowser.css.php" />
108 <script type="text/javascript" src="js/swfobject.js"></script>
109 <script type="text/javascript">
110 function uploadComplete(url) {
111 document.location = url;
116 var so = new SWFObject("flexupload.swf", "mymovie", "100%", "340", "9", "#ffffff");
117 so.addVariable("folder", "<?php echo $uploadpath; ?>");
118 so.addVariable("uptype", "<?php echo $typenow; ?>");
119 so.addVariable("destid", "<?php echo $passupfeid; ?>");
120 so.addVariable("maxsize", "<?php echo $tinybrowser['maxsize'][$_GET['type']]; ?>");
121 so.addVariable("sessid", "<?php echo session_id(); ?>");
122 so.addVariable("obfus", "<?php echo md5($_SERVER['DOCUMENT_ROOT'].$tinybrowser['obfuscate']); ?>");
123 so.addVariable("filenames", "<?php echo $filelist; ?>");
124 so.addVariable("extensions", "<?php echo $fileexts; ?>");
125 so.addVariable("filenamelbl", "<?php echo TB_FILENAME; ?>");
126 so.addVariable("sizelbl", "<?php echo TB_SIZE; ?>");
127 so.addVariable("typelbl", "<?php echo TB_TYPE; ?>");
128 so.addVariable("progresslbl", "<?php echo TB_PROGRESS; ?>");
129 so.addVariable("browselbl", "<?php echo TB_BROWSE; ?>");
130 so.addVariable("removelbl", "<?php echo TB_REMOVE; ?>");
131 so.addVariable("uploadlbl", "<?php echo TB_UPLOAD; ?>");
132 so.addVariable("uplimitmsg", "<?php echo TB_MSGMAXSIZE; ?>");
133 so.addVariable("uplimitlbl", "<?php echo TB_TTLMAXSIZE; ?>");
134 so.addVariable("uplimitbyte", "<?php echo TB_BYTES; ?>");
135 so.addParam("allowScriptAccess", "always");
136 so.addParam("type", "application/x-shockwave-flash");
137 so.write("flashcontent");'>
139 if(count($notify['type'])>0) alert($notify);
140 form_open('foldertab',false,'upload.php','?type='.$typenow.$passfeid);
144 <li id="browse_tab"><span><a href="tinybrowser.php?type=<?php echo $typenow.$passfolder.$passfeid ; ?>"><?php echo TB_BROWSE; ?></a></span></li>
145 <li id="upload_tab" class="current"><span><a href="upload.php?type=<?php echo $typenow.$passfolder.$passfeid ; ?>"><?php echo TB_UPLOAD; ?></a></span></li>
147 if($tinybrowser['allowedit'] || $tinybrowser['allowdelete'])
149 ?><li id="edit_tab"><span><a href="edit.php?type=<?php echo $typenow.$passfolder.$passfeid ; ?>"><?php echo TB_EDIT; ?></a></span></li>
152 if($tinybrowser['allowfolders'])
154 ?><li id="folders_tab"><span><a href="folders.php?type=<?php echo $typenow.$passfolder.$passfeid; ?>"><?php echo TB_FOLDERS; ?></a></span></li><?php
156 // Display folder select, if multiple exist
157 if(count($uploaddirs)>1)
159 ?><li id="folder_tab" class="right"><span><?php
160 form_select($uploaddirs,'folder',TB_FOLDERCURR,urlencode($foldernow),true);
167 <div class="panel_wrapper">
168 <div id="general_panel" class="panel currentmod">
170 <legend><?php echo TB_UPLOADFILES; ?></legend>
174 <div id="flashcontent"></div>
175 </fieldset></div></div>