| 1 | <?php |
|---|
| 2 | |
|---|
| 3 | class dcAdminContext extends Twig_Extension { |
|---|
| 4 | protected $loaded_js; |
|---|
| 5 | protected $js; |
|---|
| 6 | protected $js_var; |
|---|
| 7 | protected $head; |
|---|
| 8 | |
|---|
| 9 | protected $core; |
|---|
| 10 | public function __construct($core) { |
|---|
| 11 | $this->core = $core; |
|---|
| 12 | $this->js = array(); |
|---|
| 13 | $this->js_var = array(); |
|---|
| 14 | $this->loaded_js = array(); |
|---|
| 15 | $this->head = array(); |
|---|
| 16 | $this->jsCommon(); |
|---|
| 17 | $this->blogs = array(); |
|---|
| 18 | if ($this->core->auth->blog_count > 1 && $this->core->auth->blog_count < 20) { |
|---|
| 19 | $rs_blogs = $core->getBlogs(array('order'=>'LOWER(blog_name)','limit'=>20)); |
|---|
| 20 | while ($rs_blogs->fetch()) { |
|---|
| 21 | $this->blogs[html::escapeHTML($rs_blogs->blog_name.' - '.$rs_blogs->blog_url)] = $rs_blogs->blog_id; |
|---|
| 22 | } |
|---|
| 23 | } |
|---|
| 24 | $this->blog = array(); |
|---|
| 25 | if ($this->core->auth->blog_count) { // no blog on auth.php |
|---|
| 26 | $this->blog = array( |
|---|
| 27 | 'url' => $core->blog->url, |
|---|
| 28 | 'name' => $core->blog->name |
|---|
| 29 | ); |
|---|
| 30 | } |
|---|
| 31 | } |
|---|
| 32 | |
|---|
| 33 | public function jsLoad($src) |
|---|
| 34 | { |
|---|
| 35 | $escaped_src = html::escapeHTML($src); |
|---|
| 36 | if (!isset($this->loaded_js[$escaped_src])) { |
|---|
| 37 | $this->loaded_js[$escaped_src]=true; |
|---|
| 38 | $this->js[]='<script type="text/javascript" src="'.$escaped_src.'"></script>'; |
|---|
| 39 | } |
|---|
| 40 | return $this; |
|---|
| 41 | } |
|---|
| 42 | |
|---|
| 43 | public function jsAdd($code) |
|---|
| 44 | { |
|---|
| 45 | $this->js[]=$code; |
|---|
| 46 | return $this; |
|---|
| 47 | } |
|---|
| 48 | |
|---|
| 49 | public function head($code) { |
|---|
| 50 | $this->head[]=$code; |
|---|
| 51 | return $this; |
|---|
| 52 | } |
|---|
| 53 | public function jsVar($n,$v) |
|---|
| 54 | { |
|---|
| 55 | $this->js_vars[$n] = $v; |
|---|
| 56 | } |
|---|
| 57 | |
|---|
| 58 | public function jsVars($arr) |
|---|
| 59 | { |
|---|
| 60 | foreach($arr as $n => $v) { |
|---|
| 61 | $this->js_vars[$n] = $v; |
|---|
| 62 | } |
|---|
| 63 | return $this; |
|---|
| 64 | } |
|---|
| 65 | |
|---|
| 66 | public function getJS(){ |
|---|
| 67 | $jsvars = array(); |
|---|
| 68 | |
|---|
| 69 | foreach ($this->js_vars as $n => $v) { |
|---|
| 70 | $jsvars[] = $n." = '".html::escapeJS($v)."';"; |
|---|
| 71 | } |
|---|
| 72 | return join("\n",$this->head). |
|---|
| 73 | join("\n",$this->js). |
|---|
| 74 | '<script type="text/javascript">'."\n". |
|---|
| 75 | "//<![CDATA[\n". |
|---|
| 76 | join("\n",$jsvars). |
|---|
| 77 | "\n//]]>\n". |
|---|
| 78 | "</script>\n";; |
|---|
| 79 | } |
|---|
| 80 | |
|---|
| 81 | public function pageHead() { |
|---|
| 82 | global $core; |
|---|
| 83 | $this->jsLoadIE7(); |
|---|
| 84 | echo ' <link rel="stylesheet" href="style/default.css" type="text/css" media="screen" />'."\n"; |
|---|
| 85 | if (l10n::getTextDirection($GLOBALS['_lang']) == 'rtl') { |
|---|
| 86 | echo |
|---|
| 87 | ' <link rel="stylesheet" href="style/default-rtl.css" type="text/css" media="screen" />'."\n"; |
|---|
| 88 | } |
|---|
| 89 | $core->auth->user_prefs->addWorkspace('interface'); |
|---|
| 90 | $user_ui_hide_std_favicon = $core->auth->user_prefs->interface->hide_std_favicon; |
|---|
| 91 | if (!$user_ui_hide_std_favicon) { |
|---|
| 92 | echo '<link rel="icon" type="image/png" href="images/favicon.png" />'; |
|---|
| 93 | } |
|---|
| 94 | echo $this->getJS(); |
|---|
| 95 | } |
|---|
| 96 | |
|---|
| 97 | public function pageMenu() { |
|---|
| 98 | $menu =& $GLOBALS['_menu']; |
|---|
| 99 | foreach ($menu as $k => $v) { |
|---|
| 100 | echo $menu[$k]->draw(); |
|---|
| 101 | } |
|---|
| 102 | } |
|---|
| 103 | public function getFunctions() |
|---|
| 104 | { |
|---|
| 105 | return array( |
|---|
| 106 | 'page_head' => new Twig_Function_Method($this, 'pageHead', array('is_safe' => array('html'))), |
|---|
| 107 | 'page_menu' => new Twig_Function_Method($this, 'pageMenu', array('is_safe' => array('html'))), |
|---|
| 108 | '__' => new Twig_Function_Function("__", array('is_safe' => array('html'))) |
|---|
| 109 | ); |
|---|
| 110 | } |
|---|
| 111 | public function getGlobals() { |
|---|
| 112 | return array(); |
|---|
| 113 | } |
|---|
| 114 | public function getName() { |
|---|
| 115 | return 'AdminPage'; |
|---|
| 116 | } |
|---|
| 117 | public function getFilters() |
|---|
| 118 | { |
|---|
| 119 | return array( |
|---|
| 120 | 'trans' => new Twig_Filter_Function("__", array('is_safe' => array('html'))) |
|---|
| 121 | ); |
|---|
| 122 | } |
|---|
| 123 | |
|---|
| 124 | |
|---|
| 125 | public function jsCommon() { |
|---|
| 126 | return $this->jsVars (array( |
|---|
| 127 | 'dotclear.nonce' => $GLOBALS['core']->getNonce(), |
|---|
| 128 | 'dotclear.img_plus_src' => 'images/plus.png', |
|---|
| 129 | 'dotclear.img_plus_alt' => __('uncover'), |
|---|
| 130 | 'dotclear.img_minus_src' => 'images/minus.png', |
|---|
| 131 | 'dotclear.img_minus_alt' => __('hide'), |
|---|
| 132 | 'dotclear.img_menu_on' => 'images/menu_on.png', |
|---|
| 133 | 'dotclear.img_menu_off' => 'images/menu_off.png', |
|---|
| 134 | 'dotclear.msg.help' => __('help'), |
|---|
| 135 | 'dotclear.msg.no_selection' => __('no selection'), |
|---|
| 136 | 'dotclear.msg.select_all' => __('select all'), |
|---|
| 137 | 'dotclear.msg.invert_sel' => __('invert selection'), |
|---|
| 138 | 'dotclear.msg.website' => __('Web site:'), |
|---|
| 139 | 'dotclear.msg.email' => __('Email:'), |
|---|
| 140 | 'dotclear.msg.ip_address' => __('IP address:'), |
|---|
| 141 | 'dotclear.msg.error' => __('Error:'), |
|---|
| 142 | 'dotclear.msg.entry_created'=> __('Entry has been successfully created.'), |
|---|
| 143 | 'dotclear.msg.edit_entry' => __('Edit entry'), |
|---|
| 144 | 'dotclear.msg.view_entry' => __('view entry'), |
|---|
| 145 | 'dotclear.msg.confirm_delete_posts' => |
|---|
| 146 | __("Are you sure you want to delete selected entries (%s)?"), |
|---|
| 147 | 'dotclear.msg.confirm_delete_post' => |
|---|
| 148 | __("Are you sure you want to delete this entry?"), |
|---|
| 149 | 'dotclear.msg.confirm_delete_comments' => |
|---|
| 150 | __('Are you sure you want to delete selected comments (%s)?'), |
|---|
| 151 | 'dotclear.msg.confirm_delete_comment' => |
|---|
| 152 | __('Are you sure you want to delete this comment?'), |
|---|
| 153 | 'dotclear.msg.cannot_delete_users' => |
|---|
| 154 | __('Users with posts cannot be deleted.'), |
|---|
| 155 | 'dotclear.msg.confirm_delete_user' => |
|---|
| 156 | __('Are you sure you want to delete selected users (%s)?'), |
|---|
| 157 | 'dotclear.msg.confirm_delete_category' => |
|---|
| 158 | __('Are you sure you want to delete category "%s"?'), |
|---|
| 159 | 'dotclear.msg.confirm_reorder_categories' => |
|---|
| 160 | __('Are you sure you want to reorder all categories?'), |
|---|
| 161 | 'dotclear.msg.confirm_delete_media' => |
|---|
| 162 | __('Are you sure you want to remove media "%s"?'), |
|---|
| 163 | 'dotclear.msg.confirm_extract_current' => |
|---|
| 164 | __('Are you sure you want to extract archive in current directory?'), |
|---|
| 165 | 'dotclear.msg.confirm_remove_attachment' => |
|---|
| 166 | __('Are you sure you want to remove attachment "%s"?'), |
|---|
| 167 | 'dotclear.msg.confirm_delete_lang' => |
|---|
| 168 | __('Are you sure you want to delete "%s" language?'), |
|---|
| 169 | 'dotclear.msg.confirm_delete_plugin' => |
|---|
| 170 | __('Are you sure you want to delete "%s" plugin?'), |
|---|
| 171 | 'dotclear.msg.use_this_theme' => __('Use this theme'), |
|---|
| 172 | 'dotclear.msg.remove_this_theme' => __('Remove this theme'), |
|---|
| 173 | 'dotclear.msg.confirm_delete_theme' => |
|---|
| 174 | __('Are you sure you want to delete "%s" theme?'), |
|---|
| 175 | 'dotclear.msg.zip_file_content' => __('Zip file content'), |
|---|
| 176 | 'dotclear.msg.xhtml_validator' => __('XHTML markup validator'), |
|---|
| 177 | 'dotclear.msg.xhtml_valid' => __('XHTML content is valid.'), |
|---|
| 178 | 'dotclear.msg.xhtml_not_valid' => __('There are XHTML markup errors.'), |
|---|
| 179 | 'dotclear.msg.confirm_change_post_format' => |
|---|
| 180 | __('You have unsaved changes. Switch post format will loose these changes. Proceed anyway?'), |
|---|
| 181 | 'dotclear.msg.load_enhanced_uploader' => __('Loading enhanced uploader =>please wait.'))) |
|---|
| 182 | ->jsLoad('js/jquery/jquery.js') |
|---|
| 183 | ->jsLoad('js/jquery/jquery.biscuit.js') |
|---|
| 184 | ->jsLoad('js/jquery/jquery.bgFade.js') |
|---|
| 185 | ->jsLoad('js/jquery/jquery.constantfooter.js') |
|---|
| 186 | ->jsLoad('js/common.js') |
|---|
| 187 | ->jsLoad('js/prelude.js'); |
|---|
| 188 | } |
|---|
| 189 | |
|---|
| 190 | public function jsLoadIE7() |
|---|
| 191 | { |
|---|
| 192 | return $this->jsAdd( |
|---|
| 193 | '<!--[if lt IE 8]>'."\n". |
|---|
| 194 | '<script type="text/javascript" src="js/ie7/IE8.js"></script>'."\n". |
|---|
| 195 | '<link rel="stylesheet" type="text/css" href="style/iesucks.css" />'."\n". |
|---|
| 196 | '<![endif]-->'); |
|---|
| 197 | } |
|---|
| 198 | |
|---|
| 199 | public function jsConfirmClose() |
|---|
| 200 | { |
|---|
| 201 | $args = func_get_args(); |
|---|
| 202 | if (count($args) > 0) { |
|---|
| 203 | foreach ($args as $k => $v) { |
|---|
| 204 | $args[$k] = "'".html::escapeJS($v)."'"; |
|---|
| 205 | } |
|---|
| 206 | $args = implode(',',$args); |
|---|
| 207 | } else { |
|---|
| 208 | $args = ''; |
|---|
| 209 | } |
|---|
| 210 | |
|---|
| 211 | $this->jsLoad('js/confirm-close.js'); |
|---|
| 212 | $this->jsAdd( |
|---|
| 213 | '<script type="text/javascript">'."\n". |
|---|
| 214 | "//<![CDATA[\n". |
|---|
| 215 | "confirmClosePage = new confirmClose(".$args."); ". |
|---|
| 216 | "confirmClose.prototype.prompt = '".html::escapeJS(__('You have unsaved changes.'))."'; ". |
|---|
| 217 | "\n//]]>\n". |
|---|
| 218 | "</script>\n"); |
|---|
| 219 | return $this; |
|---|
| 220 | } |
|---|
| 221 | |
|---|
| 222 | public function jsPageTabs($default=null) |
|---|
| 223 | { |
|---|
| 224 | if ($default) { |
|---|
| 225 | $default = "'".html::escapeJS($default)."'"; |
|---|
| 226 | } |
|---|
| 227 | |
|---|
| 228 | return $this |
|---|
| 229 | ->jsLoad('js/jquery/jquery.pageTabs.js') |
|---|
| 230 | ->jsAdd('<script type="text/javascript">'."\n". |
|---|
| 231 | "//<![CDATA[\n". |
|---|
| 232 | "\$(function() {\n". |
|---|
| 233 | " \$.pageTabs(".$default.");\n". |
|---|
| 234 | "});\n". |
|---|
| 235 | "\n//]]>\n". |
|---|
| 236 | "</script>\n"); |
|---|
| 237 | } |
|---|
| 238 | |
|---|
| 239 | public function jsModal() |
|---|
| 240 | { |
|---|
| 241 | return $this |
|---|
| 242 | ->head( |
|---|
| 243 | '<link rel="stylesheet" type="text/css" href="style/modal/modal.css" />') |
|---|
| 244 | ->jsLoad('js/jquery/jquery.modal.js') |
|---|
| 245 | ->jsVars(array( |
|---|
| 246 | '$.modal.prototype.params.loader_img' =>'style/modal/loader.gif', |
|---|
| 247 | '$.modal.prototype.params.close_img' =>'style/modal/close.png' |
|---|
| 248 | )); |
|---|
| 249 | } |
|---|
| 250 | |
|---|
| 251 | public static function jsColorPicker() |
|---|
| 252 | { |
|---|
| 253 | return |
|---|
| 254 | '<link rel="stylesheet" type="text/css" href="style/farbtastic/farbtastic.css" />'."\n". |
|---|
| 255 | self::jsLoad('js/jquery/jquery.farbtastic.js'). |
|---|
| 256 | self::jsLoad('js/color-picker.js'); |
|---|
| 257 | } |
|---|
| 258 | |
|---|
| 259 | public function jsDatePicker() |
|---|
| 260 | { |
|---|
| 261 | $this |
|---|
| 262 | ->head( |
|---|
| 263 | '<link rel="stylesheet" type="text/css" href="style/date-picker.css" />') |
|---|
| 264 | ->jsLoad('js/date-picker.js') |
|---|
| 265 | ->jsVars(array( |
|---|
| 266 | "datePicker.prototype.months[0]" => __('January'), |
|---|
| 267 | "datePicker.prototype.months[1]" => __('February'), |
|---|
| 268 | "datePicker.prototype.months[2]" => __('March'), |
|---|
| 269 | "datePicker.prototype.months[3]" => __('April'), |
|---|
| 270 | "datePicker.prototype.months[4]" => __('May'), |
|---|
| 271 | "datePicker.prototype.months[5]" => __('June'), |
|---|
| 272 | "datePicker.prototype.months[6]" => __('July'), |
|---|
| 273 | "datePicker.prototype.months[7]" => __('August'), |
|---|
| 274 | "datePicker.prototype.months[8]" => __('September'), |
|---|
| 275 | "datePicker.prototype.months[9]" => __('October'), |
|---|
| 276 | "datePicker.prototype.months[10]" => __('November'), |
|---|
| 277 | "datePicker.prototype.months[11]" => __('December'), |
|---|
| 278 | "datePicker.prototype.days[0]" => __('Monday'), |
|---|
| 279 | "datePicker.prototype.days[1]" => __('Tuesday'), |
|---|
| 280 | "datePicker.prototype.days[2]" => __('Wednesday'), |
|---|
| 281 | "datePicker.prototype.days[3]" => __('Thursday'), |
|---|
| 282 | "datePicker.prototype.days[4]" => __('Friday'), |
|---|
| 283 | "datePicker.prototype.days[5]" => __('Saturday'), |
|---|
| 284 | "datePicker.prototype.days[6]" => __('Sunday'), |
|---|
| 285 | |
|---|
| 286 | "datePicker.prototype.img_src" => 'images/date-picker.png', |
|---|
| 287 | |
|---|
| 288 | "datePicker.prototype.close_msg" => __('close'), |
|---|
| 289 | "datePicker.prototype.now_msg" => __('now'))); |
|---|
| 290 | return $this; |
|---|
| 291 | } |
|---|
| 292 | |
|---|
| 293 | public function jsToolBar() |
|---|
| 294 | { |
|---|
| 295 | $this |
|---|
| 296 | ->head( |
|---|
| 297 | '<link rel="stylesheet" type="text/css" href="style/jsToolBar/jsToolBar.css" />') |
|---|
| 298 | ->jsLoad("js/jsToolBar/jsToolBar.js"); |
|---|
| 299 | |
|---|
| 300 | if (isset($GLOBALS['core']->auth) && $GLOBALS['core']->auth->getOption('enable_wysiwyg')) { |
|---|
| 301 | $this->jsLoad("js/jsToolBar/jsToolBar.wysiwyg.js"); |
|---|
| 302 | } |
|---|
| 303 | |
|---|
| 304 | $this->jsLoad("js/jsToolBar/jsToolBar.dotclear.js") |
|---|
| 305 | ->jsVars(array( |
|---|
| 306 | |
|---|
| 307 | "jsToolBar.prototype.dialog_url" => 'popup.php', |
|---|
| 308 | "jsToolBar.prototype.iframe_css" => |
|---|
| 309 | 'body{'. |
|---|
| 310 | 'font: 12px "DejaVu Sans","Lucida Grande","Lucida Sans Unicode",Arial,sans-serif;'. |
|---|
| 311 | 'color : #000;'. |
|---|
| 312 | 'background: #f9f9f9;'. |
|---|
| 313 | 'margin: 0;'. |
|---|
| 314 | 'padding : 2px;'. |
|---|
| 315 | 'border: none;'. |
|---|
| 316 | (l10n::getTextDirection($GLOBALS['_lang']) == 'rtl' ? 'direction:rtl;' : ''). |
|---|
| 317 | '}'. |
|---|
| 318 | 'pre, code, kbd, samp {'. |
|---|
| 319 | 'font-family:"Courier New",Courier,monospace;'. |
|---|
| 320 | 'font-size : 1.1em;'. |
|---|
| 321 | '}'. |
|---|
| 322 | 'code {'. |
|---|
| 323 | 'color : #666;'. |
|---|
| 324 | 'font-weight : bold;'. |
|---|
| 325 | '}'. |
|---|
| 326 | 'body > p:first-child {'. |
|---|
| 327 | 'margin-top: 0;'. |
|---|
| 328 | '}', |
|---|
| 329 | "jsToolBar.prototype.base_url" => $GLOBALS['core']->blog->host, |
|---|
| 330 | "jsToolBar.prototype.switcher_visual_title" => __('visual'), |
|---|
| 331 | "jsToolBar.prototype.switcher_source_title" => __('source'), |
|---|
| 332 | "jsToolBar.prototype.legend_msg" => |
|---|
| 333 | __('You can use the following shortcuts to format your text.'), |
|---|
| 334 | "jsToolBar.prototype.elements.blocks.options.none" => __('-- none --'), |
|---|
| 335 | "jsToolBar.prototype.elements.blocks.options.nonebis" => __('-- block format --'), |
|---|
| 336 | "jsToolBar.prototype.elements.blocks.options.p" => __('Paragraph'), |
|---|
| 337 | "jsToolBar.prototype.elements.blocks.options.h1" => __('Level 1 header'), |
|---|
| 338 | "jsToolBar.prototype.elements.blocks.options.h2" => __('Level 2 header'), |
|---|
| 339 | "jsToolBar.prototype.elements.blocks.options.h3" => __('Level 3 header'), |
|---|
| 340 | "jsToolBar.prototype.elements.blocks.options.h4" => __('Level 4 header'), |
|---|
| 341 | "jsToolBar.prototype.elements.blocks.options.h5" => __('Level 5 header'), |
|---|
| 342 | "jsToolBar.prototype.elements.blocks.options.h6" => __('Level 6 header'), |
|---|
| 343 | "jsToolBar.prototype.elements.strong.title" => __('Strong emphasis'), |
|---|
| 344 | "jsToolBar.prototype.elements.em.title" => __('Emphasis'), |
|---|
| 345 | "jsToolBar.prototype.elements.ins.title" => __('Inserted'), |
|---|
| 346 | "jsToolBar.prototype.elements.del.title" => __('Deleted'), |
|---|
| 347 | "jsToolBar.prototype.elements.quote.title" => __('Inline quote'), |
|---|
| 348 | "jsToolBar.prototype.elements.code.title" => __('Code'), |
|---|
| 349 | "jsToolBar.prototype.elements.br.title" => __('Line break'), |
|---|
| 350 | "jsToolBar.prototype.elements.blockquote.title" => __('Blockquote'), |
|---|
| 351 | "jsToolBar.prototype.elements.pre.title" => __('Preformated text'), |
|---|
| 352 | "jsToolBar.prototype.elements.ul.title" => __('Unordered list'), |
|---|
| 353 | "jsToolBar.prototype.elements.ol.title" => __('Ordered list'), |
|---|
| 354 | |
|---|
| 355 | "jsToolBar.prototype.elements.link.title" => __('Link'), |
|---|
| 356 | "jsToolBar.prototype.elements.link.href_prompt" => __('URL?'), |
|---|
| 357 | "jsToolBar.prototype.elements.link.hreflang_prompt" => __('Language?'), |
|---|
| 358 | |
|---|
| 359 | "jsToolBar.prototype.elements.img.title" => __('External image'), |
|---|
| 360 | "jsToolBar.prototype.elements.img.src_prompt" => __('URL?'), |
|---|
| 361 | |
|---|
| 362 | "jsToolBar.prototype.elements.img_select.title" => __('Media chooser'), |
|---|
| 363 | "jsToolBar.prototype.elements.post_link.title" => __('Link to an entry'))); |
|---|
| 364 | |
|---|
| 365 | if (!$GLOBALS['core']->auth->check('media,media_admin',$GLOBALS['core']->blog->id)) { |
|---|
| 366 | $this->jsVar("jsToolBar.prototype.elements.img_select.disabled",true); |
|---|
| 367 | } |
|---|
| 368 | |
|---|
| 369 | return $this; |
|---|
| 370 | } |
|---|
| 371 | |
|---|
| 372 | public function jsCandyUpload($params=array(),$base_url=null) |
|---|
| 373 | { |
|---|
| 374 | if (!$base_url) { |
|---|
| 375 | $base_url = path::clean(dirname(preg_replace('/(\?.*$)?/','',$_SERVER['REQUEST_URI']))).'/'; |
|---|
| 376 | } |
|---|
| 377 | |
|---|
| 378 | $params = array_merge($params,array( |
|---|
| 379 | 'sess_id='.session_id(), |
|---|
| 380 | 'sess_uid='.$_SESSION['sess_browser_uid'], |
|---|
| 381 | 'xd_check='.$GLOBALS['core']->getNonce() |
|---|
| 382 | )); |
|---|
| 383 | |
|---|
| 384 | return |
|---|
| 385 | '<link rel="stylesheet" type="text/css" href="style/candyUpload/style.css" />'."\n". |
|---|
| 386 | self::jsLoad('js/jquery/jquery.candyUpload.js'). |
|---|
| 387 | |
|---|
| 388 | '<script type="text/javascript">'."\n". |
|---|
| 389 | "//<![CDATA[\n". |
|---|
| 390 | "dotclear.candyUpload = {};\n". |
|---|
| 391 | self::jsVar('dotclear.msg.activate_enhanced_uploader',__('Activate enhanced uploader')). |
|---|
| 392 | self::jsVar('dotclear.msg.disable_enhanced_uploader',__('Disable enhanced uploader')). |
|---|
| 393 | self::jsVar('$._candyUpload.prototype.locales.file_uploaded',__('File successfully uploaded.')). |
|---|
| 394 | self::jsVar('$._candyUpload.prototype.locales.max_file_size',__('Maximum file size allowed:')). |
|---|
| 395 | self::jsVar('$._candyUpload.prototype.locales.limit_exceeded',__('Limit exceeded.')). |
|---|
| 396 | self::jsVar('$._candyUpload.prototype.locales.size_limit_exceeded',__('File size exceeds allowed limit.')). |
|---|
| 397 | self::jsVar('$._candyUpload.prototype.locales.canceled',__('Canceled.')). |
|---|
| 398 | self::jsVar('$._candyUpload.prototype.locales.http_error',__('HTTP Error:')). |
|---|
| 399 | self::jsVar('$._candyUpload.prototype.locales.error',__('Error:')). |
|---|
| 400 | self::jsVar('$._candyUpload.prototype.locales.choose_file',__('Choose file')). |
|---|
| 401 | self::jsVar('$._candyUpload.prototype.locales.choose_files',__('Choose files')). |
|---|
| 402 | self::jsVar('$._candyUpload.prototype.locales.cancel',__('Cancel')). |
|---|
| 403 | self::jsVar('$._candyUpload.prototype.locales.clean',__('Clean')). |
|---|
| 404 | self::jsVar('$._candyUpload.prototype.locales.upload',__('Upload')). |
|---|
| 405 | self::jsVar('$._candyUpload.prototype.locales.no_file_in_queue',__('No file in queue.')). |
|---|
| 406 | self::jsVar('$._candyUpload.prototype.locales.file_in_queue',__('1 file in queue.')). |
|---|
| 407 | self::jsVar('$._candyUpload.prototype.locales.files_in_queue',__('%d files in queue.')). |
|---|
| 408 | self::jsVar('$._candyUpload.prototype.locales.queue_error',__('Queue error:')). |
|---|
| 409 | self::jsVar('dotclear.candyUpload.base_url',$base_url). |
|---|
| 410 | self::jsVar('dotclear.candyUpload.movie_url',$base_url.'index.php?pf=swfupload.swf'). |
|---|
| 411 | self::jsVar('dotclear.candyUpload.params',implode('&',$params)). |
|---|
| 412 | "\n//]]>\n". |
|---|
| 413 | "</script>\n"; |
|---|
| 414 | } |
|---|
| 415 | |
|---|
| 416 | public static function jsToolMan() |
|---|
| 417 | { |
|---|
| 418 | return |
|---|
| 419 | '<script type="text/javascript" src="js/tool-man/core.js"></script>'. |
|---|
| 420 | '<script type="text/javascript" src="js/tool-man/events.js"></script>'. |
|---|
| 421 | '<script type="text/javascript" src="js/tool-man/css.js"></script>'. |
|---|
| 422 | '<script type="text/javascript" src="js/tool-man/coordinates.js"></script>'. |
|---|
| 423 | '<script type="text/javascript" src="js/tool-man/drag.js"></script>'. |
|---|
| 424 | '<script type="text/javascript" src="js/tool-man/dragsort.js"></script>'. |
|---|
| 425 | '<script type="text/javascript" src="js/dragsort-tablerows.js"></script>'; |
|---|
| 426 | } |
|---|
| 427 | |
|---|
| 428 | public function jsMetaEditor() |
|---|
| 429 | { |
|---|
| 430 | return $this->jsLoad("js/meta-editor.js"); |
|---|
| 431 | } |
|---|
| 432 | |
|---|
| 433 | } |
|---|
| 434 | ?> |
|---|