1 11 package org.jboss.portlet.forums; 12 13 import org.jboss.portlet.forums.model.AuthType; 14 15 19 public interface ForumsConstants { 21 22 String TPL_THEME_SMALL_HEADER = "small_header"; 23 24 25 String TPL_THEME_TOPIC_NOTIFY = "search_body"; 26 27 28 String TPL_THEME_SEARCH_BODY = "search_body"; 29 30 31 String TPL_THEME_MESSAGE_BODY = "message_body"; 32 33 34 String TPL_THEME_INDEX_BODY = "index_body"; 35 36 37 String TPL_THEME_VIEWFORUM_BODY = "viewforum_body"; 38 39 40 String TPL_THEME_VIEWTOPIC_BODY = "viewtopic_body"; 41 42 43 String TPL_THEME_VIEWTOPIC_ATTACH_BODY = "viewtopic_attach_body"; 44 45 46 String TPL_THEME_VIEWTOPIC_POLL_RESULT = "viewtopic_poll_result"; 47 48 49 String TPL_THEME_VIEWTOPIC_POLL_BALLOT = "viewtopic_poll_ballot"; 50 51 52 String TPL_THEME_JUMP_BOX = "jumpbox"; 53 54 55 String TPL_THEME_POSTING_BODY = "posting_body"; 56 57 58 String TPL_THEME_POSTING_POLL_BODY = "posting_poll_body"; 59 60 61 String TPL_THEME_POSTING_ATTACH_BODY = "posting_attach_body"; 62 63 64 String TPL_THEME_ADD_ATTACHMENT_BODY = "add_attachment_body"; 65 66 67 String TPL_THEME_POSTED_ATTACHMENTS_BODY = "posted_attachments_body"; 68 69 70 String TPL_THEME_POSTING_TOPIC_REVIEW = "posting_topic_review"; 71 72 73 String TPL_THEME_POSTING_PREVIEW = "posting_preview"; 74 75 76 String TPL_THEME_MODCP_BODY = "modcp_body"; 77 78 79 String TPL_THEME_MODCP_MOVE = "modcp_move"; 80 81 82 String TPL_THEME_CONFIRM_BODY = "confirm_body"; 83 84 85 String TPL_THEME_ERROR_BODY = "error_body"; 86 87 88 String TPL_THEME_SEARCH_RESULTS_POSTS = "search_results_posts"; 89 90 91 String TPL_THEME_SEARCH_RESULTS_TOPICS = "search_results_topics"; 92 93 94 String TPL_THEME_WATCHED_TOPICS_BODY = "watched_topics_body"; 95 96 97 String TPL_THEME_WATCHED_FORUMS_BODY = "watched_forums_body"; 98 99 100 String TPL_THEME_ADMIN_AUTH_FORUM_BODY = "admin/auth_forum_body"; 101 102 103 String TPL_THEME_ADMIN_AUTH_SELECT_BODY = "admin/auth_select_body"; 104 105 106 String TPL_THEME_ADMIN_FORUM_ADMIN_BODY = "admin/forum_admin_body"; 107 108 109 String TPL_THEME_ADMIN_FORUM_EDIT_BODY = "admin/forum_edit_body"; 110 111 112 String TPL_THEME_ADMIN_CATEGORY_EDIT_BODY = "admin/category_edit_body"; 113 114 115 String THEMENAME = "subSilver"; 116 117 118 String TPL_THEME_ADMIN_FORUM_DELETE_BODY = "admin/forum_delete_body"; 119 120 121 String TPL_THEME_ADMIN_ATTACH_MANAGE_BODY = "admin/attach_manage_body"; 122 123 124 String TPL_THEME_CODE_B_CLOSE = "code/b_close"; 125 126 127 String TPL_THEME_CODE_B_OPEN = "code/b_open"; 128 129 130 String TPL_THEME_CODE_CODE_CLOSE = "code/code_close"; 131 132 133 String TPL_THEME_CODE_CODE_OPEN = "code/code_open"; 134 135 136 String TPL_THEME_CODE_COLOR_CLOSE = "code/color_close"; 137 138 139 String TPL_THEME_CODE_COLOR_OPEN = "code/color_open"; 140 141 142 String TPL_THEME_CODE_EMAIL = "code/email"; 143 144 145 String TPL_THEME_CODE_I_CLOSE = "code/i_close"; 146 147 148 String TPL_THEME_CODE_I_OPEN = "code/i_open"; 149 150 151 String TPL_THEME_CODE_IMG = "code/img"; 152 153 154 String TPL_THEME_CODE_LISTITEM = "code/listitem"; 155 156 157 String TPL_THEME_CODE_OLIST_CLOSE = "code/olist_close"; 158 159 160 String TPL_THEME_CODE_OLIST_OPEN = "code/olist_open"; 161 162 163 String TPL_THEME_CODE_QUOTE_CLOSE = "code/quote_close"; 164 165 166 String TPL_THEME_CODE_QUOTE_OPEN = "code/quote_open"; 167 168 169 String TPL_THEME_CODE_QUOTE_USERNAME_OPEN = "code/quote_username_open"; 170 171 172 String TPL_THEME_CODE_SIZE_CLOSE = "code/size_close"; 173 174 175 String TPL_THEME_CODE_SIZE_OPEN = "code/size_open"; 176 177 178 String TPL_THEME_CODE_U_CLOSE = "code/u_close"; 179 180 181 String TPL_THEME_CODE_U_OPEN = "code/u_open"; 182 183 184 String TPL_THEME_CODE_ULIST_CLOSE = "code/ulist_close"; 185 186 187 String TPL_THEME_CODE_ULIST_OPEN = "code/ulist_open"; 188 189 190 String TPL_THEME_CODE_URL = "code/url"; 191 192 193 String TPL_THEME_BLOCK_TOPICS = "block/topics"; 194 195 196 String TPL_MAIL_TOPIC_NOTIFY = "topic_notify"; 197 198 199 String TPL_MAIL_FORUM_NOTIFY = "forum_notify"; 200 201 202 String [] SORT_BY_TYPES = 203 { 204 "${bb.Sort_Time}", 205 "${bb.Sort_Post_Subject}", 206 "${bb.Sort_Author}", 207 "${bb.Sort_Forum}" 208 }; 209 210 211 int[] PREVIOUS_DAYS = 212 { 213 0, 214 1, 215 7, 216 14, 217 30, 218 90, 219 180, 220 364 221 }; 222 223 224 String [] PREVIOUS_DAYS_TEXT_TOPICS = 225 { 226 "${bb.All_Topics}", 227 "${bb.1_Day}", 228 "${bb.7_Days}", 229 "${bb.2_Weeks}", 230 "${bb.1_Month}", 231 "${bb.3_Months}", 232 "${bb.6_Months}", 233 "${bb.1_Year}" 234 }; 235 236 237 String [] PREVIOUS_DAYS_TEXT_POSTS = 238 { 239 "${bb.All_Posts}", 240 "${bb.1_Day}", 241 "${bb.7_Days}", 242 "${bb.2_Weeks}", 243 "${bb.1_Month}", 244 "${bb.3_Months}", 245 "${bb.6_Months}", 246 "${bb.1_Year}" 247 }; 248 249 250 String [] FORUM_AUTH_FORM_FIELD_NAMES = 251 { 252 "auth_view", 253 "auth_read", 254 "auth_post", 255 "auth_reply", 256 "auth_edit", 257 "auth_delete", 258 "auth_sticky", 259 "auth_announce", 260 "auth_vote", 261 "auth_pollcreate", 262 "auth_attachment" 263 }; 264 265 266 String [] FORUM_AUTH_FORM_FIELD_LABELS = 267 { 268 "${bb.View}", 269 "${bb.Read}", 270 "${bb.Post}", 271 "${bb.Reply}", 272 "${bb.Edit}", 273 "${bb.Delete}", 274 "${bb.Sticky}", 275 "${bb.Announce}", 276 "${bb.Vote}", 277 "${bb.Pollcreate}", 278 "${bb.Attachment}" 279 }; 280 281 282 String [] FORUM_AUTH_LEVEL_LABELS = 283 { 284 "ALL", 285 "REG", 286 "PRIVATE", 287 "MOD", 288 "ADMIN" 289 }; 290 291 296 297 298 int GENERAL_MESSAGE = 200; 299 300 301 int GENERAL_ERROR = 202; 302 303 304 int CRITICAL_MESSAGE = 203; 305 306 307 int CRITICAL_ERROR = 204; 308 309 310 int POST_NORMAL = 0; 311 312 313 int POST_STICKY = 1; 314 315 316 int POST_ANNOUNCE = 2; 317 318 319 int POST_GLOBAL_ANNONCE = 3; 320 321 322 String [] AUTH_TYPE_TO_MESSAGE = 323 { 324 null, 325 null, 326 "Sorry_auth_read_", 327 "Sorry_auth_post_", 328 "Sorry_auth_reply_", 329 "Sorry_auth_edit_", 330 "Sorry_auth_delete_", 331 "Sorry_auth_announce_", 332 "Sorry_auth_sticky_", 333 null, 334 null, 335 "Sorry_auth_vote_", 336 null, 337 }; 338 339 340 int[] TOPIC_TYPE_TO_AUTH_TYPE = 341 { 342 AuthType.POST, 343 AuthType.STICKY, 344 AuthType.ANNOUNCE, 345 AuthType.POST 346 }; 347 348 350 351 int PMODE_NO_MODE = -1; 352 353 354 int PMODE_VOTE = 0; 355 356 357 int PMODE_REPLY = 1; 358 359 360 int PMODE_QUOTE = 2; 361 362 363 int PMODE_EDIT_POST = 3; 364 365 366 int PMODE_DELETE = 4; 367 368 369 int PMODE_POLL_DELETE = 5; 370 371 372 int PMODE_NEW_TOPIC = 6; 373 374 375 int PMODE_REPOST = 7; 376 377 378 int PMODE_SMILIES = 8; 379 380 381 int PMODE_TOPIC_REVIEW = 9; 382 383 384 int PMASK_VOTE = 0x0000001; 385 386 387 int PMASK_REPLY = 0x0000002; 388 389 390 int PMASK_QUOTE = 0x0000004; 391 392 393 int PMASK_EDIT_POST = 0x0000008; 394 395 396 int PMASK_DELETE = 0x0000010; 397 398 399 int PMASK_POLL_DELETE = 0x0000020; 400 401 402 int PMASK_NEW_TOPIC = 0x0000040; 403 404 405 int PMASK_SMILIES = 0x0000080; 406 407 408 int PMASK_TOPIC_REVIEW = 0x0000100; 409 410 411 int[] PMASKS = 412 { 413 PMASK_VOTE, 414 PMASK_REPLY, 415 PMASK_QUOTE, 416 PMASK_EDIT_POST, 417 PMASK_DELETE, 418 PMASK_POLL_DELETE, 419 PMASK_NEW_TOPIC, 420 PMASK_SMILIES, 421 PMASK_TOPIC_REVIEW 422 }; 423 424 434 435 436 int MMODE_NO_MODE = -1; 437 438 439 int MMODE_DELETE = 0; 440 441 442 int MMODE_MOVE = 1; 443 444 445 int MMODE_LOCK = 2; 446 447 448 int MMODE_UNLOCK = 3; 449 450 451 int MMODE_SPLIT = 4; 452 453 454 int MMODE_IP = 5; 455 456 457 String [] AUTH_PRESETS_NAMES = 458 { 459 "${bb.Public}", 460 "${bb.Registered}", 461 "${bb.Registered}[${bb.Hidden}]", 462 "${bb.Private}", 463 "${bb.Private}[${bb.Hidden}]", 464 "${bb.Moderators}", 465 "${bb.Moderators}[${bb.Hidden}]" 466 }; 467 468 474 class ModeDecoder 475 { 476 private static final String [] P_TO_HTML = new String [10]; 477 478 static 479 { 480 P_TO_HTML[PMODE_VOTE] = "vote"; 481 P_TO_HTML[PMODE_REPLY] = "reply"; 482 P_TO_HTML[PMODE_QUOTE] = "reply"; 483 P_TO_HTML[PMODE_EDIT_POST] = "editpost"; 484 P_TO_HTML[PMODE_DELETE] = "delete"; 485 P_TO_HTML[PMODE_POLL_DELETE] = "poll_delete"; 486 P_TO_HTML[PMODE_NEW_TOPIC] = "newtopic"; 487 P_TO_HTML[PMODE_REPOST] = "repost"; 488 P_TO_HTML[PMODE_SMILIES] = "smilies"; 489 P_TO_HTML[PMODE_TOPIC_REVIEW] = "topicreview"; 490 } 491 492 499 public static final String encodePosting(int mode) 500 { 501 return P_TO_HTML[mode]; 502 } 503 504 511 public static final int decodePosting(String mode) 512 { 513 if ("topicreview".equals(mode)) 514 { 515 return PMODE_TOPIC_REVIEW; 516 } 517 518 if ("smilies".equals(mode)) 519 { 520 return PMODE_SMILIES; 521 } 522 523 if ("reply".equals(mode)) 524 { 525 return PMODE_REPLY; 526 } 527 528 if ("quote".equals(mode)) 529 { 530 return PMODE_QUOTE; 531 } 532 533 if ("editpost".equals(mode)) 534 { 535 return PMODE_EDIT_POST; 536 } 537 538 if ("delete".equals(mode)) 539 { 540 return PMODE_DELETE; 541 } 542 543 if ("poll_delete".equals(mode)) 544 { 545 return PMODE_POLL_DELETE; 546 } 547 548 if ("vote".equals(mode)) 549 { 550 return PMODE_VOTE; 551 } 552 553 if ("newtopic".equals(mode)) 554 { 555 return PMODE_NEW_TOPIC; 556 } 557 558 if ("repost".equals(mode)) 559 { 560 return PMODE_REPOST; 561 } 562 563 return PMODE_NO_MODE; 564 } 565 566 615 } 616 617 618 int FORUM_UNLOCKED = 0; 619 620 621 int FORUM_LOCKED = 1; 622 623 624 int TOPIC_UNLOCKED = 0; 625 626 627 int TOPIC_LOCKED = 1; 628 629 630 int TOPIC_MOVED = 2; 631 632 633 int TOPIC_WATCH_UN_NOTIFIED = 0; 634 635 636 int TOPIC_WATCH_NOTIFIED = 1; 637 638 639 String POST_CAT_URL = "c"; 640 641 642 String POST_FORUM_URL = "f"; 643 644 645 String POST_TOPIC_URL = "t"; 646 647 648 String POST_POST_URL = "p"; 649 650 651 String POST_USERS_URL = "u"; 652 653 654 String POST_ROLES_URL = "g"; 655 656 657 int WATCH_MODE_LINKED = 0; 658 659 660 int WATCH_MODE_EMBEDED = 1; 661 662 663 public static final String FORUMSMODULE_JNDINAME = "java:portal/ForumsModule"; 664 } 665 666 | Popular Tags |