[0] | 1 | <?php |
---|
| 2 | # -- BEGIN LICENSE BLOCK --------------------------------------- |
---|
| 3 | # |
---|
| 4 | # This file is part of Dotclear 2. |
---|
| 5 | # |
---|
[1179] | 6 | # Copyright (c) 2003-2013 Olivier Meunier & Association Dotclear |
---|
[0] | 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 | if (!defined('DC_RC_PATH')) { return; } |
---|
| 13 | |
---|
| 14 | define('DC_AUTH_PAGE','auth.php'); |
---|
| 15 | |
---|
| 16 | class dcPage |
---|
| 17 | { |
---|
[342] | 18 | private static $loaded_js=array(); |
---|
| 19 | |
---|
[0] | 20 | # Auth check |
---|
| 21 | public static function check($permissions) |
---|
| 22 | { |
---|
| 23 | global $core; |
---|
[1187] | 24 | |
---|
[0] | 25 | if ($core->blog && $core->auth->check($permissions,$core->blog->id)) |
---|
| 26 | { |
---|
| 27 | return; |
---|
| 28 | } |
---|
[1187] | 29 | |
---|
[0] | 30 | if (session_id()) { |
---|
| 31 | $core->session->destroy(); |
---|
| 32 | } |
---|
| 33 | http::redirect(DC_AUTH_PAGE); |
---|
| 34 | } |
---|
[1187] | 35 | |
---|
[0] | 36 | # Check super admin |
---|
| 37 | public static function checkSuper() |
---|
| 38 | { |
---|
| 39 | global $core; |
---|
[1187] | 40 | |
---|
[0] | 41 | if (!$core->auth->isSuperAdmin()) |
---|
| 42 | { |
---|
| 43 | if (session_id()) { |
---|
| 44 | $core->session->destroy(); |
---|
| 45 | } |
---|
| 46 | http::redirect(DC_AUTH_PAGE); |
---|
| 47 | } |
---|
| 48 | } |
---|
[1187] | 49 | |
---|
[0] | 50 | # Top of admin page |
---|
[1358] | 51 | public static function open($title='',$head='',$breadcrumb='') |
---|
[0] | 52 | { |
---|
| 53 | global $core; |
---|
[1144] | 54 | |
---|
[0] | 55 | # List of user's blogs |
---|
| 56 | if ($core->auth->blog_count == 1 || $core->auth->blog_count > 20) |
---|
| 57 | { |
---|
| 58 | $blog_box = |
---|
[999] | 59 | '<p>'.__('Blog:').' <strong title="'.html::escapeHTML($core->blog->url).'">'. |
---|
[0] | 60 | html::escapeHTML($core->blog->name).'</strong>'; |
---|
[1187] | 61 | |
---|
[0] | 62 | if ($core->auth->blog_count > 20) { |
---|
| 63 | $blog_box .= ' - <a href="blogs.php">'.__('Change blog').'</a>'; |
---|
| 64 | } |
---|
[999] | 65 | $blog_box .= '</p>'; |
---|
[0] | 66 | } |
---|
| 67 | else |
---|
| 68 | { |
---|
| 69 | $rs_blogs = $core->getBlogs(array('order'=>'LOWER(blog_name)','limit'=>20)); |
---|
| 70 | $blogs = array(); |
---|
| 71 | while ($rs_blogs->fetch()) { |
---|
| 72 | $blogs[html::escapeHTML($rs_blogs->blog_name.' - '.$rs_blogs->blog_url)] = $rs_blogs->blog_id; |
---|
| 73 | } |
---|
| 74 | $blog_box = |
---|
[1310] | 75 | '<p><label for="switchblog" class="classic nomobile">'. |
---|
[1309] | 76 | __('Blogs:').'</label> '. |
---|
[0] | 77 | $core->formNonce(). |
---|
[454] | 78 | form::combo('switchblog',$blogs,$core->blog->id). |
---|
[1309] | 79 | '</p>'. |
---|
[999] | 80 | '<noscript><p><input type="submit" value="'.__('ok').'" /></p></noscript>'; |
---|
[0] | 81 | } |
---|
[1187] | 82 | |
---|
[36] | 83 | $safe_mode = isset($_SESSION['sess_safe_mode']) && $_SESSION['sess_safe_mode']; |
---|
[1187] | 84 | |
---|
[0] | 85 | # Display |
---|
| 86 | header('Content-Type: text/html; charset=UTF-8'); |
---|
| 87 | echo |
---|
| 88 | '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" '. |
---|
| 89 | ' "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'."\n". |
---|
| 90 | '<html xmlns="http://www.w3.org/1999/xhtml" '. |
---|
| 91 | 'xml:lang="'.$core->auth->getInfo('user_lang').'" '. |
---|
| 92 | 'lang="'.$core->auth->getInfo('user_lang').'">'."\n". |
---|
| 93 | "<head>\n". |
---|
| 94 | ' <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />'."\n". |
---|
[1188] | 95 | ' <meta name="ROBOTS" content="NOARCHIVE,NOINDEX,NOFOLLOW" />'."\n". |
---|
| 96 | ' <meta name="GOOGLEBOT" content="NOSNIPPET" />'."\n". |
---|
[1310] | 97 | ' <meta name="viewport" content="width=device-width, initial-scale=1.0" />'."\n". |
---|
[0] | 98 | ' <title>'.$title.' - '.html::escapeHTML($core->blog->name).' - '.html::escapeHTML(DC_VENDOR_NAME).' - '.DC_VERSION.'</title>'."\n". |
---|
[1187] | 99 | |
---|
| 100 | |
---|
[0] | 101 | self::jsLoadIE7(). |
---|
[1187] | 102 | ' <link rel="stylesheet" href="style/default.css" type="text/css" media="screen" />'."\n"; |
---|
[0] | 103 | if (l10n::getTextDirection($GLOBALS['_lang']) == 'rtl') { |
---|
[473] | 104 | echo |
---|
[1187] | 105 | ' <link rel="stylesheet" href="style/default-rtl.css" type="text/css" media="screen" />'."\n"; |
---|
[0] | 106 | } |
---|
[237] | 107 | |
---|
[244] | 108 | $core->auth->user_prefs->addWorkspace('interface'); |
---|
| 109 | $user_ui_hide_std_favicon = $core->auth->user_prefs->interface->hide_std_favicon; |
---|
| 110 | if (!$user_ui_hide_std_favicon) { |
---|
| 111 | echo '<link rel="icon" type="image/png" href="images/favicon.png" />'; |
---|
| 112 | } |
---|
[1187] | 113 | |
---|
[0] | 114 | echo |
---|
| 115 | self::jsCommon(). |
---|
| 116 | $head; |
---|
[1187] | 117 | |
---|
[0] | 118 | # --BEHAVIOR-- adminPageHTMLHead |
---|
| 119 | $core->callBehavior('adminPageHTMLHead'); |
---|
[1187] | 120 | |
---|
[0] | 121 | echo |
---|
| 122 | "</head>\n". |
---|
[36] | 123 | '<body id="dotclear-admin'. |
---|
| 124 | ($safe_mode ? ' safe-mode' : ''). |
---|
| 125 | '">'."\n". |
---|
[1187] | 126 | |
---|
[647] | 127 | '<div id="header">'. |
---|
[812] | 128 | '<ul id="prelude"><li><a href="#content">'.__('Go to the content').'</a></li><li><a href="#main-menu">'.__('Go to the menu').'</a></li></ul>'."\n". |
---|
[1187] | 129 | '<div id="top"><h1><a href="index.php">'.DC_VENDOR_NAME.'</a></h1></div>'."\n"; |
---|
| 130 | |
---|
[0] | 131 | echo |
---|
[489] | 132 | '<div id="info-boxes">'. |
---|
| 133 | '<div id="info-box1">'. |
---|
| 134 | '<form action="index.php" method="post">'. |
---|
[0] | 135 | $blog_box. |
---|
[1310] | 136 | '<p class="nomobile"><a href="'.$core->blog->url.'" onclick="window.open(this.href);return false;" title="'.__('Go to site').' ('.__('new window').')'.'">'.__('Go to site').' <img src="images/outgoing.png" alt="" /></a>'. |
---|
[999] | 137 | '</p></form>'. |
---|
[3] | 138 | '</div>'. |
---|
[489] | 139 | '<div id="info-box2">'. |
---|
[1318] | 140 | '<a class="smallscreen'.(preg_match('/index.php$/',$_SERVER['REQUEST_URI']) ? ' active' : '').'" href="index.php">'.__('My dashboard').'</a>'. |
---|
| 141 | '<span class="smallscreen"> | </span><a class="smallscreen'.(preg_match('/preferences.php(\?.*)?$/',$_SERVER['REQUEST_URI']) ? ' active' : '').'" href="preferences.php">'.__('My preferences').'</a>'. |
---|
[1309] | 142 | '<span class="smallscreen"> | </span><a href="index.php?logout=1" class="logout">'.sprintf(__('Logout %s'),$core->auth->userID()).' <img src="images/logout.png" alt="" /></a>'. |
---|
[489] | 143 | '</div>'. |
---|
[118] | 144 | '</div>'. |
---|
[0] | 145 | '</div>'; |
---|
[1187] | 146 | |
---|
[0] | 147 | echo |
---|
| 148 | '<div id="wrapper">'."\n". |
---|
| 149 | '<div id="main">'."\n". |
---|
| 150 | '<div id="content">'."\n"; |
---|
[1187] | 151 | |
---|
[36] | 152 | # Safe mode |
---|
| 153 | if ($safe_mode) |
---|
[0] | 154 | { |
---|
| 155 | echo |
---|
[36] | 156 | '<div class="error"><h3>'.__('Safe mode').'</h3>'. |
---|
[37] | 157 | '<p>'.__('You are in safe mode. All plugins have been temporarily disabled. Remind to log out then log in again normally to get back all functionalities').'</p>'. |
---|
[0] | 158 | '</div>'; |
---|
| 159 | } |
---|
[1187] | 160 | |
---|
[1355] | 161 | // Display breadcrumb (if given) before any error message |
---|
[1357] | 162 | echo $breadcrumb; |
---|
[1355] | 163 | |
---|
[0] | 164 | if ($core->error->flag()) { |
---|
| 165 | echo |
---|
[973] | 166 | '<div class="error"><p><strong>'.(count($core->error->getErrors()) > 1 ? __('Errors:') : __('Error:')).'</p></strong>'. |
---|
[0] | 167 | $core->error->toHTML(). |
---|
| 168 | '</div>'; |
---|
| 169 | } |
---|
| 170 | } |
---|
[1187] | 171 | |
---|
[0] | 172 | public static function close() |
---|
| 173 | { |
---|
[942] | 174 | global $core; |
---|
| 175 | |
---|
[0] | 176 | $menu =& $GLOBALS['_menu']; |
---|
[1187] | 177 | |
---|
[0] | 178 | echo |
---|
| 179 | "</div>\n". // End of #content |
---|
| 180 | "</div>\n". // End of #main |
---|
[1187] | 181 | |
---|
[1311] | 182 | '<div id="main-menu">'."\n". |
---|
| 183 | |
---|
| 184 | '<form id="search-menu" action="search.php" method="get">'. |
---|
| 185 | '<p><label for="q" class="hidden">'.__('Search:').' </label>'.form::field('q',30,255,''). |
---|
| 186 | '<input type="submit" value="'.__('OK').'" /></p>'. |
---|
| 187 | '</form>'; |
---|
[1187] | 188 | |
---|
[0] | 189 | foreach ($menu as $k => $v) { |
---|
| 190 | echo $menu[$k]->draw(); |
---|
| 191 | } |
---|
[1187] | 192 | |
---|
[1140] | 193 | $text = sprintf(__('Thank you for using %s.'),'Dotclear '.DC_VERSION); |
---|
[942] | 194 | |
---|
| 195 | # --BEHAVIOR-- adminPageFooter |
---|
[946] | 196 | $textAlt = $core->callBehavior('adminPageFooter',$core,$text); |
---|
[1140] | 197 | if ($textAlt != '') { |
---|
| 198 | $text = $textAlt; |
---|
| 199 | } |
---|
[1142] | 200 | $text = html::escapeHTML($text); |
---|
[942] | 201 | |
---|
[0] | 202 | echo |
---|
| 203 | '</div>'."\n". // End of #main-menu |
---|
[1329] | 204 | '<div id="footer"><a href="http://dotclear.org/" title="'.$text.'"><img src="style/dc_logos/w-dotclear90.png" alt="'.$text.'" /></a></div>'."\n". |
---|
[0] | 205 | "</div>\n"; // End of #wrapper |
---|
[1187] | 206 | |
---|
[0] | 207 | if (defined('DC_DEV') && DC_DEV === true) { |
---|
| 208 | echo self::debugInfo(); |
---|
| 209 | } |
---|
[1187] | 210 | |
---|
[0] | 211 | echo |
---|
| 212 | '</body></html>'; |
---|
| 213 | } |
---|
[1187] | 214 | |
---|
[1358] | 215 | public static function openPopup($title='',$head='',$breadcrumb='') |
---|
[0] | 216 | { |
---|
| 217 | global $core; |
---|
[1187] | 218 | |
---|
[0] | 219 | # Display |
---|
| 220 | header('Content-Type: text/html; charset=UTF-8'); |
---|
| 221 | echo |
---|
| 222 | '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" '. |
---|
| 223 | ' "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'."\n". |
---|
| 224 | '<html xmlns="http://www.w3.org/1999/xhtml" '. |
---|
| 225 | 'xml:lang="'.$core->auth->getInfo('user_lang').'" '. |
---|
| 226 | 'lang="'.$core->auth->getInfo('user_lang').'">'."\n". |
---|
[1311] | 227 | '<meta name="viewport" content="width=device-width, initial-scale=1.0" />'."\n". |
---|
[0] | 228 | "<head>\n". |
---|
| 229 | ' <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />'."\n". |
---|
| 230 | ' <title>'.$title.' - '.html::escapeHTML($core->blog->name).' - '.html::escapeHTML(DC_VENDOR_NAME).' - '.DC_VERSION.'</title>'."\n". |
---|
[1187] | 231 | |
---|
[0] | 232 | ' <meta name="ROBOTS" content="NOARCHIVE,NOINDEX,NOFOLLOW" />'."\n". |
---|
| 233 | ' <meta name="GOOGLEBOT" content="NOSNIPPET" />'."\n". |
---|
[1187] | 234 | |
---|
[0] | 235 | self::jsLoadIE7(). |
---|
[1187] | 236 | ' <link rel="stylesheet" href="style/default.css" type="text/css" media="screen" />'."\n"; |
---|
[0] | 237 | if (l10n::getTextDirection($GLOBALS['_lang']) == 'rtl') { |
---|
[473] | 238 | echo |
---|
[1187] | 239 | ' <link rel="stylesheet" href="style/default-rtl.css" type="text/css" media="screen" />'."\n"; |
---|
[0] | 240 | } |
---|
[1187] | 241 | |
---|
[0] | 242 | echo |
---|
| 243 | self::jsCommon(). |
---|
| 244 | $head; |
---|
[1187] | 245 | |
---|
[0] | 246 | # --BEHAVIOR-- adminPageHTMLHead |
---|
| 247 | $core->callBehavior('adminPageHTMLHead'); |
---|
[1187] | 248 | |
---|
[0] | 249 | echo |
---|
| 250 | "</head>\n". |
---|
| 251 | '<body id="dotclear-admin" class="popup">'."\n". |
---|
[1187] | 252 | |
---|
[1311] | 253 | '<div id="top hidden"><h1>'.DC_VENDOR_NAME.'</h1></div>'."\n"; |
---|
[1187] | 254 | |
---|
[0] | 255 | echo |
---|
| 256 | '<div id="wrapper">'."\n". |
---|
| 257 | '<div id="main">'."\n". |
---|
| 258 | '<div id="content">'."\n"; |
---|
[1187] | 259 | |
---|
[1358] | 260 | // display breadcrumb if given |
---|
| 261 | echo $breadcrumb; |
---|
| 262 | |
---|
[0] | 263 | if ($core->error->flag()) { |
---|
| 264 | echo |
---|
| 265 | '<div class="error"><strong>'.__('Errors:').'</strong>'. |
---|
| 266 | $core->error->toHTML(). |
---|
| 267 | '</div>'; |
---|
| 268 | } |
---|
| 269 | } |
---|
[1187] | 270 | |
---|
[0] | 271 | public static function closePopup() |
---|
| 272 | { |
---|
| 273 | echo |
---|
| 274 | "</div>\n". // End of #content |
---|
| 275 | "</div>\n". // End of #main |
---|
| 276 | '<div id="footer"><p> </p></div>'."\n". |
---|
| 277 | "</div>\n". // End of #wrapper |
---|
| 278 | '</body></html>'; |
---|
| 279 | } |
---|
[907] | 280 | |
---|
[1358] | 281 | public static function breadcrumb($elements=null,$with_home_link=true,$echo=false) |
---|
[1328] | 282 | { |
---|
| 283 | // First item of array elements should be blog's name, System or Plugins |
---|
[1340] | 284 | $res = '<h2>'.($with_home_link ? |
---|
| 285 | '<a class="go_home" href="index.php"><img src="style/dashboard.png" alt="'.__('Go to dashboard').'" /></a>' : |
---|
| 286 | '<img src="style/dashboard-alt.png" alt="" />'); |
---|
[1328] | 287 | $index = 0; |
---|
| 288 | foreach ($elements as $element => $url) { |
---|
[1358] | 289 | $res .= ($with_home_link ? ($index == 1 ? ' : ' : ' › ') : ($index == 0 ? ' ' : ' › ')). |
---|
| 290 | ($url ? '<a href="'.$url.'">' : '').$element.($url ? '</a>' : ''); |
---|
[1328] | 291 | $index++; |
---|
| 292 | } |
---|
| 293 | $res .= '</h2>'; |
---|
[1334] | 294 | if ($echo) { |
---|
| 295 | echo $res; |
---|
| 296 | } |
---|
[1328] | 297 | return $res; |
---|
| 298 | } |
---|
| 299 | |
---|
[907] | 300 | public static function message($msg,$timestamp=true,$div=false,$echo=true) |
---|
| 301 | { |
---|
[910] | 302 | global $core; |
---|
[1187] | 303 | |
---|
[907] | 304 | $res = ''; |
---|
| 305 | if ($msg != '') { |
---|
| 306 | $res = ($div ? '<div class="message">' : '').'<p'.($div ? '' : ' class="message"').'>'. |
---|
[1161] | 307 | ($timestamp ? dt::str(__('%H:%M:%S:'),null,$core->auth->getInfo('user_tz')).' ' : '').$msg. |
---|
| 308 | '</p>'.($div ? '</div>' : ''); |
---|
[907] | 309 | if ($echo) { |
---|
| 310 | echo $res; |
---|
| 311 | } |
---|
| 312 | } |
---|
| 313 | return $res; |
---|
| 314 | } |
---|
[1187] | 315 | |
---|
[0] | 316 | private static function debugInfo() |
---|
| 317 | { |
---|
| 318 | $global_vars = implode(', ',array_keys($GLOBALS)); |
---|
[1187] | 319 | |
---|
[0] | 320 | $res = |
---|
| 321 | '<div id="debug"><div>'. |
---|
| 322 | '<p>memory usage: '.memory_get_usage().' ('.files::size(memory_get_usage()).')</p>'; |
---|
[1187] | 323 | |
---|
[0] | 324 | if (function_exists('xdebug_get_profiler_filename')) |
---|
| 325 | { |
---|
| 326 | $res .= '<p>Elapsed time: '.xdebug_time_index().' seconds</p>'; |
---|
[1187] | 327 | |
---|
[0] | 328 | $prof_file = xdebug_get_profiler_filename(); |
---|
| 329 | if ($prof_file) { |
---|
| 330 | $res .= '<p>Profiler file : '.xdebug_get_profiler_filename().'</p>'; |
---|
| 331 | } else { |
---|
| 332 | $prof_url = http::getSelfURI(); |
---|
[321] | 333 | $prof_url .= (strpos($prof_url,'?') === false) ? '?' : '&'; |
---|
[0] | 334 | $prof_url .= 'XDEBUG_PROFILE'; |
---|
[321] | 335 | $res .= '<p><a href="'.html::escapeURL($prof_url).'">Trigger profiler</a></p>'; |
---|
[0] | 336 | } |
---|
[1187] | 337 | |
---|
[0] | 338 | /* xdebug configuration: |
---|
| 339 | zend_extension = /.../xdebug.so |
---|
| 340 | xdebug.auto_trace = On |
---|
| 341 | xdebug.trace_format = 0 |
---|
| 342 | xdebug.trace_options = 1 |
---|
| 343 | xdebug.show_mem_delta = On |
---|
| 344 | xdebug.profiler_enable = 0 |
---|
| 345 | xdebug.profiler_enable_trigger = 1 |
---|
| 346 | xdebug.profiler_output_dir = /tmp |
---|
| 347 | xdebug.profiler_append = 0 |
---|
| 348 | xdebug.profiler_output_name = timestamp |
---|
| 349 | */ |
---|
| 350 | } |
---|
[1187] | 351 | |
---|
[0] | 352 | $res .= |
---|
| 353 | '<p>Global vars: '.$global_vars.'</p>'. |
---|
| 354 | '</div></div>'; |
---|
[1187] | 355 | |
---|
[0] | 356 | return $res; |
---|
| 357 | } |
---|
[1187] | 358 | |
---|
[0] | 359 | public static function help($page,$index='') |
---|
| 360 | { |
---|
| 361 | # Deprecated but we keep this for plugins. |
---|
| 362 | } |
---|
[1187] | 363 | |
---|
[0] | 364 | public static function helpBlock() |
---|
| 365 | { |
---|
| 366 | $args = func_get_args(); |
---|
| 367 | if (empty($args)) { |
---|
| 368 | return; |
---|
| 369 | }; |
---|
[1187] | 370 | |
---|
[0] | 371 | global $__resources; |
---|
| 372 | if (empty($__resources['help'])) { |
---|
| 373 | return; |
---|
| 374 | } |
---|
[1187] | 375 | |
---|
[0] | 376 | $content = ''; |
---|
| 377 | foreach ($args as $v) |
---|
| 378 | { |
---|
| 379 | if (is_object($v) && isset($v->content)) { |
---|
| 380 | $content .= $v->content; |
---|
| 381 | continue; |
---|
| 382 | } |
---|
[1187] | 383 | |
---|
[0] | 384 | if (!isset($__resources['help'][$v])) { |
---|
| 385 | continue; |
---|
| 386 | } |
---|
| 387 | $f = $__resources['help'][$v]; |
---|
| 388 | if (!file_exists($f) || !is_readable($f)) { |
---|
| 389 | continue; |
---|
| 390 | } |
---|
[1187] | 391 | |
---|
[0] | 392 | $fc = file_get_contents($f); |
---|
| 393 | if (preg_match('|<body[^>]*?>(.*?)</body>|ms',$fc,$matches)) { |
---|
| 394 | $content .= $matches[1]; |
---|
| 395 | } else { |
---|
| 396 | $content .= $fc; |
---|
| 397 | } |
---|
| 398 | } |
---|
[1187] | 399 | |
---|
[0] | 400 | if (trim($content) == '') { |
---|
| 401 | return; |
---|
| 402 | } |
---|
[1187] | 403 | |
---|
[0] | 404 | echo |
---|
[3] | 405 | '<div id="help"><hr /><div class="help-content clear"><h2>'.__('Help').'</h2>'. |
---|
[0] | 406 | $content. |
---|
| 407 | '</div></div>'; |
---|
| 408 | } |
---|
[1187] | 409 | |
---|
[0] | 410 | public static function jsLoad($src) |
---|
| 411 | { |
---|
[342] | 412 | $escaped_src = html::escapeHTML($src); |
---|
| 413 | if (!isset(self::$loaded_js[$escaped_src])) { |
---|
| 414 | self::$loaded_js[$escaped_src]=true; |
---|
| 415 | return '<script type="text/javascript" src="'.$escaped_src.'"></script>'."\n"; |
---|
| 416 | } |
---|
[0] | 417 | } |
---|
[1187] | 418 | |
---|
[0] | 419 | public static function jsVar($n,$v) |
---|
| 420 | { |
---|
| 421 | return $n." = '".html::escapeJS($v)."';\n"; |
---|
| 422 | } |
---|
[1187] | 423 | |
---|
[0] | 424 | public static function jsCommon() |
---|
| 425 | { |
---|
| 426 | return |
---|
| 427 | self::jsLoad('js/jquery/jquery.js'). |
---|
| 428 | self::jsLoad('js/jquery/jquery.biscuit.js'). |
---|
| 429 | self::jsLoad('js/jquery/jquery.bgFade.js'). |
---|
| 430 | self::jsLoad('js/common.js'). |
---|
[447] | 431 | self::jsLoad('js/prelude.js'). |
---|
[1187] | 432 | |
---|
[0] | 433 | '<script type="text/javascript">'."\n". |
---|
| 434 | "//<![CDATA[\n". |
---|
| 435 | self::jsVar('dotclear.nonce',$GLOBALS['core']->getNonce()). |
---|
[1187] | 436 | |
---|
[1019] | 437 | self::jsVar('dotclear.img_plus_src','images/expand.png'). |
---|
[0] | 438 | self::jsVar('dotclear.img_plus_alt',__('uncover')). |
---|
[1019] | 439 | self::jsVar('dotclear.img_minus_src','images/hide.png'). |
---|
[0] | 440 | self::jsVar('dotclear.img_minus_alt',__('hide')). |
---|
| 441 | self::jsVar('dotclear.img_menu_on','images/menu_on.png'). |
---|
| 442 | self::jsVar('dotclear.img_menu_off','images/menu_off.png'). |
---|
[1187] | 443 | |
---|
[0] | 444 | self::jsVar('dotclear.msg.help', |
---|
[1302] | 445 | __('Help about this page')). |
---|
| 446 | self::jsVar('dotclear.msg.help_hide', |
---|
| 447 | __('Hide')). |
---|
[0] | 448 | self::jsVar('dotclear.msg.no_selection', |
---|
| 449 | __('no selection')). |
---|
| 450 | self::jsVar('dotclear.msg.select_all', |
---|
| 451 | __('select all')). |
---|
| 452 | self::jsVar('dotclear.msg.invert_sel', |
---|
| 453 | __('invert selection')). |
---|
| 454 | self::jsVar('dotclear.msg.website', |
---|
| 455 | __('Web site:')). |
---|
| 456 | self::jsVar('dotclear.msg.email', |
---|
| 457 | __('Email:')). |
---|
| 458 | self::jsVar('dotclear.msg.ip_address', |
---|
| 459 | __('IP address:')). |
---|
| 460 | self::jsVar('dotclear.msg.error', |
---|
| 461 | __('Error:')). |
---|
| 462 | self::jsVar('dotclear.msg.entry_created', |
---|
| 463 | __('Entry has been successfully created.')). |
---|
| 464 | self::jsVar('dotclear.msg.edit_entry', |
---|
| 465 | __('Edit entry')). |
---|
| 466 | self::jsVar('dotclear.msg.view_entry', |
---|
| 467 | __('view entry')). |
---|
| 468 | self::jsVar('dotclear.msg.confirm_delete_posts', |
---|
| 469 | __("Are you sure you want to delete selected entries (%s)?")). |
---|
| 470 | self::jsVar('dotclear.msg.confirm_delete_post', |
---|
| 471 | __("Are you sure you want to delete this entry?")). |
---|
[1395] | 472 | self::jsVar('dotclear.msg.click_to_unlock', |
---|
[1450] | 473 | __("Click here to unlock the field")). |
---|
[1049] | 474 | self::jsVar('dotclear.msg.confirm_spam_delete', |
---|
| 475 | __('Are you sure you want to delete all spams?')). |
---|
[0] | 476 | self::jsVar('dotclear.msg.confirm_delete_comments', |
---|
| 477 | __('Are you sure you want to delete selected comments (%s)?')). |
---|
| 478 | self::jsVar('dotclear.msg.confirm_delete_comment', |
---|
| 479 | __('Are you sure you want to delete this comment?')). |
---|
| 480 | self::jsVar('dotclear.msg.cannot_delete_users', |
---|
| 481 | __('Users with posts cannot be deleted.')). |
---|
| 482 | self::jsVar('dotclear.msg.confirm_delete_user', |
---|
| 483 | __('Are you sure you want to delete selected users (%s)?')). |
---|
| 484 | self::jsVar('dotclear.msg.confirm_delete_category', |
---|
| 485 | __('Are you sure you want to delete category "%s"?')). |
---|
| 486 | self::jsVar('dotclear.msg.confirm_reorder_categories', |
---|
| 487 | __('Are you sure you want to reorder all categories?')). |
---|
| 488 | self::jsVar('dotclear.msg.confirm_delete_media', |
---|
| 489 | __('Are you sure you want to remove media "%s"?')). |
---|
| 490 | self::jsVar('dotclear.msg.confirm_extract_current', |
---|
| 491 | __('Are you sure you want to extract archive in current directory?')). |
---|
| 492 | self::jsVar('dotclear.msg.confirm_remove_attachment', |
---|
| 493 | __('Are you sure you want to remove attachment "%s"?')). |
---|
| 494 | self::jsVar('dotclear.msg.confirm_delete_lang', |
---|
| 495 | __('Are you sure you want to delete "%s" language?')). |
---|
| 496 | self::jsVar('dotclear.msg.confirm_delete_plugin', |
---|
| 497 | __('Are you sure you want to delete "%s" plugin?')). |
---|
| 498 | self::jsVar('dotclear.msg.use_this_theme', |
---|
| 499 | __('Use this theme')). |
---|
| 500 | self::jsVar('dotclear.msg.remove_this_theme', |
---|
| 501 | __('Remove this theme')). |
---|
| 502 | self::jsVar('dotclear.msg.confirm_delete_theme', |
---|
| 503 | __('Are you sure you want to delete "%s" theme?')). |
---|
| 504 | self::jsVar('dotclear.msg.zip_file_content', |
---|
| 505 | __('Zip file content')). |
---|
| 506 | self::jsVar('dotclear.msg.xhtml_validator', |
---|
| 507 | __('XHTML markup validator')). |
---|
| 508 | self::jsVar('dotclear.msg.xhtml_valid', |
---|
| 509 | __('XHTML content is valid.')). |
---|
| 510 | self::jsVar('dotclear.msg.xhtml_not_valid', |
---|
| 511 | __('There are XHTML markup errors.')). |
---|
| 512 | self::jsVar('dotclear.msg.confirm_change_post_format', |
---|
| 513 | __('You have unsaved changes. Switch post format will loose these changes. Proceed anyway?')). |
---|
[224] | 514 | self::jsVar('dotclear.msg.load_enhanced_uploader', |
---|
| 515 | __('Loading enhanced uploader, please wait.')). |
---|
[0] | 516 | "\n//]]>\n". |
---|
| 517 | "</script>\n"; |
---|
| 518 | } |
---|
[1187] | 519 | |
---|
[0] | 520 | public static function jsLoadIE7() |
---|
| 521 | { |
---|
| 522 | return |
---|
| 523 | '<!--[if lt IE 8]>'."\n". |
---|
| 524 | self::jsLoad('js/ie7/IE8.js'). |
---|
| 525 | '<link rel="stylesheet" type="text/css" href="style/iesucks.css" />'."\n". |
---|
| 526 | '<![endif]-->'."\n"; |
---|
| 527 | } |
---|
[1187] | 528 | |
---|
[0] | 529 | public static function jsConfirmClose() |
---|
| 530 | { |
---|
| 531 | $args = func_get_args(); |
---|
| 532 | if (count($args) > 0) { |
---|
| 533 | foreach ($args as $k => $v) { |
---|
| 534 | $args[$k] = "'".html::escapeJS($v)."'"; |
---|
| 535 | } |
---|
| 536 | $args = implode(',',$args); |
---|
| 537 | } else { |
---|
| 538 | $args = ''; |
---|
| 539 | } |
---|
[1187] | 540 | |
---|
[0] | 541 | return |
---|
| 542 | self::jsLoad('js/confirm-close.js'). |
---|
| 543 | '<script type="text/javascript">'."\n". |
---|
| 544 | "//<![CDATA[\n". |
---|
| 545 | "confirmClosePage = new confirmClose(".$args."); ". |
---|
| 546 | "confirmClose.prototype.prompt = '".html::escapeJS(__('You have unsaved changes.'))."'; ". |
---|
| 547 | "\n//]]>\n". |
---|
| 548 | "</script>\n"; |
---|
| 549 | } |
---|
[1187] | 550 | |
---|
[0] | 551 | public static function jsPageTabs($default=null) |
---|
| 552 | { |
---|
| 553 | if ($default) { |
---|
| 554 | $default = "'".html::escapeJS($default)."'"; |
---|
| 555 | } |
---|
[1187] | 556 | |
---|
[0] | 557 | return |
---|
| 558 | self::jsLoad('js/jquery/jquery.pageTabs.js'). |
---|
| 559 | '<script type="text/javascript">'."\n". |
---|
| 560 | "//<![CDATA[\n". |
---|
| 561 | "\$(function() {\n". |
---|
[1161] | 562 | " \$.pageTabs(".$default.");\n". |
---|
| 563 | "});\n". |
---|
| 564 | "\n//]]>\n". |
---|
| 565 | "</script>\n"; |
---|
| 566 | } |
---|
| 567 | |
---|
| 568 | public static function jsModal() |
---|
| 569 | { |
---|
| 570 | return |
---|
| 571 | '<link rel="stylesheet" type="text/css" href="style/modal/modal.css" />'."\n". |
---|
| 572 | self::jsLoad('js/jquery/jquery.modal.js'). |
---|
| 573 | '<script type="text/javascript">'."\n". |
---|
| 574 | "//<![CDATA[\n". |
---|
| 575 | self::jsVar('$.modal.prototype.params.loader_img','style/modal/loader.gif'). |
---|
| 576 | self::jsVar('$.modal.prototype.params.close_img','style/modal/close.png'). |
---|
| 577 | "\n//]]>\n". |
---|
| 578 | "</script>\n"; |
---|
| 579 | } |
---|
| 580 | |
---|
| 581 | public static function jsColorPicker() |
---|
| 582 | { |
---|
| 583 | return |
---|
| 584 | '<link rel="stylesheet" type="text/css" href="style/farbtastic/farbtastic.css" />'."\n". |
---|
| 585 | self::jsLoad('js/jquery/jquery.farbtastic.js'). |
---|
| 586 | self::jsLoad('js/color-picker.js'); |
---|
| 587 | } |
---|
| 588 | |
---|
| 589 | public static function jsDatePicker() |
---|
| 590 | { |
---|
| 591 | return |
---|
| 592 | '<link rel="stylesheet" type="text/css" href="style/date-picker.css" />'."\n". |
---|
| 593 | self::jsLoad('js/date-picker.js'). |
---|
| 594 | '<script type="text/javascript">'."\n". |
---|
| 595 | "//<![CDATA[\n". |
---|
[1187] | 596 | |
---|
[1161] | 597 | "datePicker.prototype.months[0] = '".html::escapeJS(__('January'))."'; ". |
---|
| 598 | "datePicker.prototype.months[1] = '".html::escapeJS(__('February'))."'; ". |
---|
| 599 | "datePicker.prototype.months[2] = '".html::escapeJS(__('March'))."'; ". |
---|
| 600 | "datePicker.prototype.months[3] = '".html::escapeJS(__('April'))."'; ". |
---|
| 601 | "datePicker.prototype.months[4] = '".html::escapeJS(__('May'))."'; ". |
---|
| 602 | "datePicker.prototype.months[5] = '".html::escapeJS(__('June'))."'; ". |
---|
| 603 | "datePicker.prototype.months[6] = '".html::escapeJS(__('July'))."'; ". |
---|
| 604 | "datePicker.prototype.months[7] = '".html::escapeJS(__('August'))."'; ". |
---|
| 605 | "datePicker.prototype.months[8] = '".html::escapeJS(__('September'))."'; ". |
---|
| 606 | "datePicker.prototype.months[9] = '".html::escapeJS(__('October'))."'; ". |
---|
| 607 | "datePicker.prototype.months[10] = '".html::escapeJS(__('November'))."'; ". |
---|
| 608 | "datePicker.prototype.months[11] = '".html::escapeJS(__('December'))."'; ". |
---|
[1187] | 609 | |
---|
[1161] | 610 | "datePicker.prototype.days[0] = '".html::escapeJS(__('Monday'))."'; ". |
---|
| 611 | "datePicker.prototype.days[1] = '".html::escapeJS(__('Tuesday'))."'; ". |
---|
| 612 | "datePicker.prototype.days[2] = '".html::escapeJS(__('Wednesday'))."'; ". |
---|
| 613 | "datePicker.prototype.days[3] = '".html::escapeJS(__('Thursday'))."'; ". |
---|
| 614 | "datePicker.prototype.days[4] = '".html::escapeJS(__('Friday'))."'; ". |
---|
| 615 | "datePicker.prototype.days[5] = '".html::escapeJS(__('Saturday'))."'; ". |
---|
| 616 | "datePicker.prototype.days[6] = '".html::escapeJS(__('Sunday'))."'; ". |
---|
[1187] | 617 | |
---|
[1161] | 618 | "datePicker.prototype.img_src = 'images/date-picker.png'; ". |
---|
[1187] | 619 | |
---|
[1161] | 620 | "datePicker.prototype.close_msg = '".html::escapeJS(__('close'))."'; ". |
---|
| 621 | "datePicker.prototype.now_msg = '".html::escapeJS(__('now'))."'; ". |
---|
[1187] | 622 | |
---|
[1161] | 623 | "\n//]]>\n". |
---|
| 624 | "</script>\n"; |
---|
| 625 | } |
---|
| 626 | |
---|
| 627 | public static function jsToolBar() |
---|
| 628 | { |
---|
| 629 | $res = |
---|
| 630 | '<link rel="stylesheet" type="text/css" href="style/jsToolBar/jsToolBar.css" />'. |
---|
| 631 | '<script type="text/javascript" src="js/jsToolBar/jsToolBar.js"></script>'; |
---|
[1187] | 632 | |
---|
[1161] | 633 | if (isset($GLOBALS['core']->auth) && $GLOBALS['core']->auth->getOption('enable_wysiwyg')) { |
---|
| 634 | $res .= '<script type="text/javascript" src="js/jsToolBar/jsToolBar.wysiwyg.js"></script>'; |
---|
[0] | 635 | } |
---|
[1187] | 636 | |
---|
[1161] | 637 | $res .= |
---|
| 638 | '<script type="text/javascript" src="js/jsToolBar/jsToolBar.dotclear.js"></script>'. |
---|
| 639 | '<script type="text/javascript">'."\n". |
---|
| 640 | "//<![CDATA[\n". |
---|
| 641 | "jsToolBar.prototype.dialog_url = 'popup.php'; ". |
---|
| 642 | "jsToolBar.prototype.iframe_css = '". |
---|
| 643 | 'body{'. |
---|
| 644 | 'font: 12px "DejaVu Sans","Lucida Grande","Lucida Sans Unicode",Arial,sans-serif;'. |
---|
| 645 | 'color : #000;'. |
---|
| 646 | 'background: #f9f9f9;'. |
---|
| 647 | 'margin: 0;'. |
---|
| 648 | 'padding : 2px;'. |
---|
| 649 | 'border: none;'. |
---|
| 650 | (l10n::getTextDirection($GLOBALS['_lang']) == 'rtl' ? 'direction:rtl;' : ''). |
---|
| 651 | '}'. |
---|
| 652 | 'pre, code, kbd, samp {'. |
---|
| 653 | 'font-family:"Courier New",Courier,monospace;'. |
---|
| 654 | 'font-size : 1.1em;'. |
---|
| 655 | '}'. |
---|
| 656 | 'code {'. |
---|
| 657 | 'color : #666;'. |
---|
| 658 | 'font-weight : bold;'. |
---|
| 659 | '}'. |
---|
| 660 | 'body > p:first-child {'. |
---|
| 661 | 'margin-top: 0;'. |
---|
| 662 | '}'. |
---|
| 663 | "'; ". |
---|
| 664 | "jsToolBar.prototype.base_url = '".html::escapeJS($GLOBALS['core']->blog->host)."'; ". |
---|
| 665 | "jsToolBar.prototype.switcher_visual_title = '".html::escapeJS(__('visual'))."'; ". |
---|
| 666 | "jsToolBar.prototype.switcher_source_title = '".html::escapeJS(__('source'))."'; ". |
---|
| 667 | "jsToolBar.prototype.legend_msg = '". |
---|
| 668 | html::escapeJS(__('You can use the following shortcuts to format your text.'))."'; ". |
---|
| 669 | "jsToolBar.prototype.elements.blocks.options.none = '".html::escapeJS(__('-- none --'))."'; ". |
---|
| 670 | "jsToolBar.prototype.elements.blocks.options.nonebis = '".html::escapeJS(__('-- block format --'))."'; ". |
---|
| 671 | "jsToolBar.prototype.elements.blocks.options.p = '".html::escapeJS(__('Paragraph'))."'; ". |
---|
| 672 | "jsToolBar.prototype.elements.blocks.options.h1 = '".html::escapeJS(__('Level 1 header'))."'; ". |
---|
| 673 | "jsToolBar.prototype.elements.blocks.options.h2 = '".html::escapeJS(__('Level 2 header'))."'; ". |
---|
| 674 | "jsToolBar.prototype.elements.blocks.options.h3 = '".html::escapeJS(__('Level 3 header'))."'; ". |
---|
| 675 | "jsToolBar.prototype.elements.blocks.options.h4 = '".html::escapeJS(__('Level 4 header'))."'; ". |
---|
| 676 | "jsToolBar.prototype.elements.blocks.options.h5 = '".html::escapeJS(__('Level 5 header'))."'; ". |
---|
| 677 | "jsToolBar.prototype.elements.blocks.options.h6 = '".html::escapeJS(__('Level 6 header'))."'; ". |
---|
| 678 | "jsToolBar.prototype.elements.strong.title = '".html::escapeJS(__('Strong emphasis'))."'; ". |
---|
| 679 | "jsToolBar.prototype.elements.em.title = '".html::escapeJS(__('Emphasis'))."'; ". |
---|
| 680 | "jsToolBar.prototype.elements.ins.title = '".html::escapeJS(__('Inserted'))."'; ". |
---|
| 681 | "jsToolBar.prototype.elements.del.title = '".html::escapeJS(__('Deleted'))."'; ". |
---|
| 682 | "jsToolBar.prototype.elements.quote.title = '".html::escapeJS(__('Inline quote'))."'; ". |
---|
| 683 | "jsToolBar.prototype.elements.code.title = '".html::escapeJS(__('Code'))."'; ". |
---|
| 684 | "jsToolBar.prototype.elements.br.title = '".html::escapeJS(__('Line break'))."'; ". |
---|
| 685 | "jsToolBar.prototype.elements.blockquote.title = '".html::escapeJS(__('Blockquote'))."'; ". |
---|
| 686 | "jsToolBar.prototype.elements.pre.title = '".html::escapeJS(__('Preformated text'))."'; ". |
---|
| 687 | "jsToolBar.prototype.elements.ul.title = '".html::escapeJS(__('Unordered list'))."'; ". |
---|
| 688 | "jsToolBar.prototype.elements.ol.title = '".html::escapeJS(__('Ordered list'))."'; ". |
---|
[1187] | 689 | |
---|
[1161] | 690 | "jsToolBar.prototype.elements.link.title = '".html::escapeJS(__('Link'))."'; ". |
---|
| 691 | "jsToolBar.prototype.elements.link.href_prompt = '".html::escapeJS(__('URL?'))."'; ". |
---|
| 692 | "jsToolBar.prototype.elements.link.hreflang_prompt = '".html::escapeJS(__('Language?'))."'; ". |
---|
[1187] | 693 | |
---|
[1161] | 694 | "jsToolBar.prototype.elements.img.title = '".html::escapeJS(__('External image'))."'; ". |
---|
| 695 | "jsToolBar.prototype.elements.img.src_prompt = '".html::escapeJS(__('URL?'))."'; ". |
---|
[1187] | 696 | |
---|
[1161] | 697 | "jsToolBar.prototype.elements.img_select.title = '".html::escapeJS(__('Media chooser'))."'; ". |
---|
| 698 | "jsToolBar.prototype.elements.post_link.title = '".html::escapeJS(__('Link to an entry'))."'; "; |
---|
[1187] | 699 | |
---|
[1161] | 700 | if (!$GLOBALS['core']->auth->check('media,media_admin',$GLOBALS['core']->blog->id)) { |
---|
| 701 | $res .= "jsToolBar.prototype.elements.img_select.disabled = true;\n"; |
---|
[0] | 702 | } |
---|
[1187] | 703 | |
---|
[1161] | 704 | $res .= |
---|
| 705 | "\n//]]>\n". |
---|
| 706 | "</script>\n"; |
---|
[1187] | 707 | |
---|
[1161] | 708 | return $res; |
---|
| 709 | } |
---|
| 710 | |
---|
| 711 | public static function jsUpload($params=array(),$base_url=null) |
---|
| 712 | { |
---|
| 713 | if (!$base_url) { |
---|
| 714 | $base_url = path::clean(dirname(preg_replace('/(\?.*$)?/','',$_SERVER['REQUEST_URI']))).'/'; |
---|
[0] | 715 | } |
---|
[1187] | 716 | |
---|
[1161] | 717 | $params = array_merge($params,array( |
---|
| 718 | 'sess_id='.session_id(), |
---|
| 719 | 'sess_uid='.$_SESSION['sess_browser_uid'], |
---|
| 720 | 'xd_check='.$GLOBALS['core']->getNonce() |
---|
| 721 | )); |
---|
[1187] | 722 | |
---|
[1161] | 723 | return |
---|
| 724 | '<link rel="stylesheet" type="text/css" href="style/jsUpload/style.css" />'."\n". |
---|
| 725 | |
---|
| 726 | '<script id="template-upload" type="text/x-tmpl"> |
---|
| 727 | {% for (var i=0, file; file=o.files[i]; i++) { %} |
---|
[1450] | 728 | <li class="template-upload fade"> |
---|
[1162] | 729 | <div class="upload-file"> |
---|
| 730 | <div class="upload-fileinfo"> |
---|
| 731 | <span class="upload-filename">{%=file.name%}</span> |
---|
| 732 | <span class="upload-filesize">({%=o.formatFileSize(file.size)%})</span> |
---|
| 733 | <span class="upload-filecancel cancel">'.__('Cancel').'</span> |
---|
| 734 | {% if (!o.files.error && !i && !o.options.autoUpload) { %} |
---|
[1188] | 735 | <input type="submit" class="button start" value="'.__('Send').'"/> |
---|
[1162] | 736 | {% } %} |
---|
| 737 | <span class="upload-filemsg"></span> |
---|
| 738 | </div> |
---|
| 739 | {% if (!o.files.error) { %} |
---|
| 740 | <div class="upload-progress progress progress-success progress-striped active"><div class="bar" style="width:0%;"></div></div> |
---|
[1161] | 741 | {% } %} |
---|
[1450] | 742 | </li> |
---|
[1161] | 743 | {% } %} |
---|
| 744 | </script> |
---|
| 745 | <!-- The template to display files available for download --> |
---|
| 746 | <script id="template-download" type="text/x-tmpl"> |
---|
| 747 | {% for (var i=0, file; file=o.files[i]; i++) { %} |
---|
[1450] | 748 | <li class="template-download fade"> |
---|
[1162] | 749 | <div class="upload-file"> |
---|
| 750 | <div class="upload-fileinfo"> |
---|
| 751 | <span class="upload-filename">{%=file.name%}</span> |
---|
| 752 | <span class="upload-filesize">({%=o.formatFileSize(file.size)%})</span> |
---|
| 753 | <span class="upload-filemsg{% if (file.error) { %} upload-error{% } %}"> |
---|
| 754 | {% if (file.error) { %} |
---|
[1175] | 755 | '.__('Error:').' {%=file.error%} |
---|
[1162] | 756 | {% } else { %} |
---|
| 757 | '.__('File successfully uploaded.').' |
---|
| 758 | {% } %} |
---|
| 759 | </span> |
---|
| 760 | </div> |
---|
| 761 | <div class="upload-progress"> |
---|
| 762 | {% if (!file.error) { %} |
---|
| 763 | <div class="bar" style="width:100%;">100%</div> |
---|
| 764 | {% } %} |
---|
| 765 | </div> |
---|
[1450] | 766 | </li> |
---|
[1161] | 767 | {% } %} |
---|
| 768 | </script>'. |
---|
| 769 | |
---|
| 770 | self::jsLoad('js/jsUpload/vendor/jquery.ui.widget.js'). |
---|
| 771 | self::jsLoad('js/jsUpload/tmpl.js'). |
---|
| 772 | self::jsLoad('js/jsUpload/load-image.js'). |
---|
| 773 | self::jsLoad('js/jsUpload/jquery.iframe-transport.js'). |
---|
| 774 | self::jsLoad('js/jsUpload/jquery.fileupload.js'). |
---|
| 775 | self::jsLoad('js/jsUpload/jquery.fileupload-process.js'). |
---|
| 776 | self::jsLoad('js/jsUpload/jquery.fileupload-resize.js'). |
---|
| 777 | self::jsLoad('js/jsUpload/jquery.fileupload-ui.js'). |
---|
[1187] | 778 | |
---|
[1161] | 779 | '<script type="text/javascript">'."\n". |
---|
| 780 | "//<![CDATA[\n". |
---|
| 781 | "dotclear.jsUpload = {};\n". |
---|
| 782 | "dotclear.jsUpload.msg = {};\n". |
---|
| 783 | self::jsVar('dotclear.msg.enhanced_uploader_activate',__('Temporarily activate enhanced uploader')). |
---|
| 784 | self::jsVar('dotclear.msg.enhanced_uploader_disable',__('Temporarily disable enhanced uploader')). |
---|
| 785 | self::jsVar('dotclear.jsUpload.msg.limit_exceeded',__('Limit exceeded.')). |
---|
| 786 | self::jsVar('dotclear.jsUpload.msg.size_limit_exceeded',__('File size exceeds allowed limit.')). |
---|
| 787 | self::jsVar('dotclear.jsUpload.msg.canceled',__('Canceled.')). |
---|
| 788 | self::jsVar('dotclear.jsUpload.msg.http_error',__('HTTP Error:')). |
---|
| 789 | self::jsVar('dotclear.jsUpload.msg.error',__('Error:')). |
---|
| 790 | self::jsVar('dotclear.jsUpload.msg.choose_file',__('Choose file')). |
---|
| 791 | self::jsVar('dotclear.jsUpload.msg.choose_files',__('Choose files')). |
---|
| 792 | self::jsVar('dotclear.jsUpload.msg.cancel',__('Cancel')). |
---|
| 793 | self::jsVar('dotclear.jsUpload.msg.clean',__('Clean')). |
---|
| 794 | self::jsVar('dotclear.jsUpload.msg.upload',__('Upload')). |
---|
| 795 | self::jsVar('dotclear.jsUpload.msg.no_file_in_queue',__('No file in queue.')). |
---|
| 796 | self::jsVar('dotclear.jsUpload.msg.file_in_queue',__('1 file in queue.')). |
---|
| 797 | self::jsVar('dotclear.jsUpload.msg.files_in_queue',__('%d files in queue.')). |
---|
| 798 | self::jsVar('dotclear.jsUpload.msg.queue_error',__('Queue error:')). |
---|
| 799 | self::jsVar('dotclear.jsUpload.base_url',$base_url). |
---|
| 800 | "\n//]]>\n". |
---|
| 801 | "</script>\n"; |
---|
| 802 | } |
---|
[1144] | 803 | |
---|
[1161] | 804 | public static function jsToolMan() |
---|
| 805 | { |
---|
| 806 | return |
---|
| 807 | '<script type="text/javascript" src="js/tool-man/core.js"></script>'. |
---|
| 808 | '<script type="text/javascript" src="js/tool-man/events.js"></script>'. |
---|
| 809 | '<script type="text/javascript" src="js/tool-man/css.js"></script>'. |
---|
| 810 | '<script type="text/javascript" src="js/tool-man/coordinates.js"></script>'. |
---|
| 811 | '<script type="text/javascript" src="js/tool-man/drag.js"></script>'. |
---|
| 812 | '<script type="text/javascript" src="js/tool-man/dragsort.js"></script>'. |
---|
| 813 | '<script type="text/javascript" src="js/dragsort-tablerows.js"></script>'; |
---|
| 814 | } |
---|
[1144] | 815 | |
---|
[1161] | 816 | public static function jsMetaEditor() |
---|
| 817 | { |
---|
| 818 | return |
---|
| 819 | '<script type="text/javascript" src="js/meta-editor.js"></script>'; |
---|
| 820 | } |
---|
[0] | 821 | } |
---|
[1187] | 822 | ?> |
---|