[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>'. |
---|
[1558] | 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 |
---|
[1384] | 166 | '<div class="error"><p><strong>'.(count($core->error->getErrors()) > 1 ? __('Errors:') : __('Error:')).'</strong></p>'. |
---|
[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 | |
---|
[1548] | 300 | public static function message($msg,$timestamp=true,$div=false,$echo=true,$class='message') |
---|
[907] | 301 | { |
---|
[910] | 302 | global $core; |
---|
[1187] | 303 | |
---|
[907] | 304 | $res = ''; |
---|
| 305 | if ($msg != '') { |
---|
[1548] | 306 | $res = ($div ? '<div class="'.$class.'">' : '').'<p'.($div ? '' : ' class="'.$class.'"').'>'. |
---|
[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 | |
---|
[1548] | 316 | public static function success($msg,$timestamp=true,$div=false,$echo=true) |
---|
| 317 | { |
---|
| 318 | self::message($msg,$timestamp,$div,$echo,"success"); |
---|
| 319 | } |
---|
| 320 | |
---|
[0] | 321 | private static function debugInfo() |
---|
| 322 | { |
---|
| 323 | $global_vars = implode(', ',array_keys($GLOBALS)); |
---|
[1187] | 324 | |
---|
[0] | 325 | $res = |
---|
| 326 | '<div id="debug"><div>'. |
---|
| 327 | '<p>memory usage: '.memory_get_usage().' ('.files::size(memory_get_usage()).')</p>'; |
---|
[1187] | 328 | |
---|
[0] | 329 | if (function_exists('xdebug_get_profiler_filename')) |
---|
| 330 | { |
---|
| 331 | $res .= '<p>Elapsed time: '.xdebug_time_index().' seconds</p>'; |
---|
[1187] | 332 | |
---|
[0] | 333 | $prof_file = xdebug_get_profiler_filename(); |
---|
| 334 | if ($prof_file) { |
---|
| 335 | $res .= '<p>Profiler file : '.xdebug_get_profiler_filename().'</p>'; |
---|
| 336 | } else { |
---|
| 337 | $prof_url = http::getSelfURI(); |
---|
[321] | 338 | $prof_url .= (strpos($prof_url,'?') === false) ? '?' : '&'; |
---|
[0] | 339 | $prof_url .= 'XDEBUG_PROFILE'; |
---|
[321] | 340 | $res .= '<p><a href="'.html::escapeURL($prof_url).'">Trigger profiler</a></p>'; |
---|
[0] | 341 | } |
---|
[1187] | 342 | |
---|
[0] | 343 | /* xdebug configuration: |
---|
| 344 | zend_extension = /.../xdebug.so |
---|
| 345 | xdebug.auto_trace = On |
---|
| 346 | xdebug.trace_format = 0 |
---|
| 347 | xdebug.trace_options = 1 |
---|
| 348 | xdebug.show_mem_delta = On |
---|
| 349 | xdebug.profiler_enable = 0 |
---|
| 350 | xdebug.profiler_enable_trigger = 1 |
---|
| 351 | xdebug.profiler_output_dir = /tmp |
---|
| 352 | xdebug.profiler_append = 0 |
---|
| 353 | xdebug.profiler_output_name = timestamp |
---|
| 354 | */ |
---|
| 355 | } |
---|
[1187] | 356 | |
---|
[0] | 357 | $res .= |
---|
| 358 | '<p>Global vars: '.$global_vars.'</p>'. |
---|
| 359 | '</div></div>'; |
---|
[1187] | 360 | |
---|
[0] | 361 | return $res; |
---|
| 362 | } |
---|
[1187] | 363 | |
---|
[0] | 364 | public static function help($page,$index='') |
---|
| 365 | { |
---|
| 366 | # Deprecated but we keep this for plugins. |
---|
| 367 | } |
---|
[1187] | 368 | |
---|
[0] | 369 | public static function helpBlock() |
---|
| 370 | { |
---|
| 371 | $args = func_get_args(); |
---|
[1458] | 372 | |
---|
| 373 | $args = new ArrayObject($args); |
---|
| 374 | |
---|
| 375 | # --BEHAVIOR-- adminPageHelpBlock |
---|
| 376 | $GLOBALS['core']->callBehavior('adminPageHelpBlock',$args); |
---|
| 377 | |
---|
[0] | 378 | if (empty($args)) { |
---|
| 379 | return; |
---|
| 380 | }; |
---|
[1187] | 381 | |
---|
[0] | 382 | global $__resources; |
---|
| 383 | if (empty($__resources['help'])) { |
---|
| 384 | return; |
---|
| 385 | } |
---|
[1187] | 386 | |
---|
[0] | 387 | $content = ''; |
---|
| 388 | foreach ($args as $v) |
---|
| 389 | { |
---|
| 390 | if (is_object($v) && isset($v->content)) { |
---|
| 391 | $content .= $v->content; |
---|
| 392 | continue; |
---|
| 393 | } |
---|
[1187] | 394 | |
---|
[0] | 395 | if (!isset($__resources['help'][$v])) { |
---|
| 396 | continue; |
---|
| 397 | } |
---|
| 398 | $f = $__resources['help'][$v]; |
---|
| 399 | if (!file_exists($f) || !is_readable($f)) { |
---|
| 400 | continue; |
---|
| 401 | } |
---|
[1187] | 402 | |
---|
[0] | 403 | $fc = file_get_contents($f); |
---|
| 404 | if (preg_match('|<body[^>]*?>(.*?)</body>|ms',$fc,$matches)) { |
---|
| 405 | $content .= $matches[1]; |
---|
| 406 | } else { |
---|
| 407 | $content .= $fc; |
---|
| 408 | } |
---|
| 409 | } |
---|
[1187] | 410 | |
---|
[0] | 411 | if (trim($content) == '') { |
---|
| 412 | return; |
---|
| 413 | } |
---|
[1187] | 414 | |
---|
[0] | 415 | echo |
---|
[3] | 416 | '<div id="help"><hr /><div class="help-content clear"><h2>'.__('Help').'</h2>'. |
---|
[0] | 417 | $content. |
---|
| 418 | '</div></div>'; |
---|
| 419 | } |
---|
[1187] | 420 | |
---|
[0] | 421 | public static function jsLoad($src) |
---|
| 422 | { |
---|
[342] | 423 | $escaped_src = html::escapeHTML($src); |
---|
| 424 | if (!isset(self::$loaded_js[$escaped_src])) { |
---|
| 425 | self::$loaded_js[$escaped_src]=true; |
---|
| 426 | return '<script type="text/javascript" src="'.$escaped_src.'"></script>'."\n"; |
---|
| 427 | } |
---|
[0] | 428 | } |
---|
[1187] | 429 | |
---|
[0] | 430 | public static function jsVar($n,$v) |
---|
| 431 | { |
---|
| 432 | return $n." = '".html::escapeJS($v)."';\n"; |
---|
| 433 | } |
---|
[1187] | 434 | |
---|
[0] | 435 | public static function jsCommon() |
---|
| 436 | { |
---|
| 437 | return |
---|
| 438 | self::jsLoad('js/jquery/jquery.js'). |
---|
| 439 | self::jsLoad('js/jquery/jquery.biscuit.js'). |
---|
| 440 | self::jsLoad('js/jquery/jquery.bgFade.js'). |
---|
| 441 | self::jsLoad('js/common.js'). |
---|
[447] | 442 | self::jsLoad('js/prelude.js'). |
---|
[1187] | 443 | |
---|
[0] | 444 | '<script type="text/javascript">'."\n". |
---|
| 445 | "//<![CDATA[\n". |
---|
| 446 | self::jsVar('dotclear.nonce',$GLOBALS['core']->getNonce()). |
---|
[1187] | 447 | |
---|
[1019] | 448 | self::jsVar('dotclear.img_plus_src','images/expand.png'). |
---|
[0] | 449 | self::jsVar('dotclear.img_plus_alt',__('uncover')). |
---|
[1019] | 450 | self::jsVar('dotclear.img_minus_src','images/hide.png'). |
---|
[0] | 451 | self::jsVar('dotclear.img_minus_alt',__('hide')). |
---|
| 452 | self::jsVar('dotclear.img_menu_on','images/menu_on.png'). |
---|
| 453 | self::jsVar('dotclear.img_menu_off','images/menu_off.png'). |
---|
[1187] | 454 | |
---|
[0] | 455 | self::jsVar('dotclear.msg.help', |
---|
[1302] | 456 | __('Help about this page')). |
---|
| 457 | self::jsVar('dotclear.msg.help_hide', |
---|
| 458 | __('Hide')). |
---|
[1556] | 459 | self::jsVar('dotclear.msg.to_select', |
---|
| 460 | __('Select:')). |
---|
[0] | 461 | self::jsVar('dotclear.msg.no_selection', |
---|
| 462 | __('no selection')). |
---|
| 463 | self::jsVar('dotclear.msg.select_all', |
---|
| 464 | __('select all')). |
---|
| 465 | self::jsVar('dotclear.msg.invert_sel', |
---|
[1556] | 466 | __('Invert selection')). |
---|
[0] | 467 | self::jsVar('dotclear.msg.website', |
---|
| 468 | __('Web site:')). |
---|
| 469 | self::jsVar('dotclear.msg.email', |
---|
| 470 | __('Email:')). |
---|
| 471 | self::jsVar('dotclear.msg.ip_address', |
---|
| 472 | __('IP address:')). |
---|
| 473 | self::jsVar('dotclear.msg.error', |
---|
| 474 | __('Error:')). |
---|
| 475 | self::jsVar('dotclear.msg.entry_created', |
---|
| 476 | __('Entry has been successfully created.')). |
---|
| 477 | self::jsVar('dotclear.msg.edit_entry', |
---|
| 478 | __('Edit entry')). |
---|
| 479 | self::jsVar('dotclear.msg.view_entry', |
---|
| 480 | __('view entry')). |
---|
| 481 | self::jsVar('dotclear.msg.confirm_delete_posts', |
---|
| 482 | __("Are you sure you want to delete selected entries (%s)?")). |
---|
[1525] | 483 | self::jsVar('dotclear.msg.confirm_delete_categories', |
---|
| 484 | __("Are you sure you want to delete selected categories (%s)?")). |
---|
[0] | 485 | self::jsVar('dotclear.msg.confirm_delete_post', |
---|
| 486 | __("Are you sure you want to delete this entry?")). |
---|
[1395] | 487 | self::jsVar('dotclear.msg.click_to_unlock', |
---|
[1450] | 488 | __("Click here to unlock the field")). |
---|
[1049] | 489 | self::jsVar('dotclear.msg.confirm_spam_delete', |
---|
| 490 | __('Are you sure you want to delete all spams?')). |
---|
[0] | 491 | self::jsVar('dotclear.msg.confirm_delete_comments', |
---|
| 492 | __('Are you sure you want to delete selected comments (%s)?')). |
---|
| 493 | self::jsVar('dotclear.msg.confirm_delete_comment', |
---|
| 494 | __('Are you sure you want to delete this comment?')). |
---|
| 495 | self::jsVar('dotclear.msg.cannot_delete_users', |
---|
| 496 | __('Users with posts cannot be deleted.')). |
---|
| 497 | self::jsVar('dotclear.msg.confirm_delete_user', |
---|
| 498 | __('Are you sure you want to delete selected users (%s)?')). |
---|
| 499 | self::jsVar('dotclear.msg.confirm_delete_category', |
---|
| 500 | __('Are you sure you want to delete category "%s"?')). |
---|
| 501 | self::jsVar('dotclear.msg.confirm_reorder_categories', |
---|
| 502 | __('Are you sure you want to reorder all categories?')). |
---|
| 503 | self::jsVar('dotclear.msg.confirm_delete_media', |
---|
| 504 | __('Are you sure you want to remove media "%s"?')). |
---|
| 505 | self::jsVar('dotclear.msg.confirm_extract_current', |
---|
| 506 | __('Are you sure you want to extract archive in current directory?')). |
---|
| 507 | self::jsVar('dotclear.msg.confirm_remove_attachment', |
---|
| 508 | __('Are you sure you want to remove attachment "%s"?')). |
---|
| 509 | self::jsVar('dotclear.msg.confirm_delete_lang', |
---|
| 510 | __('Are you sure you want to delete "%s" language?')). |
---|
| 511 | self::jsVar('dotclear.msg.confirm_delete_plugin', |
---|
| 512 | __('Are you sure you want to delete "%s" plugin?')). |
---|
| 513 | self::jsVar('dotclear.msg.use_this_theme', |
---|
| 514 | __('Use this theme')). |
---|
| 515 | self::jsVar('dotclear.msg.remove_this_theme', |
---|
| 516 | __('Remove this theme')). |
---|
| 517 | self::jsVar('dotclear.msg.confirm_delete_theme', |
---|
| 518 | __('Are you sure you want to delete "%s" theme?')). |
---|
[1462] | 519 | self::jsVar('dotclear.msg.confirm_delete_backup', |
---|
| 520 | __('Are you sure you want to delete this backup?')). |
---|
[0] | 521 | self::jsVar('dotclear.msg.zip_file_content', |
---|
| 522 | __('Zip file content')). |
---|
| 523 | self::jsVar('dotclear.msg.xhtml_validator', |
---|
| 524 | __('XHTML markup validator')). |
---|
| 525 | self::jsVar('dotclear.msg.xhtml_valid', |
---|
| 526 | __('XHTML content is valid.')). |
---|
| 527 | self::jsVar('dotclear.msg.xhtml_not_valid', |
---|
| 528 | __('There are XHTML markup errors.')). |
---|
| 529 | self::jsVar('dotclear.msg.confirm_change_post_format', |
---|
| 530 | __('You have unsaved changes. Switch post format will loose these changes. Proceed anyway?')). |
---|
[224] | 531 | self::jsVar('dotclear.msg.load_enhanced_uploader', |
---|
| 532 | __('Loading enhanced uploader, please wait.')). |
---|
[0] | 533 | "\n//]]>\n". |
---|
| 534 | "</script>\n"; |
---|
| 535 | } |
---|
[1187] | 536 | |
---|
[0] | 537 | public static function jsLoadIE7() |
---|
| 538 | { |
---|
| 539 | return |
---|
[1456] | 540 | '<!--[if lt IE 9]>'."\n". |
---|
| 541 | self::jsLoad('js/ie7/IE9.js'). |
---|
[0] | 542 | '<link rel="stylesheet" type="text/css" href="style/iesucks.css" />'."\n". |
---|
| 543 | '<![endif]-->'."\n"; |
---|
| 544 | } |
---|
[1187] | 545 | |
---|
[0] | 546 | public static function jsConfirmClose() |
---|
| 547 | { |
---|
| 548 | $args = func_get_args(); |
---|
| 549 | if (count($args) > 0) { |
---|
| 550 | foreach ($args as $k => $v) { |
---|
| 551 | $args[$k] = "'".html::escapeJS($v)."'"; |
---|
| 552 | } |
---|
| 553 | $args = implode(',',$args); |
---|
| 554 | } else { |
---|
| 555 | $args = ''; |
---|
| 556 | } |
---|
[1187] | 557 | |
---|
[0] | 558 | return |
---|
| 559 | self::jsLoad('js/confirm-close.js'). |
---|
| 560 | '<script type="text/javascript">'."\n". |
---|
| 561 | "//<![CDATA[\n". |
---|
| 562 | "confirmClosePage = new confirmClose(".$args."); ". |
---|
| 563 | "confirmClose.prototype.prompt = '".html::escapeJS(__('You have unsaved changes.'))."'; ". |
---|
| 564 | "\n//]]>\n". |
---|
| 565 | "</script>\n"; |
---|
| 566 | } |
---|
[1187] | 567 | |
---|
[0] | 568 | public static function jsPageTabs($default=null) |
---|
| 569 | { |
---|
| 570 | if ($default) { |
---|
| 571 | $default = "'".html::escapeJS($default)."'"; |
---|
| 572 | } |
---|
[1187] | 573 | |
---|
[0] | 574 | return |
---|
| 575 | self::jsLoad('js/jquery/jquery.pageTabs.js'). |
---|
| 576 | '<script type="text/javascript">'."\n". |
---|
| 577 | "//<![CDATA[\n". |
---|
| 578 | "\$(function() {\n". |
---|
[1161] | 579 | " \$.pageTabs(".$default.");\n". |
---|
| 580 | "});\n". |
---|
| 581 | "\n//]]>\n". |
---|
| 582 | "</script>\n"; |
---|
| 583 | } |
---|
| 584 | |
---|
| 585 | public static function jsModal() |
---|
| 586 | { |
---|
| 587 | return |
---|
| 588 | '<link rel="stylesheet" type="text/css" href="style/modal/modal.css" />'."\n". |
---|
| 589 | self::jsLoad('js/jquery/jquery.modal.js'). |
---|
| 590 | '<script type="text/javascript">'."\n". |
---|
| 591 | "//<![CDATA[\n". |
---|
| 592 | self::jsVar('$.modal.prototype.params.loader_img','style/modal/loader.gif'). |
---|
| 593 | self::jsVar('$.modal.prototype.params.close_img','style/modal/close.png'). |
---|
| 594 | "\n//]]>\n". |
---|
| 595 | "</script>\n"; |
---|
| 596 | } |
---|
| 597 | |
---|
| 598 | public static function jsColorPicker() |
---|
| 599 | { |
---|
| 600 | return |
---|
| 601 | '<link rel="stylesheet" type="text/css" href="style/farbtastic/farbtastic.css" />'."\n". |
---|
| 602 | self::jsLoad('js/jquery/jquery.farbtastic.js'). |
---|
| 603 | self::jsLoad('js/color-picker.js'); |
---|
| 604 | } |
---|
| 605 | |
---|
| 606 | public static function jsDatePicker() |
---|
| 607 | { |
---|
| 608 | return |
---|
| 609 | '<link rel="stylesheet" type="text/css" href="style/date-picker.css" />'."\n". |
---|
| 610 | self::jsLoad('js/date-picker.js'). |
---|
| 611 | '<script type="text/javascript">'."\n". |
---|
| 612 | "//<![CDATA[\n". |
---|
[1187] | 613 | |
---|
[1161] | 614 | "datePicker.prototype.months[0] = '".html::escapeJS(__('January'))."'; ". |
---|
| 615 | "datePicker.prototype.months[1] = '".html::escapeJS(__('February'))."'; ". |
---|
| 616 | "datePicker.prototype.months[2] = '".html::escapeJS(__('March'))."'; ". |
---|
| 617 | "datePicker.prototype.months[3] = '".html::escapeJS(__('April'))."'; ". |
---|
| 618 | "datePicker.prototype.months[4] = '".html::escapeJS(__('May'))."'; ". |
---|
| 619 | "datePicker.prototype.months[5] = '".html::escapeJS(__('June'))."'; ". |
---|
| 620 | "datePicker.prototype.months[6] = '".html::escapeJS(__('July'))."'; ". |
---|
| 621 | "datePicker.prototype.months[7] = '".html::escapeJS(__('August'))."'; ". |
---|
| 622 | "datePicker.prototype.months[8] = '".html::escapeJS(__('September'))."'; ". |
---|
| 623 | "datePicker.prototype.months[9] = '".html::escapeJS(__('October'))."'; ". |
---|
| 624 | "datePicker.prototype.months[10] = '".html::escapeJS(__('November'))."'; ". |
---|
| 625 | "datePicker.prototype.months[11] = '".html::escapeJS(__('December'))."'; ". |
---|
[1187] | 626 | |
---|
[1161] | 627 | "datePicker.prototype.days[0] = '".html::escapeJS(__('Monday'))."'; ". |
---|
| 628 | "datePicker.prototype.days[1] = '".html::escapeJS(__('Tuesday'))."'; ". |
---|
| 629 | "datePicker.prototype.days[2] = '".html::escapeJS(__('Wednesday'))."'; ". |
---|
| 630 | "datePicker.prototype.days[3] = '".html::escapeJS(__('Thursday'))."'; ". |
---|
| 631 | "datePicker.prototype.days[4] = '".html::escapeJS(__('Friday'))."'; ". |
---|
| 632 | "datePicker.prototype.days[5] = '".html::escapeJS(__('Saturday'))."'; ". |
---|
| 633 | "datePicker.prototype.days[6] = '".html::escapeJS(__('Sunday'))."'; ". |
---|
[1187] | 634 | |
---|
[1161] | 635 | "datePicker.prototype.img_src = 'images/date-picker.png'; ". |
---|
[1187] | 636 | |
---|
[1161] | 637 | "datePicker.prototype.close_msg = '".html::escapeJS(__('close'))."'; ". |
---|
| 638 | "datePicker.prototype.now_msg = '".html::escapeJS(__('now'))."'; ". |
---|
[1187] | 639 | |
---|
[1161] | 640 | "\n//]]>\n". |
---|
| 641 | "</script>\n"; |
---|
| 642 | } |
---|
| 643 | |
---|
| 644 | public static function jsToolBar() |
---|
| 645 | { |
---|
| 646 | $res = |
---|
| 647 | '<link rel="stylesheet" type="text/css" href="style/jsToolBar/jsToolBar.css" />'. |
---|
| 648 | '<script type="text/javascript" src="js/jsToolBar/jsToolBar.js"></script>'; |
---|
[1187] | 649 | |
---|
[1161] | 650 | if (isset($GLOBALS['core']->auth) && $GLOBALS['core']->auth->getOption('enable_wysiwyg')) { |
---|
| 651 | $res .= '<script type="text/javascript" src="js/jsToolBar/jsToolBar.wysiwyg.js"></script>'; |
---|
[0] | 652 | } |
---|
[1187] | 653 | |
---|
[1161] | 654 | $res .= |
---|
| 655 | '<script type="text/javascript" src="js/jsToolBar/jsToolBar.dotclear.js"></script>'. |
---|
| 656 | '<script type="text/javascript">'."\n". |
---|
| 657 | "//<![CDATA[\n". |
---|
| 658 | "jsToolBar.prototype.dialog_url = 'popup.php'; ". |
---|
| 659 | "jsToolBar.prototype.iframe_css = '". |
---|
| 660 | 'body{'. |
---|
| 661 | 'font: 12px "DejaVu Sans","Lucida Grande","Lucida Sans Unicode",Arial,sans-serif;'. |
---|
| 662 | 'color : #000;'. |
---|
| 663 | 'background: #f9f9f9;'. |
---|
| 664 | 'margin: 0;'. |
---|
| 665 | 'padding : 2px;'. |
---|
| 666 | 'border: none;'. |
---|
| 667 | (l10n::getTextDirection($GLOBALS['_lang']) == 'rtl' ? 'direction:rtl;' : ''). |
---|
| 668 | '}'. |
---|
| 669 | 'pre, code, kbd, samp {'. |
---|
| 670 | 'font-family:"Courier New",Courier,monospace;'. |
---|
| 671 | 'font-size : 1.1em;'. |
---|
| 672 | '}'. |
---|
| 673 | 'code {'. |
---|
| 674 | 'color : #666;'. |
---|
| 675 | 'font-weight : bold;'. |
---|
| 676 | '}'. |
---|
| 677 | 'body > p:first-child {'. |
---|
| 678 | 'margin-top: 0;'. |
---|
| 679 | '}'. |
---|
| 680 | "'; ". |
---|
| 681 | "jsToolBar.prototype.base_url = '".html::escapeJS($GLOBALS['core']->blog->host)."'; ". |
---|
| 682 | "jsToolBar.prototype.switcher_visual_title = '".html::escapeJS(__('visual'))."'; ". |
---|
| 683 | "jsToolBar.prototype.switcher_source_title = '".html::escapeJS(__('source'))."'; ". |
---|
| 684 | "jsToolBar.prototype.legend_msg = '". |
---|
| 685 | html::escapeJS(__('You can use the following shortcuts to format your text.'))."'; ". |
---|
| 686 | "jsToolBar.prototype.elements.blocks.options.none = '".html::escapeJS(__('-- none --'))."'; ". |
---|
| 687 | "jsToolBar.prototype.elements.blocks.options.nonebis = '".html::escapeJS(__('-- block format --'))."'; ". |
---|
| 688 | "jsToolBar.prototype.elements.blocks.options.p = '".html::escapeJS(__('Paragraph'))."'; ". |
---|
| 689 | "jsToolBar.prototype.elements.blocks.options.h1 = '".html::escapeJS(__('Level 1 header'))."'; ". |
---|
| 690 | "jsToolBar.prototype.elements.blocks.options.h2 = '".html::escapeJS(__('Level 2 header'))."'; ". |
---|
| 691 | "jsToolBar.prototype.elements.blocks.options.h3 = '".html::escapeJS(__('Level 3 header'))."'; ". |
---|
| 692 | "jsToolBar.prototype.elements.blocks.options.h4 = '".html::escapeJS(__('Level 4 header'))."'; ". |
---|
| 693 | "jsToolBar.prototype.elements.blocks.options.h5 = '".html::escapeJS(__('Level 5 header'))."'; ". |
---|
| 694 | "jsToolBar.prototype.elements.blocks.options.h6 = '".html::escapeJS(__('Level 6 header'))."'; ". |
---|
| 695 | "jsToolBar.prototype.elements.strong.title = '".html::escapeJS(__('Strong emphasis'))."'; ". |
---|
| 696 | "jsToolBar.prototype.elements.em.title = '".html::escapeJS(__('Emphasis'))."'; ". |
---|
| 697 | "jsToolBar.prototype.elements.ins.title = '".html::escapeJS(__('Inserted'))."'; ". |
---|
| 698 | "jsToolBar.prototype.elements.del.title = '".html::escapeJS(__('Deleted'))."'; ". |
---|
| 699 | "jsToolBar.prototype.elements.quote.title = '".html::escapeJS(__('Inline quote'))."'; ". |
---|
| 700 | "jsToolBar.prototype.elements.code.title = '".html::escapeJS(__('Code'))."'; ". |
---|
| 701 | "jsToolBar.prototype.elements.br.title = '".html::escapeJS(__('Line break'))."'; ". |
---|
| 702 | "jsToolBar.prototype.elements.blockquote.title = '".html::escapeJS(__('Blockquote'))."'; ". |
---|
| 703 | "jsToolBar.prototype.elements.pre.title = '".html::escapeJS(__('Preformated text'))."'; ". |
---|
| 704 | "jsToolBar.prototype.elements.ul.title = '".html::escapeJS(__('Unordered list'))."'; ". |
---|
| 705 | "jsToolBar.prototype.elements.ol.title = '".html::escapeJS(__('Ordered list'))."'; ". |
---|
[1187] | 706 | |
---|
[1161] | 707 | "jsToolBar.prototype.elements.link.title = '".html::escapeJS(__('Link'))."'; ". |
---|
| 708 | "jsToolBar.prototype.elements.link.href_prompt = '".html::escapeJS(__('URL?'))."'; ". |
---|
| 709 | "jsToolBar.prototype.elements.link.hreflang_prompt = '".html::escapeJS(__('Language?'))."'; ". |
---|
[1187] | 710 | |
---|
[1161] | 711 | "jsToolBar.prototype.elements.img.title = '".html::escapeJS(__('External image'))."'; ". |
---|
| 712 | "jsToolBar.prototype.elements.img.src_prompt = '".html::escapeJS(__('URL?'))."'; ". |
---|
[1187] | 713 | |
---|
[1161] | 714 | "jsToolBar.prototype.elements.img_select.title = '".html::escapeJS(__('Media chooser'))."'; ". |
---|
| 715 | "jsToolBar.prototype.elements.post_link.title = '".html::escapeJS(__('Link to an entry'))."'; "; |
---|
[1187] | 716 | |
---|
[1161] | 717 | if (!$GLOBALS['core']->auth->check('media,media_admin',$GLOBALS['core']->blog->id)) { |
---|
| 718 | $res .= "jsToolBar.prototype.elements.img_select.disabled = true;\n"; |
---|
[0] | 719 | } |
---|
[1187] | 720 | |
---|
[1161] | 721 | $res .= |
---|
| 722 | "\n//]]>\n". |
---|
| 723 | "</script>\n"; |
---|
[1187] | 724 | |
---|
[1161] | 725 | return $res; |
---|
| 726 | } |
---|
| 727 | |
---|
| 728 | public static function jsUpload($params=array(),$base_url=null) |
---|
| 729 | { |
---|
| 730 | if (!$base_url) { |
---|
| 731 | $base_url = path::clean(dirname(preg_replace('/(\?.*$)?/','',$_SERVER['REQUEST_URI']))).'/'; |
---|
[0] | 732 | } |
---|
[1187] | 733 | |
---|
[1161] | 734 | $params = array_merge($params,array( |
---|
| 735 | 'sess_id='.session_id(), |
---|
| 736 | 'sess_uid='.$_SESSION['sess_browser_uid'], |
---|
| 737 | 'xd_check='.$GLOBALS['core']->getNonce() |
---|
| 738 | )); |
---|
[1187] | 739 | |
---|
[1161] | 740 | return |
---|
| 741 | '<link rel="stylesheet" type="text/css" href="style/jsUpload/style.css" />'."\n". |
---|
| 742 | |
---|
| 743 | '<script type="text/javascript">'."\n". |
---|
| 744 | "//<![CDATA[\n". |
---|
| 745 | "dotclear.jsUpload = {};\n". |
---|
| 746 | "dotclear.jsUpload.msg = {};\n". |
---|
| 747 | self::jsVar('dotclear.msg.enhanced_uploader_activate',__('Temporarily activate enhanced uploader')). |
---|
| 748 | self::jsVar('dotclear.msg.enhanced_uploader_disable',__('Temporarily disable enhanced uploader')). |
---|
| 749 | self::jsVar('dotclear.jsUpload.msg.limit_exceeded',__('Limit exceeded.')). |
---|
| 750 | self::jsVar('dotclear.jsUpload.msg.size_limit_exceeded',__('File size exceeds allowed limit.')). |
---|
| 751 | self::jsVar('dotclear.jsUpload.msg.canceled',__('Canceled.')). |
---|
| 752 | self::jsVar('dotclear.jsUpload.msg.http_error',__('HTTP Error:')). |
---|
| 753 | self::jsVar('dotclear.jsUpload.msg.error',__('Error:')). |
---|
| 754 | self::jsVar('dotclear.jsUpload.msg.choose_file',__('Choose file')). |
---|
| 755 | self::jsVar('dotclear.jsUpload.msg.choose_files',__('Choose files')). |
---|
| 756 | self::jsVar('dotclear.jsUpload.msg.cancel',__('Cancel')). |
---|
| 757 | self::jsVar('dotclear.jsUpload.msg.clean',__('Clean')). |
---|
| 758 | self::jsVar('dotclear.jsUpload.msg.upload',__('Upload')). |
---|
[1461] | 759 | self::jsVar('dotclear.jsUpload.msg.send',__('Send')). |
---|
| 760 | self::jsVar('dotclear.jsUpload.msg.file_successfully_uploaded',__('File successfully uploaded.')). |
---|
[1161] | 761 | self::jsVar('dotclear.jsUpload.msg.no_file_in_queue',__('No file in queue.')). |
---|
| 762 | self::jsVar('dotclear.jsUpload.msg.file_in_queue',__('1 file in queue.')). |
---|
| 763 | self::jsVar('dotclear.jsUpload.msg.files_in_queue',__('%d files in queue.')). |
---|
| 764 | self::jsVar('dotclear.jsUpload.msg.queue_error',__('Queue error:')). |
---|
| 765 | self::jsVar('dotclear.jsUpload.base_url',$base_url). |
---|
| 766 | "\n//]]>\n". |
---|
[1461] | 767 | "</script>\n". |
---|
| 768 | |
---|
| 769 | self::jsLoad('js/jsUpload/vendor/jquery.ui.widget.js'). |
---|
| 770 | self::jsLoad('js/jsUpload/tmpl.js'). |
---|
| 771 | self::jsLoad('js/jsUpload/template-upload.js'). |
---|
| 772 | self::jsLoad('js/jsUpload/template-download.js'). |
---|
| 773 | self::jsLoad('js/jsUpload/load-image.js'). |
---|
| 774 | self::jsLoad('js/jsUpload/jquery.iframe-transport.js'). |
---|
| 775 | self::jsLoad('js/jsUpload/jquery.fileupload.js'). |
---|
| 776 | self::jsLoad('js/jsUpload/jquery.fileupload-process.js'). |
---|
| 777 | self::jsLoad('js/jsUpload/jquery.fileupload-resize.js'). |
---|
| 778 | self::jsLoad('js/jsUpload/jquery.fileupload-ui.js'); |
---|
[1161] | 779 | } |
---|
[1144] | 780 | |
---|
[1161] | 781 | public static function jsToolMan() |
---|
| 782 | { |
---|
| 783 | return |
---|
| 784 | '<script type="text/javascript" src="js/tool-man/core.js"></script>'. |
---|
| 785 | '<script type="text/javascript" src="js/tool-man/events.js"></script>'. |
---|
| 786 | '<script type="text/javascript" src="js/tool-man/css.js"></script>'. |
---|
| 787 | '<script type="text/javascript" src="js/tool-man/coordinates.js"></script>'. |
---|
| 788 | '<script type="text/javascript" src="js/tool-man/drag.js"></script>'. |
---|
| 789 | '<script type="text/javascript" src="js/tool-man/dragsort.js"></script>'. |
---|
| 790 | '<script type="text/javascript" src="js/dragsort-tablerows.js"></script>'; |
---|
| 791 | } |
---|
[1144] | 792 | |
---|
[1161] | 793 | public static function jsMetaEditor() |
---|
| 794 | { |
---|
| 795 | return |
---|
| 796 | '<script type="text/javascript" src="js/meta-editor.js"></script>'; |
---|
| 797 | } |
---|
[0] | 798 | } |
---|
[1187] | 799 | ?> |
---|