code
stringlengths
1
2.01M
repo_name
stringlengths
3
62
path
stringlengths
1
267
language
stringclasses
231 values
license
stringclasses
13 values
size
int64
1
2.01M
#layout, #footer, #splitBar, #splitBarProxy, #alertBackground, #dialogBackground, #background, .comboxop, .shadow, .panelBar{ display:none;} #printBox{display:block;} /* CSS Table */ table.list {border-collapse:collapse;table-layout:fixed} table.list thead tr {background-color: #F0EFF0;} table.list th {padding:1px 2px; line-height:21px; border: solid 1px #D0D0D0; font-weight:bolder; } table.list td {padding:1px 2px; line-height:21px; border:solid 1px #D0D0D0;overflow: hidden;} /* Grid */ .grid table {border-collapse:collapse; table-layout:fixed;} .grid table th {padding:1px 2px; line-height:21px; border: solid 1px #D0D0D0; font-weight:bolder;} .grid table td {padding:1px 2px; line-height:21px; border: solid 1px #D0D0D0; line-height: 21px; overflow:hidden;} .grid .gridTbody td div { display: block; height: 21px; line-height: 21px; overflow: hidden;} .grid .left { text-align:left;} .grid .right { text-align:right;} .grid .center { text-align:center;}
zyroot
trunk/admin/dwz1.4.5/themes/css/print.css
CSS
art
986
@charset "utf-8"; html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td { padding:0; margin:0; font-size:12px; line-height:100%; font-family:Arial, sans-serif;} ul, ol { list-style:none;} img { border:0;} body { margin:0; text-align:center; background:#FFF url(../default/images/login_bg.png) repeat-x top;} #login { display:block; width:950px; margin:0 auto; text-align:left;} #login_header { display:block; padding-top:40px; height:80px;} .login_logo { float:left; margin-top:10px;} .login_info { float:left; margin-left:10px; line-height:80px; font-size:18px; color:#0088cc; font-weight: bold;} .login_headerContent { float:right; display:block; width:280px; height:80px; padding:0 40px; background:url(../default/images/login_header_bg.png) no-repeat top right;} .navList { display:block; overflow:hidden; height:20px; padding-left:28px;} .navList ul { float:left; display:block; overflow:hidden;} .navList li { float:left; display:block; margin-left:-1px; padding:0 10px; background:url(../default/images/login_list.png) no-repeat 0 5px;} .navList a { display:block; white-space:nowrap; line-height:21px; color:#000; text-decoration:none;} .navList a:hover { text-decoration:underline;} #login_content { display:block; position:relative;} .login_title { display:block; padding:25px 0 0 38px;} .loginForm { display:block; width:240px; padding:40px 20px 0 20px; position:absolute; right:40px;} .loginForm p { margin:10px 0;} .loginForm label { float:left; width:70px; padding:0 0 0 10px; line-height:25px; color:#4c4c4c; font-size:14px;} .loginForm input { padding:3px 2px; border-style:solid; border-width:1px; border-color:#80a5c4;} .loginForm .login_input {} .loginForm .code { float:left; margin-right:5px;} .login_bar { padding-left:70px;} .login_bar .sub { display:block; width:75px; height:30px; border:none; background:url(../default/images/login_sub.png) no-repeat; cursor:pointer;} .login_banner { display:block; height:270px;} .login_main { display:block; height:200px; padding-right:40px; background:url(../default/images/login_content_bg.png) no-repeat top;} .helpList { float:right; width:200px;} .helpList li { display:block; padding-left:10px; background:url(../default/images/login_list.png) no-repeat 0 -40px;} .helpList a { line-height:21px; color:#333; text-decoration:none; } .helpList a:hover { text-decoration:underline;} .login_inner { display:block; width:560px; padding:30px 20px 0 20px;} .login_inner p { margin:10px 0; line-height:150%; font-size:14px; color:#666;} #login_footer { clear:both; display:block; margin-bottom:20px; padding:10px; border-top:solid 1px #e2e5e8; color:#666; text-align:center;}
zyroot
trunk/admin/dwz1.4.5/themes/css/login.css
CSS
art
2,968
@charset "utf-8"; /* 1.改模板的颜色.panel .panelContent { border-color:#}全部为目标颜色 2.改body的background 3.改图片的路径 4.改 #sidebar_s .collapse和#sidebar_s .collapse:hover颜色 5.改.tree .selected { background:#d0fc68;}颜色 */ /* Icon */ .tabsHeader li.main a span span, #taskbar li .taskbutton span { background:url(../default/images/icon.png) no-repeat;} /* Panel */ .panel, .panel .panelHeader, .panel .panelHeaderContent, .panel .panelHeaderContent h1, .panel .panelFooter, .panel .panelFooterContent { background:url(../purple/images/panel/panel.png) no-repeat;} .panel .expandable, .panel .collapsable { background:url(../purple/images/panel/panel_icon.png) no-repeat;} .panel .panelHeaderContent h1 { color:#2d3f00; } .panel .panelContent { border-color:#e29de2; background:#F9E8F9;} .panel .grid { border-color:#E29DE2;} /* Tabs */ .tabs, .tabsHeader, .tabsHeaderContent, .tabs .tabsHeader ul, .tabs .tabsHeader li, .tabs .tabsHeader li a, .tabs .tabsHeader li span, .tabs .tabsFooter, .tabs .tabsFooterContent { background:url(../purple/images/tabs/tabspanel.png) no-repeat;} .tabs .tabsHeader li a { color:#2d3f00;} .tabs .tabsHeader li span { color:#2d3f00;} .tabs .tabsContent { border-color:#e29de2; background:#F9E8F9;} /* TabsPage */ .tabsPage .tabsPageHeader, .tabsPage .tabsPageHeader li, .tabsPage .tabsPageHeader li a, .tabsPage .tabsPageHeader li span { background:url(../purple/images/tabs/tabspage.png) no-repeat;} .tabsPage .tabsPageHeader { background-color:#e9f0f2;} .tabsPage .tabsPageHeader { border-color:#e29de2;} .tabsPage .tabsPageHeader li a { color:#2d3f00;} .tabsPage .tabsPageHeader li .close, .tabsPage .tabsPageHeader li.hover .close, .tabsPage .tabsPageHeader li.selected .close { background:url(../purple/images/tabs/tabspage_icon.png) no-repeat;} .tabsPage .tabsLeft, .tabsPage .tabsRight, .tabsPage .tabsMore { background:url(../purple/images/tabs/tabscontrol.png) no-repeat;} .tabsPage .tabsMoreList { border-color:#E29DE2; background:#FFF;} .tabsPage .tabsPageHeader .home_icon { background:url(../default/images/icon.png) no-repeat;} .tabsPage .tabsPageContent { border-color:#e29de2; background:#FFF;} /* Alert */ .alert .alertFooter, .alert .alertFooter_r, .alert .alertFooter_c { background:url(../purple/images/alert/alertpanel.png) no-repeat;} .alert .alertContent { border-color:#b8d0d6; background:#eef4f5;} .alert .warn .alertInner { border-color:#e83e09; background:#fefacf;} .alert .error .alertInner { border-color:#e50000; background:#fefacf;} .alert .correct .alertInner, .alert .info .alertInner { border-color:#b8d0d6; background:#fefacf;} .alert .confirm .alertInner { border-color:#b8d0d6; background:#fefacf;} .alert h1 { background:url(../default/images/alert/alertpanel_icon.png) no-repeat;} /* Dialog */ .dialog .dialogHeader, .dialog .dialogHeader_r, .dialog .dialogHeader_c, .dialog .dialogFooter, .dialog .dialogFooter_r, .dialog .dialogFooter_c { background:url(../purple/images/dialog/dialogpanel.png) no-repeat;} .dialog .dialogHeader h1, .dialog .dialogHeader .close, .dialog .dialogHeader .maximize, .dialog .dialogHeader .restore, .dialog .dialogHeader .minimize, .resizable_f_r { background:url(../purple/images/dialog/dialogpanel_icon.png) no-repeat;} .dialog .dialogHeader h1 { color:#2d3f00;} .dialog .dialogContent { border-color:#e29de2; background:#F9E8F9;} .resizable { border-color:#3b6200; background:#aae31d;} /* Shadow */ .shadow .shadow_h_l { background:url(../default/images/shadow/shadow_h_l.png) no-repeat;} .shadow .shadow_h_r { background:url(../default/images/shadow/shadow_h_r.png) no-repeat;} .shadow .shadow_h_c { background:url(../default/images/shadow/shadow_h_c.png) repeat-x;} .shadow .shadow_c_l { background:url(../default/images/shadow/shadow_c_l.png) repeat-y;} .shadow .shadow_c_r { background:url(../default/images/shadow/shadow_c_r.png) repeat-y;} .shadow .shadow_c_c { background:url(../default/images/shadow/shadow_c_c.png) repeat;} .shadow .shadow_f_l { background:url(../default/images/shadow/shadow_f_l.png) no-repeat;} .shadow .shadow_f_r { background:url(../default/images/shadow/shadow_f_r.png) no-repeat;} .shadow .shadow_f_c { background:url(../default/images/shadow/shadow_f_c.png) repeat-x;} /* Tree */ .tree div div { background:url(../default/images/tree/tree.png) no-repeat;} .tree .folder_collapsable, .tree .folder_expandable, .tree .file {background:transparent url(../default/images/tree/folder.png) no-repeat scroll 0 0;} .tree .checked, .tree .unchecked, .tree .indeterminate { background:url(../default/images/tree/check.png) no-repeat;} .tree ul { background:#FFF;} .tree li a, .tree li span { color:#2d3f00;} .tree .hover { background:#f6f6f6;} .tree .selected { background:#F9E8F9;} /* Accordion */ .accordion .accordionHeader, .accordion .accordionHeader h2, .accordion .accordionHeader h2 span { color:#2d3f00; background:url(../purple/images/accordion/accordion.png);} .accordion { border-color:#e29de2; background:#FFF;} .accordion .accordionHeader { background-color:#eaf4ff;} .accordion .accordionContent { border-color:#e29de2;} /* Grid */ .panelBar, .toolBar li.hover, .toolBar li.hover a, .toolBar li.hover span, .toolBar span, .panelBar .pagination, .panelBar .pagination li.hover, .panelBar .pagination li.hover a, .panelBar .pagination li span, .panelBar .pagination li.disabled span span, .panelBar .line, .panelBar .pagination li.jumpto, .panelBar .pagination li.jumpto .goto { background:url(../purple/images/grid/grid.png) no-repeat;} .panelBar { border-color:#e29de2; background-color:#efefef;} .grid .gridHeader { background:#EEE;} .grid { background:#FFF;} .grid table { border-color:#d0d0d0;} .grid .gridHeader, .grid .gridHeader th { border-color:#d0d0d0; background:#f0eff0 url(../default/images/grid/tableth.png) repeat-x;} .grid table th div { border-left-color:#EEE; border-right-color:#d0d0d0;} .grid table td { border-color:#ededed;} .grid .resizeMarker, .grid .resizeProxy { background:url(../default/images/grid/resizeCol.png) repeat-y;} .grid .gridRowBg { background:#f7f7f7;} .grid .hover { background:#f6f6f6;} .grid .selected { border-color:#C00; background:#e29de2;} .grid .error{background:#fb7e81;} /* ProgressBar */ .progressBar { border:solid 2px #86a5ad; background:#FFF url(../default/images/progressBar/progressBar_m.gif) no-repeat 10px 10px;} /* ----------------------------------------------------------------- Form */ /* TextInput */ .textInput, input.focus, input.required, input.error, input.readonly, input.disabled, textarea.focus, textarea.required, textarea.error, textarea.readonly, textarea.disabled { background:url(../default/images/form/input_bg.png) no-repeat scroll;} .textInput, .textArea { border-color:#a2bac0 #b8d0d6 #b8d0d6 #a2bac0; background-color:#FFF;} input.required, textarea.required { border-color:#a2bac0 #b8d0d6 #b8d0d6 #a2bac0; background-color:#FFF;} input.error, textarea.error { border-color:#F80C11 #FB7E81 #FB7E81 #F80C11;} input.focus, textarea.focus { border-color:#64aabc #a9d7e3 #a9d7e3 #64aabc; background-color:#f8fafc;} input.readonly, textarea.readonly { border-color:#9eabb3 #d5dbdf #d5dbdf #9eabb3; background-color:#F6F6F6;} input.disabled, textarea.disabled { border-color:#9eabb3 #d5dbdf #d5dbdf #9eabb3; background-color:#F6F6F6;} .inputButton, .inputDateButton { background:url(../default/images/form/input_bt.png) no-repeat;} /* Button */ .button, .button span, .buttonDisabled, .buttonDisabled span, .buttonActive, .buttonActive span, .button .buttonContent, .buttonHover, .buttonHover .buttonContent, .buttonActive .buttonContent, .buttonActiveHover, .buttonActiveHover .buttonContent, .buttonDisabled .buttonContent { background:url(../purple/images/button/button_s.png) no-repeat;} .button span, .buttonDisabled span, .buttonActive span, .button .buttonContent, .buttonHover, .buttonHover .buttonContent, .buttonActive .buttonContent, .buttonDisabled .buttonContent, .button button, .buttonHover button, .buttonActive button, .buttonDisabled button { color:#2d3f00;} .buttonDisabled span, .buttonDisabled:hover span, .buttonDisabled button { color:#999;} /* ----------------------------------------------------------------- Pages */ /* Layout */ body, #splitBar { background:#F9E8F9;} #splitBarProxy { border-color:#c0c0c0; background:#CCC;} #header, #header .headerNav { background:url(../purple/images/header_bg.png) repeat-x;} #header { background-color:#5b9700;} #header .logo { background:url(../default/images/logo.png) no-repeat;} #header .nav li { float:left; margin-left:-1px; padding:0 8px; line-height:11px; background:url(../purple/images/listLine.png) no-repeat;} #header .nav li a { color:#FFF;} #header .themeList li div { background:url(../default/images/themeButton.png) no-repeat;} .toggleCollapse, .toggleCollapse div { background:url(../purple/images/layout/toggleSidebar.png) no-repeat;} .toggleCollapse { border-style:solid; border-width:1px 1px 0 1px; border-color:#e29de2; background-color:#e7eff0;} .toggleCollapse h2 { color:#2d3f00;} #sidebar_s .collapse { border:solid 1px #e29de2; background:#F9E8F9;} #sidebar_s .collapse:hover { background:#F9E8F9;} #taskbar, #taskbar li, #taskbar li .taskbutton { background:url(../default/images/layout/taskbar.png) no-repeat;} #taskbar .close, #taskbar .restore, #taskbar .minimize { background:url(../default/images/layout/taskbar_icon.png) no-repeat;} #taskbar li .taskbutton span { color:#FFF;} #taskbar .taskbarLeft, #taskbar .taskbarRight { background:url(../default/images/layout/taskbar_control.png) no-repeat;} /* Menu */ #navMenu, #navMenu li, #navMenu li.selected a, #navMenu li.selected span { background:url(../default/images/menu/menu.png) no-repeat;} #navMenu { background-color:#1871dd; } #navMenu li a, #navMenu li span { color:#FFF; } #navMenu li.selected span { color:#000; } /* Homepage */ .sidebarContent { display:block; overflow:auto; height:500px; border:solid 1px #86B4EC; background:#FFF;} .accountInfo { display:block; overflow:hidden; height:60px; padding:0 10px; background:url(../default/images/account_info_bg.png) repeat-x} .accountInfo p { padding:8px 0 0 0; line-height:19px;} .accountInfo p span { font-size:14px; font-weight:bold;} .accountInfo .right { float:right; padding-right:10px; text-align:right;} .accountInfo .alertInfo { float:right; width:300px; height:60px; padding-left:10px; border-left:solid 1px #accdf4;} .accountInfo .alertInfo h2 { padding:8px 0; line-height:17px;} .accountInfo .alertInfo a { padding:6px 0 0 0; line-height:21px;} /* Pages */ .pageForm .inputInfo { color:#999;} /* Pages dialog */ .dialog .pageHeader, .dialog .pageContent { border-color:#E29DE2;} .dialog .pageContent .pageFormContent { border-color:#E29DE2; background:#FFF;} /* Pages default */ .page .pageHeader, .formBar { border-color:#E29DE2; background:#ebf0f5 url(../default/images/pageHeader_bg.png) repeat-x;} .page .searchBar label { color:#183152;} /* Pages Form */ .formBar { border-color:#E29DE2;} .divider { border-color:#E29DE2;} /* combox */ .combox .select a { color:#183152; } .comboxop { border-color:#B8D0D6; } .combox, .combox div, .combox div a { background:url(../default/images/search-bg.gif) no-repeat; }
zyroot
trunk/admin/dwz1.4.5/themes/purple/style.css
CSS
art
11,420
@charset "utf-8"; /* Icon */ .tabsHeader li.main a span span, #taskbar li .taskbutton span { background:url(./images/icon.png) no-repeat;} /* Panel */ .panel, .panel .panelHeader, .panel .panelHeaderContent, .panel .panelHeaderContent h1, .panel .panelFooter, .panel .panelFooterContent { background:url(./images/panel/panel.png) no-repeat;} .panel .expandable, .panel .collapsable { background:url(./images/panel/panel_icon.png) no-repeat;} .panel .panelHeaderContent h1 { color:#15428B; } .panel .panelContent { border-color:#99bbe8; background:#e4ebf6;} .panel .grid { border-color:#99bbe8;} /* Tabs */ .tabs, .tabsHeader, .tabsHeaderContent, .tabs .tabsHeader ul, .tabs .tabsHeader li, .tabs .tabsHeader li a, .tabs .tabsHeader li span, .tabs .tabsFooter, .tabs .tabsFooterContent { background:url(./images/tabs/tabspanel.png) no-repeat;} .tabs .tabsHeader li a { color:#03408b;} .tabs .tabsHeader li span { color:#15428B;} .tabs .tabsContent { border-color:#99bbe8; background:#e4ebf6;} /* TabsPage */ .tabsPage .tabsPageHeader, .tabsPage .tabsPageHeader li, .tabsPage .tabsPageHeader li a, .tabsPage .tabsPageHeader li span { background:url(./images/tabs/tabspage.png) no-repeat;} .tabsPage .tabsPageHeader { background-color:#e9f0f2;} .tabsPage .tabsPageHeader { border-color:#99bbe8;} .tabsPage .tabsPageHeader li a { color:#15428B;} .tabsPage .tabsPageHeader li .close, .tabsPage .tabsPageHeader li.hover .close, .tabsPage .tabsPageHeader li.selected .close { background:url(./images/tabs/tabspage_icon.png) no-repeat;} .tabsPage .tabsLeft, .tabsPage .tabsRight, .tabsPage .tabsMore { background:url(./images/tabs/tabscontrol.png) no-repeat;} .tabsPage .tabsMoreList { border-color:#88a0be; background:#FFF;} .tabsPage .tabsPageHeader .home_icon { background:url(./images/icon.png) no-repeat;} .tabsPage .tabsPageContent { border-color:#88a0be; background:#FFF;} /* Alert */ .alert .alertFooter, .alert .alertFooter_r, .alert .alertFooter_c { background:url(./images/alert/alertpanel.png) no-repeat;} .alert .alertContent { border-color:#88a0be; background:#ced9e7;} .alert .warn .alertInner { border-color:#e83e09; background:#fefacf;} .alert .error .alertInner { border-color:#e50000; background:#fefacf;} .alert .correct .alertInner, .alert .info .alertInner { border-color:#99bbe8; background:#fefacf;} .alert .confirm .alertInner { border-color:#99bbe8; background:#fefacf;} .alert h1 { border-color:#CCC; background:url(./images/alert/alertpanel_icon.png) no-repeat;} /* Dialog */ .dialog .dialogHeader, .dialog .dialogHeader_r, .dialog .dialogHeader_c, .dialog .dialogFooter, .dialog .dialogFooter_r, .dialog .dialogFooter_c { background:url(./images/dialog/dialogpanel.png) no-repeat;} .dialog .dialogHeader h1, .dialog .dialogHeader .close, .dialog .dialogHeader .maximize, .dialog .dialogHeader .restore, .dialog .dialogHeader .minimize, .resizable_f_r { background:url(./images/dialog/dialogpanel_icon.png) no-repeat;} .dialog .dialogHeader h1 { color:#15428B;} .dialog .dialogContent { border-color:#99bbe8; background:#e4ebf6;} .resizable { border-color:#081629; background:#c3d7dc;} /* Shadow */ .shadow .shadow_h_l { background:url(./images/shadow/shadow_h_l.png) no-repeat;} .shadow .shadow_h_r { background:url(./images/shadow/shadow_h_r.png) no-repeat;} .shadow .shadow_h_c { background:url(./images/shadow/shadow_h_c.png) repeat-x;} .shadow .shadow_c_l { background:url(./images/shadow/shadow_c_l.png) repeat-y;} .shadow .shadow_c_r { background:url(./images/shadow/shadow_c_r.png) repeat-y;} .shadow .shadow_c_c { background:url(./images/shadow/shadow_c_c.png) repeat;} .shadow .shadow_f_l { background:url(./images/shadow/shadow_f_l.png) no-repeat;} .shadow .shadow_f_r { background:url(./images/shadow/shadow_f_r.png) no-repeat;} .shadow .shadow_f_c { background:url(./images/shadow/shadow_f_c.png) repeat-x;} /* Tree */ .tree div div { background:url(./images/tree/tree.png) no-repeat;} .tree .folder_collapsable, .tree .folder_expandable, .tree .file { background:url(./images/tree/folder.png) no-repeat;} .tree .checked, .tree .unchecked, .tree .indeterminate { background:url(./images/tree/check.png) no-repeat;} .tree ul { background:#FFF;} .tree li a, .tree li span { color:#15428B;} .tree .hover { background:#f5f5f5;} .tree .selected { background-color:#e8edf3;} /* Accordion */ .accordion .accordionHeader, .accordion .accordionHeader h2, .accordion .accordionHeader h2 span { color:#15428B; background:url(./images/accordion/accordion.png);} .accordion { border-color:#99bbe8; background:#FFF;} .accordion .accordionHeader { background-color:#eaf4ff;} .accordion .accordionContent { border-color:#99bbe8;} /* Grid */ .panelBar, .toolBar li.hover, .toolBar li.hover a, .toolBar li.hover span, .toolBar span, .pagination, .pagination li.hover, .pagination li.hover a, .pagination li span, .pagination li.disabled span span, .panelBar .line, .pagination li.jumpto, .pagination li.jumpto .goto { background:url(./images/grid/grid.png) no-repeat;} .panelBar { border-color:#99bbe8; background-color:#efefef;} .grid .gridHeader { background:#EEE;} .grid { background:#FFF;} .grid table { border-color:#d0d0d0;} .grid .gridHeader, .grid .gridHeader th { border-color:#d0d0d0; background:#f0eff0 url(./images/grid/tableth.png) repeat-x;} .grid table th div { border-left-color:#EEE; border-right-color:#d0d0d0;} .grid table td { border-color:#ededed;} .grid .resizeMarker, .grid .resizeProxy { background:url(./images/grid/resizeCol.png) repeat-y;} .grid .gridHeader th.hover, .grid .gridHeader th.thSelected { border-color:#aaccf6; } .grid .gridTbody .gridRowBg { background:#f7f7f7;} .grid .gridTbody .gridRow { border-color:#ededed;} .grid .gridTbody .gridRow td.tdLast { border-color:#ededed;} .grid .gridTbody .hover { border-color:#dddddd; background:#f5f5f5;} .grid .gridTbody .hover .tdSelected { background:#f5f5f5;} .grid .gridTbody .selected { border-color:#99bbe8; background:#dfe8f6;} .grid .gridTbody .selected .tdSelected { background:#e8edf3;} .grid .gridTbody .tdSelected { background:#f8f8f8;} .grid .error{background:#fb7e81;} /* ProgressBar */ .progressBar { border:solid 2px #86a5ad; background:#FFF url(./images/progressBar/progressBar_m.gif) no-repeat 10px 10px;} /* ----------------------------------------------------------------- Form */ /* TextInput */ .textInput, input.focus, input.required, input.error, input.readonly, input.disabled, textarea.focus, textarea.required, textarea.error, textarea.readonly, textarea.disabled { background:url(./images/form/input_bg.png) no-repeat scroll;} .textInput, .textArea { border-color:#a2bac0 #99bbe8 #99bbe8 #a2bac0; background-color:#FFF;} input.required, textarea.required { border-color:#a2bac0 #99bbe8 #99bbe8 #a2bac0; background-color:#FFF;} input.error, textarea.error { border-color:#F80C11 #FB7E81 #FB7E81 #F80C11;} input.focus, textarea.focus { border-color:#8db2e3 #99bbe8 #99bbe8 #8db2e3; background-color:#f8fafc;} input.readonly, textarea.readonly { border-color:#9eabb3 #d5dbdf #d5dbdf #9eabb3; background-color:#F6F6F6;} input.disabled, textarea.disabled { border-color:#9eabb3 #d5dbdf #d5dbdf #9eabb3; background-color:#F6F6F6;} .inputButton, .inputDateButton { background:url(./images/form/input_bt.png) no-repeat;} /* Button */ .button, .button span, .buttonDisabled, .buttonDisabled span, .buttonActive, .buttonActive span, .button .buttonContent, .buttonHover, .buttonHover .buttonContent, .buttonActive .buttonContent, .buttonActiveHover, .buttonActiveHover .buttonContent, .buttonDisabled .buttonContent { background:url(./images/button/button_s.png) no-repeat;} .button span, .buttonDisabled span, .buttonActive span, .button .buttonContent, .buttonHover, .buttonHover .buttonContent, .buttonActive .buttonContent, .buttonDisabled .buttonContent, .button button, .buttonHover button, .buttonActive button, .buttonDisabled button { color:#15428B;} .buttonDisabled span, .buttonDisabled:hover span, .buttonDisabled button { color:#999;} /* ----------------------------------------------------------------- Pages */ /* Layout */ body, #splitBar { background:#dfe8f6;} #splitBarProxy { border-color:#c0c0c0; background:#CCC;} #header, #header .headerNav { background:url(./images/header_bg.png) repeat-x;} #header { background-color:#102c4a;} #header .logo { background:url(../default/images/logo.png) no-repeat;} #header .nav li { float:left; margin-left:-1px; padding:0 8px; line-height:11px; background:url(./images/listLine.png) no-repeat;} #header .nav li a { color:#15428b;} #header .themeList li div { background:url(../default/images/themeButton.png) no-repeat;} .toggleCollapse, .toggleCollapse div { background:url(./images/layout/toggleSidebar.png) no-repeat;} .toggleCollapse { border-style:solid; border-width:1px 1px 0 1px; border-color:#99BBE8; background-color:#dfe8f6;} .toggleCollapse h2 { color:#15428B;} #sidebar_s .collapse { border:solid 1px #99bbe8; background:#eff5f6;} #sidebar_s .collapse:hover { background:#f5f9fa;} #taskbar, #taskbar li, #taskbar li .taskbutton { background:url(./images/layout/taskbar.png) no-repeat;} #taskbar .close, #taskbar .restore, #taskbar .minimize { background:url(./images/layout/taskbar_icon.png) no-repeat;} #taskbar li .taskbutton span { color:#FFF;} #taskbar .taskbarLeft, #taskbar .taskbarRight { background:url(./images/layout/taskbar_control.png) no-repeat;} /* Menu */ #navMenu, #navMenu li, #navMenu li.selected a, #navMenu li.selected span { background:url(../default/images/menu/menu.png) no-repeat;} #navMenu { background-color:#1871dd; } #navMenu li a, #navMenu li span { color:#FFF; } #navMenu li.selected span { color:#000; } /* Homepage */ .sidebarContent { display:block; overflow:auto; height:500px; border:solid 1px #86B4EC; background:#FFF;} .accountInfo { display:block; overflow:hidden; height:60px; padding:0 10px; background:url(./images/account_info_bg.png) repeat-x} .accountInfo p { padding:8px 0 0 0; line-height:19px;} .accountInfo p span { font-size:14px; font-weight:bold;} .accountInfo .right { float:right; padding-right:10px; text-align:right;} .accountInfo .alertInfo { float:right; width:300px; height:60px; padding-left:10px; border-left:solid 1px #accdf4;} .accountInfo .alertInfo h2 { padding:8px 0; line-height:17px;} .accountInfo .alertInfo a { padding:6px 0 0 0; line-height:21px;} /* Pages */ .pageForm .inputInfo { color:#999;} /* Pages dialog */ .dialog .pageHeader, .dialog .pageContent { border-color:#99bbe8;} .dialog .pageContent .pageFormContent { border-color:#99bbe8; background:#FFF;} /* Pages default */ .page .pageHeader, .formBar { border-color:#99bbe8; background:#ebf0f5 url(../default/images/pageHeader_bg.png) repeat-x;} .page .searchBar label { color:#15428B;} /* Pages Form */ .formBar { border-color:#99bbe8;} .divider { border-color:#99bbe8;} /* combox */ .combox .select a { color:#15428B; } .comboxop { border-color:#99bbe8; } .combox, .combox div, .combox div a { background:url(../default/images/search-bg.gif) no-repeat; }
zyroot
trunk/admin/dwz1.4.5/themes/azure/style.css
CSS
art
11,208
@charset "utf-8"; /* Icon */ .tabsHeader li.main a span span, #taskbar li .taskbutton span { background:url(../default/images/icon.png) no-repeat;} /* Panel */ .panel, .panel .panelHeader, .panel .panelHeaderContent, .panel .panelHeaderContent h1, .panel .panelFooter, .panel .panelFooterContent { background:url(../green/images/panel/panel.png) no-repeat;} .panel .expandable, .panel .collapsable { background:url(../green/images/panel/panel_icon.png) no-repeat;} .panel .panelHeaderContent h1 { color:#2d3f00; } .panel .panelContent { border-color:#8abb12; background:#e3fda7;} .panel .grid { border-color:#8ABB12;} /* Tabs */ .tabs, .tabsHeader, .tabsHeaderContent, .tabs .tabsHeader ul, .tabs .tabsHeader li, .tabs .tabsHeader li a, .tabs .tabsHeader li span, .tabs .tabsFooter, .tabs .tabsFooterContent { background:url(../green/images/tabs/tabspanel.png) no-repeat;} .tabs .tabsHeader li a { color:#2d3f00;} .tabs .tabsHeader li span { color:#2d3f00;} .tabs .tabsContent { border-color:#8abb12; background:#e3fda7;} /* TabsPage */ .tabsPage .tabsPageHeader, .tabsPage .tabsPageHeader li, .tabsPage .tabsPageHeader li a, .tabsPage .tabsPageHeader li span { background:url(../green/images/tabs/tabspage.png) no-repeat;} .tabsPage .tabsPageHeader { background-color:#e9f0f2;} .tabsPage .tabsPageHeader { border-color:#8abb12;} .tabsPage .tabsPageHeader li a { color:#2d3f00;} .tabsPage .tabsPageHeader li .close, .tabsPage .tabsPageHeader li.hover .close, .tabsPage .tabsPageHeader li.selected .close { background:url(../green/images/tabs/tabspage_icon.png) no-repeat;} .tabsPage .tabsLeft, .tabsPage .tabsRight, .tabsPage .tabsMore { background:url(../green/images/tabs/tabscontrol.png) no-repeat;} .tabsPage .tabsMoreList { border-color:#8ABB12; background:#FFF;} .tabsPage .tabsPageHeader .home_icon { background:url(../default/images/icon.png) no-repeat;} .tabsPage .tabsPageContent { border-color:#8abb12; background:#FFF;} /* Alert */ .alert .alertFooter, .alert .alertFooter_r, .alert .alertFooter_c { background:url(../green/images/alert/alertpanel.png) no-repeat;} .alert .alertContent { border-color:#b8d0d6; background:#eef4f5;} .alert .warn .alertInner { border-color:#e83e09; background:#fefacf;} .alert .error .alertInner { border-color:#e50000; background:#fefacf;} .alert .correct .alertInner, .alert .info .alertInner { border-color:#b8d0d6; background:#fefacf;} .alert .confirm .alertInner { border-color:#b8d0d6; background:#fefacf;} .alert h1 { background:url(../default/images/alert/alertpanel_icon.png) no-repeat;} /* Dialog */ .dialog .dialogHeader, .dialog .dialogHeader_r, .dialog .dialogHeader_c, .dialog .dialogFooter, .dialog .dialogFooter_r, .dialog .dialogFooter_c { background:url(../green/images/dialog/dialogpanel.png) no-repeat;} .dialog .dialogHeader h1, .dialog .dialogHeader .close, .dialog .dialogHeader .maximize, .dialog .dialogHeader .restore, .dialog .dialogHeader .minimize, .resizable_f_r { background:url(../green/images/dialog/dialogpanel_icon.png) no-repeat;} .dialog .dialogHeader h1 { color:#2d3f00;} .dialog .dialogContent { border-color:#8abb12; background:#e3fda7;} .resizable { border-color:#3b6200; background:#aae31d;} /* Shadow */ .shadow .shadow_h_l { background:url(../default/images/shadow/shadow_h_l.png) no-repeat;} .shadow .shadow_h_r { background:url(../default/images/shadow/shadow_h_r.png) no-repeat;} .shadow .shadow_h_c { background:url(../default/images/shadow/shadow_h_c.png) repeat-x;} .shadow .shadow_c_l { background:url(../default/images/shadow/shadow_c_l.png) repeat-y;} .shadow .shadow_c_r { background:url(../default/images/shadow/shadow_c_r.png) repeat-y;} .shadow .shadow_c_c { background:url(../default/images/shadow/shadow_c_c.png) repeat;} .shadow .shadow_f_l { background:url(../default/images/shadow/shadow_f_l.png) no-repeat;} .shadow .shadow_f_r { background:url(../default/images/shadow/shadow_f_r.png) no-repeat;} .shadow .shadow_f_c { background:url(../default/images/shadow/shadow_f_c.png) repeat-x;} /* Tree */ .tree div div { background:url(../default/images/tree/tree.png) no-repeat;} .tree .folder_collapsable, .tree .folder_expandable, .tree .file {background:transparent url(../default/images/tree/folder.png) no-repeat scroll 0 0;} .tree .checked, .tree .unchecked, .tree .indeterminate { background:url(../default/images/tree/check.png) no-repeat;} .tree ul { background:#FFF;} .tree li a, .tree li span { color:#2d3f00;} .tree .hover { background:#f6f6f6;} .tree .selected { background:#d0fc68;} /* Accordion */ .accordion .accordionHeader, .accordion .accordionHeader h2, .accordion .accordionHeader h2 span { color:#2d3f00; background:url(../green/images/accordion/accordion.png);} .accordion { border-color:#8abb12; background:#FFF;} .accordion .accordionHeader { background-color:#eaf4ff;} .accordion .accordionContent { border-color:#8abb12;} /* Grid */ .panelBar, .toolBar li.hover, .toolBar li.hover a, .toolBar li.hover span, .toolBar span, .pagination, .pagination li.hover, .pagination li.hover a, .pagination li span, .pagination li.disabled span span, .panelBar .line, .pagination li.jumpto, .pagination li.jumpto .goto { background:url(../green/images/grid/grid.png) no-repeat;} .panelBar { border-color:#8abb12; background-color:#efefef;} .grid .gridHeader { background:#EEE;} .grid { background:#FFF;} .grid table { border-color:#d0d0d0;} .grid .gridHeader, .grid .gridHeader th { border-color:#d0d0d0; background:#f0eff0 url(../default/images/grid/tableth.png) repeat-x;} .grid table th div { border-left-color:#EEE; border-right-color:#d0d0d0;} .grid table td { border-color:#ededed;} .grid .resizeMarker, .grid .resizeProxy { background:url(../default/images/grid/resizeCol.png) repeat-y;} .grid .gridRowBg { background:#f7f7f7;} .grid .hover { background:#f6f6f6;} .grid .selected { border-color:#C00; background:#7cc5e5;} .grid .error{background:#fb7e81;} /* ProgressBar */ .progressBar { border:solid 2px #86a5ad; background:#FFF url(../default/images/progressBar/progressBar_m.gif) no-repeat 10px 10px;} /* ----------------------------------------------------------------- Form */ /* TextInput */ .textInput, input.focus, input.required, input.error, input.readonly, input.disabled, textarea.focus, textarea.required, textarea.error, textarea.readonly, textarea.disabled { background:url(../default/images/form/input_bg.png) no-repeat scroll;} .textInput, .textArea { border-color:#a2bac0 #b8d0d6 #b8d0d6 #a2bac0; background-color:#FFF;} input.required, textarea.required { border-color:#a2bac0 #b8d0d6 #b8d0d6 #a2bac0; background-color:#FFF;} input.error, textarea.error { border-color:#F80C11 #FB7E81 #FB7E81 #F80C11;} input.focus, textarea.focus { border-color:#64aabc #a9d7e3 #a9d7e3 #64aabc; background-color:#f8fafc;} input.readonly, textarea.readonly { border-color:#9eabb3 #d5dbdf #d5dbdf #9eabb3; background-color:#F6F6F6;} input.disabled, textarea.disabled { border-color:#9eabb3 #d5dbdf #d5dbdf #9eabb3; background-color:#F6F6F6;} .inputButton, .inputDateButton { background:url(../default/images/form/input_bt.png) no-repeat;} /* Button */ .button, .button span, .buttonDisabled, .buttonDisabled span, .buttonActive, .buttonActive span, .button .buttonContent, .buttonHover, .buttonHover .buttonContent, .buttonActive .buttonContent, .buttonActiveHover, .buttonActiveHover .buttonContent, .buttonDisabled .buttonContent { background:url(../green/images/button/button_s.png) no-repeat;} .button span, .buttonDisabled span, .buttonActive span, .button .buttonContent, .buttonHover, .buttonHover .buttonContent, .buttonActive .buttonContent, .buttonDisabled .buttonContent, .button button, .buttonHover button, .buttonActive button, .buttonDisabled button { color:#2d3f00;} .buttonDisabled span, .buttonDisabled:hover span, .buttonDisabled button { color:#999;} /* ----------------------------------------------------------------- Pages */ /* Layout */ body, #splitBar { background:#cdef7d;} #splitBarProxy { border-color:#c0c0c0; background:#CCC;} #header, #header .headerNav { background:url(../green/images/header_bg.png) repeat-x;} #header { background-color:#5b9700;} #header .logo { background:url(../default/images/logo.png) no-repeat;} #header .nav li { float:left; margin-left:-1px; padding:0 8px; line-height:11px; background:url(../green/images/listLine.png) no-repeat;} #header .nav li a { color:#FFF;} #header .themeList li div { background:url(../default/images/themeButton.png) no-repeat;} .toggleCollapse, .toggleCollapse div { background:url(../green/images/layout/toggleSidebar.png) no-repeat;} .toggleCollapse { border-style:solid; border-width:1px 1px 0 1px; border-color:#8abb12; background-color:#e7eff0;} .toggleCollapse h2 { color:#2d3f00;} #sidebar_s .collapse { border:solid 1px #8abb12; background:#b8e844;} #sidebar_s .collapse:hover { background:#cdef7d;} #taskbar, #taskbar li, #taskbar li .taskbutton { background:url(../default/images/layout/taskbar.png) no-repeat;} #taskbar .close, #taskbar .restore, #taskbar .minimize { background:url(../default/images/layout/taskbar_icon.png) no-repeat;} #taskbar li .taskbutton span { color:#FFF;} #taskbar .taskbarLeft, #taskbar .taskbarRight { background:url(../default/images/layout/taskbar_control.png) no-repeat;} /* Menu */ #navMenu, #navMenu li, #navMenu li.selected a, #navMenu li.selected span { background:url(../default/images/menu/menu.png) no-repeat;} #navMenu { background-color:#1871dd;} #navMenu li a, #navMenu li span { color:#FFF;} #navMenu li.selected span { color:#000;} /* Homepage */ .sidebarContent { display:block; overflow:auto; height:500px; border:solid 1px #86B4EC; background:#FFF;} .accountInfo { display:block; overflow:hidden; height:60px; padding:0 10px; background:url(../default/images/account_info_bg.png) repeat-x} .accountInfo p { padding:8px 0 0 0; line-height:19px;} .accountInfo p span { font-size:14px; font-weight:bold;} .accountInfo .right { float:right; padding-right:10px; text-align:right;} .accountInfo .alertInfo { float:right; width:300px; height:60px; padding-left:10px; border-left:solid 1px #accdf4;} .accountInfo .alertInfo h2 { padding:8px 0; line-height:17px;} .accountInfo .alertInfo a { padding:6px 0 0 0; line-height:21px;} /* Pages */ .pageForm .inputInfo { color:#999;} /* Pages dialog */ .dialog .pageHeader, .dialog .pageContent { border-color:#8ABB12;} .dialog .pageContent .pageFormContent { border-color:#8ABB12; background:#FFF;} /* Pages default */ .page .pageHeader, .formBar { border-color:#8ABB12; background:#ebf0f5 url(../default/images/pageHeader_bg.png) repeat-x;} .page .searchBar label { color:#183152;} /* Pages Form */ .formBar { border-color:#8ABB12;} .divider { border-color:#8ABB12;} /* combox */ .combox .select a { color:#183152; } .comboxop { border-color:#B8D0D6; } .combox, .combox div, .combox div a { background:url(../default/images/search-bg.gif) no-repeat; }
zyroot
trunk/admin/dwz1.4.5/themes/green/style.css
CSS
art
11,085
false
zyroot
trunk/admin/dwz1.4.5/validate_remote.html
HTML
art
5
<h2 class="contentTitle">uploadify多文件上传</h2> <style type="text/css" media="screen"> .my-uploadify-button { background:none; border: none; text-shadow: none; border-radius:0; } .uploadify:hover .my-uploadify-button { background:none; border: none; } .fileQueue { width: 400px; height: 150px; overflow: auto; border: 1px solid #E5E5E5; margin-bottom: 10px; } </style> <div class="pageContent" style="margin: 0 10px" layoutH="50"> <input id="testFileInput" type="file" name="image" uploaderOption="{ swf:'uploadify/scripts/uploadify.swf', uploader:'demo/common/ajaxDone.html', formData:{PHPSESSID:'xxx', ajax:1}, buttonText:'请选择文件', fileSizeLimit:'200KB', fileTypeDesc:'*.jpg;*.jpeg;*.gif;*.png;', fileTypeExts:'*.jpg;*.jpeg;*.gif;*.png;', auto:true, multi:true, onUploadSuccess:uploadifySuccess, onQueueComplete:uploadifyQueueComplete }" /> <div class="divider"></div> <input id="testFileInput2" type="file" name="image2" uploaderOption="{ swf:'uploadify/scripts/uploadify.swf', uploader:'demo/common/ajaxDone.html', formData:{PHPSESSID:'xxx', ajax:1}, queueID:'fileQueue', buttonImage:'uploadify/img/add.jpg', buttonClass:'my-uploadify-button', width:102, auto:false }" /> <div id="fileQueue" class="fileQueue"></div> <input type="image" src="uploadify/img/upload.jpg" onclick="$('#testFileInput2').uploadify('upload', '*');"/> <input type="image" src="uploadify/img/cancel.jpg" onclick="$('#testFileInput2').uploadify('cancel', '*');"/> <div class="divider"></div> <p style="margin:10px"><a href="http://www.uploadify.com/documentation/" target="_blank">Uploadify 在线文档</a></p> <textarea cols="160" rows="10"> uploaderOption: http://www.uploadify.com/documentation/ auto : true, // Automatically upload files when added to the queue buttonClass : '', // A class name to add to the browse button DOM object buttonCursor : 'hand', // The cursor to use with the browse button buttonImage : null, // (String or null) The path to an image to use for the Flash browse button if not using CSS to style the button buttonText : 'SELECT FILES', // The text to use for the browse button checkExisting : false, // The path to a server-side script that checks for existing files on the server debug : false, // Turn on swfUpload debugging mode fileObjName : 'Filedata', // The name of the file object to use in your server-side script fileSizeLimit : 0, // The maximum size of an uploadable file in KB (Accepts units B KB MB GB if string, 0 for no limit) fileTypeDesc : 'All Files', // The description for file types in the browse dialog fileTypeExts : '*.*', // Allowed extensions in the browse dialog (server-side validation should also be used) height : 30, // The height of the browse button itemTemplate : false, // The template for the file item in the queue method : 'post', // The method to use when sending files to the server-side upload script multi : true, // Allow multiple file selection in the browse dialog formData : {}, // An object with additional data to send to the server-side upload script with every file upload preventCaching : true, // Adds a random value to the Flash URL to prevent caching of it (conflicts with existing parameters) progressData : 'percentage', // ('percentage' or 'speed') Data to show in the queue item during a file upload queueID : false, // The ID of the DOM object to use as a file queue (without the #) queueSizeLimit : 999, // The maximum number of files that can be in the queue at one time removeCompleted : true, // Remove queue items from the queue when they are done uploading removeTimeout : 3, // The delay in seconds before removing a queue item if removeCompleted is set to true requeueErrors : false, // Keep errored files in the queue and keep trying to upload them successTimeout : 30, // The number of seconds to wait for Flash to detect the server's response after the file has finished uploading uploadLimit : 0, // The maximum number of files you can upload width : 120, // The width of the browse button </textarea> </div>
zyroot
trunk/admin/dwz1.4.5/w_uploadify.html
HTML
art
4,694
<form id="pagerForm" method="post" action="demo_page1.html"> <input type="hidden" name="status" value="${param.status}"> <input type="hidden" name="keywords" value="${param.keywords}" /> <input type="hidden" name="pageNum" value="1" /> <input type="hidden" name="numPerPage" value="${model.numPerPage}" /> <input type="hidden" name="orderField" value="${param.orderField}" /> </form> <div class="pageHeader"> <form onsubmit="return navTabSearch(this);" action="demo_page1.html" method="post"> <div class="searchBar"> <!--<ul class="searchContent"> <li> <label>我的客户:</label> <input type="text"/> </li> <li> <select class="combox" name="province"> <option value="">所有省市</option> <option value="北京">北京</option> <option value="上海">上海</option> <option value="天津">天津</option> <option value="重庆">重庆</option> <option value="广东">广东</option> </select> </li> </ul> --> <table class="searchContent"> <tr> <td> 我的客户:<input type="text" name="keyword" /> </td> <td> <select class="combox" name="province"> <option value="">所有省市</option> <option value="北京">北京</option> <option value="上海">上海</option> <option value="天津">天津</option> <option value="重庆">重庆</option> <option value="广东">广东</option> </select> </td> <td> 建档日期:<input type="text" class="date" readonly="true" /> </td> </tr> </table> <div class="subBar"> <ul> <li><div class="buttonActive"><div class="buttonContent"><button type="submit">检索</button></div></div></li> <li><a class="button" href="demo_page6.html" target="dialog" mask="true" title="查询框"><span>高级检索</span></a></li> </ul> </div> </div> </form> </div> <div class="pageContent"> <div class="panelBar"> <ul class="toolBar"> <li><a class="add" href="demo_page4.html" target="navTab"><span>添加</span></a></li> <li><a class="delete" href="demo/common/ajaxDone.html?uid={sid_user}" target="ajaxTodo" title="确定要删除吗?"><span>删除</span></a></li> <li><a class="edit" href="demo_page4.html?uid={sid_user}" target="navTab"><span>修改</span></a></li> <li class="line">line</li> <li><a class="icon" href="demo/common/dwz-team.xls" target="dwzExport" targetType="navTab" title="实要导出这些记录吗?"><span>导出EXCEL</span></a></li> </ul> </div> <table class="table" width="100%" layoutH="138"> <thead> <tr> <th width="80"></th> <th width="120">客户号</th> <th>客户名称</th> <th width="100">客户类型</th> <th width="150">证件号码</th> <th width="80" align="center">信用等级</th> <th width="80">所属行业</th> <th width="80">建档日期</th> </tr> </thead> <tbody> <tr target="sid_user" rel="1"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="2"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="3"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="4"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="5"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="6"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="7"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="8"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="9"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="10"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="1"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="2"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="3"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="4"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="5"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="6"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="7"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="8"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="9"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="10"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="1"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="2"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="3"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="4"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="5"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="6"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="7"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="8"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="9"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="10"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="1"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="2"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="3"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="4"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="5"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="6"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="7"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="8"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="9"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="10"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="1"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="2"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="3"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="4"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="5"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="6"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="7"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="8"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="9"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="10"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="1"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="2"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="3"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="4"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="5"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="6"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="7"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="8"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="9"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="10"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="1"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="2"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="3"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="4"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="5"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="6"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="7"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="8"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="9"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="10"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="1"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="2"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="3"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="4"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="5"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="6"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="7"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="8"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="9"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="10"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="1"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="2"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="3"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="4"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="5"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="6"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="7"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="8"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="9"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> <tr target="sid_user" rel="10"> <td>天津农信社</td> <td>A120113196309052434</td> <td>天津市华建装饰工程有限公司</td> <td>联社营业部</td> <td>29385739203816293</td> <td>5级</td> <td>政府机构</td> <td>2009-05-21</td> </tr> </tbody> </table> <div class="panelBar"> <div class="pages"> <span>显示</span> <select class="combox" name="numPerPage" onchange="navTabPageBreak({numPerPage:this.value})"> <option value="20">20</option> <option value="50">50</option> <option value="100">100</option> <option value="200">200</option> </select> <span>条,共${totalCount}条</span> </div> <div class="pagination" targetType="navTab" totalCount="200" numPerPage="20" pageNumShown="10" currentPage="1"></div> </div> </div>
zyroot
trunk/admin/dwz1.4.5/demo_page1.html
HTML
art
30,172
<div class="pageContent"> <form method="post" action="demo/common/ajaxDone.html" class="pageForm required-validate" onsubmit="return validateCallback(this, navTabAjaxDone);"> <div class="pageFormContent" layoutH="56"> <p> <label>客 户 号:</label> <input name="sn" type="text" size="30" value="100001" readonly="readonly"/> </p> <p> <label>客户名称:</label> <input name="name" class="required" type="text" size="30" value="张慧华" alt="请输入客户名称"/> </p> <p> <label>部门名称:</label> <input type="hidden" name="orgLookup.id" value="${orgLookup.id}"/> <input type="text" class="required" name="orgLookup.orgName" value="" suggestFields="orgNum,orgName" suggestUrl="demo/database/db_lookupSuggest.html" lookupGroup="orgLookup" /> <a class="btnLook" href="demo/database/dwzOrgLookup.html" lookupGroup="orgLookup">查找带回</a> </p> <p> <label>部门编号:</label> <input type="text" readonly="readonly" value="" name="dwz_orgLookup.orgNum" class="textInput"> </p> <p> <label>识 别 码:</label> <input name="code" class="digits" type="text" size="30" alt="请输入数字"/> </p> <p> <label>客户类型:</label> <select name="type" class="required combox"> <option value="">请选择</option> <option value="个人">个人</option> <option value="公司" selected>公司</option> </select> </p> <p> <label>营业执照号:</label> <input type="text" size="30" /> </p> <p> <label>执照签发日期:</label> <input type="text" name="startDate" class="date" size="30" /><a class="inputDateButton" href="javascript:;">选择</a> </p> <p> <label>执照到期日期:</label> <input type="text" name="endDate" class="date" size="30" /><a class="inputDateButton" href="javascript:;">选择</a> </p> <p> <label>注册资金:</label> <select name="capital" class="required combox"> <option value="">请选择</option> <option value="10">10</option> <option value="50" selected>50</option> <option value="100">100</option> </select> <span class="unit">万元</span> </p> <p> <label>注册类型:</label> <input type="text" size="30" /> </p> <p> <label>注册地址:</label> <input type="text" size="30" /> </p> <p> <label>所属行业:</label> <input type="text" size="30" /> </p> <p> <label>组织机构代码:</label> <input type="text" size="30" /> </p> <p> <label>国税登记证号码:</label> <input type="text" size="30" /> </p> <p> <label>地税登记证号码:</label> <input type="text" size="30" /> </p> <p> <label>贷款卡编码:</label> <input type="text" size="30" /> </p> <p> <label>法人姓名:</label> <input type="text" size="30" /> </p> <p> <label>法人代表身份证号:</label> <input type="text" size="30" /> </p> <p> <label>身份证到期日期:</label> <input type="text" size="30" /> </p> <p> <label>其他证件及号码:</label> <input type="text" size="30" /> </p> <p> <label>曾用名称:</label> <input type="text" size="30" /> </p> <p> <label>首次贷款日期:</label> <input readonly="readonly" type="text" size="30" /> </p> <div class="divider"></div> <p> <label>建档日期:</label> <input readonly="readonly" type="text" size="30" /> </p> <p> <label>管户经理:</label> <input readonly="readonly" type="text" size="30" /> </p> <p> <label>最新修改时间:</label> <input readonly="readonly" type="text" size="30" /> </p> <p> <label>最新修改人员:</label> <input readonly="readonly" type="text" size="30" /> </p> </div> <div class="formBar"> <ul> <!--<li><a class="buttonActive" href="javascript:;"><span>保存</span></a></li>--> <li><div class="buttonActive"><div class="buttonContent"><button type="submit">保存</button></div></div></li> <li> <div class="button"><div class="buttonContent"><button type="button" class="close">取消</button></div></div> </li> </ul> </div> </form> </div>
zyroot
trunk/admin/dwz1.4.5/demo_page4.html
HTML
art
4,428
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="X-UA-Compatible" content="IE=7" /> <title>简单实用国产jQuery UI框架 - DWZ富客户端框架(J-UI.com)</title> <link href="themes/default/style.css" rel="stylesheet" type="text/css" media="screen"/> <link href="themes/css/core.css" rel="stylesheet" type="text/css" media="screen"/> <link href="themes/css/print.css" rel="stylesheet" type="text/css" media="print"/> <link href="uploadify/css/uploadify.css" rel="stylesheet" type="text/css" media="screen"/> <!--[if IE]> <link href="themes/css/ieHack.css" rel="stylesheet" type="text/css" media="screen"/> <![endif]--> <!--[if lte IE 9]> <script src="js/speedup.js" type="text/javascript"></script> <![endif]--> <script src="js/jquery-1.7.2.js" type="text/javascript"></script> <script src="js/jquery.cookie.js" type="text/javascript"></script> <script src="js/jquery.validate.js" type="text/javascript"></script> <script src="js/jquery.bgiframe.js" type="text/javascript"></script> <script src="xheditor/xheditor-1.1.14-zh-cn.min.js" type="text/javascript"></script> <script src="uploadify/scripts/jquery.uploadify.js" type="text/javascript"></script> <!-- svg图表 supports Firefox 3.0+, Safari 3.0+, Chrome 5.0+, Opera 9.5+ and Internet Explorer 6.0+ --> <script type="text/javascript" src="chart/raphael.js"></script> <script type="text/javascript" src="chart/g.raphael.js"></script> <script type="text/javascript" src="chart/g.bar.js"></script> <script type="text/javascript" src="chart/g.line.js"></script> <script type="text/javascript" src="chart/g.pie.js"></script> <script type="text/javascript" src="chart/g.dot.js"></script> <script src="js/dwz.core.js" type="text/javascript"></script> <script src="js/dwz.util.date.js" type="text/javascript"></script> <script src="js/dwz.validate.method.js" type="text/javascript"></script> <script src="js/dwz.regional.zh.js" type="text/javascript"></script> <script src="js/dwz.barDrag.js" type="text/javascript"></script> <script src="js/dwz.drag.js" type="text/javascript"></script> <script src="js/dwz.tree.js" type="text/javascript"></script> <script src="js/dwz.accordion.js" type="text/javascript"></script> <script src="js/dwz.ui.js" type="text/javascript"></script> <script src="js/dwz.theme.js" type="text/javascript"></script> <script src="js/dwz.switchEnv.js" type="text/javascript"></script> <script src="js/dwz.alertMsg.js" type="text/javascript"></script> <script src="js/dwz.contextmenu.js" type="text/javascript"></script> <script src="js/dwz.navTab.js" type="text/javascript"></script> <script src="js/dwz.tab.js" type="text/javascript"></script> <script src="js/dwz.resize.js" type="text/javascript"></script> <script src="js/dwz.dialog.js" type="text/javascript"></script> <script src="js/dwz.dialogDrag.js" type="text/javascript"></script> <script src="js/dwz.sortDrag.js" type="text/javascript"></script> <script src="js/dwz.cssTable.js" type="text/javascript"></script> <script src="js/dwz.stable.js" type="text/javascript"></script> <script src="js/dwz.taskBar.js" type="text/javascript"></script> <script src="js/dwz.ajax.js" type="text/javascript"></script> <script src="js/dwz.pagination.js" type="text/javascript"></script> <script src="js/dwz.database.js" type="text/javascript"></script> <script src="js/dwz.datepicker.js" type="text/javascript"></script> <script src="js/dwz.effects.js" type="text/javascript"></script> <script src="js/dwz.panel.js" type="text/javascript"></script> <script src="js/dwz.checkbox.js" type="text/javascript"></script> <script src="js/dwz.history.js" type="text/javascript"></script> <script src="js/dwz.combox.js" type="text/javascript"></script> <script src="js/dwz.print.js" type="text/javascript"></script> <!-- <script src="bin/dwz.min.js" type="text/javascript"></script> --> <script src="js/dwz.regional.zh.js" type="text/javascript"></script> <script type="text/javascript"> $(function(){ DWZ.init("dwz.frag.xml", { loginUrl:"login_dialog.html", loginTitle:"登录", // 弹出登录对话框 // loginUrl:"login.html", // 跳到登录页面 statusCode:{ok:200, error:300, timeout:301}, //【可选】 pageInfo:{pageNum:"pageNum", numPerPage:"numPerPage", orderField:"orderField", orderDirection:"orderDirection"}, //【可选】 debug:true, // 调试模式 【true|false】 callback:function(){ initEnv(); $("#themeList").theme({themeBase:"themes"}); // themeBase 相对于index页面的主题base路径 } }); }); </script> </head> <body scroll="no"> <div id="layout"> <div id="header"> <div class="headerNav"> <a class="logo" href="http://j-ui.com">标志</a> <ul class="nav"> <li id="switchEnvBox"><a href="javascript:">(<span>北京</span>)切换城市</a> <ul> <li><a href="sidebar_1.html">北京</a></li> <li><a href="sidebar_2.html">上海</a></li> <li><a href="sidebar_2.html">南京</a></li> <li><a href="sidebar_2.html">深圳</a></li> <li><a href="sidebar_2.html">广州</a></li> <li><a href="sidebar_2.html">天津</a></li> <li><a href="sidebar_2.html">杭州</a></li> </ul> </li> <li><a href="https://me.alipay.com/dwzteam" target="_blank">捐赠</a></li> <li><a href="changepwd.html" target="dialog" width="600">设置</a></li> <li><a href="http://www.cnblogs.com/dwzjs" target="_blank">博客</a></li> <li><a href="http://weibo.com/dwzui" target="_blank">微博</a></li> <li><a href="http://bbs.dwzjs.com" target="_blank">论坛</a></li> <li><a href="login.html">退出</a></li> </ul> <ul class="themeList" id="themeList"> <li theme="default"><div class="selected">蓝色</div></li> <li theme="green"><div>绿色</div></li> <!--<li theme="red"><div>红色</div></li>--> <li theme="purple"><div>紫色</div></li> <li theme="silver"><div>银色</div></li> <li theme="azure"><div>天蓝</div></li> </ul> </div> <!-- navMenu --> </div> <div id="leftside"> <div id="sidebar_s"> <div class="collapse"> <div class="toggleCollapse"><div></div></div> </div> </div> <div id="sidebar"> <div class="toggleCollapse"><h2>主菜单</h2><div>收缩</div></div> <div class="accordion" fillSpace="sidebar"> <div class="accordionHeader"> <h2><span>Folder</span>界面组件</h2> </div> <div class="accordionContent"> <ul class="tree treeFolder"> <li><a href="tabsPage.html" target="navTab">主框架面板</a> <ul> <li><a href="main.html" target="navTab" rel="main">我的主页</a></li> <li><a href="http://www.baidu.com" target="navTab" rel="page1">页面一(外部页面)</a></li> <li><a href="demo_page2.html" target="navTab" rel="external" external="true">iframe navTab页面</a></li> <li><a href="demo_page1.html" target="navTab" rel="page1" fresh="false">替换页面一</a></li> <li><a href="demo_page2.html" target="navTab" rel="page2">页面二</a></li> <li><a href="demo_page4.html" target="navTab" rel="page3" title="页面三(自定义标签名)">页面三</a></li> <li><a href="demo_page4.html" target="navTab" rel="page4" fresh="false">测试页面(fresh="false")</a></li> <li><a href="w_editor.html" target="navTab">表单提交会话超时</a></li> <li><a href="demo/common/ajaxTimeout.html" target="navTab">navTab会话超时</a></li> <li><a href="demo/common/ajaxTimeout.html" target="dialog">dialog会话超时</a></li> <li><a href="index_menu.html" target="_blank">横向导航条</a></li> </ul> </li> <li><a>常用组件</a> <ul> <li><a href="w_panel.html" target="navTab" rel="w_panel">面板</a></li> <li><a href="w_tabs.html" target="navTab" rel="w_tabs">选项卡面板</a></li> <li><a href="w_dialog.html" target="navTab" rel="w_dialog">弹出窗口</a></li> <li><a href="w_alert.html" target="navTab" rel="w_alert">提示窗口</a></li> <li><a href="w_list.html" target="navTab" rel="w_list">CSS表格容器</a></li> <li><a href="demo_page1.html" target="navTab" rel="w_table">表格容器</a></li> <li><a href="w_removeSelected.html" target="navTab" rel="w_table">表格数据库排序+批量删除</a></li> <li><a href="w_tree.html" target="navTab" rel="w_tree">树形菜单</a></li> <li><a href="w_accordion.html" target="navTab" rel="w_accordion">滑动菜单</a></li> <li><a href="w_editor.html" target="navTab" rel="w_editor">编辑器</a></li> <li><a href="w_datepicker.html" target="navTab" rel="w_datepicker">日期控件</a></li> <li><a href="demo/database/db_widget.html" target="navTab" rel="db">suggest+lookup+主从结构</a></li> <li><a href="demo/database/treeBringBack.html" target="navTab" rel="db">tree查找带回</a></li> <li><a href="demo/sortDrag/1.html" target="navTab" rel="sortDrag">单个sortDrag示例</a></li> <li><a href="demo/sortDrag/2.html" target="navTab" rel="sortDrag">多个sortDrag示例</a></li> </ul> </li> <li><a>表单组件</a> <ul> <li><a href="w_validation.html" target="navTab" rel="w_validation">表单验证</a></li> <li><a href="w_button.html" target="navTab" rel="w_button">按钮</a></li> <li><a href="w_textInput.html" target="navTab" rel="w_textInput">文本框/文本域</a></li> <li><a href="w_combox.html" target="navTab" rel="w_combox">下拉菜单</a></li> <li><a href="w_checkbox.html" target="navTab" rel="w_checkbox">多选框/单选框</a></li> <li><a href="demo_upload.html" target="navTab" rel="demo_upload">iframeCallback表单提交</a></li> <li><a href="w_uploadify.html" target="navTab" rel="w_uploadify">uploadify多文件上传</a></li> </ul> </li> <li><a>组合应用</a> <ul> <li><a href="demo/pagination/layout1.html" target="navTab" rel="pagination1">局部刷新分页1</a></li> <li><a href="demo/pagination/layout2.html" target="navTab" rel="pagination2">局部刷新分页2</a></li> </ul> </li> <li><a>图表</a> <ul> <li><a href="chart/test/barchart.html" target="navTab" rel="chart">柱状图(垂直)</a></li> <li><a href="chart/test/hbarchart.html" target="navTab" rel="chart">柱状图(水平)</a></li> <li><a href="chart/test/linechart.html" target="navTab" rel="chart">折线图</a></li> <li><a href="chart/test/linechart2.html" target="navTab" rel="chart">曲线图</a></li> <li><a href="chart/test/linechart3.html" target="navTab" rel="chart">曲线图(自定义X坐标)</a></li> <li><a href="chart/test/piechart.html" target="navTab" rel="chart">饼图</a></li> </ul> </li> <li><a href="dwz.frag.xml" target="navTab" external="true">dwz.frag.xml</a></li> </ul> </div> <div class="accordionHeader"> <h2><span>Folder</span>典型页面</h2> </div> <div class="accordionContent"> <ul class="tree treeFolder treeCheck"> <li><a href="demo_page1.html" target="navTab" rel="demo_page1">查询我的客户</a></li> <li><a href="demo_page1.html" target="navTab" rel="demo_page2">表单查询页面</a></li> <li><a href="demo_page4.html" target="navTab" rel="demo_page4">表单录入页面</a></li> <li><a href="demo_page5.html" target="navTab" rel="demo_page5">有文本输入的表单</a></li> <li><a href="javascript:;">有提示的表单输入页面</a> <ul> <li><a href="javascript:;">页面一</a></li> <li><a href="javascript:;">页面二</a></li> </ul> </li> <li><a href="javascript:;">选项卡和图形的页面</a> <ul> <li><a href="javascript:;">页面一</a></li> <li><a href="javascript:;">页面二</a></li> </ul> </li> <li><a href="javascript:;">选项卡和图形切换的页面</a></li> <li><a href="javascript:;">左右两个互动的页面</a></li> <li><a href="javascript:;">列表输入的页面</a></li> <li><a href="javascript:;">双层栏目列表的页面</a></li> </ul> </div> <div class="accordionHeader"> <h2><span>Folder</span>流程演示</h2> </div> <div class="accordionContent"> <ul class="tree"> <li><a href="newPage1.html" target="dialog" rel="dlg_page">列表</a></li> <li><a href="newPage1.html" target="dialog" rel="dlg_page2">列表</a></li> </ul> </div> </div> </div> </div> <div id="container"> <div id="navTab" class="tabsPage"> <div class="tabsPageHeader"> <div class="tabsPageHeaderContent"><!-- 显示左右控制时添加 class="tabsPageHeaderMargin" --> <ul class="navTab-tab"> <li tabid="main" class="main"><a href="javascript:;"><span><span class="home_icon">我的主页</span></span></a></li> </ul> </div> <div class="tabsLeft">left</div><!-- 禁用只需要添加一个样式 class="tabsLeft tabsLeftDisabled" --> <div class="tabsRight">right</div><!-- 禁用只需要添加一个样式 class="tabsRight tabsRightDisabled" --> <div class="tabsMore">more</div> </div> <ul class="tabsMoreList"> <li><a href="javascript:;">我的主页</a></li> </ul> <div class="navTab-panel tabsPageContent layoutBox"> <div class="page unitBox"> <div class="accountInfo"> <div class="alertInfo"> <h2><a href="doc/dwz-user-guide.pdf" target="_blank">DWZ框架使用手册(PDF)</a></h2> <a href="doc/dwz-user-guide.swf" target="_blank">DWZ框架演示视频</a> </div> <div class="right"> <p><a href="doc/dwz-user-guide.zip" target="_blank" style="line-height:19px">DWZ框架使用手册(CHM)</a></p> <p><a href="doc/dwz-ajax-develop.swf" target="_blank" style="line-height:19px">DWZ框架Ajax开发视频教材</a></p> </div> <p><span>DWZ富客户端框架</span></p> <p>DWZ官方微博:<a href="http://weibo.com/dwzui" target="_blank">http://weibo.com/dwzui</a></p> </div> <div class="pageFormContent" layoutH="80" style="margin-right:230px"> <p style="color:red">DWZ官方微博 <a href="http://weibo.com/dwzui" target="_blank">http://weibo.com/dwzui</a></p> <p style="color:red">DWZ官方微群 <a href="http://q.weibo.com/587328/invitation=11TGXSt-148c2" target="_blank">http://q.weibo.com/587328/invitation=11TGXSt-148c2</a></p> <div class="divider"></div> <h2>dwz v1.2视频教程:</h2> <p><a href="http://www.u-training.com/thread-57-1-1.html" target="_blank">http://www.u-training.com/thread-57-1-1.html</a></p> <div class="divider"></div> <h2>DWZ系列开源项目:</h2> <div class="unit"><a href="http://code.google.com/p/dwz/" target="_blank">dwz富客户端框架 - jUI</a></div> <div class="unit"><a href="http://code.google.com/p/dwz4j" target="_blank">dwz4j(Java Web)快速开发框架 + jUI整合应用</a></div> <div class="unit"><a href="http://code.google.com/p/dwz4php" target="_blank">ThinkPHP + jUI整合应用</a></div> <div class="unit"><a href="http://code.google.com/p/dwz4php" target="_blank">Zend Framework + jUI整合应用</a></div> <div class="unit"><a href="http://www.yiiframework.com/extension/dwzinterface/" target="_blank">YII + jUI整合应用</a></div> <div class="divider"></div> <h2>常见问题及解决:</h2> <pre style="margin:5px;line-height:1.4em"> Error loading XML document: dwz.frag.xml 直接用IE打开index.html弹出一个对话框:Error loading XML document: dwz.frag.xml 原因:没有加载成功dwz.frag.xml。IE ajax laod本地文件有限制, 是ie安全级别的问题, 不是框架的问题。 解决方法:部署到apache 等 Web容器下。 </pre> <div class="divider"></div> <h2>有偿服务请联系:</h2> <pre style="margin:5px;line-height:1.4em;"> 定制化开发,公司培训,技术支持 合作电话:010-52897073 邮箱:support@dwzjs.com </pre> </div> <div style="width:230px;position: absolute;top:60px;right:0" layoutH="80"> <iframe width="100%" height="430" class="share_self" frameborder="0" scrolling="no" src="http://widget.weibo.com/weiboshow/index.php?width=0&height=430&fansRow=2&ptype=1&skin=1&isTitle=0&noborder=1&isWeibo=1&isFans=0&uid=1739071261&verifier=c683dfe7"></iframe> </div> </div> </div> </div> </div> </div> <div id="footer">Copyright &copy; 2010 <a href="demo_page2.html" target="dialog">DWZ团队</a> Tel:010-52897073</div> <!-- 注意此处js代码用于google站点统计,非DWZ代码,请删除 --> <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-16716654-1']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? ' https://ssl' : ' http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script> </body> </html>
zyroot
trunk/admin/dwz1.4.5/index.html
HTML
art
17,843
<div class="pageContent"> <div class="pageFormContent" layoutH="58"> <ul class="tree expand"> <li><a href="javascript:">北京</a> <ul> <li><a href="javascript:" onclick="$.bringBack({id:'1', districtName:'东城', cityName:'北京'})">东城</a></li> <li><a href="javascript:" onclick="$.bringBack({id:'2', districtName:'西城', cityName:'北京'})">西城</a></li> </ul> </li> <li><a href="javascript:">上海</a> <ul> <li><a href="javascript:" onclick="$.bringBack({id:'1', districtName:'崇明', cityName:'上海'})">崇明</a></li> <li><a href="javascript:" onclick="$.bringBack({id:'2', districtName:'黄浦', cityName:'上海'})">黄浦</a></li> </ul> </li> </ul> </div> <div class="formBar"> <ul> <li><div class="button"><div class="buttonContent"><button class="close" type="button">关闭</button></div></div></li> </ul> </div> </div>
zyroot
trunk/admin/dwz1.4.5/demo/database/treeLookup.html
HTML
art
935
<h2 class="contentTitle">suggest+lookup</h2> <form action="demo/common/ajaxDone.html?navTabId=masterList&callbackType=closeCurrent" method="post" class="pageForm required-validate" onsubmit="return validateCallback(this, navTabAjaxDone)"> <div class="pageContent"> <div class="pageFormContent" layoutH="97"> <dl class="nowrap"> <dt>部门名称A1:</dt> <dd> <input id="inputOrg1" name="org1.id" value="" type="hidden"/> <input class="required" name="org1.orgName" type="text" postField="keyword" suggestFields="orgNum,orgName" suggestUrl="demo/database/db_lookupSuggest.html" lookupGroup="org1"/> <a class="btnLook" href="demo/database/dwzOrgLookup.html" lookupGroup="org1">查找带回</a> <span class="info">(suggest+lookup)</span> </dd> </dl> <dl class="nowrap"> <dt>部门编号A1:</dt> <dd> <input class="readonly" name="org1.orgNum" readonly="readonly" type="text"/> </dd> </dl> <dl class="nowrap"> <dt>部门名称A2:</dt> <dd> <input name="org1_1.id" value="" type="hidden"/> <input class="required" name="org1_1.orgName" type="text" suggestFields="orgNum,orgName" suggestUrl="demo/database/db_lookupSuggest.html?orgId={inputOrg1}" warn="请选择部门A1" lookupGroup="org1_1"/> <a class="btnLook" href="demo/database/dwzOrgLookup.html?orgId={inputOrg1}" warn="请选择部门A1" lookupGroup="org1_1">查找带回</a> <span class="info">(suggest、lookup 联动效果)</span> </dd> </dl> <div class="divider"></div> <dl class="nowrap"> <dt>部门名称B:</dt> <dd> <input name="org2.id" value="" type="hidden"> <input class="required" name="org2.orgName" type="text" suggestFields="orgName" suggestUrl="demo/database/db_lookupSuggest.html" lookupGroup="org2"/> <span class="info">(suggest)</span> </dd> </dl> <div class="divider"></div> <dl class="nowrap"> <dt>部门名称C:</dt> <dd> <input name="org3.id" value="" type="hidden"> <input name="org3.orgName" type="text"/> <a class="btnLook" href="demo/database/dwzOrgLookup2.html" lookupGroup="org3">查找带回</a> <span class="info">(lookup 通过复选框选择多个值查找回带)</span> </dd> </dl> <dl class="nowrap"> <dt>部门编号C:</dt> <dd> <input class="readonly" name="org3.orgNum" readonly="readonly" type="text"/> </dd> </dl> <div class="divider"></div> <dl class="nowrap"> <dt>部门(结尾带下标):</dt> <dd> <input name="org.id[]" value="1" type="hidden"/> <input class="required" name="org.orgName[]" value="技术部" type="text" suggestFields="orgNum,orgName" suggestUrl="demo/database/db_lookupSuggest.html" lookupGroup="org" suffix="[]"/> <a class="btnLook" href="demo/database/dwzOrgLookup.html" lookupGroup="org" suffix="[]">查找带回</a> <span class="info">需要suffix="[]"属性,下标一般用于主从结构子表</span> </dd> </dl> <div class="divider"></div> <dl class="nowrap"> <dt>部门(中间带下标):</dt> <dd> <input name="org[].id" value="1" type="hidden"/> <input class="required" name="org[].orgName" value="技术部" type="text" suggestFields="orgNum,orgName" suggestUrl="demo/database/db_lookupSuggest.html" lookupGroup="org[]"/> <a class="btnLook" href="demo/database/dwzOrgLookup.html" lookupGroup="org[]">查找带回</a> <span class="info">不需要suffix="[]"属性,lookupGroup属性中加上方括号[]</span> </dd> </dl> <div class="divider"></div> <dl class="nowrap"> <dt>自定义lookupPk:</dt> <dd> <input name="obj.orgNum" value="" type="hidden"/> <input class="required" name="obj.orgName" type="text" suggestFields="orgNum,orgName" suggestUrl="demo/database/db_lookupSuggest.html" lookupGroup="obj" lookupPk="orgNum"/> <a class="btnLook" href="demo/database/dwzOrgLookup.html" lookupGroup="obj" lookupPk="orgNum">查找带回</a> <span class="info">自定义lookup主键,只需添加lookupPk="xxx"属性(lookupPk默认值为id)</span> </dd> </dl> <div class="divider"></div> <dl class="nowrap"> <dt>附件:</dt> <dd> <input name="attachment.id" value="" type="hidden"> <input class="readonly" name="attachment.fileName" value="" readonly="readonly" type="text"/> <a class="btnAttach" href="demo/database/db_attachmentLookup.html" lookupGroup="attachment" width="560" height="300" title="附件">附件</a> <span class="info">(lookup附件)</span> </dd> </dl> <div class="divider"></div> <h3 class="contentTitle">主从结构</h3> <div class="tabs"> <div class="tabsHeader"> <div class="tabsHeaderContent"> <ul> <li class="selected"><a href="javascript:void(0)"><span>从表1【Struts2 示例】</span></a></li> <li><a href="javascript:void(0)"><span>从表2【PHP 示例 - 结尾带下标[#index#]】</span></a></li> <li><a href="javascript:void(0)"><span>从表2【PHP 示例 - 结尾带下标[]】</span></a></li> </ul> </div> </div> <div class="tabsContent" style="height: 150px;"> <div> <table class="list nowrap itemDetail" addButton="新建从表1条目" width="100%"> <thead> <tr> <th type="text" name="items[#index#].itemString" size="12" fieldClass="required" fieldAttrs="{remote:'validate_remote.html', maxlength:10}">从字符串</th> <th type="text" name="items[#index#].itemInt" defaultVal="#index#" size="12" fieldClass="digits">从整数</th> <th type="text" name="items[#index#].itemFloat" defaultVal="0.8" size="12" fieldClass="number">从浮点</th> <th type="date" name="items[#index#].itemDate" defaultVal="2011-12-28" size="12">从日期</th> <th type="date" format="yyyy-MM-dd HH:mm:ss" name="items[#index#].itemDataTime" size="16">从日期时间</th> <th type="lookup" name="items[#index#].org.orgName" lookupGroup="items[#index#].org" lookupUrl="demo/database/dwzOrgLookup.html" suggestUrl="demo/database/db_lookupSuggest.html" suggestFields="orgName" postField="keywords" size="12" fieldClass="required">部门名称</th> <th type="enum" name="items[#index#].itemEnum" enumUrl="demo/database/db_select.html" size="12">从枚举</th> <th type="attach" name="items[#index#].attachment.fileName" lookupGroup="items[#index#].attachment" lookupUrl="demo/database/db_attachmentLookup.html" size="12">从附件</th> <th type="del" width="60">操作</th> </tr> </thead> <tbody></tbody> </table> </div> <div> <table class="list nowrap itemDetail" addButton="新建从表2条目" width="100%"> <thead> <tr> <th type="text" name="items.itemString[#index#]" size="12" fieldClass="required">从字符串</th> <th type="text" name="items.itemInt[#index#]" size="12" fieldClass="digits">从整数</th> <th type="text" name="items.itemFloat[#index#]" size="12" fieldClass="number">从浮点</th> <th type="date" name="items.itemDate[#index#]" size="12">从日期</th> <th type="date" format="yyyy-MM-dd HH:mm:ss" name="items.itemDataTime[#index#]" size="16">从日期时间</th> <th type="lookup" name="items.org.orgName[#index#]" lookupGroup="items.org" lookupUrl="demo/database/dwzOrgLookup.html" lookupPk="orgNum" suggestUrl="demo/database/db_lookupSuggest.html" suggestFields="orgNum,orgName" size="12">部门名称</th> <th type="enum" name="items.itemEnum[#index#]" enumUrl="demo/database/db_select.html" size="12">从枚举</th> <th type="attach" name="items.attachment.fileName[#index#]" lookupGroup="items.attachment" lookupUrl="demo/database/db_attachmentLookup.html" size="12">从附件</th> <th type="del" width="60">操作</th> </tr> </thead> <tbody></tbody> </table> </div> <div> <table class="list nowrap itemDetail" addButton="新建从表3条目" width="100%"> <thead> <tr> <th type="text" name="items.itemString[]" size="12" fieldClass="required">从字符串</th> <th type="text" name="items.itemInt[]" size="12" fieldClass="digits">从整数</th> <th type="text" name="items.itemFloat[]" size="12" fieldClass="number">从浮点</th> <th type="date" name="items.itemDate[]" size="12">从日期</th> <th type="date" format="yyyy-MM-dd HH:mm:ss" name="items.itemDataTime[]" size="16">从日期时间</th> <th type="lookup" name="items.org.orgName[]" lookupGroup="items.org" lookupUrl="demo/database/dwzOrgLookup.html" suggestUrl="demo/database/db_lookupSuggest.html" suggestFields="orgName" size="12">部门名称</th> <th type="enum" name="items.itemEnum[]" enumUrl="demo/database/db_select.html" size="12">从枚举</th> <th type="attach" name="items.attachment.fileName[]" lookupGroup="items.attachment" lookupUrl="demo/database/db_attachmentLookup.html" size="12">从附件</th> <th type="del" width="60">操作</th> </tr> </thead> <tbody></tbody> </table> </div> </div> <div class="tabsFooter"> <div class="tabsFooterContent"></div> </div> </div> </div> <div class="formBar"> <ul> <li><div class="buttonActive"><div class="buttonContent"><button type="submit">保存</button></div></div></li> <li><div class="button"><div class="buttonContent"><button class="close" type="button">关闭</button></div></div></li> </ul> </div> </div> </form>
zyroot
trunk/admin/dwz1.4.5/demo/database/db_widget.html
HTML
art
9,697
<select class="combox" name="${param.inputName}"> <option value="Yes">是</option> <option value="No">否</option> </select>
zyroot
trunk/admin/dwz1.4.5/demo/database/db_select.html
HTML
art
129
<h2 class="contentTitle">tree查找带回</h2> <div class="pageContent"> <form action="demo/common/ajaxDone.html" method="post" class="pageForm required-validate" onsubmit="return validateCallback(this, navTabAjaxDone)"> <div class="pageFormContent" layoutH="97"> <dl class="nowrap"> <dt>城市:</dt> <dd> <input class="required" name="district.cityName" type="text" readonly/> </dd> </dl> <dl class="nowrap"> <dt>区县:</dt> <dd> <input name="district.id" value="" type="hidden"/> <input class="required" name="district.districtName" type="text" readonly/> <a class="btnLook" href="demo/database/treeLookup.html" lookupGroup="district">查找带回</a> </dd> </dl> </div> <div class="formBar"> <ul> <li><div class="buttonActive"><div class="buttonContent"><button type="submit">保存</button></div></div></li> <li><div class="button"><div class="buttonContent"><button class="close" type="button">关闭</button></div></div></li> </ul> </div> </form> </div>
zyroot
trunk/admin/dwz1.4.5/demo/database/treeBringBack.html
HTML
art
1,055
{ "id":"1000", "fileName":"测试文件.txt", "attachmentPath":"/upload/测试文件.txt", "attachmentSize":"1024" }
zyroot
trunk/admin/dwz1.4.5/demo/database/db_attachmentBrightBack.html
HTML
art
125
<h2 class="contentTitle">请选择需要上传的附件</h2> <form action="demo/database/db_attachmentBrightBack.html" method="post" enctype="multipart/form-data" class="pageForm required-validate" onsubmit="return iframeCallback(this, $.bringBack)"> <div class="pageContent"> <div class="pageFormContent" layoutH="97"> <dl> <dt>附件:</dt><dd><input type="file" name="image" class="required" size="30" /></dd> </dl> </div> <div class="formBar"> <ul> <li><div class="buttonActive"><div class="buttonContent"><button type="submit">上传</button></div></div></li> <li><div class="button"><div class="buttonContent"><button class="close" type="button">关闭</button></div></div></li> </ul> </div> </div> </form>
zyroot
trunk/admin/dwz1.4.5/demo/database/db_attachmentLookup.html
HTML
art
755
<form id="pagerForm" action="demo/database/dwzOrgLookup2.html"> <input type="hidden" name="pageNum" value="1" /> <input type="hidden" name="numPerPage" value="${model.numPerPage}" /> <input type="hidden" name="orderField" value="${param.orderField}" /> <input type="hidden" name="orderDirection" value="${param.orderDirection}" /> </form> <div class="pageHeader"> <form rel="pagerForm" method="post" action="demo/database/dwzOrgLookup2.html" onsubmit="return dwzSearch(this, 'dialog');"> <div class="searchBar"> <ul class="searchContent"> <li> <label>部门名称:</label> <input class="textInput" name="orgName" value="" type="text"> </li> <li> <label>部门编号:</label> <input class="textInput" name="orgNum" value="" type="text"> </li> <li> <label>部门经理:</label> <input class="textInput" name="leader" value="" type="text"> </li> <li> <label>上级部门:</label> <input class="textInput" name="parentOrg.orgName" value="" type="text"> </li> </ul> <div class="subBar"> <ul> <li><div class="buttonActive"><div class="buttonContent"><button type="submit">查询</button></div></div></li> <li><div class="button"><div class="buttonContent"><button type="button" multLookup="orgId" warn="请选择部门">选择带回</button></div></div></li> </ul> </div> </div> </form> </div> <div class="pageContent"> <table class="table" layoutH="118" targetType="dialog" width="100%"> <thead> <tr> <th width="30"><input type="checkbox" class="checkboxCtrl" group="orgId" /></th> <th orderfield="orgName">部门名称</th> <th orderfield="orgNum">部门编号</th> <th orderfield="leader">部门经理</th> <th orderfield="creator">创建人</th> </tr> </thead> <tbody> <tr> <td><input type="checkbox" name="orgId" value="{id:'1', orgName:'技术部', orgNum:'1001'}"/></td> <td>技术部</td> <td>1001</td> <td>leader</td> <td>administrator</td> </tr> <tr> <td><input type="checkbox" name="orgId" value="{id:'2', orgName:'人事部', orgNum:'1002'}"/></td> <td>人事部</td> <td>1002</td> <td>test</td> <td>administrator</td> </tr> <tr> <td><input type="checkbox" name="orgId" value="{id:'3', orgName:'销售部', orgNum:'1003'}"/></td> <td>人事部</td> <td>1002</td> <td>test</td> <td>administrator</td> </tr> </tbody> </table> <div class="panelBar"> <div class="pages"> <span>每页</span> <select name="numPerPage" onchange="dwzPageBreak({targetType:dialog, numPerPage:'10'})"> <option value="10" selected="selected">10</option> <option value="20">20</option> <option value="50">50</option> <option value="100">100</option> </select> <span>条,共2条</span> </div> <div class="pagination" targetType="dialog" totalCount="2" numPerPage="10" pageNumShown="1" currentPage="1"></div> </div> </div>
zyroot
trunk/admin/dwz1.4.5/demo/database/dwzOrgLookup2.html
HTML
art
3,035
[ {"id":"1", "orgName":"技术部", "orgNum":"1001"}, {"id":"2", "orgName":"人事部", "orgNum":"1002"}, {"id":"3", "orgName":"销售部", "orgNum":"1003"}, {"id":"4", "orgName":"售后部", "orgNum":"1004"} ]
zyroot
trunk/admin/dwz1.4.5/demo/database/db_lookupSuggest.html
HTML
art
219
<form id="pagerForm" action="demo/database/dwzOrgLookup.html"> <input type="hidden" name="pageNum" value="1" /> <input type="hidden" name="numPerPage" value="${model.numPerPage}" /> <input type="hidden" name="orderField" value="${param.orderField}" /> <input type="hidden" name="orderDirection" value="${param.orderDirection}" /> </form> <div class="pageHeader"> <form rel="pagerForm" method="post" action="demo/database/dwzOrgLookup.html" onsubmit="return dwzSearch(this, 'dialog');"> <div class="searchBar"> <ul class="searchContent"> <li> <label>部门名称:</label> <input class="textInput" name="orgName" value="" type="text"> </li> <li> <label>部门编号:</label> <input class="textInput" name="orgNum" value="" type="text"> </li> <li> <label>部门经理:</label> <input class="textInput" name="fullName" value="" type="text"> </li> <li> <label>上级部门:</label> <input class="textInput" name="parentOrg.orgName" value="" type="text"> </li> </ul> <div class="subBar"> <ul> <li><div class="buttonActive"><div class="buttonContent"><button type="submit">查询</button></div></div></li> </ul> </div> </div> </form> </div> <div class="pageContent"> <table class="table" layoutH="118" targetType="dialog" width="100%"> <thead> <tr> <th orderfield="orgName">部门名称</th> <th orderfield="orgNum">部门编号</th> <th orderfield="leader">部门经理</th> <th orderfield="creator">创建人</th> <th width="80">查找带回</th> </tr> </thead> <tbody> <tr> <td>技术部</td> <td>1001</td> <td>administrator</td> <td>administrator</td> <td> <a class="btnSelect" href="javascript:$.bringBack({id:'1', orgName:'技术部', orgNum:'1001'})" title="查找带回">选择</a> </td> </tr> <tr> <td>人事部</td> <td>1002</td> <td>test</td> <td>administrator</td> <td> <a class="btnSelect" href="javascript:$.bringBack({id:'2', orgName:'人事部', orgNum:'1002'})" title="查找带回">选择</a> </td> </tr> </tbody> </table> <div class="panelBar"> <div class="pages"> <span>每页</span> <select name="numPerPage" onchange="dwzPageBreak({targetType:dialog, numPerPage:'10'})"> <option value="10" selected="selected">10</option> <option value="20">20</option> <option value="50">50</option> <option value="100">100</option> </select> <span>条,共2条</span> </div> <div class="pagination" targetType="dialog" totalCount="2" numPerPage="10" pageNumShown="1" currentPage="1"></div> </div> </div>
zyroot
trunk/admin/dwz1.4.5/demo/database/dwzOrgLookup.html
HTML
art
2,723
<h2 class="contentTitle">单个sortDrag示例</h2> <div class="pageContent sortDrag" layoutH="42"> <div style="border:1px solid #B8D0D6;padding:5px;margin:5px">A1</div> <div style="border:1px solid #B8D0D6;padding:5px;margin:5px">A2</div> <div style="border:1px solid #B8D0D6;padding:5px;margin:5px">A3</div> <div style="border:1px solid #B8D0D6;padding:5px;margin:5px">A4</div> <div style="border:1px solid #B8D0D6;padding:5px;margin:5px">A5</div> </div>
zyroot
trunk/admin/dwz1.4.5/demo/sortDrag/1.html
HTML
art
473
<h2 class="contentTitle">多个sortDrag示例</h2> <div class="pageContent" layoutH="42"> <div class="sortDrag" style="width:48%;border:1px solid #e66;margin:5px;float:left;min-height:100px"> <div style="border:1px solid #B8D0D6;padding:5px;margin:5px">A1</div> <div style="border:1px solid #B8D0D6;padding:5px;margin:5px">A2</div> <div style="border:1px solid #B8D0D6;padding:5px;margin:5px">A3</div> <div style="border:1px solid #B8D0D6;padding:5px;margin:5px">A4</div> <div style="border:1px solid #B8D0D6;padding:5px;margin:5px">A5</div> </div> <div class="sortDrag" style="width:48%;border:1px solid #e66;margin:5px;float:left;min-height:100px"> <div style="border:1px solid #B8D0D6;padding:5px;margin:5px">B1</div> <div style="border:1px solid #B8D0D6;padding:5px;margin:5px">B2</div> <div style="border:1px solid #B8D0D6;padding:5px;margin:5px">B3</div> <div style="border:1px solid #B8D0D6;padding:5px;margin:5px">B4</div> <div style="border:1px solid #B8D0D6;padding:5px;margin:5px">B5</div> </div> </div>
zyroot
trunk/admin/dwz1.4.5/demo/sortDrag/2.html
HTML
art
1,048
[ ["东城", "东城"], ["西城", "西城"], ["崇文", "崇文"], ["宣武", "宣武"], ["朝阳", "朝阳"], ["丰台", "丰台"], ["石景山", "石景山"], ["海淀", "海淀"], ["门头沟", "门头沟"], ["房山", "房山"], ["通州", "通州"], ["顺义", "顺义"], ["昌平", "昌平"], ["大兴", "大兴"], ["平谷", "平谷"], ["怀柔", "怀柔"], ["密云", "密云"], ["延庆", "延庆"] ]
zyroot
trunk/admin/dwz1.4.5/demo/combox/area_bj.html
HTML
art
498
[ ["崇明", "崇明"], ["黄浦", "黄浦"], ["卢湾", "卢湾"], ["徐汇", "徐汇"], ["长宁", "长宁"], ["静安", "静安"], ["普陀", "普陀"], ["闸北", "闸北"], ["虹口", "虹口"], ["杨浦", "杨浦"], ["闵行", "闵行"], ["宝山", "宝山"], ["嘉定", "嘉定"], ["浦东", "浦东"], ["金山", "金山"], ["松江", "松江"], ["青浦", "青浦"], ["南汇", "南汇"], ["奉贤", "奉贤"], ["朱家角", "朱家角"] ]
zyroot
trunk/admin/dwz1.4.5/demo/combox/area_sh.html
HTML
art
489
[ ["all", "所有城市"], ["bj", "北京市"] ]
zyroot
trunk/admin/dwz1.4.5/demo/combox/city_bj.html
HTML
art
53
[ ["all", "所有城市"], ["sh", "上海市"] ]
zyroot
trunk/admin/dwz1.4.5/demo/combox/city_sh.html
HTML
art
53
[ ["", "请选择城市"] ]
zyroot
trunk/admin/dwz1.4.5/demo/combox/area_all.html
HTML
art
33
[ ["all", "请选择省份"] ]
zyroot
trunk/admin/dwz1.4.5/demo/combox/city_all.html
HTML
art
36
<style type="text/css"> ul.rightTools {float:right; display:block;} ul.rightTools li{float:left; display:block; margin-left:5px} </style> <div class="pageContent" style="padding:5px"> <div class="panel" defH="40"> <h1>病人基本信息</h1> <div> 病人编号:<input type="text" name="patientNo" /> <ul class="rightTools"> <li><a class="button" target="dialog" href="demo/pagination/dialog1.html" mask="true"><span>创建病例</span></a></li> <li><div class="buttonDisabled"><div class="buttonContent"><button>病人治疗流程</button></div></div></li> <li><div class="buttonDisabled"><div class="buttonContent"><button>按病人编号检索病例</button></div></div></li> <li><div class="buttonDisabled"><div class="buttonContent"><button>从病人列表选取病例</button></div></div></li> </ul> </div> </div> <div class="divider"></div> <div class="tabs"> <div class="tabsHeader"> <div class="tabsHeaderContent"> <ul> <li><a href="javascript:;"><span>实验室检测</span></a></li> <li><a href="javascript:;"><span>病人处方</span></a></li> <li><a href="javascript:;"><span>病人服药情况</span></a></li> <li><a href="javascript:;"><span>基线调查</span></a></li> <li><a href="javascript:;"><span>随访</span></a></li> </ul> </div> </div> <div class="tabsContent"> <div> <div layoutH="146" style="float:left; display:block; overflow:auto; width:240px; border:solid 1px #CCC; line-height:21px; background:#fff"> <ul class="tree treeFolder"> <li><a href="javascript">实验室检测</a> <ul> <li><a href="demo/pagination/list1.html" target="ajax" rel="jbsxBox">尿检</a></li> <li><a href="demo/pagination/list1.html" target="ajax" rel="jbsxBox">HIV检测</a></li> <li><a href="demo/pagination/list1.html" target="ajax" rel="jbsxBox">HCV检测</a></li> <li><a href="demo/pagination/list1.html" target="ajax" rel="jbsxBox">TB检测</a></li> </ul> </li> </ul> </div> <div id="jbsxBox" class="unitBox" style="margin-left:246px;"> <!--#include virtual="list1.html" --> </div> </div> <div>病人处方</div> <div>病人服药情况</div> <div>基线调查</div> <div>随访</div> </div> <div class="tabsFooter"> <div class="tabsFooterContent"></div> </div> </div> </div>
zyroot
trunk/admin/dwz1.4.5/demo/pagination/layout1.html
HTML
art
2,506
{ "statusCode":"200", "message":"\u64cd\u4f5c\u6210\u529f", "navTabId":"", "rel":"jbsxBox", "callbackType":"closeCurrent", "forwardUrl":"", "confirmMsg":"" }
zyroot
trunk/admin/dwz1.4.5/demo/pagination/ajaxDone2.html
HTML
art
174
{ "statusCode":"200", "message":"\u64cd\u4f5c\u6210\u529f", "navTabId":"pagination", "rel":"", "callbackType":"closeCurrent", "forwardUrl":"", "confirmMsg":"" }
zyroot
trunk/admin/dwz1.4.5/demo/pagination/ajaxDone1.html
HTML
art
177
<div class="pageContent"> <div id="jbsxBox2" class="unitBox" style="float:left; display:block; overflow:auto; width:514px;"> <!--#include virtual="list2.html" --> </div> <div id="jbsxBox3" class="unitBox" style="margin-left:520px;"> <!--#include virtual="list3.html" --> </div> </div>
zyroot
trunk/admin/dwz1.4.5/demo/pagination/layout2.html
HTML
art
307
<div class="pageHeader" style="border:1px #B8D0D6 solid"> <form id="pagerForm" onsubmit="return divSearch(this, 'jbsxBox2');" action="demo/pagination/list2.html" method="post"> <input type="hidden" name="pageNum" value="1" /> <input type="hidden" name="numPerPage" value="${model.numPerPage}" /> <input type="hidden" name="orderField" value="${param.orderField}" /> <input type="hidden" name="orderDirection" value="${param.orderDirection}" /> <div class="searchBar"> <table class="searchContent"> <tr> <td> 姓名:<input type="text" name="name" /> </td> <td><div class="buttonActive"><div class="buttonContent"><button type="submit">检索</button></div></div></td> </tr> </table> </div> </form> </div> <div class="pageContent" style="border-left:1px #B8D0D6 solid;border-right:1px #B8D0D6 solid"> <div class="panelBar"> <ul class="toolBar"> <li><a class="add" href="demo/pagination/dialog2.html" target="dialog" mask="true"><span>添加</span></a></li> <li><a class="delete" href="demo/pagination/ajaxDone3.html?uid={sid_obj}" target="ajaxTodo" title="确定要删除吗?"><span>删除</span></a></li> <li><a class="edit" href="demo/pagination/dialog2.html?uid={sid_obj}" target="dialog" mask="true"><span>修改</span></a></li> <li class="line">line</li> <li><a class="icon" href="demo/common/dwz-team.xls" target="dwzExport" title="实要导出这些记录吗?"><span>导出EXCEL</span></a></li> </ul> </div> <table class="table" width="99%" layoutH="138" rel="jbsxBox2"> <thead> <tr> <th width="80">序号</th> <th orderField="name" class="asc">姓名</th> <th orderField="sex">性别</th> <th>操作</th> </tr> </thead> <tbody> <tr target="sid_obj" rel="1"> <td>1</td> <td>张三</td> <td>男</td> <td><a href="demo/pagination/list3.html" target="ajax" rel="jbsxBox3">载入右边grid</a></td> </tr> <tr target="sid_obj" rel="2"> <td>2</td> <td>李四</td> <td>女</td> <td><a href="demo/pagination/list3.html" target="ajax" rel="jbsxBox3">载入右边grid</a></td> </tr> </tbody> </table> <div class="panelBar"> <div class="pages"> <span>显示</span> <select class="combox" name="numPerPage" onchange="navTabPageBreak({numPerPage:this.value}, 'jbsxBox2')"> <option value="20">20</option> <option value="50">50</option> <option value="100">100</option> <option value="200">200</option> </select> <span>条,共2条</span> </div> <div class="pagination" rel="jbsxBox2" totalCount="200" numPerPage="20" pageNumShown="5" currentPage="1"></div> </div> </div>
zyroot
trunk/admin/dwz1.4.5/demo/pagination/list2.html
HTML
art
2,704
<div class="pageContent"> <form method="post" action="demo/pagination/ajaxDone1.html" class="pageForm required-validate" onsubmit="return validateCallback(this, dialogAjaxDone)"> <div class="pageFormContent" layoutH="58"> <div class="unit"> <label>病历号:</label> <input type="text" name="patientNo" size="30" minlength="6" maxlength="20" class="required" /> </div> <div class="unit"> <label>病人姓名:</label> <input type="text" name="patientNames" size="30" class="required"/> </div> </div> <div class="formBar"> <ul> <li><div class="buttonActive"><div class="buttonContent"><button type="submit">提交</button></div></div></li> <li><div class="button"><div class="buttonContent"><button type="button" class="close">取消</button></div></div></li> </ul> </div> </form> </div>
zyroot
trunk/admin/dwz1.4.5/demo/pagination/dialog1.html
HTML
art
879
<div class="pageHeader" style="border:1px #B8D0D6 solid"> <form id="pagerForm" onsubmit="return divSearch(this, 'jbsxBox3');" action="demo/pagination/list3.html" method="post"> <input type="hidden" name="pageNum" value="1" /> <input type="hidden" name="numPerPage" value="${model.numPerPage}" /> <input type="hidden" name="orderField" value="${param.orderField}" /> <input type="hidden" name="orderDirection" value="${param.orderDirection}" /> <div class="searchBar"> <table class="searchContent"> <tr> <td> 姓名:<input type="text" name="name" /> </td> <td><div class="buttonActive"><div class="buttonContent"><button type="submit">检索</button></div></div></td> </tr> </table> </div> </form> </div> <div class="pageContent" style="border-left:1px #B8D0D6 solid;border-right:1px #B8D0D6 solid"> <div class="panelBar"> <ul class="toolBar"> <li><a class="add" href="demo/pagination/dialog2.html" target="dialog" mask="true"><span>添加</span></a></li> <li><a class="delete" href="demo/pagination/ajaxDone3.html?uid={sid_obj}" target="ajaxTodo" title="确定要删除吗?"><span>删除</span></a></li> <li><a class="edit" href="demo/pagination/dialog2.html?uid={sid_obj}" target="dialog" mask="true"><span>修改</span></a></li> <li class="line">line</li> <li><a class="icon" href="demo/common/dwz-team.xls" target="dwzExport" title="实要导出这些记录吗?"><span>导出EXCEL</span></a></li> </ul> </div> <table class="table" width="99%" layoutH="138"> <thead> <tr> <th width="80">序号</th> <th>姓名</th> <th>性别</th> </tr> </thead> <tbody> <tr target="sid_obj" rel="1"> <td>1</td> <td>张三</td> <td>男</td> </tr> <tr target="sid_obj" rel="2"> <td>2</td> <td>李四</td> <td>女</td> </tr> </tbody> </table> <div class="panelBar"> <div class="pages"> <span>显示</span> <select class="combox" name="numPerPage" onchange="navTabPageBreak({numPerPage:this.value}, 'jbsxBox3')"> <option value="20">20</option> <option value="50">50</option> <option value="100">100</option> <option value="200">200</option> </select> <span>条,共2条</span> </div> <div class="pagination" rel="jbsxBox3" totalCount="200" numPerPage="20" pageNumShown="5" currentPage="1"></div> </div> </div>
zyroot
trunk/admin/dwz1.4.5/demo/pagination/list3.html
HTML
art
2,419
<div class="pageHeader" style="border:1px #B8D0D6 solid"> <form id="pagerForm" onsubmit="return divSearch(this, 'jbsxBox');" action="demo/pagination/list1.html" method="post"> <input type="hidden" name="pageNum" value="1" /> <input type="hidden" name="numPerPage" value="${model.numPerPage}" /> <input type="hidden" name="orderField" value="${param.orderField}" /> <input type="hidden" name="orderDirection" value="${param.orderDirection}" /> <div class="searchBar"> <table class="searchContent"> <tr> <td class="dateRange"> 尿检日期: <input type="text" value="" readonly="readonly" class="date" name="dateStart"> <span class="limit">-</span> <input type="text" value="" readonly="readonly" class="date" name="dateEnd"> </td> <td> 尿检结果: <input type="radio" name="njjg" value="" checked="checked" />全部 <input type="radio" name="njjg" value="1"/>阴性 <input type="radio" name="njjg" value="2"/>阳性 </td> <td> 病人编号:<input type="text" name="keyword" /> </td> <td><div class="buttonActive"><div class="buttonContent"><button type="submit">检索</button></div></div></td> </tr> </table> </div> </form> </div> <div class="pageContent" style="border-left:1px #B8D0D6 solid;border-right:1px #B8D0D6 solid"> <div class="panelBar"> <ul class="toolBar"> <li><a class="add" href="demo/pagination/dialog2.html" target="dialog" mask="true"><span>添加尿检检测</span></a></li> <li><a class="delete" href="demo/pagination/ajaxDone3.html?uid={sid_obj}" target="ajaxTodo" title="确定要删除吗?"><span>删除</span></a></li> <li><a class="edit" href="demo/pagination/dialog2.html?uid={sid_obj}" target="dialog" mask="true"><span>修改</span></a></li> <li class="line">line</li> <li><a class="icon" href="demo/common/dwz-team.xls" target="dwzExport" title="实要导出这些记录吗?"><span>导出EXCEL</span></a></li> </ul> </div> <table class="table" width="99%" layoutH="260" rel="jbsxBox"> <thead> <tr> <th width="80">序号</th> <th width="120" orderField="number" class="asc">诊所编号</th> <th orderField="name">诊所名称</th> <th width="100">病人编号</th> <th width="100">病人姓名</th> <th width="120">尿检日期</th> <th width="100">尿检结果</th> <th width="80">检验次数</th> </tr> </thead> <tbody> <tr target="sid_obj" rel="1"> <td>1</td> <td>bj0001</td> <td>xxx诊所</td> <td>xxx</td> <td>张三</td> <td>2011-9-6</td> <td>xxx</td> <td>1</td> </tr> <tr target="sid_obj" rel="2"> <td>1</td> <td>bj0001</td> <td>xxx诊所</td> <td>xxx</td> <td>李四</td> <td>2011-9-6</td> <td>xxx</td> <td>1</td> </tr> <tr target="sid_obj" rel="1"> <td>1</td> <td>bj0001</td> <td>xxx诊所</td> <td>xxx</td> <td>张三</td> <td>2011-9-6</td> <td>xxx</td> <td>1</td> </tr> <tr target="sid_obj" rel="2"> <td>1</td> <td>bj0001</td> <td>xxx诊所</td> <td>xxx</td> <td>李四</td> <td>2011-9-6</td> <td>xxx</td> <td>1</td> </tr> <tr target="sid_obj" rel="1"> <td>1</td> <td>bj0001</td> <td>xxx诊所</td> <td>xxx</td> <td>张三</td> <td>2011-9-6</td> <td>xxx</td> <td>1</td> </tr> <tr target="sid_obj" rel="2"> <td>1</td> <td>bj0001</td> <td>xxx诊所</td> <td>xxx</td> <td>李四</td> <td>2011-9-6</td> <td>xxx</td> <td>1</td> </tr> <tr target="sid_obj" rel="1"> <td>1</td> <td>bj0001</td> <td>xxx诊所</td> <td>xxx</td> <td>张三</td> <td>2011-9-6</td> <td>xxx</td> <td>1</td> </tr> <tr target="sid_obj" rel="2"> <td>1</td> <td>bj0001</td> <td>xxx诊所</td> <td>xxx</td> <td>李四</td> <td>2011-9-6</td> <td>xxx</td> <td>1</td> </tr> <tr target="sid_obj" rel="1"> <td>1</td> <td>bj0001</td> <td>xxx诊所</td> <td>xxx</td> <td>张三</td> <td>2011-9-6</td> <td>xxx</td> <td>1</td> </tr> <tr target="sid_obj" rel="2"> <td>1</td> <td>bj0001</td> <td>xxx诊所</td> <td>xxx</td> <td>李四</td> <td>2011-9-6</td> <td>xxx</td> <td>1</td> </tr> <tr target="sid_obj" rel="1"> <td>1</td> <td>bj0001</td> <td>xxx诊所</td> <td>xxx</td> <td>张三</td> <td>2011-9-6</td> <td>xxx</td> <td>1</td> </tr> <tr target="sid_obj" rel="2"> <td>1</td> <td>bj0001</td> <td>xxx诊所</td> <td>xxx</td> <td>李四</td> <td>2011-9-6</td> <td>xxx</td> <td>1</td> </tr> </tbody> </table> <div class="panelBar"> <div class="pages"> <span>显示</span> <select class="combox" name="numPerPage" onchange="navTabPageBreak({numPerPage:this.value}, 'jbsxBox')"> <option value="20">20</option> <option value="50">50</option> <option value="100">100</option> <option value="200">200</option> </select> <span>条,共50条</span> </div> <div class="pagination" rel="jbsxBox" totalCount="200" numPerPage="20" pageNumShown="5" currentPage="1"></div> </div> </div>
zyroot
trunk/admin/dwz1.4.5/demo/pagination/list1.html
HTML
art
5,425
<div class="pageContent"> <form method="post" action="demo/pagination/ajaxDone2.html" class="pageForm required-validate" onsubmit="return validateCallback(this, dialogAjaxDone)"> <div class="pageFormContent" layoutH="58"> <div class="unit"> <label>病历号:</label> <input type="text" name="patientNo" size="30" minlength="6" maxlength="20" class="required" /> </div> <div class="unit"> <label>病人姓名:</label> <input type="text" name="patientNames" size="30" class="required" readonly/> </div> </div> <div class="formBar"> <ul> <li><div class="buttonActive"><div class="buttonContent"><button type="submit">提交</button></div></div></li> <li><div class="button"><div class="buttonContent"><button type="button" class="close">取消</button></div></div></li> </ul> </div> </form> </div>
zyroot
trunk/admin/dwz1.4.5/demo/pagination/dialog2.html
HTML
art
888
{ "statusCode":"200", "message":"\u64cd\u4f5c\u6210\u529f", "navTabId":"", "rel":"jbsxBox", "callbackType":"", "forwardUrl":"", "confirmMsg":"" }
zyroot
trunk/admin/dwz1.4.5/demo/pagination/ajaxDone3.html
HTML
art
162
{ "statusCode":"200", "message":"\u64cd\u4f5c\u6210\u529f", "navTabId":"", "rel":"", "callbackType":"", "forwardUrl":"", "confirmMsg":"" }
zyroot
trunk/admin/dwz1.4.5/demo/common/ajaxDone.html
HTML
art
155
{ "statusCode":"301", "message":"\u4f1a\u8bdd\u8d85\u65f6\uff0c\u8bf7\u91cd\u65b0\u767b\u5f55\u3002", "navTabId":"", "callbackType":"", "forwardUrl":"" }
zyroot
trunk/admin/dwz1.4.5/demo/common/ajaxTimeout.html
HTML
art
166
新建窗口3
zyroot
trunk/admin/dwz1.4.5/newPage3.html
HTML
art
13
<h2 class="contentTitle">编辑器</h2> <div style="display:block; overflow:hidden; padding:0 10px; line-height:21px;"> <div class="tabs"> <div class="tabsHeader"> <div class="tabsHeaderContent"> <ul> <li class="selected"><a href="javascript:;"><span>示例</span></a></li> <li><a href="javascript:;"><span>代码</span></a></li> </ul> </div> </div> <div class="tabsContent" layoutH="100"> <div> <form method="post" action="demo/common/ajaxTimeout.html" class="pageForm required-validate" onsubmit="return iframeCallback(this)"> <div class="pageFormContent" layoutH="158"> <div class="unit"> <textarea class="editor" name="description" rows="8" cols="100" upLinkUrl="upload.php" upLinkExt="zip,rar,txt" upImgUrl="upload.php" upImgExt="jpg,jpeg,gif,png" upFlashUrl="upload.php" upFlashExt="swf" upMediaUrl="upload.php" upMediaExt:"avi"> <strong>xheditor + 文件上传</strong><br/> upLinkUrl:超链接上传接口地址<br/> upLinkExt:超链接本地上传扩展限制 【可选】【默认值: zip,rar,txt】<br/> upImgUrl:图片上传接口地址<br/> upImgExt:图片本地上传扩展限制 【可选】【默认值:jpg,jpeg,gif,png】<br/> upFlashUrl:动画上传接口地址<br/> upFlashExt:动画本地上传扩展限制 【可选】【默认值: swf】<br/> upMediaUrl:视频上传接口地址<br/> upMediaExt:视频本地上传扩展限制 【可选】【默认值: avi】 </textarea> </div> <div class="unit"> <textarea class="editor" name="description" rows="6" cols="100">full(完全) 默认方式</textarea> </div> <div class="unit"> <textarea class="editor" name="description" rows="6" cols="100" tools="mfull">mfull(多行完全)</textarea> </div> <div class="unit"> <textarea class="editor" name="description" rows="6" cols="100" tools="simple">simple(简单)</textarea> </div> <div class="unit"> <textarea class="editor" name="description" rows="6" cols="100" tools="mini">mini(迷你)</textarea> </div> <div class="unit"> <textarea class="editor" name="description" rows="6" cols="100" tools="Cut,Copy,Paste,Pastetext,|,Source,Fullscreen,About">custom(自定义)</textarea> </div> <div class="unit"> <textarea class="editor" name="description" rows="6" cols="100" tools="Cut,Copy,Paste,Pastetext,/,Source,Fullscreen,About">自定义多行模式</textarea> </div> </div> <div class="formBar"> <ul> <li><div class="buttonActive"><div class="buttonContent"><button type="submit">提交</button></div></div></li> <li><div class="button"><div class="buttonContent"><button type="button" class="close">取消</button></div></div></li> </ul> </div> </form> </div> <div> <textarea rows="15" cols="90"> 说明: textarea class="editor" 自动加载在线编辑器. 注意textarea name 属性不能为空 </textarea> </div> </div> <div class="tabsFooter"> <div class="tabsFooterContent"></div> </div> </div> </div>
zyroot
trunk/admin/dwz1.4.5/w_editor.html
HTML
art
3,199
<script type="text/javascript"> function closedialog(param) { alert(param.msg); return true; } </script> <h2 class="contentTitle">弹出窗口</h2> <div class="pageContent" layoutH="42"> <div style="float:left; display:block; overflow:hidden; width:400px; padding:0 10px; line-height:21px;"> <a class="button" href="demo_page1.html" target="dialog" rel="dlg_page1" max="true" title="打开窗口1 [自定义标题]" width="800" height="480"><span>打开窗口1</span></a><br /><br /> <a class="button" href="demo_page1.html" target="dialog" rel="dlg_page2"><span>打开窗口2</span></a><br /><br /> <a class="button" href="demo_page2.html" target="dialog" rel="dlg_page2" width="645" height="370" fresh="false"><span>打开窗口3</span></a><br /><br /> <div class="divider"></div> <a class="button" href="demo_page1.html" target="dialog" rel="dlg_page4" title="打开窗口4 [自定义标题]"><span>打开窗口4</span></a><br /><br /> <a class="button" href="demo_page2.html" target="dialog" rel="dlg_page5" close="closedialog" param="{msg:'gogo'}"><span>打开窗口5</span></a><br /><br /> <a class="button" href="demo_page2.html" target="dialog" rel="dlg_page5"><span>打开窗口6</span></a> </div> <div style="float:left; display:block; overflow:hidden; width:400px; padding:0 10px; line-height:21px;"> <a class="button" href="demo_page1.html" target="dialog" rel="dlg_page7"><span>打开窗口7</span></a><br /><br /> <a class="button" href="demo_page4.html" target="dialog" rel="dlg_page8"><span>打开窗口8</span></a><br /><br /> <a class="button" href="demo_page4.html" target="dialog" rel="dlg_page9"><span>打开窗口9</span></a><br /><br /> <div class="divider"></div> <a class="button" href="demo_page1.html" target="dialog" rel="dlg_page10" mask="true" title="模态窗口1 [自定义标题]"><span>模态窗口1</span></a><br /><br /> <a class="button" href="demo_page2.html" target="dialog" rel="dlg_page11" mask="true"><span>模态窗口2</span></a><br /><br /> <a class="button" href="demo_page2.html" target="dialog" rel="dlg_page12" mask="true"><span>模态窗口3</span></a><br /><br /> </div> </div>
zyroot
trunk/admin/dwz1.4.5/w_dialog.html
HTML
art
2,194
<div class="pageContent"> <form method="post" action="demo/common/ajaxDone.html" class="pageForm required-validate" onsubmit="return validateCallback(this, dialogAjaxDone)"> <div class="pageFormContent" layoutH="58"> <div class="unit"> <label>旧密码:</label> <input type="password" name="oldPassword" size="30" minlength="6" maxlength="20" class="required" /> </div> <div class="unit"> <label>新密码:</label> <input type="password" id="cp_newPassword" name="newPassword" customvalid="customvalidPwd(element)" title="customvalid:111111 不是合法的密码" size="30" minlength="6" maxlength="20" class="required alphanumeric"/> </div> <div class="unit"> <label>重复输入新密码:</label> <input type="password" name="rnewPassword" size="30" equalTo="#cp_newPassword" class="required alphanumeric"/> </div> </div> <div class="formBar"> <ul> <li><div class="buttonActive"><div class="buttonContent"><button type="submit">提交</button></div></div></li> <li><div class="button"><div class="buttonContent"><button type="button" class="close">取消</button></div></div></li> </ul> </div> </form> </div> <script type="text/javascript"> function customvalidPwd(element){ if ($(element).val() == "111111") return false; return true; } </script>
zyroot
trunk/admin/dwz1.4.5/changepwd.html
HTML
art
1,369
<div class="accordion" fillSpace="sideBar"> <div class="accordionHeader"> <h2><span>Folder</span>界面组件</h2> </div> <div class="accordionContent"> <ul class="tree treeFolder"> <li><a href="tabsPage.html" target="navTab">框架面板</a></li> </ul> </div> <div class="accordionHeader"> <h2><span>Folder</span>典型页面</h2> </div> <div class="accordionContent"> <ul class="tree treeFolder treeCheck"> <li><a href="demo_upload.html" target="navTab" rel="demo_upload">文件上传表单提交示例</a></li> <li><a href="demo_page1.html" target="navTab" rel="demo_page1">查询我的客户</a></li> <li><a href="demo_page1.html" target="navTab" rel="demo_page2">表单查询页面</a></li> <li><a href="demo_page4.html" target="navTab" rel="demo_page4">表单录入页面</a></li> <li><a href="demo_page5.html" target="navTab" rel="demo_page5">有文本输入的表单</a></li> </ul> </div> <div class="accordionHeader"> <h2><span>Folder</span>流程演示</h2> </div> <div class="accordionContent"> <ul class="tree"> <li><a href="newPage1.html" target="dialog" rel="dlg_page">列表</a></li> </ul> </div> </div>
zyroot
trunk/admin/dwz1.4.5/sidebar_1.html
HTML
art
1,202
<div class="accountInfo"> <div class="alertInfo"> <!-- <h2>最新消息:</h2> <a href="">深交所:中小散户是股票上市首日买入主体 占比56%</a> --> <h2><a href="doc/dwz-user-guide.pdf" target="_blank">DWZ框架使用手册下载</a></h2> <a href="doc/dwz-user-guide.swf" target="_blank">DWZ框架视频教材下载</a> </div> <div class="right"> <p>待办工作32项,消息212条</p> <p>07月12日,星期二</p> </div> <p><span>DWZ富客户端框架 </span></p> <p><a href="demo_page2.html" target="dialog">DWZ小组</a></p> </div> <div class="pageCentent"> <textarea layoutH="80" style="width:98%"> DWZ富客户端框架设计目标是简单实用、扩展方便、快速开发、RIA思路、轻量级 DWZ支持用html扩展的方式来代替javascript代码, 基本可以保证程序员不董javascript, 也能使用各种页面组件和ajax技术. 如果有特定需求也可以扩展DWZ做定制化开化. DWZ基于jQuery可以非常方便的定制特定需求的UI组件, 并以jQuery插件的形式发布. DWZ富客户端框架完全开源,可以免费获取全部源码。团队中的每个人都是开源的拥护者,都希望为中国软件开源事业尽自己的一份力量。 在线演示地址 http://demo.dwzjs.com 在线文档 http://demo.dwzjs.com/doc/dwz-user-guide.pdf DWZ框架Ajax开发视频教材 http://demo.dwzjs.com/doc/dwz-ajax-develop.swf DWZ框架演示视频 http://demo.dwzjs.com/doc/dwz-user-guide.swf Google Code下载: http://code.google.com/p/dwz/ 学习DWZ的建议: 通读DWZ文档,很多新手提的问题文档中都写了 看demo每个组件演示效果和代码(留意组件html结构) 建议安装firebug,用firebug看html结构、CSS和调试JS都非常方便。见附录一 firebug介绍 对于初学者不建议看DWZ全部源码,但还是非常有必要看看dwz.ui.js和dwz.ajax.js 可以从google code下载dwz_thinkphp版本,结合php后台去理解DWZ和服务器端的交互方式 DWZ区别于其它JS框架,最大的优点: 完全开源,源码没有做任何混淆处理,方便扩展 CSS和js代码彻底分离,修改样式方便 简单实用,扩展方便,轻量级框架,快速开发 仍然保留了html的页面布局方式 支持HTML扩展方式调用UI组件,开发人员不需写js 只要懂html语法不需精通js,就可以使用ajax开发后台 基于jQuery,UI组件以jQuery插件的形式发布,扩展方便 DWZ研发组联系方式: DWZ创始人: [北京]杜权(UI设计) d@j-ui.com [杭州]吴平(Ajax开发) w@j-ui.com [北京]张慧华(Ajax开发) z@j-ui.com 新加入成员: [北京]张涛 QQ:122794105 [北京]冀刚 QQ:63502308 jiweigang2008@tom.com [北京]郑应海 QQ:55691650 [成都]COCO QQ:80095667 官方微博(欢迎加入) http://weibo.com/dwzui jQuery.DWZ-jUI-1群(满员) 369203 jQuery.DWZ-jUI-2群(满员) 69611933 jQuery.DWZ-jUI-3群(满员) 20866231 jQuery.DWZ-jUI-4群(满员) 234274529 jQuery.DWZ-jUI-5群(满员) 85031937 jQuery.DWZ-jUI-6群(欢迎加入) 172602882 jQuery.DWZ-jUI-7群(满员) 210322217 jQuery.DWZ-jUI-8群(欢迎加入) 139067378 </textarea> </div>
zyroot
trunk/admin/dwz1.4.5/main.html
HTML
art
3,252
<h2 class="contentTitle">文本框/文本域</h2> <div class="pageFormContent" layoutH="60"> <fieldset> <legend>单行文本框</legend> <dl> <dt>普通输入框:</dt> <dd><input name="field1" type="text" /></dd> </dl> <dl> <dt>提示信息:</dt> <dd><input name="field2" type="text" alt="提示信息"/></dd> </dl> <dl> <dt>必填:</dt> <dd><input class="required" name="field3" type="text" /></dd> </dl> <dl> <dt>错误:</dt> <dd><input class="error" name="field4" type="text" /></dd> </dl> <dl> <dt>只读:</dt> <dd><input readonly="true" name="field5" type="text" /></dd> </dl> <dl> <dt>禁用:</dt> <dd><input disabled="true" name="field6" type="text" /></dd> </dl> <dl> <dt>密码:</dt> <dd><input name="password" type="text" /></dd> </dl> </fieldset> <fieldset> <legend>多行文本框(文本域)</legend> <dl class="nowrap"> <dt>普通文本框:</dt> <dd><textarea name="textarea1" cols="80" rows="2"></textarea></dd> </dl> <dl class="nowrap"> <dt>必填:</dt> <dd><textarea name="textarea2" cols="80" rows="2"></textarea></dd> </dl> <dl class="nowrap"> <dt>错误:</dt> <dd><textarea name="textarea3" class="error" cols="80" rows="2"></textarea></dd> </dl> <dl class="nowrap"> <dt>只读:</dt> <dd><textarea name="textarea4" readonly="true" cols="80" rows="2"></textarea></dd> </dl> <dl class="nowrap"> <dt>禁用:</dt> <dd><textarea name="textarea5" disabled="true" cols="80" rows="2"></textarea></dd> </dl> </fieldset> </div>
zyroot
trunk/admin/dwz1.4.5/w_textInput.html
HTML
art
1,654
<h2 class="contentTitle">团队格言</h2> <div class="pageContent"> <div class="pageFormContent" layoutH="97"> 1.保持简单直白(Keep It Simple Stupid)<br/><br/> 2.不要自我复制(Don’t Repeat Yourself)<br/><br/> 3.能干的人解决问题。智慧的人绕开问题(A clever person solves a problem. A wise person avoids it)<br/><br/> 4.沉默会被理解为赞同(Silence is construed as approval)<br/><br/> 5.没有火就不会有烟(There is no smoke without fire)<br/><br/> 6.先想好,后编程(Think first, Program later)<br/><br/> </div> <div class="formBar"> <ul> <li><div class="button"><div class="buttonContent"><button class="close" type="button">不再显示</button></div></div></li> </ul> </div> </div>
zyroot
trunk/admin/program_maxim.php
Hack
art
812
<script type="text/javascript"> setTimeout(function(){ <?php if($data['dialogId']){?> $.pdialog.close('<?php echo $data['dialogId'];?>'); <?php }?> <?php if($data['message']){?> <?php if($data['statusCode'] == 200){?> alertMsg.correct('<?php echo $data['message']?>'); <?php }else{?> alertMsg.error('<?php echo $data['message']?>'); <?php }?> <?php }?> <?php if($data['navTabId']){?> navTab.reloadFlag('<?php echo $data['navTabId'];?>'); <?php }?> },0); </script>
zyroot
trunk/admin/html/page_error.php
PHP
art
507
<h2 class="contentTitle">编辑角色</h2> <form action="<?php echo site_url('/ajax/aj_edit_role.php');?>" method="post" class="pageForm required-validate" onsubmit="return validateCallback(this, dialogAjaxDone)"> <div class="pageContent"> <div class="pageFormContent" layoutH="97"> <div class="unit"> <label>角色名:</label> <input type="text" name="role_name" size="25" class="required textInput valid" value="<?php echo $role_info['role_name']?>"><input type="hidden" name="role_id" value="<?php echo $role_info['role_id']?>"> <span class="inputInfo">填写角色名称</span> </div> </div> <div class="formBar"> <ul> <li><div class="buttonActive"><div class="buttonContent"><button type="submit">确定</button></div></div></li> <li><div class="button"><div class="buttonContent"><button class="close" type="button">关闭</button></div></div></li> </ul> </div> </div> </form>
zyroot
trunk/admin/html/edit_role.php
PHP
art
961
<h2 class="contentTitle">添加分类</h2> <form action="<?php echo site_url('/ajax/aj_add_cate.php');?>" method="post" class="pageForm required-validate" onsubmit="return validateCallback(this, dialogAjaxDone)"> <div class="pageContent"> <div class="pageFormContent" layoutH="97"> <div class="unit"> <label>分类名:</label> <input type="text" name="cate_name" size="25" class="required textInput valid"> <span class="inputInfo">填写分类名称</span> </div> <div class="unit"> <label>所属分类:</label> <input name="parent_cate_id" type="hidden"/> <input type="text" name="parent_cate_name" size="25" class="textInput" readonly=""> <a class="btnLook" target="dialog" width="300" href="<?php echo site_url('cate.php?a=catetree');?>" rel="cate_tree">选择父级分类</a> <span class="inputInfo">点击选择父级分类</span> </div> <div class="unit"> <label>资源链接:</label> <input type="text" name="action" size="25" class="textInput"> <span class="inputInfo">父类请留空</span> </div> <div class="unit"> <label>权限组:</label> <input name="role_ids" type="hidden"/> <textarea rows="2" cols="30" class="textInput" name="role_names" readonly=""></textarea> <a class="btnLook" target="dialog" href="<?php echo site_url('role.php?a=lookup&rel=add_cate');?>" rel="role_lookup">选择所属权限组</a> <span class="inputInfo">点击选择权限组</span> </div> <div class="unit"> <label>是否显示:</label> <select class="combox" name="is_show"> <option value="0">否</option> <option value="1" selected="">是</option> </select> <span class="inputInfo">是否显示在右侧菜单栏</span> </div> </div> <div class="formBar"> <ul> <li><div class="buttonActive"><div class="buttonContent"><button type="submit">确认</button></div></div></li> <li><div class="button"><div class="buttonContent"><button class="close" type="button">关闭</button></div></div></li> </ul> </div> </div> </form>
zyroot
trunk/admin/html/add_cate.php
PHP
art
2,283
<div class="pageHeader"> <form rel="pagerForm" method="post" action="dwzOrgLookup.html" onsubmit="return dwzSearch(this, 'dialog');"> <div class="searchBar"> <table class="searchContent"> <tr> <td> 用户名:<input type="text" name="user_name" /> </td> <td><div class="button"><div class="buttonContent"><button type="submit">检索</button></div></div></td> </tr> </table> </div> </form> </div> <div class="pageContent"> <table class="table" width="100%" targettype="dialog" layoutH="97"> <thead> <tr> <th width="22" align="center"></th> <th width="30" align="center">ID</th> <th width="50" align="center">用户名</th> </tr> </thead> <tbody> <?php foreach($users as $v){?> <tr target="sid" rel="<?php echo $v['user_id'];?>"> <td><input name="user_id" value="<?php echo $v['user_id'];?>" type="checkbox"></td> <td><?php echo $v['user_id'];?></td> <td><?php echo $v['user_name'];?></td> </tr> <?php }?> </tbody> </table> <div class="formBar"> <ul> <li><a class="button" href="javascript:void(0);" onclick="lookUserCallBack2();"><span>确认</span></a></li> <li><div class="button"><div class="buttonContent"><button class="close" type="button">关闭</button></div></div></li> </ul> </div> </div> <script type="text/javascript"> function lookUserCallBack2(){ var dialog = $("body").data('look_user3'); var user_ids = []; dialog.find("input:checked").filter("[name='user_id']").each(function(i){ user_ids.push($(this).val()); }); $.post('<?php echo site_url("/ajax/aj_add_funuser.php"); ?>',{user_ids:user_ids,fun_id:<?php echo $fun_id?>},function(data){ if(data.statusCode == 200){ var url = $("body").data('show_fun').data('url'); $.pdialog.reload(url,{dialogId:'show_fun'}); $.pdialog.closeCurrent(); }else{ alertMsg.error(data.message); } }); } (function($){ setTimeout(function(){//这里代码有延迟事件,所以用setTimeout调整执行顺序 var dialog = $("body").data('look_user3'); dialog.find("td").bind('click',function(e){ if(!$(e.target).is(':input')){ var $obj = $(this).closest('tr').children('td:first').find('input'); $obj.attr('checked',!$obj.attr('checked')); } }); },0); })(jQuery); </script>
zyroot
trunk/admin/html/look_user3.php
PHP
art
2,589
<form id="pagerForm" method="post" action="<?php echo site_url('index.php?m=cate');?>"> <input type="hidden" name="pageNum" value="1" /> <input type="hidden" name="numPerPage" value="<?php echo $list['pager']->per_page;?>" /> <input type="hidden" name="cate_name" value="<?php echo $_input->post('cate_name');?>" /> <input type="hidden" name="action" value="<?php echo $_input->post('action');?>" /> </form> <div class="pageHeader"> <form onsubmit="return navTabSearch(this);" action="<?php echo site_url('index.php?m=cate');?>" method="post"> <div class="searchBar"> <table class="searchContent"> <tr> <td> 分类名:<input type="text" name="cate_name" value="<?php echo $_input->post('cate_name');?>"/> </td> <td> 资源:<input type="text" name="action" value="<?php echo $_input->post('action');?>"/> </td> <td><div class="button"><div class="buttonContent"><button type="submit">检索</button></div></div></td> </tr> </table> </div> </form> </div> <div class="pageContent"> <div class="panelBar"> <ul class="toolBar"> <li><a class="add" href="<?php echo site_url('index.php?m=cate&a=add');?>" target="dialog" height="400" rel="add_cate"><span>添加</span></a></li> <li class="line">line</li> <li><a class="delete" href="<?php echo site_url('index.php?m=cate&a=del');?>&cate_id={sid}" target="ajaxTodo" title="确定要删除吗?"><span>删除</span></a></li> <li class="line">line</li> <li><a class="edit" href="<?php echo site_url('index.php?m=cate&a=edit');?>&cate_id={sid}" target="dialog" height="400"><span>修改</span></a></li> </ul> </div> <table class="table" width="100%" layoutH="138"> <thead> <tr> <th width="30" align="center">ID</th> <th width="80" align="center">分类名称</th> <th width="80">资源</th> <th width="50" align="center">是否显示</th> <th width="50" align="center">左值</th> <th width="50" align="center">右值</th> <th width="50" align="center">父类ID</th> <th width="50" align="center">操作</th> </tr> </thead> <tbody> <?php foreach($list['rs'] as $v){?> <tr target="sid" rel="<?php echo $v['cate_id'];?>"> <td><?php echo $v['cate_id'];?></td> <td><?php echo $v['cate_name'];?></td> <td><?php echo $v['action'];?></td> <td><?php echo $v['is_show'] ? '<span style="color:green;">是</span>':'<span style="color:red">否</span>';?></td> <td><?php echo $v['left_value'];?></td> <td><?php echo $v['right_value'];?></td> <td><?php echo $v['parent_cate_id'];?></td> <td><a href="<?php echo site_url('index.php?m=cate&a=edit');?>&cate_id=<?php echo $v['cate_id'];?>" target="dialog" height="400" rel="edit_cate">编辑</a> | <a href="<?php echo site_url('index.php?m=cate&a=del');?>&cate_id=<?php echo $v['cate_id'];?>" target="ajaxTodo" title="确定要删除吗?">删除</a></td> </tr> <?php }?> </tbody> </table> <div class="panelBar"> <div class="pages"> <span>显示</span> <?php $_pager_num_type = array(30,50,100); ?> <select class="combox" name="numPerPage" change="navTabPageBreak" param="numPerPage"> <?php foreach($_pager_num_type as $v){ echo '<option value="'.$v.'" '.($list['pager']->per_page == $v ? 'selected':'').'>'.$v.'</option>'; } ?> </select> <span>条,共<?php echo $list['pager']->getTotalCount();?>条</span> </div> <div class="pagination" targetType="navTab" totalCount="<?php echo $list['pager']->getTotalCount();?>" numPerPage="<?php echo $list['pager']->per_page;?>" pageNumShown="5" currentPage="<?php echo $list['pager']->curr_page;?>"></div> </div> </div>
zyroot
trunk/admin/html/cate.php
PHP
art
4,070
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>提示信息</title> <style type="text/css"> *{margin:0;padding:0px} body{background:#fff;color:#333;font:12px Verdana, Tahoma, sans-serif;text-align:center;margin:0 auto;} a{text-decoration:none;color:#29458C} a:hover{text-decoration:underline;color:#f90} #msg{border:1px solid #c5d7ef;text-align:left;margin:10% auto; width:50%} #msgtitle{padding:5px 10px;background:#f0f6fb;border-bottom:1px #c5d7ef solid} #msgtitle h1{font-size:14px;font-weight:bold;padding-left:10px;border-left:3px solid #acb4be;color:#1f3a87} #msgcontent {padding:20px 50px;} #msgcontent li{display:block;padding:5px;list-style:none;} #msgcontent p{text-align:center;margin-top:10px;padding:0} </style> </head> <body> <div id="msg"> <div id="msgtitle"> <h1>提示信息</h1> </div> <div id="msgcontent"> <p><?php echo $message;?></p> </div> </div> <?php if($url){?> <script type="text/javascript"> setTimeout(function(){window.location.href = '<?php echo $url;?>';},2000); </script> <?php }?> </body> </html>
zyroot
trunk/admin/html/error.php
PHP
art
1,131
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>风险管理平台</title> <link href="<?php echo site_url('dwz1.4.5/themes/css/login.css');?>" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="<?php echo site_url('dwz1.4.5/js/jquery-1.7.2.min.js');?>"></script> </head> <body> <div id="login"> <div id="login_header"> <h1 class="login_logo"> <a href="http://demo.dwzjs.com"><img src="<?php echo site_url('dwz1.4.5/themes/default/images/login_logo.gif');?>" /></a> </h1> <div class="login_headerContent"> <div class="navList"> <ul> <li><a href="#">设为首页</a></li> <li><a href="http://bbs.dwzjs.com">反馈</a></li> <li><a href="doc/dwz-user-guide.pdf" target="_blank">帮助</a></li> </ul> </div> <h2 class="login_title"><img src="<?php echo site_url('dwz1.4.5/themes/default/images/login_title.png');?>" /></h2> </div> </div> <div id="login_content"> <div class="loginForm"> <form id="login_form" method="post" action="<?php echo site_url('index.php?m=user&a=login');?>"> <p> <label>用户名:</label> <input type="text" name="user_name" size="20" class="login_input" /> </p> <p> <label>密码:</label> <input type="password" name="password" size="20" class="login_input" /> </p> <div class="login_bar"> <input class="sub" type="submit" value=" " style="margin-left: 10px"/> </div> </form> </div> <div class="login_banner"><img src="<?php echo site_url('dwz1.4.5/themes/default/images/login_banner.jpg');?>" /></div> <div class="login_main"> <ul class="helpList"> <li><a href="#">下载驱动程序</a></li> <li><a href="#">如何安装密钥驱动程序?</a></li> <li><a href="#">忘记密码怎么办?</a></li> <li><a href="#">为什么登录失败?</a></li> </ul> <div class="login_inner"> <p>您可以使用 网易网盘 ,随时存,随地取</p> <p>您还可以使用 闪电邮 在桌面随时提醒邮件到达,快速收发邮件。</p> <p>在 百宝箱 里您可以查星座,订机票,看小说,学做菜…</p> </div> </div> </div> <div id="login_footer"> Copyright &copy; 2009 www.dwzjs.com Inc. All Rights Reserved. </div> </div> <script type="text/javascript"> (function($){ $('#login_form').submit(function(){ fel = $('input[name="user_name"]'); if($.trim(fel.val()) == ''){ alert('用户名不能为空!'); fel.focus(); return false; } fel = $('input[name="password"]'); if($.trim(fel.val()) == ''){ alert('密码不能为空!'); fel.focus(); return false; } }); })(jQuery); </script> </body> </html>
zyroot
trunk/admin/html/login.php
PHP
art
3,175
<?php function getTree($data,$cate_ids) { $html = ''; foreach($data as $k => $v) { if(isset($v['cate_child'])) { //父亲找到儿子 $checked = (in_array($v['cate_id'],$cate_ids) ? 'checked="true"':''); $html .= '<li><a tname="cate_ids" tvalue="'.$v['cate_id'].'" '.$checked.'>'.$v['cate_name'].'</a>'; $html .= getTree($v['cate_child'],$cate_ids); $html .= '</li>'; }else{ $checked = (in_array($v['cate_id'],$cate_ids) ? 'checked="true"':''); $html .= '<li><a tname="cate_ids" tvalue="'.$v['cate_id'].'" '.$checked.'>'.$v['cate_name'].'</a></li>'; } } return '<ul tree treeFolder>'.$html.'</ul>'; } $parent_array = array();//记录每一个父节点的地址引用 $tree_array = array();//整颗树的数组 foreach($menu_arr as $v){ $node_num = ($v['right_value']-$v['left_value'] - 1)/2; if($v['parent_cate_id']){//如果没有parent_cate_id则是顶层 $parent_array[$v['parent_cate_id']]['cate_child'][$v['cate_id']] = $v; if($node_num > 0){ $parent_array[$v['cate_id']] = &$parent_array[$v['parent_cate_id']]['cate_child'][$v['cate_id']]; } }else{ $tree_array[$v['cate_id']] = $v; if($node_num > 0){ $parent_array[$v['cate_id']] = &$tree_array[$v['cate_id']]; } } } ?> <div class="pageContent"> <div class="pageFormContent" layoutH="60"> <ul class="tree treeFolder treeCheck expand" id="_select_cate"> <li><a tname="cate_ids" tvalue="0">管理中心</a> <?php echo getTree($tree_array,$cate_ids);?> </li> </ul> </div> <div class="formBar"> <ul> <li><a class="button" href="javascript:void(0);" onclick="roleTreeCallBack();"><span>确认</span></a></li> <li><div class="button"><div class="buttonContent"><button class="close" type="button">关闭</button></div></div></li> </ul> </div> </div> <script type="text/javascript"> function roleTreeCallBack(){ var dialog = $("body").data('role_cate_tree'); var el = dialog.find("div.ckbox.checked,div.ckbox.indeterminate"); var ids = []; el.each(function(){ ids.push($(this).children(':checkbox').val()); }); $.post('<?php echo site_url("/ajax/aj_set_cate_role.php"); ?>',{cate_ids:ids,role_id:<?php echo $role_id?>},function(data){ if(data.statusCode == 200){ alertMsg.correct(data.message); $.pdialog.closeCurrent(); }else{ alertMsg.error(data.message); } }); } </script>
zyroot
trunk/admin/html/role_cate_tree.php
PHP
art
2,839
<h2 class="contentTitle">编辑用户</h2> <form action="<?php echo site_url('/ajax/aj_edit_user.php');?>" method="post" class="pageForm required-validate" onsubmit="return validateCallback(this, dialogAjaxDone)"> <div class="pageContent"> <div class="pageFormContent" layoutH="97"> <div class="unit"> <label>用户名:</label> <?php if($is_super_admin){?> <input type="text" name="user_name" value="<?php echo $user_info['user_name'];?>" class="required textInput valid"/> <?php }else{?> <?php echo $user_info['user_name'];?> <?php }?> <input type="hidden" name="user_id" value="<?php echo $user_info['user_id'];?>"> </div> <div class="unit"> <label>旧密码:</label> <input type="password" name="password" size="25" class="textInput"> <span class="inputInfo">原来的登录密码</span> </div> <div class="unit"> <label>新密码:</label> <input type="password" name="newpassword" size="25" class="textInput"> <span class="inputInfo">要修改的密码</span> </div> <div class="unit"> <label>确认密码:</label> <input type="password" name="repassword" size="25" class="textInput"> <span class="inputInfo">确认要修改的密码</span> </div> <?php if($editrole){?> <div class="unit"> <label>权限组:</label> <input name="role_ids" type="hidden" value="<?php echo $role_ids;?>"/> <textarea rows="2" cols="30" class="textInput" name="role_names" readonly=""><?php echo $role_names;?></textarea> <a class="btnLook" target="dialog" href="<?php echo site_url('role.php?a=lookup&rel=edit_user');?>" rel="role_lookup">选择所属权限组</a> <span class="inputInfo">点击选择权限组</span> </div> <?php }?> <div class="unit"> <label>邮箱:</label> <input type="text" name="email" size="25" class="email textInput valid" value="<?php echo $user_info['email'];?>"> <span class="inputInfo">联系使用</span> </div> <div class="unit"> <label>联系电话:</label> <input type="text" name="tel" size="25" class="phone textInput valid" value="<?php echo $user_info['tel'];?>"> <span class="inputInfo">联系使用</span> </div> </div> <div class="formBar"> <ul> <li><div class="buttonActive"><div class="buttonContent"><button type="submit">保存</button></div></div></li> <li><div class="button"><div class="buttonContent"><button class="close" type="button">关闭</button></div></div></li> </ul> </div> </div> </form>
zyroot
trunk/admin/html/edit_user.php
PHP
art
2,815
<div class="pageHeader"> <form rel="pagerForm" method="post" action="dwzOrgLookup.html" onsubmit="return dwzSearch(this, 'dialog');"> <div class="searchBar"> <table class="searchContent"> <tr> <td> 角色名:<input type="text" name="user_name" /> </td> <td><div class="button"><div class="buttonContent"><button type="submit">检索</button></div></div></td> </tr> </table> </div> </form> </div> <div class="pageContent"> <table class="table" width="100%" targettype="dialog" layoutH="97"> <thead> <tr> <th width="22" align="center"><input type="checkbox" group="role_ids" class="checkboxCtrl" name="all_role_id"></th> <th width="30" align="center">ID</th> <th width="50" align="center">角色名称</th> </tr> </thead> <tbody> <?php foreach($roles as $v){?> <tr target="sid" rel="<?php echo $v['role_id'];?>"> <td><input name="role_ids" value="<?php echo $v['role_id'];?>" type="checkbox" <?php if(in_array($v['role_id'],$role_ids)) echo 'checked';?>></td> <td><?php echo $v['role_id'];?></td> <td><?php echo $v['role_name'];?></td> </tr> <?php }?> </tbody> </table> <div class="formBar"> <ul> <li><a class="button" href="javascript:void(0);" onclick="setUserRoleCallBack();"><span>确认</span></a></li> <li><div class="button"><div class="buttonContent"><button class="close" type="button">关闭</button></div></div></li> </ul> </div> </div> <script type="text/javascript"> function setUserRoleCallBack(){ var dialog = $("body").data('set_user_role'); var el = dialog.find("input[name='role_ids']:checked"); if(el.size()){ var ids = []; el.each(function(){ ids.push($(this).val()); }); $.post("<?php echo site_url('/ajax/aj_user_role.php'); ?>",{role_ids:ids,user_id:<?php echo $user_id?>},function(data){ if(data.statusCode == 200){ alertMsg.correct(data.message); $.pdialog.closeCurrent(); }else{ alertMsg.error(data.message); } }); }else{ alertMsg.error('至少选择一个角色!'); } } </script>
zyroot
trunk/admin/html/user_role.php
PHP
art
2,343
<form id="pagerForm" method="post" action="<?php echo site_url('index.php?m=role');?>"> <input type="hidden" name="pageNum" value="1" /> <input type="hidden" name="numPerPage" value="<?php echo $list['pager']->per_page;?>" /> </form> <div class="pageContent"> <div class="panelBar"> <ul class="toolBar"> <li><a class="add" href="<?php echo site_url('index.php?m=role&a=add');?>" target="dialog" height="200"><span>添加</span></a></li> <li class="line">line</li> <li><a class="delete" href="<?php echo site_url('index.php?m=role&a=del');?>&role_id={sid}" target="ajaxTodo" title="确定要删除吗?"><span>删除</span></a></li> <li class="line">line</li> <li><a class="edit" href="<?php echo site_url('index.php?m=role&a=edit');?>&role_id={sid}" target="dialog" height="200"><span>修改</span></a></li> </ul> </div> <table class="table" width="100%" layoutH="75"> <thead> <tr> <th width="30" align="center">ID</th> <th width="50" align="center">角色名称</th> <th width="80" align="center">操作</th> </tr> </thead> <tbody> <?php foreach($list['rs'] as $v){?> <tr target="sid" rel="<?php echo $v['role_id'];?>"> <td><?php echo $v['role_id'];?></td> <td><?php echo $v['role_name'];?></td> <td><a href="<?php echo site_url('index.php?m=role&a=set');?>&role_id=<?php echo $v['role_id'];?>" target="dialog" height="400" width="300" title="<?php echo $v['role_name'];?>-设置权限" rel="role_cate_tree">设置权限</a> | <a href="<?php echo site_url('index.php?m=role&a=edit');?>&role_id=<?php echo $v['role_id'];?>" target="dialog" height="200">编辑</a> | <a href="<?php echo site_url('index.php?m=role&a=del');?>&role_id=<?php echo $v['role_id'];?>" target="ajaxTodo" title="确定要删除吗?">删除</a></td> </tr> <?php }?> </tbody> </table> <div class="panelBar"> <div class="pages"> <span>显示</span> <?php $_pager_num_type = array(30,50,100); ?> <select class="combox" name="numPerPage" change="navTabPageBreak" param="numPerPage"> <?php foreach($_pager_num_type as $v){ echo '<option value="'.$v.'" '.($list['pager']->per_page == $v ? 'selected':'').'>'.$v.'</option>'; } ?> </select> <span>条,共<?php echo $list['pager']->getTotalCount();?>条</span> </div> <div class="pagination" targetType="navTab" totalCount="<?php echo $list['pager']->getTotalCount();?>" numPerPage="<?php echo $list['pager']->per_page;?>" pageNumShown="5" currentPage="<?php echo $list['pager']->curr_page;?>"></div> </div> </div>
zyroot
trunk/admin/html/role.php
PHP
art
2,805
<h2 class="contentTitle">添加用户</h2> <form action="<?php echo site_url('/ajax/aj_add_user.php');?>" method="post" class="pageForm required-validate" onsubmit="return validateCallback(this, dialogAjaxDone)"> <div class="pageContent"> <div class="pageFormContent" layoutH="97"> <div class="unit"> <label>用户名:</label> <input type="text" name="user_name" size="25" class="required textInput valid"> <span class="inputInfo">请填写员工真实姓名</span> </div> <div class="unit"> <label>密码:</label> <input type="password" name="password" size="25" class="required textInput valid"> <span class="inputInfo">登录密码</span> </div> <div class="unit"> <label>确认密码:</label> <input type="password" name="repassword" size="25" class="required textInput valid"> <span class="inputInfo">确认登录密码</span> </div> <div class="unit"> <label>权限组:</label> <input name="role_ids" type="hidden"/> <textarea rows="2" cols="30" class="textInput" name="role_names" readonly=""></textarea> <a class="btnLook" target="dialog" href="<?php echo site_url('role.php?a=lookup&rel=add_user');?>" rel="role_lookup">选择所属权限组</a> <span class="inputInfo">点击选择权限组</span> </div> <div class="unit"> <label>邮箱:</label> <input type="text" name="email" size="25" class="email textInput valid"> <span class="inputInfo">联系使用</span> </div> <div class="unit"> <label>联系电话:</label> <input type="text" name="tel" size="25" class="phone textInput valid"> <span class="inputInfo">联系使用</span> </div> </div> <div class="formBar"> <ul> <li><div class="buttonActive"><div class="buttonContent"><button type="submit">确认</button></div></div></li> <li><div class="button"><div class="buttonContent"><button class="close" type="button">关闭</button></div></div></li> </ul> </div> </div> </form>
zyroot
trunk/admin/html/add_user.php
PHP
art
2,202
<h2 class="contentTitle">编辑分类</h2> <form action="<?php echo site_url('/ajax/aj_edit_cate.php');?>" method="post" class="pageForm required-validate" onsubmit="return validateCallback(this, dialogAjaxDone)"> <div class="pageContent"> <div class="pageFormContent" layoutH="97"> <div class="unit"> <label>分类名:</label> <input type="text" name="cate_name" size="25" class="required textInput valid" value="<?php echo $cate_info['cate_name'];?>"> <input type="hidden" name="cate_id" value="<?php echo $cate_info['cate_id'];?>" class="required valid"/> <span class="inputInfo">填写分类名称</span> </div> <div class="unit"> <label>资源:</label> <input type="text" name="action" size="25" class="textInput" value="<?php echo $cate_info['action'];?>"> <span class="inputInfo">如user.php?a=add</span> </div> <div class="unit"> <label>所属分类:</label> <input name="parent_cate_id" type="hidden" value="<?php echo $cate_info['parent_cate_id'];?>"/> <input type="text" name="parent_cate_name" size="25" class="textInput" value="<?php echo $parent_cate_info['cate_name'];?>" readonly=""/> <span class="inputInfo">暂时不支持更新分类</span> </div> <div class="unit"> <label>权限组:</label> <input name="role_ids" type="hidden" value="<?php echo $role_ids;?>"/> <textarea rows="2" cols="30" class="textInput" name="role_names" readonly=""><?php echo $role_names;?></textarea> <a class="btnLook" target="dialog" href="<?php echo site_url('role.php?a=lookup&rel=edit_cate');?>" rel="role_lookup">选择所属权限组</a> <span class="inputInfo">点击选择权限组</span> </div> <div class="unit"> <label>是否显示:</label> <select class="combox" name="is_show"> <option value="0" <?php if($cate_info['is_show'] == 0) echo 'selected=""';?>>否</option> <option value="1" <?php if($cate_info['is_show'] == 1) echo 'selected=""';?>>是</option> </select> <span class="inputInfo">是否显示在右侧菜单栏</span> </div> </div> <div class="formBar"> <ul> <li><div class="buttonActive"><div class="buttonContent"><button type="submit">确认</button></div></div></li> <li><div class="button"><div class="buttonContent"><button class="close" type="button">关闭</button></div></div></li> </ul> </div> </div> </form>
zyroot
trunk/admin/html/edit_cate.php
PHP
art
2,616
<?php function getTree($data,$cate_ids) { $html = ''; foreach($data as $k => $v) { if(isset($v['cate_child'])) { //父亲找到儿子 $checked = (in_array($v['cate_id'],$cate_ids) ? 'checked="true"':''); $html .= '<li><a tname="cate_ids" tvalue="'.$v['cate_id'].'" '.$checked.'>'.$v['cate_name'].'</a>'; $html .= getTree($v['cate_child'],$cate_ids); $html .= '</li>'; }else{ $checked = (in_array($v['cate_id'],$cate_ids) ? 'checked="true"':''); $html .= '<li><a tname="cate_ids" tvalue="'.$v['cate_id'].'" '.$checked.'>'.$v['cate_name'].'</a></li>'; } } return '<ul class="treeFolder treeCheck expand">'.$html.'</ul>'; } $parent_array = array();//记录每一个父节点的地址引用 $tree_array = array();//整颗树的数组 foreach($menu_arr as $v){ $node_num = ($v['right_value']-$v['left_value'] - 1)/2; if($v['parent_cate_id']){//如果没有parent_cate_id则是顶层 $parent_array[$v['parent_cate_id']]['cate_child'][$v['cate_id']] = $v; if($node_num > 0){ $parent_array[$v['cate_id']] = &$parent_array[$v['parent_cate_id']]['cate_child'][$v['cate_id']]; } }else{ $tree_array[$v['cate_id']] = $v; if($node_num > 0){ $parent_array[$v['cate_id']] = &$tree_array[$v['cate_id']]; } } } ?> <div class="pageContent"> <div class="pageFormContent" layoutH="60"> <ul class="tree treeFolder treeCheck expand" id="_select_cate"> <li><a tname="cate_ids" tvalue="0">管理中心</a> <?php echo getTree($tree_array,$cate_ids);?> </li> </ul> </div> <div class="formBar"> <ul> <li><a class="button" href="javascript:void(0);" onclick="userTreeCallBack();"><span>确认</span></a></li> <li><div class="button"><div class="buttonContent"><button class="close" type="button">关闭</button></div></div></li> </ul> </div> </div> <script type="text/javascript"> function userTreeCallBack(){ var dialog = $("body").data('user_cate_tree'); var el = dialog.find("div.ckbox.checked,div.ckbox.indeterminate"); var ids = []; el.each(function(){ ids.push($(this).children(':checkbox').val()); }); $.post('<?php echo site_url("/ajax/aj_set_user_role.php"); ?>',{cate_ids:ids,user_id:<?php echo $user_id?>},function(data){ if(data.statusCode == 200){ alertMsg.correct(data.message); $.pdialog.closeCurrent(); }else{ alertMsg.error(data.message); } }); } </script>
zyroot
trunk/admin/html/user_cate_tree.php
PHP
art
2,859
<div class="pageHeader"> <div class="searchBar"> <table class="searchContent"> <tr> <td> 用户名:<input type="text" name="user_name" id="_look_user_name"/> </td> <td><div class="button"><div class="buttonContent"><button type="button">检索</button></div></div></td> </tr> </table> </div> </div> <div class="pageContent"> <table class="table" width="100%" targettype="dialog" layoutH="97"> <thead> <tr> <th width="22" align="center"><input type="checkbox" group="ids" class="checkboxCtrl"></th> <th width="30" align="center">ID</th> <th width="50" align="center">用户名</th> </tr> </thead> <tbody id="_look_user_list"> <?php foreach($users as $v){?> <tr target="sid" rel="<?php echo $v['user_id'];?>"> <td><input name="ids" value="<?php echo $v['user_id'].'_'.$v['user_name'];?>" type="checkbox"></td> <td><?php echo $v['user_id'];?></td> <td><?php echo $v['user_name'];?></td> </tr> <?php }?> </tbody> </table> <div class="formBar"> <ul> <li><a class="button" href="javascript:void(0);" onclick="lookUserCallBack();"><span>确认</span></a></li> <li><div class="button"><div class="buttonContent"><button class="close" type="button">关闭</button></div></div></li> </ul> </div> </div> <script type="text/javascript"> function lookUserCallBack(){ var pdialog = $("body").data('<?php echo $parent_rel;?>'); var dialog = $("body").data('look_user'); var role_ids = [],role_names = []; dialog.find("input:checked").filter("[name='ids']").each(function(i){ var _r = $(this).val().split('_'); role_ids.push(_r[0]); role_names.push(_r[1]); }); $('input[name="user_ids"]', pdialog).val(role_ids.join(',')); $('textarea[name="user_names"]', pdialog).val(role_names.join(',')); $.pdialog.closeCurrent(); } (function($){ var pdialog = $("body").data('<?php echo $parent_rel;?>'); var sids = $('input[name="user_ids"]', pdialog).val().split(','); setTimeout(function(){//这里代码有延迟事件,所以用setTimeout调整执行顺序 var dialog = $("body").data('look_user'); dialog.find("input[name='ids']").each(function(i){ if($.inArray($(this).val().split('_')[0],sids) != -1){ $(this).attr('checked',true); } }); dialog.find("td").bind('click',function(e){ if(!$(e.target).is(':input')){ var $obj = $(this).closest('tr').children('td:first').find('input'); $obj.attr('checked',!$obj.attr('checked')); } }); },0); })(jQuery); </script>
zyroot
trunk/admin/html/look_user.php
PHP
art
2,824
<h2 class="contentTitle">添加角色</h2> <form action="<?php echo site_url('/ajax/aj_add_role.php');?>" method="post" class="pageForm required-validate" onsubmit="return validateCallback(this, dialogAjaxDone)"> <div class="pageContent"> <div class="pageFormContent" layoutH="97"> <div class="unit"> <label>角色名:</label> <input type="text" name="role_name" size="25" class="required textInput valid"> <span class="inputInfo">填写角色名称</span> </div> </div> <div class="formBar"> <ul> <li><div class="buttonActive"><div class="buttonContent"><button type="submit">确认</button></div></div></li> <li><div class="button"><div class="buttonContent"><button class="close" type="button">关闭</button></div></div></li> </ul> </div> </div> </form>
zyroot
trunk/admin/html/add_role.php
PHP
art
836
<div class="pageHeader"> <div class="searchBar"> <table class="searchContent"> <tr> <td> 用户名:<input type="text" name="user_name" id="_look_user2_name"/> </td> <td><div class="button"><div class="buttonContent"><button type="button">检索</button></div></div></td> </tr> </table> </div> </div> <div class="pageContent"> <table class="table" width="100%" targettype="dialog" layoutH="97"> <thead> <tr> <th width="22" align="center"></th> <th width="30" align="center">ID</th> <th width="50" align="center">用户名</th> </tr> </thead> <tbody> <?php foreach($users as $v){?> <tr target="sid" rel="<?php echo $v['user_id'];?>"> <td><input name="ids" value="<?php echo $v['user_id'].'_'.$v['user_name'];?>" type="radio"></td> <td><?php echo $v['user_id'];?></td> <td><?php echo $v['user_name'];?></td> </tr> <?php }?> </tbody> </table> <div class="formBar"> <ul> <li><a class="button" href="javascript:void(0);" onclick="lookUserCallBack();"><span>确认</span></a></li> <li><div class="button"><div class="buttonContent"><button class="close" type="button">关闭</button></div></div></li> </ul> </div> </div> <script type="text/javascript"> function lookUserCallBack(){ var pdialog = $("body").data('<?php echo $parent_rel;?>'); var dialog = $("body").data('look_user2'); var user = dialog.find("input:checked").filter("[name='ids']").val().split('_'); $('input[name="puser_id"]', pdialog).val(user[0]); $('input[name="puser_name"]', pdialog).val(user[1]); $.pdialog.closeCurrent(); } (function($){ var pdialog = $("body").data('<?php echo $parent_rel;?>'); var pid = $('input[name="puser_id"]', pdialog).val(); setTimeout(function(){//这里代码有延迟事件,所以用setTimeout调整执行顺序 var dialog = $("body").data('look_user2'); dialog.find("input[name='ids']").each(function(i){ if($(this).val().split('_')[0] == pid){ $(this).attr('checked',true); } }); dialog.find("td").bind('click',function(e){ if(!$(e.target).is(':input')){ var $obj = $(this).closest('tr').children('td:first').find('input'); $obj.attr('checked',!$obj.attr('checked')); } }); },0); })(jQuery); </script>
zyroot
trunk/admin/html/look_user2.php
PHP
art
2,549
<div class="pageHeader"> <form rel="pagerForm" method="post" action="dwzOrgLookup.html" onsubmit="return dwzSearch(this, 'dialog');"> <div class="searchBar"> <table class="searchContent"> <tr> <td> 角色名:<input type="text" name="user_name" /> </td> <td><div class="button"><div class="buttonContent"><button type="submit">检索</button></div></div></td> </tr> </table> </div> </form> </div> <div class="pageContent"> <table class="table" width="100%" targettype="dialog" layoutH="97"> <thead> <tr> <th width="22" align="center"><input type="checkbox" group="ids" class="checkboxCtrl"></th> <th width="30" align="center">ID</th> <th width="50" align="center">角色名称</th> </tr> </thead> <tbody> <?php foreach($list['rs'] as $v){?> <tr target="sid" rel="<?php echo $v['role_id'];?>"> <td><input name="ids" value="<?php echo $v['role_id'].'_'.$v['role_name'];?>" type="checkbox"></td> <td><?php echo $v['role_id'];?></td> <td><?php echo $v['role_name'];?></td> </tr> <?php }?> </tbody> </table> <div class="formBar"> <ul> <li><a class="button" href="javascript:void(0);" onclick="addRoleCallBack();"><span>确认</span></a></li> <li><div class="button"><div class="buttonContent"><button class="close" type="button">关闭</button></div></div></li> </ul> </div> </div> <script type="text/javascript"> function addRoleCallBack(){ var pdialog = $("body").data('<?php echo $parent_rel;?>'); var dialog = $("body").data('role_lookup'); var role_ids = [],role_names = []; dialog.find("input:checked").filter("[name='ids']").each(function(i){ var _r = $(this).val().split('_'); role_ids.push(_r[0]); role_names.push(_r[1]); }); $('input[name="role_ids"]', pdialog).val(role_ids.join(',')); $('textarea[name="role_names"]', pdialog).val(role_names.join(',')); $.pdialog.closeCurrent(); } (function($){ var pdialog = $("body").data('<?php echo $parent_rel;?>'); var sids = $('input[name="role_ids"]', pdialog).val().split(','); setTimeout(function(){//这里代码有延迟事件,所以用setTimeout调整执行顺序 var dialog = $("body").data('role_lookup'); dialog.find("input[name='ids']").each(function(i){ if($.inArray($(this).val().split('_')[0],sids) != -1){ $(this).attr('checked',true); } }); },0); })(jQuery); </script>
zyroot
trunk/admin/html/role_lookup.php
PHP
art
2,642
<?php function getTree($data) { $html = ''; foreach($data as $k => $v) { if(isset($v['cate_child'])) { //父亲找到儿子 $html .= '<li><a tname="cate_ids" tvalue="'.$v['cate_id'].'">'.$v['cate_name'].'</a>'; $html .= getTree($v['cate_child']); $html .= '</li>'; }else{ $html .= '<li><a tname="cate_ids" tvalue="'.$v['cate_id'].'">'.$v['cate_name'].'</a></li>'; } } return '<ul>'.$html.'</ul>'; } $parent_array = array();//记录每一个父节点的地址引用 $tree_array = array();//整颗树的数组 foreach($menu_arr as $v){ $node_num = ($v['right_value']-$v['left_value'] - 1)/2; if($v['parent_cate_id']){//如果没有parent_cate_id则是顶层 $parent_array[$v['parent_cate_id']]['cate_child'][$v['cate_id']] = $v; if($node_num > 0 || ($node_num == 0 && $v['action'] == '')){ $parent_array[$v['cate_id']] = &$parent_array[$v['parent_cate_id']]['cate_child'][$v['cate_id']]; $parent_array[$v['cate_id']]['cate_child'] = array(); } }else{ $tree_array[$v['cate_id']] = $v; if($node_num > 0 || ($node_num == 0 && $v['action'] == '')){ $parent_array[$v['cate_id']] = &$tree_array[$v['cate_id']]; $parent_array[$v['cate_id']]['cate_child'] = array(); } } } // p($tree_array); ?> <div class="pageContent"> <div class="pageFormContent" layoutH="60"> <ul class="tree treeFolder expand" id="_select_cate"> <li><a tname="cate_ids" tvalue="0">管理中心</a> <?php echo getTree($tree_array);?> </li> </ul> </div> <div class="formBar"> <ul> <li><a class="button" href="javascript:void(0);" onclick="cateTreeCallBack();"><span>确认</span></a></li> <li><div class="button"><div class="buttonContent"><button class="close" type="button">关闭</button></div></div></li> </ul> </div> </div> <script type="text/javascript"> var olda = ''; (function($){ $('#_select_cate').find('a').click(function(){ if(olda){ olda.text(olda.text().replace('(√)','')); } $(this).text($(this).text()+'(√)'); olda = $(this); }); var pdialog = $("body").data('add_cate'); var sids = $('input[name="parent_cate_id"]', pdialog).val(); setTimeout(function(){//这里代码有延迟事件,所以用setTimeout调整执行顺序 var dialog = $("body").data('cate_tree'); var el = dialog.find("a[tvalue='"+sids+"']"); el.text(el.text()+'(√)'); olda = el; },0); })(jQuery); function cateTreeCallBack(){ if(olda){ var pdialog = $("body").data('add_cate'); $('input[name="parent_cate_id"]', pdialog).val(olda.attr('tvalue')); $('input[name="parent_cate_name"]', pdialog).val(olda.text().replace('(√)','')); $.pdialog.closeCurrent(); }else{ alertMsg.error('必须选择一个分类!'); } } </script>
zyroot
trunk/admin/html/cate_tree.php
PHP
art
3,292
<form id="pagerForm" method="post" action="<?php echo site_url('index.php?m=user');?>"> <input type="hidden" name="pageNum" value="1" /> <input type="hidden" name="numPerPage" value="<?php echo $user_list['pager']->per_page;?>" /> <input type="hidden" name="user_name" value="<?php echo $_input->post('user_name');?>" /> </form> <div class="pageHeader"> <form onsubmit="return navTabSearch(this);" action="<?php echo site_url('index.php?m=user');?>" method="post"> <div class="searchBar"> <table class="searchContent"> <tr> <td> 用户名:<input type="text" name="user_name" value="<?php echo $_input->post('user_name');?>"/> </td> <td><div class="button"><div class="buttonContent"><button type="submit">检索</button></div></div></td> </tr> </table> </div> </form> </div> <div class="pageContent"> <div class="panelBar"> <ul class="toolBar"> <li><a class="add" href="<?php echo site_url('index.php?m=user&a=adduser');?>" target="dialog" height="350" rel="add_user"><span>添加</span></a></li> <li class="line">line</li> <li><a class="delete" href="<?php echo site_url('index.php?m=user&a=deluser');?>&user_id={sid_user}" target="ajaxTodo" title="确定要删除吗?"><span>删除</span></a></li> <li class="line">line</li> <li><a class="edit" href="<?php echo site_url('index.php?m=user&a=edituser');?>&user_id={sid_user}" target="dialog" height="400" rel="edit_user"><span>修改</span></a></li> </ul> </div> <table class="table" width="100%" layoutH="112"> <thead> <tr> <th width="30" align="center">ID</th> <th width="50" align="center">用户名</th> <th width="100">角色</th> <th width="50">CVS/SVN</th> <th width="50">邮箱</th> <th width="50" align="center">联系电话</th> <th width="80" align="center">最后登录时间</th> <th width="50" align="center">最后登录IP</th> <th width="160" align="center">操作</th> </tr> </thead> <tbody> <?php foreach($user_list['rs'] as $v){?> <tr target="sid_user" rel="<?php echo $v['user_id'];?>"> <td><?php echo $v['user_id'];?></td> <td><?php echo $v['user_name'];?></td> <td><?php echo $v['role_names'];?></td> <td><?php echo $v['svn_user'];?></td> <td><?php echo $v['email'];?></td> <td><?php echo $v['tel'];?></td> <td><?php echo $v['last_time'];?></td> <td><?php echo $v['last_ip'];?></td> <td><a href="<?php echo site_url('index.php?m=user&a=setrole');?>&user_id=<?php echo $v['user_id'];?>" target="dialog" title="<?php echo $v['user_name'];?>-设置角色" rel="set_user_role">设置角色</a> | <a href="<?php echo site_url('index.php?m=user&a=editrole');?>&user_id=<?php echo $v['user_id'];?>" target="dialog" height="400" width="300" title="<?php echo $v['user_name'];?>-设置权限" rel="user_cate_tree">设置权限</a> | <a href="<?php echo site_url('index.php?m=user&a=edituser');?>&user_id=<?php echo $v['user_id'];?>" target="dialog" height="400">编辑</a> | <a href="<?php echo site_url('index.php?m=user&a=deluser');?>&user_id=<?php echo $v['user_id'];?>" target="ajaxTodo" title="确定要删除吗?">删除</a></td> </tr> <?php }?> </tbody> </table> <div class="panelBar"> <div class="pages"> <span>显示</span> <?php $_pager_num_type = array(30,50,100); ?> <select class="combox" name="numPerPage" change="navTabPageBreak" param="numPerPage"> <?php foreach($_pager_num_type as $v){ echo '<option value="'.$v.'" '.($user_list['pager']->per_page == $v ? 'selected':'').'>'.$v.'</option>'; } ?> </select> <span>条,共<?php echo $user_list['pager']->getTotalCount();?>条</span> </div> <div class="pagination" targetType="navTab" totalCount="<?php echo $user_list['pager']->getTotalCount();?>" numPerPage="<?php echo $user_list['pager']->per_page;?>" pageNumShown="5" currentPage="<?php echo $user_list['pager']->curr_page;?>"></div> </div> </div>
zyroot
trunk/admin/html/user.php
PHP
art
4,346
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="X-UA-Compatible" content="IE=7" /> <title>PPS娱乐圈上线发布系统</title> <link href="<?php echo site_url('dwz1.4.5/themes/default/style.css');?>" rel="stylesheet" type="text/css" media="screen"/> <link href="<?php echo site_url('dwz1.4.5/themes/css/core.css');?>" rel="stylesheet" type="text/css" media="screen"/> <link href="<?php echo site_url('dwz1.4.5/themes/css/print.css');?>" rel="stylesheet" type="text/css" media="print"/> <link href="<?php echo site_url('dwz1.4.5/uploadify/css/uploadify.css');?>" rel="stylesheet" type="text/css" media="screen"/> <!--[if IE]> <link href="<?php echo site_url('dwz1.4.5/themes/css/ieHack.css');?>" rel="stylesheet" type="text/css" media="screen"/> <![endif]--> <!--[if lte IE 9]> <script src="<?php echo site_url('dwz1.4.5/js/speedup.js');?>" type="text/javascript"></script> <![endif]--> <script src="<?php echo site_url('dwz1.4.5/js/jquery-1.7.2.js');?>" type="text/javascript"></script> <script src="<?php echo site_url('dwz1.4.5/js/jquery.cookie.js');?>" type="text/javascript"></script> <script src="<?php echo site_url('dwz1.4.5/js/jquery.validate.js');?>" type="text/javascript"></script> <script src="<?php echo site_url('dwz1.4.5/js/jquery.bgiframe.js');?>" type="text/javascript"></script> <script src="<?php echo site_url('dwz1.4.5/xheditor/xheditor-1.1.14-zh-cn.min.js');?>" type="text/javascript"></script> <script src="<?php echo site_url('dwz1.4.5/uploadify/scripts/jquery.uploadify.js');?>" type="text/javascript"></script> <!-- svg图表 supports Firefox 3.0+, Safari 3.0+, Chrome 5.0+, Opera 9.5+ and Internet Explorer 6.0+ --> <script type="text/javascript" src="<?php echo site_url('dwz1.4.5/chart/raphael.js');?>"></script> <script type="text/javascript" src="<?php echo site_url('dwz1.4.5/chart/g.raphael.js');?>"></script> <script type="text/javascript" src="<?php echo site_url('dwz1.4.5/chart/g.bar.js');?>"></script> <script type="text/javascript" src="<?php echo site_url('dwz1.4.5/chart/g.line.js');?>"></script> <script type="text/javascript" src="<?php echo site_url('dwz1.4.5/chart/g.pie.js');?>"></script> <script type="text/javascript" src="<?php echo site_url('dwz1.4.5/chart/g.dot.js');?>"></script> <script src="<?php echo site_url('dwz1.4.5/js/dwz.core.js');?>" type="text/javascript"></script> <script src="<?php echo site_url('dwz1.4.5/js/dwz.util.date.js');?>" type="text/javascript"></script> <script src="<?php echo site_url('dwz1.4.5/js/dwz.validate.method.js');?>" type="text/javascript"></script> <script src="<?php echo site_url('dwz1.4.5/js/dwz.regional.zh.js');?>" type="text/javascript"></script> <script src="<?php echo site_url('dwz1.4.5/js/dwz.barDrag.js');?>" type="text/javascript"></script> <script src="<?php echo site_url('dwz1.4.5/js/dwz.drag.js');?>" type="text/javascript"></script> <script src="<?php echo site_url('dwz1.4.5/js/dwz.tree.js');?>" type="text/javascript"></script> <script src="<?php echo site_url('dwz1.4.5/js/dwz.accordion.js');?>" type="text/javascript"></script> <script src="<?php echo site_url('dwz1.4.5/js/dwz.ui.js');?>" type="text/javascript"></script> <script src="<?php echo site_url('dwz1.4.5/js/dwz.theme.js');?>" type="text/javascript"></script> <script src="<?php echo site_url('dwz1.4.5/js/dwz.switchEnv.js');?>" type="text/javascript"></script> <script src="<?php echo site_url('dwz1.4.5/js/dwz.alertMsg.js');?>" type="text/javascript"></script> <script src="<?php echo site_url('dwz1.4.5/js/dwz.contextmenu.js');?>" type="text/javascript"></script> <script src="<?php echo site_url('dwz1.4.5/js/dwz.navTab.js');?>" type="text/javascript"></script> <script src="<?php echo site_url('dwz1.4.5/js/dwz.tab.js');?>" type="text/javascript"></script> <script src="<?php echo site_url('dwz1.4.5/js/dwz.resize.js');?>" type="text/javascript"></script> <script src="<?php echo site_url('dwz1.4.5/js/dwz.dialog.js');?>" type="text/javascript"></script> <script src="<?php echo site_url('dwz1.4.5/js/dwz.dialogDrag.js');?>" type="text/javascript"></script> <script src="<?php echo site_url('dwz1.4.5/js/dwz.sortDrag.js');?>" type="text/javascript"></script> <script src="<?php echo site_url('dwz1.4.5/js/dwz.cssTable.js');?>" type="text/javascript"></script> <script src="<?php echo site_url('dwz1.4.5/js/dwz.stable.js');?>" type="text/javascript"></script> <script src="<?php echo site_url('dwz1.4.5/js/dwz.taskBar.js');?>" type="text/javascript"></script> <script src="<?php echo site_url('dwz1.4.5/js/dwz.ajax.js');?>" type="text/javascript"></script> <script src="<?php echo site_url('dwz1.4.5/js/dwz.pagination.js');?>" type="text/javascript"></script> <script src="<?php echo site_url('dwz1.4.5/js/dwz.database.js');?>" type="text/javascript"></script> <script src="<?php echo site_url('dwz1.4.5/js/dwz.datepicker.js');?>" type="text/javascript"></script> <script src="<?php echo site_url('dwz1.4.5/js/dwz.effects.js');?>" type="text/javascript"></script> <script src="<?php echo site_url('dwz1.4.5/js/dwz.panel.js');?>" type="text/javascript"></script> <script src="<?php echo site_url('dwz1.4.5/js/dwz.checkbox.js');?>" type="text/javascript"></script> <script src="<?php echo site_url('dwz1.4.5/js/dwz.history.js');?>" type="text/javascript"></script> <script src="<?php echo site_url('dwz1.4.5/js/dwz.combox.js');?>" type="text/javascript"></script> <script src="<?php echo site_url('dwz1.4.5/js/dwz.print.js');?>" type="text/javascript"></script> <!-- <script src="<?php //echo site_url('dwz1.4.5/bin/dwz.min.js');?>" type="text/javascript"></script> --> <script src="<?php echo site_url('dwz1.4.5/js/dwz.regional.zh.js');?>" type="text/javascript"></script> <script type="text/javascript"> function closePM(){ $.cookie('program_maxim',1,{path: '/',expires:1,domain: '<?php echo COOKIE_DOMAIN; ?>'}); return true; } jQuery(function($){ DWZ.init("<?php echo site_url('dwz1.4.5/dwz.frag.xml');?>", { // loginUrl:"loginsub.html", loginTitle:"登录", // 弹出登录对话框 loginUrl:"<?php echo site_url('login.php');?>", // 跳到登录页面 statusCode:{ok:200, error:300, timeout:301}, //【可选】 pageInfo:{pageNum:"pageNum", numPerPage:"numPerPage", orderField:"orderField", orderDirection:"orderDirection"}, //【可选】 debug:false, // 调试模式 【true|false】 callback:function(){ initEnv(); $("#themeList").theme({themeBase:"<?php echo site_url('dwz1.4.5/themes');?>"}); navTab.openTab('main', '<?php echo site_url('main.php')?>',{title:'我的主页'}); if($.cookie('program_maxim') != 1){ //$.pdialog.open('<?php echo site_url('program_maxim.php')?>', 'program_maxim', '今天你做到了吗?', {close:closePM}); } } }); }); </script> </head> <body scroll="no"> <div id="layout"> <div id="header"> <div class="headerNav"> <a class="logo" href=".">标志</a> <ul class="nav"> <li><a href="<?php echo site_url('main.php')?>" target="navTab" rel="main">我的主页</a></li> <li id="switchEnvBox"><a href="javascript:void(0)"><?php echo $user_info['user_name']?></a> <ul> <?php foreach($user_roles as $v){?> <li><?php echo $v['role_name'];?></li> <?php }?> </ul> </li> <li><a href="<?php echo site_url('/index.php?m=user'); ?>&a=edituser&user_id=<?php echo $user_info['user_id']?>&editrole=0" target="dialog" height="350" rel="edit_user">设置</a></li> <li><a href="<?php echo site_url('logout.php');?>">退出</a></li> </ul> <ul class="themeList" id="themeList"> <li theme="default"><div class="selected">蓝色</div></li> <li theme="green"><div>绿色</div></li> <li theme="purple"><div>紫色</div></li> <li theme="silver"><div>银色</div></li> <li theme="azure"><div>天蓝</div></li> </ul> </div> <!-- navMenu --> </div> <div id="leftside"> <div id="sidebar_s"> <div class="collapse"> <div class="toggleCollapse"><div></div></div> </div> </div> <div id="sidebar"> <div class="toggleCollapse"><h2>主菜单</h2><div>收缩</div></div> <?php function getTree($data,$user_cate_ids) { $html = ''; foreach($data as $k => $v) { if(in_array($v['cate_id'],$user_cate_ids) && $v['is_show']){ if(isset($v['cate_child'])) { //父亲找到儿子 $html .= '<li><a>'.$v['cate_name'].'</a>'; $html .= getTree($v['cate_child'],$user_cate_ids); $html .= '</li>'; }else{ $path_info = pathinfo($v['action']); $html .= '<li><a href="'.site_url('index.php?m='.$v['action']).'" target="navTab" rel="'.$path_info['filename'].'">'.$v['cate_name'].'</a></li>'; } } } return '<ul>'.$html.'</ul>'; } $parent_array = array();//记录每一个父节点的地址引用 $tree_array = array();//整颗树的数组 foreach($menu_arr as $v){ $node_num = ($v['right_value']-$v['left_value'] - 1)/2; if($v['parent_cate_id']){//如果没有parent_cate_id则是顶层 $parent_array[$v['parent_cate_id']]['cate_child'][$v['cate_id']] = $v; if($node_num > 0){ $parent_array[$v['cate_id']] = &$parent_array[$v['parent_cate_id']]['cate_child'][$v['cate_id']]; } }else{ $tree_array[$v['cate_id']] = $v; if($node_num > 0){ $parent_array[$v['cate_id']] = &$tree_array[$v['cate_id']]; } } } ?> <div class="accordion" fillSpace="sidebar"> <?php foreach($tree_array as $value){ if(in_array($value['cate_id'],$user_cate_ids) && $value['is_show']){ ?> <div class="accordionHeader"> <h2><span>Folder</span><?php echo $value['cate_name'];?></h2> </div> <div class="accordionContent"> <ul class="tree treeFolder"> <?php if($value['cate_child']) echo substr(substr(getTree($value['cate_child'],$user_cate_ids),4),0,-5);?> </ul> </div> <?php }}?> </div> </div> </div> <div id="container"> <div id="navTab" class="tabsPage"> <div class="tabsPageHeader"> <div class="tabsPageHeaderContent"><!-- 显示左右控制时添加 class="tabsPageHeaderMargin" --> <ul class="navTab-tab"> <li tabid="main" class="main"><a href="javascript:;"><span><span class="home_icon">我的主页</span></span></a></li> </ul> </div> <div class="tabsLeft">left</div><!-- 禁用只需要添加一个样式 class="tabsLeft tabsLeftDisabled" --> <div class="tabsRight">right</div><!-- 禁用只需要添加一个样式 class="tabsRight tabsRightDisabled" --> <div class="tabsMore">more</div> </div> <ul class="tabsMoreList"> <li><a href="javascript:;">我的主页</a></li> </ul> <div class="navTab-panel tabsPageContent"> <div class="pager"></div> </div> </div> </div> <div id="taskbar" style="left:0px; display:none;"> <div class="taskbarContent"> <ul></ul> </div> <div class="taskbarLeft taskbarLeftDisabled" style="display:none;">taskbarLeft</div> <div class="taskbarRight" style="display:none;">taskbarRight</div> </div> <div id="splitBar"></div> <div id="splitBarProxy"></div> </div> <div id="footer">Copyright &copy; 2011 PPS娱乐圈</div> <!--拖动效果--> <div class="resizable"></div> <!--阴影--> <div class="shadow" style="width:508px; top:148px; left:296px;"> <div class="shadow_h"> <div class="shadow_h_l"></div> <div class="shadow_h_r"></div> <div class="shadow_h_c"></div> </div> <div class="shadow_c"> <div class="shadow_c_l" style="height:296px;"></div> <div class="shadow_c_r" style="height:296px;"></div> <div class="shadow_c_c" style="height:296px;"></div> </div> <div class="shadow_f"> <div class="shadow_f_l"></div> <div class="shadow_f_r"></div> <div class="shadow_f_c"></div> </div> </div> <!--遮盖屏幕--> <div id="alertBackground" class="alertBackground"></div> <div id="dialogBackground" class="dialogBackground"></div> <div id='background' class='background'></div> <div id='progressBar' class='progressBar'>数据加载中,请稍等...</div> </body> </html>
zyroot
trunk/admin/html/index.php
PHP
art
13,552
<?php function debug_info() { global $db_configs; if (DEBUG == false) return false; $memory_get_usage = round(memory_get_usage(true) / 1048576, 2); $execute_time = round(microtime(true) - START_TIME, 3); $redis_logs = RedisFactory::getInstance()->getLog(); $redis_connect_time = 0; foreach (RedisFactory::getInstances() as $redis_instance) { $redis_connect_time += $redis_instance->getConnTime(); } $db_logs = array(); $db_connect_time = 0; foreach (DBFactory::getInstances() as $db_link => $db_instance) { $db_logs[$db_link . '[' . $db_configs[$db_link]['dbname'] . ']'] = $db_instance->getLog(); $db_connect_time += $db_instance->getConnTime(); } $debug_html = <<<DEBUG_HTML <style> #debug_info_tool{ border-top: 1px solid #999; border-left: 1px solid #999; border-right: 2px solid #999; border-bottom: 2px solid #999; width: 600px; font-size:12px; font-family: verdana fixedsys; padding: 2px; z-index: 1000; text-align: left; position: fixed; #position: absolute; _position: absolute; top: expression(offsetParent.scrollTop + 35); overflow: hidden; } #debug_info_tool li{ list-style:decimal; background-image:none; padding: 3px 1em; border-bottom: 1px dotted black; } #debug_info_tool ol{ background-color:#fff; max-height:400px;overflow:auto; _height:expression(this.scrollHeight > 400 ? "400px" : "auto"); margin-left:0em; padding-left:0.2em; margin-bottom:0; } </style> <div id="debug_info_tool" style="top: 0px; left: 3px;"> <div style="background-color:#39f; color:#fff; padding: 2px;"> <div style="float: right; cursor: pointer; padding: 0 4px;" onmouseover="this.style.backgroundColor='#fff'; this.style.color='#39f';" onmouseout="this.style.backgroundColor='#39f'; this.style.color='#fff';" onclick="debug_hide('debug_info_tool');">Ⅹ</div> <div style="float: right; cursor: pointer; padding: 0 4px;" onmouseover="this.style.backgroundColor='#fff'; this.style.color='#39f';" onmouseout="this.style.backgroundColor='#39f'; this.style.color='#fff';" onclick="if(!debug_isShow('debug_info_body')){debug_show('debug_info_body');this.innerHTML='—';debug_id('debug_info_tool').style.width='600px';}else{debug_hide('debug_info_body');this.innerHTML='口';debug_id('debug_info_tool').style.width='300px';}">—</div> <div style="cursor: pointer;" id="debug_info_title"><b>调试工具栏(时间:{execute_time}秒, 内存:{memory_get_usage}MB)</b></div> </div> <div id="debug_info_body" style="display:none;"> <div style="padding: 1px; border-bottom: 1px solid black;"> <div style="cursor: pointer;background-color:#fff;" onclick="debug_hide('db_info');debug_hide('debug_info');debug_id('redis_info').style.display=(debug_isShow('redis_info')?'none':'block')"><b>REDIS查询次数:{redis_query_count}, 命中次数:{redis_succ_count}, MISS次数:{redis_fail_count}, 总连接时间:{redis_connect_time}秒, 总执行时间:{redis_total_time}秒</b></div> <div style="display: none;" id="redis_info"> <ol> {redis_info} </ol> </div> </div> <div style="padding: 1px; border-bottom: 1px solid black;"> <div style="cursor: pointer;background-color:#fff;" onclick="debug_hide('redis_info');debug_hide('debug_info');debug_id('db_info').style.display=(debug_isShow('db_info')?'none':'block')"><b>DB查询次数:{db_query_count}次, 总连接时间:{db_connect_time}, 总执行时间:{db_total_time}秒, 出错SQL数:{error_query_num}</b></div> <div style="display: none;" id="db_info"> <ol> {db_info} </ol> </div> </div> <div style="padding: 1px;"> <div style="cursor: pointer;background-color:#fff;" onclick="debug_hide('redis_info');debug_hide('db_info');debug_id('debug_info').style.display=(debug_isShow('debug_info')?'none':'block')"><b>调试信息栏{xhprof}</b></div> <div style="display: none;" id="debug_info"> <ol> {debug_info} </ol> </div> </div> </div> </div> <script> debug_show('debug_info_body'); function debug_id(id) { return document.getElementById(id); } function debugGetElementsByClassName(className, parentElement){ var elems = (debug_id(parentElement)||document.body).getElementsByTagName("*"); var result=[]; for (i=0; j=elems[i]; i++){ if ((" "+j.className+" ").indexOf(" "+className+" ")!=-1){ result.push(j); } } return result; } function debug_show(ele) { if (typeof ele == 'string') ele = debug_id(ele); ele.style.display = 'block'; } function debug_hide(ele) { if (typeof ele == 'string') ele = debug_id(ele); ele.style.display = 'none'; } function debug_isShow(ele) { if (typeof ele == 'string') ele = debug_id(ele); return ele.style.display == 'block'; } var DebugDrag = { obj : null, init : function(o, oRoot, minX, maxX, minY, maxY, bSwapHorzRef, bSwapVertRef, fXMapper, fYMapper) { o.onmousedown = DebugDrag.start; o.hmode = bSwapHorzRef ? false : true ; o.vmode = bSwapVertRef ? false : true ; o.root = oRoot && oRoot != null ? oRoot : o ; if (o.hmode && isNaN(parseInt(o.root.style.left ))) o.root.style.left = "0px"; if (o.vmode && isNaN(parseInt(o.root.style.top ))) o.root.style.top = "0px"; if (!o.hmode && isNaN(parseInt(o.root.style.right ))) o.root.style.right = "0px"; if (!o.vmode && isNaN(parseInt(o.root.style.bottom))) o.root.style.bottom = "0px"; o.minX = typeof minX != 'undefined' ? minX : null; o.minY = typeof minY != 'undefined' ? minY : null; o.maxX = typeof maxX != 'undefined' ? maxX : null; o.maxY = typeof maxY != 'undefined' ? maxY : null; o.xMapper = fXMapper ? fXMapper : null; o.yMapper = fYMapper ? fYMapper : null; o.root.onDragStart = new Function(); o.root.onDragEnd = new Function(); o.root.onDrag = new Function(); }, start : function(e) { var o = DebugDrag.obj = this; o.style.cursor = 'move'; e = DebugDrag.fixE(e); var y = parseInt(o.vmode ? o.root.style.top : o.root.style.bottom); var x = parseInt(o.hmode ? o.root.style.left : o.root.style.right ); o.root.onDragStart(x, y); o.lastMouseX = e.clientX; o.lastMouseY = e.clientY; if (o.hmode) { if (o.minX != null) o.minMouseX = e.clientX - x + o.minX; if (o.maxX != null) o.maxMouseX = o.minMouseX + o.maxX - o.minX; } else { if (o.minX != null) o.maxMouseX = -o.minX + e.clientX + x; if (o.maxX != null) o.minMouseX = -o.maxX + e.clientX + x; } if (o.vmode) { if (o.minY != null) o.minMouseY = e.clientY - y + o.minY; if (o.maxY != null) o.maxMouseY = o.minMouseY + o.maxY - o.minY; } else { if (o.minY != null) o.maxMouseY = -o.minY + e.clientY + y; if (o.maxY != null) o.minMouseY = -o.maxY + e.clientY + y; } document.onmousemove = DebugDrag.drag; document.onmouseup = DebugDrag.end; return false; }, drag : function(e) { e = DebugDrag.fixE(e); var o = DebugDrag.obj; var ey = e.clientY; var ex = e.clientX; var y = parseInt(o.vmode ? o.root.style.top : o.root.style.bottom); var x = parseInt(o.hmode ? o.root.style.left : o.root.style.right ); var nx, ny; if (o.minX != null) ex = o.hmode ? Math.max(ex, o.minMouseX) : Math.min(ex, o.maxMouseX); if (o.maxX != null) ex = o.hmode ? Math.min(ex, o.maxMouseX) : Math.max(ex, o.minMouseX); if (o.minY != null) ey = o.vmode ? Math.max(ey, o.minMouseY) : Math.min(ey, o.maxMouseY); if (o.maxY != null) ey = o.vmode ? Math.min(ey, o.maxMouseY) : Math.max(ey, o.minMouseY); nx = x + ((ex - o.lastMouseX) * (o.hmode ? 1 : -1)); ny = y + ((ey - o.lastMouseY) * (o.vmode ? 1 : -1)); if (o.xMapper) nx = o.xMapper(y) else if (o.yMapper) ny = o.yMapper(x) DebugDrag.obj.root.style[o.hmode ? "left" : "right"] = nx + "px"; DebugDrag.obj.root.style[o.vmode ? "top" : "bottom"] = ny + "px"; DebugDrag.obj.lastMouseX = ex; DebugDrag.obj.lastMouseY = ey; DebugDrag.obj.root.onDrag(nx, ny); return false; }, end : function() { DebugDrag.obj.style.cursor = 'pointer'; document.onmousemove = null; document.onmouseup = null; DebugDrag.obj.root.onDragEnd( parseInt(DebugDrag.obj.root.style[DebugDrag.obj.hmode ? "left" : "right"]), parseInt(DebugDrag.obj.root.style[DebugDrag.obj.vmode ? "top" : "bottom"])); DebugDrag.obj = null; }, fixE : function(e) { if (typeof e == 'undefined') e = window.event; if (typeof e.layerX == 'undefined') e.layerX = e.offsetX; if (typeof e.layerY == 'undefined') e.layerY = e.offsetY; return e; } }; DebugDrag.init(debug_id('debug_info_title'), debug_id('debug_info_tool')); function mousePosition(ev){ if(ev.pageX || ev.pageY){ return {x:ev.pageX, y:ev.pageY}; } return { x:ev.clientX + document.body.scrollLeft - document.body.clientLeft, y:ev.clientY + document.body.scrollTop - document.body.clientTop }; } function debugCreateToolTip(dom, ev) { if (!debug_id("debug_tip")) { // only one tip should be active at a time var tiptext = dom.getAttribute('tooltip'); // create div for text var divtip = document.createElement("div"); divtip.setAttribute('id',"debug_tip"); document.body.appendChild(divtip); var elm_div = debug_id("debug_tip"); // lets grab the elements we just created // set styles on the tip box elm_div.style.border = "solid 1px black"; elm_div.innerHTML = tiptext; elm_div.style.position = "absolute"; elm_div.style.background = "#ffffcc"; elm_div.style.zIndex = "2000"; elm_div.style.textAlign = "left"; // position the top of the tool tip var mouse_pos = mousePosition(ev); elm_div.style.top = (mouse_pos.y + 5) + 'px'; elm_div.style.left = (mouse_pos.x + 5) + 'px'; } } function debugRemoveToolTip() { // remove the tool tip div and the image associated with it if (debug_id("debug_tip")) { var elm = debug_id("debug_tip"); document.body.removeChild(elm); } } var tooltipDoms = debugGetElementsByClassName('tooltip', 'debug_info_tool'); var n; for (n in tooltipDoms) { tooltipDoms[n].onmouseover = function(ev){ ev = ev || window.event; debugCreateToolTip(this, ev); } tooltipDoms[n].onmouseout = function(){ debugRemoveToolTip(); } } // bind link tag function hanlder(event){ var debug_event = event? event: window.event; var debug_obj = event.srcElement ? event.srcElement:event.target; if (debug_obj.tagName.toLowerCase() == 'a' && debug_obj.href.match(/^http:\/\/y\d?\.pps\.tv(\/.+)?/i)){ var link = debug_obj.href; if (debug_event.preventDefault){ debug_event.preventDefault(); }else{ window.event.returnValue = false; } if (link.indexOf('?') != -1){ if (link.indexOf('#') != -1){ link = link.substring(0, link.indexOf('#')) + '&debug' + link.substring(link.indexOf('#'), link.length - 1); }else{ link += '&debug'; } }else{ if (link.indexOf('#') != -1){ link = link.substring(0, link.indexOf('#')) + '?debug' + link.substring(link.indexOf('#'), link.length - 1); }else{ link += '?debug'; } } location.href = link; } else { // alert(debug_obj.tagName + ':' + debug_obj.href.substring(0, 4).toLowerCase()); } } if(window.attachEvent){ document.attachEvent("onclick", hanlder); } else{ document.addEventListener("click", hanlder, true); } </script> DEBUG_HTML; // redis info $rediss = array(); $nodes_num = array(); $group_time = array(); foreach ($redis_logs as $redis_log) { if (isset($group_time[$redis_log['redis']])) $group_time[$redis_log['redis']] += $redis_log['time']; else $group_time[$redis_log['redis']] = $redis_log['time']; $key = md5($redis_log['func'] . join(',', $redis_log['params'])); if (isset($rediss[$key])) { $rediss[$key]++; } else { $rediss[$key] = 1; } if (isset($nodes_num[$redis_log['redis']][$redis_log['group']][$redis_log['config']])) $nodes_num[$redis_log['redis']][$redis_log['group']][$redis_log['config']]++; else $nodes_num[$redis_log['redis']][$redis_log['group']][$redis_log['config']] = 1; } $redis_info = ''; foreach ($nodes_num as $redis => $group_num) { $group_total_num = 0; foreach ($group_num as $group => $node_num) { $group_total_num += array_sum($node_num); } $redis_info .= '<li style="background-color:#eee;"><b>' . $redis . '</b>, 执行时间:' . round($group_time[$redis], 6) . '秒<br/>'; foreach ($group_num as $group => $node_num) { $redis_info .= '&nbsp;&nbsp;' . $group . '<br/>'; foreach ($node_num as $node => $num) { $redis_info .= '&nbsp;&nbsp;&nbsp;&nbsp;' . $node . '查询次数:' . $num . '次, 节点组内使用比例:' . round($num * 100 / $group_total_num, 2) . '%<br/>'; } } $redis_info .= '</li>'; } $redis_succ_count = $redis_fail_count = $redis_total_time = 0; $all_redis_keys = array(); foreach ($redis_logs as $redis_log) { $redis_md5_key = md5($redis_log['func'] . join(',', $redis_log['params'])); $query_count = $rediss[$redis_md5_key]; if ($redis_log['ret']) { $redis_succ_count++; if ($query_count > 1) $color = '#00f'; else $color = '#000'; } else { $redis_fail_count++; $color = '#f00'; } $redis_total_time += $redis_log['time']; $trace_str = ''; foreach ($redis_log['trace'] as $n => $trace) { $trace_str .= ($n + 1) . '.文件:' . str_replace(array('/home/httpd/t', '/home/httpd/y'), '', $trace['file']) . ', 行数:' . $trace['line'] . ', 方法:' . $trace['func'] . "()<br/>"; } if (!in_array($redis_md5_key, $all_redis_keys)) { $redis_info .= '<li style="color:' . $color . '" class="tooltip" tooltip="' . $trace_str . '">' . $redis_log['redis'] . '->' . $redis_log['group'] . '->' . $redis_log['config'] . '->' . $redis_log['func'] . '(' . join(', ', $redis_log['params']) . ')<br/>执行时间:' . round($redis_log['time'], 6) . '秒, 查询次数:' . $query_count . '</li>'; $all_redis_keys[] = $redis_md5_key; } } // db info $sqls = array(); $query_num = $error_query_num = 0; foreach ($db_logs as $_db_log) { foreach ($_db_log as $db_log) { $key = md5($db_log['sql'] . serialize($db_log['params'])); if (isset($sqls[$key])) { $sqls[$key]++; } else { $sqls[$key] = 1; } if ($db_log['error']) $error_query_num++; $query_num++; } } $db_info = ''; $db_total_time = 0; $all_db_keys = array(); foreach ($db_logs as $db_link => $_db_log) { foreach ($_db_log as $db_log) { $db_md5_key = md5($db_log['sql'] . serialize($db_log['params'])); $query_count = $sqls[$db_md5_key]; $color = $db_log['time'] > 0.01 ? '#f00' : ($query_count > 1 ? '#00f' : '#000'); $params = array(); foreach ($db_log['params'] as $k => $v) { $params[] = $k . ' => ' . $v; } $trace_str = ''; foreach ($db_log['trace'] as $n => $trace) { $trace_str .= ($n + 1) . '.文件:' . str_replace(array('/home/httpd/t', '/home/httpd/y'), '', $trace['file']) . ', 行数:' . $trace['line'] . ', 方法:' . $trace['func'] . "()<br/>"; } $db_total_time += $db_log['time']; if (! in_array($db_md5_key, $all_db_keys)) { $error_str = $db_log['error'] ? '<br/><span style="color:#f60;"><b>Error</b>: ' . substr($db_log['error'], 0, strrpos($db_log['error'], '(')) . '</span>' : ''; $db_info .= '<li style="color:' . $color . '" class="tooltip" tooltip="' . $trace_str . '">执行时间:' . round($db_log['time'], 3) . '秒,查询次数:' . $query_count . '<br/><b>' . $db_link . '->SQL</b>: <pre>' . str_replace("\t", "&nbsp;&nbsp;", $db_log['sql']) . '</pre>' . ($params ? '<br/><b>Params</b>: [ ' . join(', ', $params) . ' ]' : '') . $error_str . '</li>'; $all_db_keys[] = $db_md5_key; } } } // debug info $debug_info = ''; $time_debugs = array(); foreach (time_debug() as $time_debug) { $time_debugs[$time_debug['name']] = $time_debug; } foreach (d('get_debug_data') as $m => $_debug_info) { $trace_str = ''; $backtrace = $_debug_info['backtrace']; $pre_backtrace = array_shift($backtrace); foreach ($backtrace as $n => $trace) { $trace_str .= ($n + 1) . '.文件:' . str_replace(array('/home/httpd/t', '/home/httpd/y'), '', $trace['file']) . ', 行数:' . $trace['line'] . ', 方法:' . $trace['function'] . "()<br/>"; } $time_debug_str = ''; if (isset($time_debugs['debug_time_' . ($m + 1)])) $time_debug_str = ', 偏移时间:' . round($time_debugs['debug_time_' . ($m + 1)]['offset_time'], 3) . 's, 执行时间:' . round($time_debugs['debug_time_' . ($m + 1)]['exec_time'], 3) . 's'; $debug_info .= '<li class="tooltip" tooltip="' . $trace_str . '">文件:' . str_replace(array('/home/httpd/t', '/home/httpd/y'), '', $pre_backtrace['file']) . ', 行数:' . $pre_backtrace['line'] . $time_debug_str . ', 信息:<br/>'; $debug_info .= '<pre>' . var_export($_debug_info['info'], true) . '</pre>'; $debug_info .= '</li>'; } if (defined('XHPROF_VIEW_URL')) $xhprof = '(<a href="' . XHPROF_VIEW_URL . '" target="_blank">XHPROF</a>)'; else $xhprof = ''; // replace data $debug_html = str_replace( array('{execute_time}', '{memory_get_usage}', '{xhprof}', '{redis_info}', '{redis_connect_time}', '{redis_succ_count}', '{redis_fail_count}', '{redis_query_count}', '{redis_total_time}', '{db_info}', '{db_connect_time}', '{db_query_count}', '{db_total_time}', '{error_query_num}', '{debug_info}'), array($execute_time, $memory_get_usage, $xhprof, $redis_info, $redis_connect_time, $redis_succ_count, $redis_fail_count, count($redis_logs), round($redis_total_time, 3), $db_info, $db_connect_time, $query_num, round($db_total_time, 3), $error_query_num, $debug_info), $debug_html); echo $debug_html; } function xhprof_save() { if (! DEBUG || !function_exists('xhprof_disable')) { return false; } $xhprof_data = xhprof_disable(); include_once ROOT_PATH . "../xhprof/xhprof_lib/utils/xhprof_lib.php"; include_once ROOT_PATH . "../xhprof/xhprof_lib/utils/xhprof_runs.php"; $xhprof_runs = new XHProfRuns_Default(); $run_id = $xhprof_runs->save_run($xhprof_data, "xhprof_foo"); define('XHPROF_VIEW_URL', "http://xhprof2.pps.tv/xhprof_html/index.php?run=$run_id&source=xhprof_foo"); } ?>
zyroot
trunk/admin/lib/debug.php
PHP
art
21,750
<?php function group_concat_step($context, $idx, $string, $separator = ",") { return ($context) ? ($string . $separator . $context) : $string; } function group_concat_finalize($context) { return $context; } class DBFactory { /** * @static * @param string $db * @return OciPDO */ static private $instances = array(); static function getInstances() { return self::$instances; } static function getInstance($db = DEFAULT_DB_NAME) { if (! isset(self::$instances[$db])) { global $db_configs; if (isset($db_configs[$db])) { $config = $db_configs[$db]; try { if ($config['dbtype'] == 'mysql') { self::$instances[$db] = new MysqlPDO('mysql:host=' . $config['dbhost'] . ';dbname=' . $config['dbname'], $config['dbuser'], $config['dbpswd'], array( PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES ".$config['dbcoding'])); } else if ($config['dbtype'] == 'oci') { self::$instances[$db] = new OciPDO('oci:dbname='.$config['dbname'],$config['dbuser'],$config['dbpswd']); } else if ($config['dbtype'] == 'sqlite') { self::$instances[$db] = new SQLitePDO('sqlite:'.$config['dbname']); self::$instances[$db]->sqliteCreateAggregate("group_concat", "group_concat_step", "group_concat_finalize", 2); } return self::$instances[$db]; } catch(PDOException $e) { p($e->getMessage()); } } else { p('db config error', 'db_config'); // need to redirect a friendly page exit; } } else return self::$instances[$db]; } } class OciPDO extends PDO { private $log = array(); private $connect_time = 0; private function doLog($sql, $time, $params = array(), $error = null) { if (DEBUG == false) return; $traces = array(); foreach (array_slice(debug_backtrace(), 2) as $trace) { $traces[] = array( 'file' => $trace['file'], 'line' => $trace['line'], 'func' => $trace['function'], ); } $this->log[] = array( 'sql' => $sql, 'params'=> $params, 'time' => $time, 'trace' => $traces, 'error' => $error, ); } public function getLog() { return $this->log; } public function getConnTime() { return $this->connect_time; } function __construct($dsn, $username = '', $password = '', $driver_options = array()) { try { $start_time = microtime(true); parent::__construct($dsn, $username, $password, array(PDO::ATTR_CASE=>PDO::CASE_LOWER) + $driver_options); $end_time = microtime(true); $connect_time = round($end_time - $start_time, 3); $this->connect_time = $connect_time; } catch(PDOException $e) { // d(func_get_args(), false); p(array_merge(array('dsn'=>$dsn), (array)$e->getMessage()), 'db_connect'); } } public function lastInsertID($sequence_name = NULL) { $sql = "select " . $sequence_name . ".currval from dual"; return $this->getOne($sql); } public function nextSeqID($sequence_name) { $sql = "select " . $sequence_name . ".nextval from dual"; return $this->getOne($sql); } public function selectLimit($sql, $limit, $limit_from = 0, $params = array(), $driver_options = array()) { $limit_to = $limit_from + $limit; $sql = "SELECT * FROM ( SELECT a.*, rownum r FROM ( " . $sql . " ) a WHERE rownum <= :limit_to ) b WHERE r > :limit_from"; return $this->getAll($sql, array_merge($params, array('limit_to'=>$limit_to, 'limit_from'=>$limit_from)), $driver_options); } public function getAll($sql, $params = array(), $driver_options = array(), $fetch_style = PDO::FETCH_ASSOC) { $stmt = $this->execute($sql, $params, $driver_options); $all = array(); while ($row = $stmt->fetch($fetch_style)) { if ($row) { foreach ($row as $col => $val) { if (is_resource($val)) $row[$col] = stream_get_contents($val); } $all[] = $row; } } return $all; } public function getOneAll($sql, $params = array(), $driver_options = array(), $column_number = 0) { $stmt = $this->execute($sql, $params, $driver_options); $ones = array(); while ($one = $stmt->fetchColumn($column_number)) { if (is_resource($one)) $ones[] = stream_get_contents($one); else $ones[] = $one; } return $ones; } public function getRow($sql, $params = array(), $driver_options = array(), $fetch_style = PDO::FETCH_ASSOC) { $stmt = $this->execute($sql, $params, $driver_options); $row = $stmt->fetch($fetch_style); if ($row) { foreach ($row as $col => $val) { if (is_resource($val)) $row[$col] = stream_get_contents($val); } } return $row; } public function getOne($sql, $params = array(), $driver_options = array(), $column_number = 0) { $stmt = $this->execute($sql, $params, $driver_options); $one = $stmt->fetchColumn($column_number); if (is_resource($one)) return stream_get_contents($one); else return $one; } public function execute($sql, $params = array(), $driver_options = array(), $transaction = false) { $start_time = microtime(true); $stmt = $this->prepare($sql, $driver_options); if ($stmt) { foreach ($params as $k => &$param) { $stmt->bindParam($k, $param, PDO::PARAM_STR, strlen($param)); } if ($transaction) $this->beginTransaction(); $ret = $stmt->execute(); if ($transaction) { if ($ret) { $this->commit(); } else { $this->rollBack(); } } } else { $ret = false; } $end_time = microtime(true); $exec_time = $end_time - $start_time; if (! defined('LOG_DB_LONGTIME')) define('LOG_DB_LONGTIME', false); if (LOG_DB_LONGTIME && $exec_time > LOG_DB_LONGTIME) { p(array('sql'=>$sql, 'params'=>$params, 'time'=>$exec_time), 'db_longtime'); } $error_msg = null; if (! $ret) { $error = $stmt ? $stmt->errorInfo() : $this->errorInfo(); if (isset($error[2]) && $error[2]) { $error_msg = $error[2]; p(array('sql'=>$sql, 'params'=>$params, 'error'=>$error_msg), 'db_runtime'); } } if (defined('RUNNING_MODE') && RUNNING_MODE == 'dev') { $this->doLog($sql, $exec_time, $params, $error_msg); } return $stmt; } } class SQLitePDO extends PDO { private $log = array(); private $connect_time = 0; private function doLog($sql, $time, $params = array(), $error = null) { if (DEBUG == false) return; $traces = array(); foreach (array_slice(debug_backtrace(), 2) as $trace) { $traces[] = array( 'file' => $trace['file'], 'line' => $trace['line'], 'func' => $trace['function'], ); } $this->log[] = array( 'sql' => $sql, 'params'=> $params, 'time' => $time, 'trace' => $traces, 'error' => $error, ); } public function getLog() { return $this->log; } public function getConnTime() { return $this->connect_time; } function __construct($dsn, $driver_options = array()) { try { $start_time = microtime(true); parent::__construct($dsn, null, null, array(PDO::ATTR_CASE=>PDO::CASE_LOWER) + $driver_options); $end_time = microtime(true); $connect_time = round($end_time - $start_time, 3); $this->connect_time = $connect_time; } catch(PDOException $e) { p(array_merge(array('dsn'=>$dsn), (array)$e->getMessage()), 'db_connect'); } } public function selectLimit($sql, $limit, $limit_from = 0, $params = array(), $driver_options = array()) { $limit_to = $limit_from + $limit; $sql .= " limit :limit_from,:limit_to"; return $this->getAll($sql, array_merge($params, array('limit_to'=>$limit_to, 'limit_from'=>$limit_from)), $driver_options); } public function getAll($sql, $params = array(), $driver_options = array(), $fetch_style = PDO::FETCH_ASSOC) { $stmt = $this->execute($sql, $params, $driver_options); $all = $stmt->fetchAll($fetch_style); return $all; } public function getOneAll($sql, $params = array() , $column_number = 0, $driver_options = array()) { $stmt = $this->execute($sql, $params, $driver_options); $all = array(); while ($row = $stmt->fetch(PDO::FETCH_NUM)) { $all[] = $row[$column_number]; } return $all; } public function getRow($sql, $params = array(), $driver_options = array(), $fetch_style = PDO::FETCH_ASSOC) { $stmt = $this->execute($sql, $params, $driver_options); $row = $stmt->fetch($fetch_style); return $row; } public function getOne($sql, $params = array(), $driver_options = array(), $column_number = 0) { $stmt = $this->execute($sql, $params, $driver_options); $one = $stmt->fetchColumn($column_number); return $one; } public function execute($sql, $params = array(), $driver_options = array(), $transaction = false) { $start_time = microtime(true); $stmt = $this->prepare($sql, $driver_options); if ($stmt) { foreach ($params as $k => &$param) { $stmt->bindParam($k, $param, PDO::PARAM_STR, strlen($param)); } if ($transaction) $this->beginTransaction(); $ret = $stmt->execute(); if ($transaction) { if ($ret) { $this->commit(); } else { $this->rollBack(); } } } else { $ret = false; } $end_time = microtime(true); $exec_time = $end_time - $start_time; if (! defined('LOG_DB_LONGTIME')) define('LOG_DB_LONGTIME', false); if (LOG_DB_LONGTIME && $exec_time > LOG_DB_LONGTIME) { p(array('sql'=>$sql, 'params'=>$params, 'time'=>$exec_time), 'db_longtime'); } $error_msg = null; if (! $ret) { $error = $stmt ? $stmt->errorInfo() : $this->errorInfo(); if (isset($error[2]) && $error[2]) { $error_msg = $error[2]; p(array('sql'=>$sql, 'params'=>$params, 'error'=>$error_msg), 'db_runtime'); } } if (defined('RUNNING_MODE') && RUNNING_MODE == 'dev') { $this->doLog($sql, $exec_time, $params, $error_msg); } return $stmt; } } class MysqlPDO extends PDO { private $log = array(); private $connect_time = 0; private function doLog($sql, $time, $params = array(), $error = null) { if (DEBUG == false) return; $traces = array(); foreach (array_slice(debug_backtrace(), 2) as $trace) { $traces[] = array( 'file' => $trace['file'], 'line' => $trace['line'], 'func' => $trace['function'], ); } $this->log[] = array( 'sql' => $sql, 'params'=> $params, 'time' => $time, 'trace' => $traces, 'error' => $error, ); } public function getLog() { return $this->log; } public function getConnTime() { return $this->connect_time; } function __construct($dsn, $username, $password, $driver_options = array()) { try { $start_time = microtime(true); parent::__construct($dsn, $username, $password, array(PDO::ATTR_CASE=>PDO::CASE_LOWER) + $driver_options); $end_time = microtime(true); $connect_time = round($end_time - $start_time, 3); $this->connect_time = $connect_time; } catch(PDOException $e) { p(array_merge(array('dsn'=>$dsn), (array)$e->getMessage()), 'db_connect'); } } public function selectLimit($sql, $limit, $limit_from = 0, $params = array(), $driver_options = array()) { $limit_to = $limit_from + $limit; $sql .= " limit :limit_from,:limit_to"; return $this->getAll($sql, array_merge($params, array('limit_to'=>$limit_to, 'limit_from'=>$limit_from)), $driver_options); } public function getAll($sql, $params = array(), $driver_options = array(), $fetch_style = PDO::FETCH_ASSOC) { $stmt = $this->execute($sql, $params, $driver_options); $all = $stmt->fetchAll($fetch_style); return $all; } public function getOneAll($sql, $params = array() , $column_number = 0, $driver_options = array()) { $stmt = $this->execute($sql, $params, $driver_options); $all = array(); while ($row = $stmt->fetch(PDO::FETCH_NUM)) { $all[] = $row[$column_number]; } return $all; } public function getRow($sql, $params = array(), $driver_options = array(), $fetch_style = PDO::FETCH_ASSOC) { $stmt = $this->execute($sql, $params, $driver_options); $row = $stmt->fetch($fetch_style); return $row; } public function getOne($sql, $params = array(), $driver_options = array(), $column_number = 0) { $stmt = $this->execute($sql, $params, $driver_options); $one = $stmt->fetchColumn($column_number); return $one; } public function execute($sql, $params = array(), $driver_options = array(), $transaction = false) { $start_time = microtime(true); $stmt = $this->prepare($sql, $driver_options); if ($stmt) { foreach ($params as $k => &$param) { $stmt->bindParam($k, $param, PDO::PARAM_STR, strlen($param)); } if ($transaction) $this->beginTransaction(); $ret = $stmt->execute(); if ($transaction) { if ($ret) { $this->commit(); } else { $this->rollBack(); } } } else { $ret = false; } $end_time = microtime(true); $exec_time = $end_time - $start_time; if (! defined('LOG_DB_LONGTIME')) define('LOG_DB_LONGTIME', false); if (LOG_DB_LONGTIME && $exec_time > LOG_DB_LONGTIME) { p(array('sql'=>$sql, 'params'=>$params, 'time'=>$exec_time), 'db_longtime'); } $error_msg = null; if (! $ret) { $error = $stmt ? $stmt->errorInfo() : $this->errorInfo(); if (isset($error[2]) && $error[2]) { $error_msg = $error[2]; p(array('sql'=>$sql, 'params'=>$params, 'error'=>$error_msg), 'db_runtime'); } } if (defined('RUNNING_MODE') && RUNNING_MODE == 'dev') { $this->doLog($sql, $exec_time, $params, $error_msg); } return $stmt; } }
zyroot
trunk/admin/lib/db.php
PHP
art
17,600
<?php class Session { /** * 判断是否启用session_start的标志符 * @access private * @var bool */ private $is_start = false; /** * 存储SESSION的命名前缀 * @access private * @var string */ private $prefix; function __construct($prefix = SITE_PREFIX) { $this->prefix = $prefix; ob_start(); } /** * 返回Session的单例 * @access public * @return object Session类的实例 */ public static function getInstance($prefix = SITE_PREFIX) { static $instance; if (! $instance) { $instance = new Session($prefix); } return $instance; } /** * 获取Session值 * @access public * @param string $key 需要获取的Session名 * @param mixed $default 当不存在需要获取的Session值时的默认值 * @return mixed 返回的Session值 */ public function get($key = null, $default = null) { $this->session_start(); if ($key) { $key = $this->prefix . $key; if (isset($_SESSION[$key])) { return $_SESSION[$key]; } else { return $default; } } else { return $this->getAll(); } } /** * 返回所有Session数据 * @access public * @return array 返回的所有Session数据 */ public function getAll() { return $_SESSION; } /** * 设置Session值 * @access public * @param string $key 需要设置的Session名 * @param mixed $value 需要设置的Session值 */ public function set($key, $value) { $this->session_start(); $key = $this->prefix . $key; $_SESSION[$key] = $value; } /** * 删除某Session值 * @access public * @param string $key 需要删除的Session名 */ public function del($key) { $this->session_start(); $key = $this->prefix . $key; unset($_SESSION[$key]); } /** * 删除某Session值,del()方法的别名 * @see del */ public function delete($key) { $this->session_start(); $key = $this->prefix . $key; $this->del($key); } /** * 销毁所有Session数据 * @access public */ public function destroy() { $this->session_start(); $this->is_start = false; $_SESSION = array(); } /** * 启动Session * @access private */ private function session_start() { if (! $this->is_start) { session_start(); $this->is_start = true; $uauth = md5(return_ip()); if (!$this->get('uauth')) { $this->set('uauth', $uauth); } else if ($uauth != $this->get('uauth')) { $this->destroy(); } } } } ?>
zyroot
trunk/admin/lib/session.php
PHP
art
3,279
<?php class Response { // CONTENT TYPE const JSON = 'application/json'; const HTML = 'text/html'; const JAVASCRIPT = 'text/javascript'; const JS = 'text/javascript'; const TEXT = 'text/plain'; const XML = 'text/xml'; static public $response_type = null; static public function JSON($data = array(), $content_type = Response::JSON) { self::$response_type = Response::JSON; if($content_type!==null){ header("Content-type: " . $content_type); } if (is_object($data)) $data = get_object_vars($data); else if (! is_array($data)) $data = array(); return htmlspecialchars(json_encode($data), ENT_NOQUOTES); } static public function HTML($data = array(), $content_type = Response::JSON) { self::$response_type = Response::HTML; header("Content-type: " . $content_type); if (is_object($data)) $data = get_object_vars($data); else if (! is_array($data)) $data = array(); return json_encode($data); } static public function STRING($data = '') { echo $data; exit; } } ?>
zyroot
trunk/admin/lib/response.php
PHP
art
1,241
<?php class Input { static public function getInstance(){ return new self(); } private function _fetch_from_array(&$array, $index = '' ,$default = null) { if ( ! isset($array[$index])) { return $default; } return $array[$index]; } public function get($index = '', $default = null) { return $this->_fetch_from_array($_GET, $index, $default); } public function post($index = '', $default = null) { return $this->_fetch_from_array($_POST, $index, $default); } public function request($index = '', $default = null) { if ( ! isset($_POST[$index])) { return $this->get($index, $default); } else { return $this->post($index, $default); } } public function isRequest($method) { $request_method = $_SERVER['REQUEST_METHOD']; if($request_method==$method){ return true; } return false; } public function isPost() { $request_method = $_SERVER['REQUEST_METHOD']; if($request_method=='POST'){ return true; } return false; } public function isGet() { $request_method = $_SERVER['REQUEST_METHOD']; if($request_method=='GET'){ return true; } return false; } public function isAjax() { return (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] === 'XMLHttpRequest'); } public function cookie($index = '', $default='') { return $this->_fetch_from_array($_COOKIE, $index,$default); } public function server($index = '', $default='') { return $this->_fetch_from_array($_SERVER, $index,$default); } }
zyroot
trunk/admin/lib/input.php
PHP
art
1,555
<?php class SnowPager { const DB = 1; const REDIS = 2; private $data_provider; private $pager; function __construct($dao, $curr_page = 1, $per_page = 10, $type = self::DB) { if ($type == self::DB) $this->data_provider = new PagerDBDataProvider($dao); else if ($type == self::REDIS) $this->data_provider = new PagerRedisDataProvider($dao); else return false; $this->pager = new Pager($per_page, $curr_page); } public function setTotalCount($cmd, $params = array()) { if (is_numeric($cmd)) $this->pager->setTotalCount($cmd); else $this->pager->setTotalCount($this->data_provider->getCount($cmd, $params)); return $this; } // alias function of setTotalCount public function ct($cmd, $params = array()) { return $this->setTotalCount($cmd, $params); } public function getResult($cmd, $params = array()) { if (is_string($cmd)) $rs = $this->data_provider->getResult($cmd, $this->pager->getPerPage(), ($this->pager->getCurrPage() - 1) * $this->pager->getPerPage(), $params); else if (is_array($cmd)) $rs = $cmd; return array('pager'=>$this->pager, 'rs'=>$rs); } // alias function of getResult public function rs($cmd, $params = array()) { return $this->getResult($cmd, $params); } public function getPager() { return $this->pager; } function __call($method, $arguments) { if (method_exists($this->pager, $method)) { if ($arguments) { return $this->pager->$method($arguments[0]); } else { return $this->pager->$method(); } } else { return false; } } } abstract class PagerDataProvider { protected $dao; function __construct($dao) { $this->dao = $dao; } abstract protected function getCount($cmd, $params = array()); abstract protected function getResult($cmd, $per_page, $offset, $params = array()); } class PagerDbDataProvider extends PagerDataProvider { public function getCount($count_sql, $params = array()) { return $this->dao->getOne($count_sql, $params); } public function getResult($select_sql, $per_page, $offset, $params = array()) { return $this->dao->selectLimit($select_sql, $per_page, $offset, $params); } } class PagerRedisDataProvider extends PagerDataProvider { public function getCount($set_key, $params = array()) { return $this->dao->sCard($set_key); } public function getResult($key, $per_page, $offset, $params = array()) { $fields = array(); if (isset($params['get'])) { foreach ((array)$params['get'] as $get) { if (false === ($pos = strpos($get, '->'))) { $fields[] = $get; } else { $fields[] = substr($get, $pos + 2); } } } $fields_count = count($fields); $redis_rs = array(); if (isset($params['store'])) { $redis_rs = $this->dao->lRange($params['store'], 0, $per_page * $fields_count); } if (! $redis_rs) { if (isset($params['expire'])) { $expire = $params['expire']; unset($params['expire']); } $params = array_merge($params, array('limit'=>array($offset, $per_page))); $redis_rs = $this->dao->sort($key, $params); if (isset($params['store'])) { $redis_rs = $this->dao->lRange($params['store'], 0, $per_page * $fields_count); $this->dao->expire($params['store'], $expire); } } $rs = $row = array(); if ($fields_count) { foreach ($redis_rs as $k => $v) { $i = $k % $fields_count; $row[$fields[$i]] = $v; if ($i == ($fields_count - 1)) { $rs[] = $row; $row = array(); } } return $rs; } else { return $redis_rs; } } } class Pager { public $total_count; public $per_page; public $curr_page; public $total_page = null; public $nearer_page = 5; function __construct($per_page = 10, $curr_page = 1) { $this->per_page = $per_page; $this->curr_page = $curr_page; $this->total_count = 0; } public function getTotalCount() { return $this->total_count; } public function setTotalCount($total_count) { $this->total_count = $total_count; } public function setNearerPage($offset){ $this->nearer_page = $offset; } public function getPerPage() { return $this->per_page; } public function setPerPage($per_page) { $this->per_page = $per_page; } public function getCurrPage() { return $this->curr_page; } public function setCurrPage($curr_page) { $this->curr_page = $curr_page; } public function getTotalPage() { return $this->total_page ? $this->total_page : ceil($this->getTotalCount() / $this->getPerPage()); } public function setTotalPage($total_page) { $this->total_page = $total_page; } public function hasFirstPage() { return $this->getCurrPage() != 1; } public function hasLastPage() { return $this->getCurrPage() != $this->getTotalPage(); } public function hasPrePage() { return $this->getCurrPage() > 1; } public function hasNextPage() { return $this->getCurrPage() < $this->getTotalPage(); } public function getNearerPages() { $min_page = (($this->getCurrPage() - $this->nearer_page) > 0 ) ? $this->getCurrPage() - $this->nearer_page : 1; $max_page = (($this->getCurrPage() + $this->nearer_page) < $this->getTotalPage()) ? $this->getCurrPage() + $this->nearer_page : $this->getTotalPage(); if ($min_page <= $max_page) return range($min_page, $max_page); else return array(); } } ?>
zyroot
trunk/admin/lib/pager.php
PHP
art
6,814
<?php /** * Created by JetBrains PhpStorm. * User: CAIXUDONG * Date: 11-6-15 * Time: 下午4:04 */ Class Template{ static public function show($view = '',$data = array()){ global $_input,$_session; if($view == ''){ $view = basename($_SERVER['SCRIPT_NAME']); } if (file_exists(VIEW_PATH . $view)){ if($data){ extract($data); } include VIEW_PATH . $view; }else{ die('模板:'.VIEW_PATH.$view.'没有找到!'); } } }
zyroot
trunk/admin/lib/template.php
PHP
art
581
<?php class Model { private $model; protected $reader; public $select_db = DEFAULT_DB_NAME; public function __construct($model) { $this->model = $model; $this->reader = $this->reader ? $this->reader : $this->model; } static final public function getInstance($model) { $model = ucwords($model); static $instances = array(); if (! isset($instances[$model])) { $file = strtolower($model); if (file_exists(MODEL_PATH . $file . '.php')){ include_once MODEL_PATH . $file . '.php'; $classname = $model.'Model'; $instances[$model] = new $classname($model); }else{ p('没有找到Model文件:'.MODEL_PATH.$file.'.php'); } } return $instances[$model]; } final public function db($db = DEFAULT_DB_NAME) { if($db != DEFAULT_DB_NAME){ $this->select_db = $db; } return DBFactory::getInstance($this->select_db); } final public function pager($curr_page = 1, $per_page = 10, $db_name = DEFAULT_DB_NAME) { include_once LIB_PATH . 'pager.php'; return new SnowPager($this->db($db_name), $curr_page, $per_page); } final public function input(){ return Input::getInstance(); } final public function session(){ return Session::getInstance(); } } ?>
zyroot
trunk/admin/lib/model.php
PHP
art
1,503
<?php function loadModule($module, $params = array()) { global $_user, $_session; if ($params) { extract($params); } $content = ''; if (file_exists($module_file = MODULE_PATH . $module . '.php')) { ob_start(); include $module_file; $content = ob_get_contents(); ob_end_clean(); } return $content; } function module($module, $params = array(), $cache_name = '', $expire = -1) { if (! $cache_name) $cache_name = $module; $content = ''; if ($expire < 0) { // no cache need $content = loadModule($module, $params); } else { // need cache for expire time if (! ($content = cache('cache:' . $cache_name))) { // no cache or cache expire out $content = loadModule($module, $params); cache('cache:' . $cache_name, $content, $expire); } } return $content; } function site_url($var=NULL) { if($var==NULL){ return SITE_URL; }else{ $var = trim($var,'/'); return SITE_URL.$var; } } function e($s){ echo $s,'<br/>'; } function return_ip() { $ip = "-1"; if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { $ip_a = explode(',',$_SERVER['HTTP_X_FORWARDED_FOR']) ; for($i=0;$i<count($ip_a);$i++) {// $tmp = trim($ip_a[$i]) ; if($tmp=='unknown'||$tmp=='127.0.0.1'||strncmp($tmp,'10.',3)==0||strncmp($tmp,'172',3)==0||strncmp($tmp,'192',3)==0) continue ; $ip = $tmp; break ; } } else if(!empty($_SERVER['HTTP_CLIENT_IP'])) { $ip = trim($_SERVER['HTTP_CLIENT_IP']); } else if (!empty($_SERVER['REMOTE_ADDR'])) { $ip = trim($_SERVER['REMOTE_ADDR']); } else { $ip = "-1"; } return $ip; } function p($info, $exit = true, $ret = false) { if (defined('RUNNING_MODE') && RUNNING_MODE == 'dev') { $debug = debug_backtrace(); $output = ''; $output .= '<b>File</b>:' . $debug[0]['file'] . '<br/>'; $output .= '<b>Line</b>:' . $debug[0]['line'] . '<br/>'; $output .= '<b>Info</b>:<br/>'; $output .= '<pre>'; $output .= var_export($info, true); $output .= '</pre>'; if ($ret) return $ret; else echo $output; if ($exit) exit; } else { return; } } function l($info, $file = 'info',$dir = LOG_PATH) { $debug = debug_backtrace(); if (count($debug) > 1) $debug = $debug[1]; else $debug = $debug[0]; $time = date('Y-m-d H:i:s'); $ip = $_SERVER['REMOTE_ADDR']; $url = $_SERVER['REQUEST_URI']; $file_name = $debug['file']; $line = $debug['line']; $function = $debug['function']; $info = is_string($info) ? $info : var_export($info, true); $server_addr = $_SERVER['SERVER_ADDR']; $str = 'Time:' . $time . ', ' . 'Server:' . $server_addr . ', ' . 'IP:' . $ip . ', ' . 'URL:' . $url . ', ' . 'File:' . $file_name . ', ' . 'Line:' . $line . ', ' . 'Function:' . $function . ', ' . 'Info:' . $info . "\n"; file_put_contents($dir . $file . '.log', $str, FILE_APPEND); } function curUrlName($str) { $cur_url_array = explode('.',$str); $cur_url_name = str_replace("/","",$cur_url_array[0]); return $cur_url_name; } //remove page val's url //@caixudong 增加两个参数,第一个是手动传入的额外参数,第二个是否从URL删除分页参数,默认删除 function parse_cur_url($p = array(),$remove_page = true){ //base url $base_name = '/' . basename($_SERVER['SCRIPT_FILENAME']); //ex url // $tmp_arr = $_GET + $_POST + $p; $tmp_arr = array_merge($_GET, $_POST, $p); // remove page if($remove_page) unset($tmp_arr['page']); if($tmp_arr) $ex_url = http_build_query($tmp_arr); else $ex_url = ''; //full url if($ex_url) $full_url = $base_name."?".$ex_url; else $full_url = $base_name; return $full_url; } //截取中文字符 function cnSubStr($string,$sublen,$tip='') { $len = strlen($string); if($sublen>=$len) { return $string; } $s=""; for($i=0;$i<$sublen;$i++) { if(ord($string{$i})>127) { $s.=$string{$i}.$string{++$i}; continue; }else{ $s.=$string{$i}; continue; } } if(strlen($s) >= $len) return $s; return $s.$tip; } //去除空格 function trim_space($s) { $s = mb_ereg_replace('^( | )+', '', $s); $s = mb_ereg_replace('( | )+$', '', $s); return $s; } //网页内容抓取 add by final function curl_get_contents($url,$timeout = 5){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_TIMEOUT, $timeout); curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)'); // curl_setopt($ch, CURLOPT_REFERER,_REFERER_); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); @curl_setopt($ch, CURLOPT_DNS_USE_GLOBAL_CACH, true); curl_setopt($ch, CURLOPT_DNS_CACHE_TIMEOUT, 86400); // 缓存一天 $content = curl_exec($ch); curl_close($ch); return $content; } // array_diff's bug for PHP5.2.6-5.3.3 function my_array_diff($a1, $a2) { $a2 = array_flip((array)$a2); foreach ((array)$a1 as $key => $item) { if (isset($a2[$item])) { unset($a1[$key]); } } return $a1; } function d($info = null, $time = false) { if (! DEBUG) return; static $debug_info = array(); if ($info != 'get_debug_data') { $debug_info[] = array('info'=>$info, 'backtrace'=>debug_backtrace()); if ($time) time_debug('debug_time_' . count($debug_info)); } return $debug_info; } //去除空格判断空 function trim_empty($str,$is_zh = false){ $str = $is_zh ? trim_space($str) : trim($str); return empty($str); } //获取HOST function getHttpHost(){ return "http://".(isset($_SERVER['HTTP_X_FORWARDED_HOST']) ? $_SERVER['HTTP_X_FORWARDED_HOST'] : (isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : '')); } //跳转 function redirect($uri = '/', $method = 'location', $http_response_code = 302) { switch($method) { case 'refresh' : header("Refresh:0;url=".$uri); break; default : header("Location: ".$uri, TRUE, $http_response_code); break; } exit; } $pub_roles_configs = array( 1=>array(2,3,10), 2=>array(10), 3=>array(4,10), 4=>array(5,10), 5=>array(6,10), 6=>array(7,8,10), 7=>array(4,10), 8=>array(9,10), 9=>array(), 10=>array(), ); function getPubStatusClass($funs,$status,$v,$test_is_role,$is_upload,$is_super_admin){ global $pub_roles_configs,$_session; if($funs['status'] == $status){ if($is_super_admin && $status == 9){ $url = 'list.php?a=logstatus&fun_id='.$funs['fun_id'].'&status='.$status; echo '<li class="select"><a href="'.site_url($url).'" target="dialog" title="置为'.$v.'?">>再次发布</a></li>'; }else{ echo '<li class="select">'.$v.'</li>'; } }else{ if(in_array($status,$pub_roles_configs[$funs['status']])){ $is_active = false; switch($status){ case 1: case 2: case 3: case 5://仅负责人操作 case 10: $is_active = $funs['puser_id'] == $_session->get('user_id'); break; case 4://所有人都提交,并且是负责人 $is_active = $is_upload && $funs['puser_id'] == $_session->get('user_id'); break; case 6://是发布人和负责人 $is_active = in_array($_session->get('user_id'),array($funs['puser_id'],$funs['user_id'])); break; case 7: case 8://是不是测试或者是超级管理员 $is_active = $test_is_role || $is_super_admin; break; case 9://只有负责人才可以发布,并且要时间大于填写的发布时间 $is_active = $funs['puser_id'] == $_session->get('user_id'); break; } if(!$is_active){ $v = $funs['status'] == 7 ? '重新提交' : $v; echo '<li class="active">'.$v.'</li>'; }else{ if(in_array($status,array(2,7,10)) || ($status == 8 && !$test_is_role && $is_super_admin) || ($status == 9 && strtotime($funs['online_time']) > time())){ $url = 'list.php?a=logstatus&fun_id='.$funs['fun_id'].'&status='.$status; echo '<li class="active"><a href="'.site_url($url).'" target="dialog" title="置为'.$v.'?">>'.$v.'</a></li>'; }else{ echo '<li class="active"><a href="javascript:void(0);" onclick="setPubStatus(\''.$funs['fun_id'].'\',\''.$status.'\',\''.$v.'\')" title="置为'.$v.'?">>'.$v.'</a></li>'; } } }else{ echo '<li class="disabled">'.$v.'</li>'; } } } function getPubStatusLog($status){ global $pub_status_configs; return '将状态置为:'.$pub_status_configs[$status]; } function rtxMessage($messages){ foreach($messages as $v){ $title = iconv('UTF-8','GBK',$v['title']); $message = iconv('UTF-8','GBK',$v['message']); $user_name = iconv('UTF-8','GBK',$v['user_name']); $rtx_notice = 'http://180.168.84.109:8012/sendnotify.cgi?delaytime=0&title='.$title.'&msg='.$message.'&receiver='.$user_name; //异步调用 // $fp = fsockopen("180.168.84.109", 8012, $errno, $errstr, 30); // if (!$fp) { // echo "$errstr ($errno)<br />\n"; // } else { // $out = "GET /sendnotify.cgi?delaytime=0&title=$title&msg=$message&receiver=$user_name / HTTP/1.1\r\n"; // $out .= "Host: 180.168.84.109\r\n"; // $out .= "Connection: Close\r\n\r\n"; // // fwrite($fp, $out); // /*忽略执行结果 // while (!feof($fp)) { // echo fgets($fp, 128); // }*/ // fclose($fp); // } curl_get_contents($rtx_notice,10); } } function getMultipleDocuments($nodes, $referer){ set_time_limit(90); if(!$referer){ $referer = $nodes[0]; } $node_count = count($nodes); $curl_arr = array(); $master = curl_multi_init(); for($i = 0; $i < $node_count; $i++) { $curl_arr[$i] = curl_init($nodes[$i]); curl_setopt($curl_arr[$i], CURLOPT_FOLLOWLOCATION, true); curl_setopt($curl_arr[$i],CURLOPT_FRESH_CONNECT,true); curl_setopt($curl_arr[$i],CURLOPT_CONNECTTIMEOUT,10); curl_setopt($curl_arr[$i],CURLOPT_RETURNTRANSFER,true); curl_setopt($curl_arr[$i],CURLOPT_REFERER,$referer); curl_setopt($curl_arr[$i],CURLOPT_TIMEOUT,30); curl_multi_add_handle($master, $curl_arr[$i]); } $previousActive = -1; $finalresult = array(); $returnedOrder = array(); do{ curl_multi_exec($master, $running); if($running !== $previousActive){ $info = curl_multi_info_read($master); if($info['handle']){ $finalresult[] = curl_multi_getcontent($info['handle']); $returnedOrder[] = array_search($info['handle'], $curl_arr, true); curl_multi_remove_handle($master, $info['handle']); curl_close($curl_arr[end($returnedOrder)]); echo 'downloaded '.$nodes[end($returnedOrder)].'. We can process it further straight away, but for this example, we will not.'; ob_flush();flush(); } } $previousActive = $running; }while($running > 0); curl_multi_close($master); set_time_limit(30); return array_combine($returnedOrder, $finalresult); } //$nodes = array('http://127.0.0.1/test/sock_server.php','http://127.0.0.1/test/sock_server.php','http://127.0.0.1/test/sock_server.php','http://127.0.0.1/test/sock_server.php','http://127.0.0.1/test/sock_server.php','http://127.0.0.1/test/sock_server.php','http://127.0.0.1/test/sock_server.php','http://127.0.0.1/test/sock_server.php','http://127.0.0.1/test/sock_server.php'); //$returnedDocs = getMultipleDocuments($nodes, null); function mkdirs($dir_path, $rights=0777){ $dirs = explode('/', $dir_path); $dir=''; foreach ($dirs as $part) { $dir .= $part.'/'; if (!is_dir($dir) && strlen($dir)>0){ mkdir($dir, $rights); } } }
zyroot
trunk/admin/lib/util.php
PHP
art
13,386
<?php class Controller { private $curr_class; public function __construct($classname) { $this->curr_class = $classname; } static final public function getInstance($controll) { $controll = ucwords($controll); static $instances = array(); if (! isset($instances[$controll])) { $controll = strtolower($controll); if (file_exists(CONTROLLER_PATH . $controll . '.php')){ include_once CONTROLLER_PATH . $controll . '.php'; $classname = ucfirst($controll.'Controller'); $instances[$controll] = new $classname($classname); }else{ p('没有找到Controller文件:'.CONTROLLER_PATH.$controll.'.php'); } } return $instances[$controll]; } final public function input(){ return Input::getInstance(); } final public function session(){ return Session::getInstance(); } public function __call($fun,$arg){ echo '{"statusCode":"300","message":"对不起,您访问的控制器不存在!<br/>'.$this->curr_class.'::'.$fun.'"}'; exit; } } ?>
zyroot
trunk/admin/lib/controller.php
PHP
art
1,234
<?php /** * Created by JetBrains PhpStorm. * User: CAIXUDONG * Date: 11-6-15 * Time: 下午3:59 */ include 'bootstrap.php'; //控制器名称 $file_name = basename(__FILE__,'.php'); $controller = $_input->get('m',$file_name); //动作名称 $action = $_input->get('a','index'); if(!in_array($action,array('login'))){ $user_info = Model::getInstance('user')->needLogin(); $_m = $controller == $file_name ? '' : '?m='.$controller; $_a = $action == 'index' ? '' : ($_m == '' ? '?' : '&') .'a='.$action; $action_name = strtolower(trim($file_name . '.php' . $_m . $_a)); $is_action = Model::getInstance('user')->isAction($action_name); } Controller::getInstance($controller)->{$action}();
zyroot
trunk/admin/index.php
PHP
art
736
package net.coobird.thumbnailator; import java.awt.Dimension; import java.awt.image.BufferedImage; import java.util.Collections; import java.util.List; import net.coobird.thumbnailator.filters.ImageFilter; import net.coobird.thumbnailator.geometry.Region; import net.coobird.thumbnailator.resizers.Resizer; /** * This class is used to specify the parameters to use when creating a thumbnail. * * @author coobird * */ public class ThumbnailParameter { /** * A constant used to denote that the output format of the thumbnail should * be the same as the format of the original image. */ public static final String ORIGINAL_FORMAT = null; /** * A constant used to denote that the output format type of the thumbnail * should be the default type of the codec being used. */ public static final String DEFAULT_FORMAT_TYPE = null; /** * A constant used to denote that the default compression quality settings * should be used when creating the thumbnail. */ public static final float DEFAULT_QUALITY = Float.NaN; /** * A constant used to denote that the image type of the original image * should be used when creating the thumbnail. */ public static final int ORIGINAL_IMAGE_TYPE = -1; /** * A constant used to denote that the default image type should be used * when creating the thumbnail. */ public static final int DEFAULT_IMAGE_TYPE = BufferedImage.TYPE_INT_ARGB; /** * The thumbnail size. * <p> * If this field is set, then the {@link #scalingFactor} field will be set * as {@link Double#NaN} to indicate that it is not set. */ private final Dimension thumbnailSize; /** * The scaling factor to apply to the width when creating a thumbnail from * the original image. * <p> * If this field is set, then the {@link #thumbnailSize} field will be set * as {@code null} to indicate that it is not set. */ private final double widthScalingFactor; /** * The scaling factor to apply to the height when creating a thumbnail from * the original image. * <p> * If this field is set, then the {@link #thumbnailSize} field will be set * as {@code null} to indicate that it is not set. */ private final double heightScalingFactor; /** * Indicated whether or not the thumbnail should retain the aspect ratio * the same as the original image when the aspect ratio of the desired * dimensions for the thumbnail does not match the ratio of the original * image. */ private final boolean keepAspectRatio; /** * The output format for the thumbnail. * <p> * A value of {@link ThumbnailParameter#ORIGINAL_FORMAT} indicates that the * image format of the original image should be used as the output format. */ private final String outputFormat; /** * The output format type for the thumbnail. * <p> * A value of {@link ThumbnailParameter#DEFAULT_FORMAT_TYPE} indicates * that the default type of the specified compression format should be used * as the output format type. */ private final String outputFormatType; /** * The output quality settings which will be used by the image compressor. * <p> * An acceptable value is in the range of {@code 0.0f} to {@code 1.0f}, * where {@code 0.0f} is for the lowest quality setting and {@code 1.0f} for * the highest quality setting. * <p> * A value of {@link Float#NaN} indicates that the default quality settings * of the output codec should be used. */ private final float outputQuality; /** * The image type of the {@code BufferedImage} used for the thumbnail. */ private final int imageType; /** * {@link ImageFilter}s to apply to the thumbnail. * <p> * The filters will be applied after the original image has been resized. */ private final List<ImageFilter> filters; /** * The {@link Resizer} to use when performing the resizing operation to * create a thumbnail. */ private final Resizer resizer; /** * The region of the source image to use when creating a thumbnail. * <p> * A value of {@code null} represents that the entire source image should * be used to create the thumbnail. */ private final Region sourceRegion; /** * Perform validations on the {@code thumbnailSize} field. */ private void validateThumbnailSize() { if (thumbnailSize == null) { throw new IllegalArgumentException("Thumbnail size cannot be null."); } else if (thumbnailSize.width < 0 || thumbnailSize.height < 0) { throw new IllegalArgumentException("Thumbnail dimensions must be greater than 0."); } } /** * Perform validations on the {@code widthScalingFactor} and * {@code heightScalingFactor} fields. */ private void validateScalingFactor() { if (widthScalingFactor <= 0.0 || heightScalingFactor <= 0.0) { throw new IllegalArgumentException("Scaling factor is less than or equal to 0."); } else if (Double.isNaN(widthScalingFactor) || Double.isInfinite(widthScalingFactor)) { throw new IllegalArgumentException("Scaling factor must be a rational number."); } else if (Double.isNaN(heightScalingFactor) || Double.isInfinite(heightScalingFactor)) { throw new IllegalArgumentException("Scaling factor must be a rational number."); } } /** * A private constructor to be used to instantiate an object holding the * parameters needed in order to make a thumbnail. * * @param thumbnailSize The size of the thumbnail to generate. * @param widthScalingFactor The scaling factor to apply to the width * when creating a thumbnail from the original * image. * @param heightScalingFactor The scaling factor to apply to the height * when creating a thumbnail from the original * image. * @param sourceRegion The region of the source image to use when * creating a thumbnail. * A value of {@code null} indicates that the * entire source image should be used to create * the thumbnail. * @param keepAspectRatio Indicates whether or not the thumbnail should * maintain the aspect ratio of the original image. * @param outputFormat A string indicating the compression format * that should be applied on the thumbnail. * A value of * {@link ThumbnailParameter#ORIGINAL_FORMAT} * should be provided if the same image format as * the original should be used for the thumbnail. * @param outputFormatType A string indicating the compression type that * should be used when writing the thumbnail. * A value of * {@link ThumbnailParameter#DEFAULT_FORMAT_TYPE} * should be provided if the thumbnail should be * written using the default compression type of * the codec specified in {@code outputFormat}. * @param outputQuality A value from {@code 0.0f} to {@code 1.0f} which * indicates the quality setting to use for the * compression of the thumbnail. {@code 0.0f} * indicates the lowest quality, {@code 1.0f} * indicates the highest quality setting for the * compression. * {@link ThumbnailParameter#DEFAULT_QUALITY} * should be specified when the codec's default * compression quality settings should be used. * @param imageType The {@link BufferedImage} image type of the * thumbnail. * A value of * {@link ThumbnailParameter#DEFAULT_IMAGE_TYPE} * should be specified when the default image * type should be used when creating the thumbnail. * @param filters The {@link ImageFilter}s to apply to the * thumbnail. * A value of {@code null} will be recognized as * no filters are to be applied. * The filters are applied after the original * image has been resized. * @param resizer The {@link Resizer} to use when performing the * resizing operation to create a thumbnail. * * @throws IllegalArgumentException If size is {@code null} or if the * dimensions are negative. */ private ThumbnailParameter( Dimension thumbnailSize, double widthScalingFactor, double heightScalingFactor, Region sourceRegion, boolean keepAspectRatio, String outputFormat, String outputFormatType, float outputQuality, int imageType, List<ImageFilter> filters, Resizer resizer ) { if (thumbnailSize == null) { throw new IllegalArgumentException("Thumbnail size cannot be null."); } else if (thumbnailSize.width < 0 || thumbnailSize.height < 0) { throw new IllegalArgumentException("Thumbnail dimensions must be greater than 0."); } this.thumbnailSize = thumbnailSize; this.sourceRegion = sourceRegion; this.widthScalingFactor = widthScalingFactor; this.heightScalingFactor = heightScalingFactor; this.keepAspectRatio = keepAspectRatio; this.outputFormat = outputFormat; this.outputFormatType = outputFormatType; /* * Note: * The value of DEFAULT_QUALITY is Float.NaN which cannot be compared * by using the regular == operator. Therefore, to check that NaN is * being used, one must use the Float.NaN method. */ if ( (outputQuality < 0.0f || outputQuality > 1.0f) && !Float.isNaN(outputQuality) ) { throw new IllegalArgumentException("The output quality must be " + "between 0.0f and 1.0f, or Float.NaN to use the default " + "compression quality of codec being used."); } this.outputQuality = outputQuality; this.imageType = imageType; this.filters = filters == null ? Collections.<ImageFilter>emptyList() : filters; if (resizer == null) { throw new IllegalArgumentException("Resizer cannot be null"); } this.resizer = resizer; } /** * Creates an object holding the parameters needed in order to make a * thumbnail. * * @param thumbnailSize The size of the thumbnail to generate. * @param sourceRegion The region of the source image to use when * creating a thumbnail. * A value of {@code null} indicates that the * entire source image should be used to create * the thumbnail. * @param keepAspectRatio Indicates whether or not the thumbnail should * maintain the aspect ratio of the original image. * @param outputFormat A string indicating the compression format * that should be applied on the thumbnail. * A value of * {@link ThumbnailParameter#ORIGINAL_FORMAT} * should be provided if the same image format as * the original should be used for the thumbnail. * @param outputFormatType A string indicating the compression type that * should be used when writing the thumbnail. * A value of * {@link ThumbnailParameter#DEFAULT_FORMAT_TYPE} * should be provided if the thumbnail should be * written using the default compression type of * the codec specified in {@code outputFormat}. * @param outputQuality A value from {@code 0.0f} to {@code 1.0f} which * indicates the quality setting to use for the * compression of the thumbnail. {@code 0.0f} * indicates the lowest quality, {@code 1.0f} * indicates the highest quality setting for the * compression. * {@link ThumbnailParameter#DEFAULT_QUALITY} * should be specified when the codec's default * compression quality settings should be used. * @param imageType The {@link BufferedImage} image type of the * thumbnail. * A value of * {@link ThumbnailParameter#DEFAULT_IMAGE_TYPE} * should be specified when the default image * type should be used when creating the thumbnail. * @param filters The {@link ImageFilter}s to apply to the * thumbnail. * A value of {@code null} will be recognized as * no filters are to be applied. * The filters are applied after the original * image has been resized. * @param resizer The {@link Resizer} to use when performing the * resizing operation to create a thumbnail. * * @throws IllegalArgumentException If size is {@code null} or if the * dimensions are negative. */ public ThumbnailParameter( Dimension thumbnailSize, Region sourceRegion, boolean keepAspectRatio, String outputFormat, String outputFormatType, float outputQuality, int imageType, List<ImageFilter> filters, Resizer resizer ) { this( thumbnailSize, Double.NaN, Double.NaN, sourceRegion, keepAspectRatio, outputFormat, outputFormatType, outputQuality, imageType, filters, resizer ); validateThumbnailSize(); } /** * Creates an object holding the parameters needed in order to make a * thumbnail. * * @param widthScalingFactor The scaling factor to apply to the width * when creating a thumbnail from the original * image. * @param heightScalingFactor The scaling factor to apply to the height * when creating a thumbnail from the original * image. * @param sourceRegion The region of the source image to use when * creating a thumbnail. * A value of {@code null} indicates that the * entire source image should be used to create * the thumbnail. * @param keepAspectRatio Indicates whether or not the thumbnail should * maintain the aspect ratio of the original image. * @param outputFormat A string indicating the compression format * that should be applied on the thumbnail. * A value of * {@link ThumbnailParameter#ORIGINAL_FORMAT} * should be provided if the same image format as * the original should be used for the thumbnail. * @param outputFormatType A string indicating the compression type that * should be used when writing the thumbnail. * A value of * {@link ThumbnailParameter#DEFAULT_FORMAT_TYPE} * should be provided if the thumbnail should be * written using the default compression type of * the codec specified in {@code outputFormat}. * @param outputQuality A value from {@code 0.0f} to {@code 1.0f} which * indicates the quality setting to use for the * compression of the thumbnail. {@code 0.0f} * indicates the lowest quality, {@code 1.0f} * indicates the highest quality setting for the * compression. * {@link ThumbnailParameter#DEFAULT_QUALITY} * should be specified when the codec's default * compression quality settings should be used. * @param imageType The {@link BufferedImage} image type of the * thumbnail. * A value of * {@link ThumbnailParameter#DEFAULT_IMAGE_TYPE} * should be specified when the default image * type should be used when creating the thumbnail. * @param filters The {@link ImageFilter}s to apply to the * thumbnail. * A value of {@code null} will be recognized as * no filters are to be applied. * The filters are applied after the original * image has been resized. * @param resizer The {@link Resizer} to use when performing the * resizing operation to create a thumbnail. * * @throws IllegalArgumentException If the scaling factor is not a * rational number or is less than or * equal to 0. */ public ThumbnailParameter( double widthScalingFactor, double heightScalingFactor, Region sourceRegion, boolean keepAspectRatio, String outputFormat, String outputFormatType, float outputQuality, int imageType, List<ImageFilter> filters, Resizer resizer ) { this( null, widthScalingFactor, heightScalingFactor, sourceRegion, keepAspectRatio, outputFormat, outputFormatType, outputQuality, imageType, filters, resizer ); validateScalingFactor(); } /** * Returns the size of the thumbnail. * <p> * Returns {@code null} if the scaling factor is set rather than the * explicit thumbnail size. * * @return The size of the thumbnail. */ public Dimension getSize() { if (thumbnailSize != null) { return (Dimension)thumbnailSize.clone(); } else { return null; } } /** * Returns the scaling factor to apply to the width when creating the * thumbnail. * <p> * Returns {@link Double#NaN} if the thumbnail size is set rather than the * scaling factor. * * @return The width scaling factor for the thumbnail. * @since 0.3.10 */ public double getWidthScalingFactor() { return widthScalingFactor; } /** * Returns the scaling factor to apply to the height when creating the * thumbnail. * <p> * Returns {@link Double#NaN} if the thumbnail size is set rather than the * scaling factor. * * @return The height scaling factor for the thumbnail. * @since 0.3.10 */ public double getHeightScalingFactor() { return heightScalingFactor; } /** * Returns the type of image. The value returned is the constant used for * image types of {@link BufferedImage}. * * @return The type of the image. */ public int getType() { return imageType; } /** * Returns whether or not the thumbnail is to maintain the aspect ratio of * the source image when creating the thumbnail. * * @return {@code true} if the thumbnail is to maintain the aspect * ratio of the original image, {@code false} otherwise. */ public boolean isKeepAspectRatio() { return keepAspectRatio; } /** * Returns the output format for the thumbnail. * <p> * If the output format is to use the same compression format as the * original image, this method will return * {@link ThumbnailParameter#ORIGINAL_FORMAT}. * * @return The output format for the thumbnail. */ public String getOutputFormat() { return outputFormat; } /** * Returns the output format type for the thumbnail. * <p> * If the default compression type of the compression format is to be used, * then this method will return * {@link ThumbnailParameter#DEFAULT_FORMAT_TYPE}. * * @return The output format type for the thumbnail. */ public String getOutputFormatType() { return outputFormatType; } /** * Returns the compression quality settings for the thumbnail. * <p> * The value is in the range of {@code 0.0f} to {@code 1.0f}, * where {@code 0.0f} is for the lowest quality setting and {@code 1.0f} for * the highest quality setting. * <p> * If the default compression quality is to be used, then this method will * return {@link ThumbnailParameter#DEFAULT_QUALITY}. * * @return The compression quality settings for the thumbnail. */ public float getOutputQuality() { return outputQuality; } /** * Returns the list of {@link ImageFilter}s which are applied to the * thumbnail. * <p> * These filters are applied after the original image has been resized. * * @return The {@link ImageFilter}s which are applied to the thumbnail. */ public List<ImageFilter> getImageFilters() { return Collections.unmodifiableList(filters); } /** * Returns the {@link Resizer} to use when performing the resizing * operation to create the thumbnail. * * @return The {@link Resizer} to use when creating a thumbnail. */ public Resizer getResizer() { return resizer; } /** * Returns whether or not the original image type should be used for the * thumbnail. * * @return {@code true} if the original image type should be used, * {@code false} otherwise. */ public boolean useOriginalImageType() { return imageType == ORIGINAL_IMAGE_TYPE; } /** * Returns the region of the source image to use when creating a thumbnail, * represented by a {@link Region} object. * * @return The {@code Region} object representing the source region * to use when creating a thumbnail. * <p> * A value of {@code null} indicates that the entire source * image should be used to create the thumbnail. */ public Region getSourceRegion() { return sourceRegion; } }
zyslovely-thumb
src/net/coobird/thumbnailator/ThumbnailParameter.java
Java
mit
20,920
package net.coobird.thumbnailator.makers; import java.awt.image.BufferedImage; import java.util.HashMap; import java.util.Map; import net.coobird.thumbnailator.builders.BufferedImageBuilder; import net.coobird.thumbnailator.resizers.Resizer; import net.coobird.thumbnailator.resizers.ResizerFactory; /** * An abstract class which provides support functionalities for * {@link ThumbnailMaker} implementations. * * @author coobird * */ public abstract class ThumbnailMaker { /** * String used for an exception message. */ private static final String NOT_READY_FOR_MAKE = "Maker not ready to " + "make thumbnail."; /** * Used when determining whether the "imageType" parameter has been set * already or not. */ private static final String PARAM_IMAGE_TYPE = "imageType"; /** * Used when determining whether the "resizer" parameter has been set * already or not. */ private static final String PARAM_RESIZER = "resizer"; /** * Class which keeps track of the parameters being set for the * {@link ThumbnailMaker}. * <p> * This class provides functionality to determine whether or not all the * required parameters have been set or not. * * @author coobird * */ protected final static class ReadinessTracker { private final Map<String, Boolean> alreadySetMap = new HashMap<String, Boolean>(); /** * Returns whether or not the {@link ThumbnailMaker} has all its * required parameter set to be able to make a thumbnail. * * @return {@code true} if the {@link ThumbnailMaker} is ready * to make thumbnails, {@code false} otherwise. */ protected boolean isReady() { for (Map.Entry<String, Boolean> entry : alreadySetMap.entrySet()) { if (!entry.getValue()) { return false; } } return true; } /** * Tells the {@link ReadinessTracker} that the given parameter has not * yet been set by the {@link ThumbnailMaker}. * * @param parameterName The parameter which has not been set. */ protected void unset(String parameterName) { alreadySetMap.put(parameterName, false); } /** * Tells the {@link ReadinessTracker} that the given parameter has been * set by the {@link ThumbnailMaker}. * * @param parameterName The parameter to be marked as being set. */ protected void set(String parameterName) { alreadySetMap.put(parameterName, true); } /** * Returns whether the specified parameter has already been set. * * @param parameterName The parameter to check whether it has been * already set or not * @return {@code true} if the parameter has been set, * {@code false} otherwise. */ protected boolean isSet(String parameterName) { return alreadySetMap.get(parameterName); } } /** * Object used to keep track whether the required parameters for creating * a thumbnail has been set. */ protected final ReadinessTracker ready; /** * Default image type of the thumbnails created by {@link ThumbnailMaker}. */ private static final int DEFAULT_IMAGE_TYPE = BufferedImage.TYPE_INT_ARGB; /** * The image type of the resulting thumbnail. */ protected int imageType; /** * The {@link Resizer} to use when performing resizing operations. * <p> * If this field is kept {@code null}, the {@link Resizer} to use will be * determined when the thumbnail is to be created. * <p> * By delaying the decision of picking the {@link Resizer} to use until * when the thumbnail is to be created could lead to a more suitable * {@link Resizer} being picked, as the dimensions for the source and * destination images are known at that time. */ protected Resizer resizer; /** * Creates and initializes an instance of {@link ThumbnailMaker}. */ public ThumbnailMaker() { ready = new ReadinessTracker(); ready.unset(PARAM_IMAGE_TYPE); ready.unset(PARAM_RESIZER); defaultImageType(); defaultResizer(); } /** * Makes a thumbnail. * * @param img The source image. * @return The thumbnail created from the source image, using the * parameters set by the {@link ThumbnailMaker}. */ public abstract BufferedImage make(BufferedImage img); /** * Makes a thumbnail of the specified dimensions, from the specified * source image. * * @param img The source image. * @param width The target width of the thumbnail. * @param height The target height of the thumbnail. * @return The thumbnail image. * @throws IllegalStateException If the {@code ThumbnailMaker} is * not ready to create thumbnails. * @throws IllegalArgumentException If the width and/or height is zero. */ protected BufferedImage makeThumbnail( BufferedImage img, int width, int height ) { if (!ready.isReady()) { throw new IllegalStateException(ThumbnailMaker.NOT_READY_FOR_MAKE); } if (width == 0) { throw new IllegalArgumentException("Width cannot be zero."); } if (height == 0) { throw new IllegalArgumentException("Height cannot be zero."); } BufferedImage resultImage = new BufferedImageBuilder(width, height, imageType).build(); resizer.resize(img, resultImage); return resultImage; } /** * Sets the type for the {@link BufferedImage} to produce. * * @param imageType The type of the {@code BufferedImage}. * @return A reference to this object. */ public ThumbnailMaker imageType(int imageType) { this.imageType = imageType; ready.set(PARAM_IMAGE_TYPE); return this; } /** * Sets the type of the {@link BufferedImage} to be the default type. * * @return A reference to this object. */ public ThumbnailMaker defaultImageType() { return imageType(DEFAULT_IMAGE_TYPE); } /** * Sets the {@link Resizer} which is used for the resizing operation. * * @param resizer The {@link Resizer} to use when resizing the image * to create the thumbnail. * @return A reference to this object. */ public ThumbnailMaker resizer(Resizer resizer) { this.resizer = resizer; ready.set(PARAM_RESIZER); return this; } /** * Sets the {@link Resizer} to use the default {@link Resizer}. * * @return A reference to this object. */ public ThumbnailMaker defaultResizer() { return resizer(ResizerFactory.getResizer()); } }
zyslovely-thumb
src/net/coobird/thumbnailator/makers/ThumbnailMaker.java
Java
mit
6,601
package net.coobird.thumbnailator.makers; import java.awt.image.BufferedImage; /** * A {@link ThumbnailMaker} which resizes an image to a specified dimension * when producing a thumbnail. * <p> * Optionally, if the aspect ratio of the thumbnail is to be maintained the same * as the original image (by calling the {@link #keepAspectRatio(boolean)} * method with the value {@code true}), then the dimensions specified by the * {@link #size(int, int)} method, {@link #FixedSizeThumbnailMaker(int, int)} or * {@link #FixedSizeThumbnailMaker(int, int, boolean)} constructor will be used * as the maximum constraint of dimensions of the thumbnail. * <p> * In other words, when the aspect ratio is to be kept constant, then * thumbnails which are created will be sized to fit inside the dimensions * specified by the size parameter. * <p> * <DL> * <DT><B>Usage:</B></DT> * <DD> * The following example demonstrates how to create a thumbnail which fits * within 200 pixels by 200 pixels, while preserving the aspect ratio of the * source image: * <pre> BufferedImage img = ImageIO.read(new File("sourceImage.jpg")); BufferedImage thumbnail = new FixedSizeThumbnailMaker() .size(200, 200) .keepAspectRatio(true) .make(img); * </pre> * </DD> * </DL> * * @author coobird * */ public final class FixedSizeThumbnailMaker extends ThumbnailMaker { private static final String PARAM_SIZE = "size"; private static final String PARAM_KEEP_RATIO = "keepRatio"; private int width; private int height; private boolean keepRatio; /** * Creates a {@link FixedSizeThumbnailMaker}. * <p> * The size of the resulting thumbnail, and whether or not the aspect ratio * of the original image should be maintained in the thumbnail must be * set before this instance is able to produce thumbnails. */ public FixedSizeThumbnailMaker() { super(); ready.unset(PARAM_SIZE); ready.unset(PARAM_KEEP_RATIO); } /** * Creates a {@link FixedSizeThumbnailMaker} which is to create thumbnails * with the specified size. * <p> * Before this instance is able to produce thumbnails, whether or not the * aspect ratio of the original image should be maintained in the thumbnail * must be specified by calling the {@link #keepAspectRatio(boolean)} * method. * * @param width The width of the thumbnail to produce. * @param height The height of the thumbnails to produce. */ public FixedSizeThumbnailMaker(int width, int height) { this(); size(width, height); } /** * Creates a {@link FixedSizeThumbnailMaker} which is to create thumbnails * with the specified size, and also preserves the aspect ratio of the * original image in the thumbnail. * * @param width The width of the thumbnail to produce. * @param height The height of the thumbnails to produce. * @param aspectRatio Whether or not to maintain the aspect ratio in the * thumbnail the same as the original image. * <p> * If {@code true} is specified, then the * thumbnail image will have the same aspect ratio * as the original image. */ public FixedSizeThumbnailMaker(int width, int height, boolean aspectRatio) { this(); size(width, height); keepAspectRatio(aspectRatio); } /** * Sets the size of the thumbnail to produce. * * @param width The width of the thumbnail to produce. * @param height The height of the thumbnails to produce. * @return A reference to this object. * @throws IllegalStateException If the size has already * been previously set. */ public FixedSizeThumbnailMaker size(int width, int height) { if (ready.isSet(PARAM_SIZE)) { throw new IllegalStateException( "The size has already been set." ); } this.width = width; this.height = height; ready.set(PARAM_SIZE); return this; } /** * Sets whether or not the thumbnail is to maintain the aspect ratio of * the original image. * * @param keep Whether or not to maintain the aspect ratio in the * thumbnail the same as the original image. * <p> * If {@code true} is specified, then the * thumbnail image will have the same aspect ratio * as the original image. * @return A reference to this object. * @throws IllegalStateException If whether to keep the aspect ratio has * already been previously set. */ public FixedSizeThumbnailMaker keepAspectRatio(boolean keep) { if (ready.isSet(PARAM_KEEP_RATIO)) { throw new IllegalStateException( "Whether to keep the aspect ratio has already been set." ); } this.keepRatio = keep; ready.set(PARAM_KEEP_RATIO); return this; } @Override public BufferedImage make(BufferedImage img) { int targetWidth = this.width; int targetHeight = this.height; if (keepRatio) { int sourceWidth = img.getWidth(); int sourceHeight = img.getHeight(); double sourceRatio = (double)sourceWidth / (double)sourceHeight; double targetRatio = (double)targetWidth / (double)targetHeight; /* * If the ratios are not the same, then choose a width and height * which will fit within the target width and height. */ if (Double.compare(sourceRatio, targetRatio) != 0) { if (sourceRatio > targetRatio) { targetWidth = width; targetHeight = (int)(targetWidth / sourceRatio); } else { targetWidth = (int)(targetHeight * sourceRatio); targetHeight = height; } } } return super.makeThumbnail(img, targetWidth, targetHeight); } }
zyslovely-thumb
src/net/coobird/thumbnailator/makers/FixedSizeThumbnailMaker.java
Java
mit
5,785
/** * This package provides classes which can be used to make thumbnails given * parameters to create the images. */ package net.coobird.thumbnailator.makers;
zyslovely-thumb
src/net/coobird/thumbnailator/makers/package-info.java
Java
mit
167
package net.coobird.thumbnailator.makers; import java.awt.image.BufferedImage; /** * A {@link ThumbnailMaker} which scales an image by a specified scaling factor * when producing a thumbnail. * <p> * <DL> * <DT><B>Usage:</B></DT> * <DD> * The following example demonstrates how to create a thumbnail which is 25% * the size of the source image: * <pre> BufferedImage img = ImageIO.read(new File("sourceImage.jpg")); BufferedImage thumbnail = new ScaledThumbnailMaker() .scale(0.25) .make(img); * </pre> * </DD> * </DL> * It is also possible to independently specify the scaling factor for the * width and height. (If the two scaling factors are not equal then the aspect * ratio of the original image will not be preserved.) * <p> * <DL> * <DT><B>Usage:</B></DT> * <DD> * The following example demonstrates how to create a thumbnail which is scaled * 50% in the width and 75% in the height: * <pre> BufferedImage img = ImageIO.read(new File("sourceImage.jpg")); BufferedImage thumbnail = new ScaledThumbnailMaker() .scale(0.50, 0.75) .make(img); * </pre> * </DD> * </DL> * * @author coobird * */ public final class ScaledThumbnailMaker extends ThumbnailMaker { private static final String PARAM_SCALE = "scale"; /** * The scaling factor to apply to the width when resizing an image to * create a thumbnail. */ private double widthFactor; /** * The scaling factor to apply to the height when resizing an image to * create a thumbnail. */ private double heightFactor; /** * <p> * Creates an instance of {@code ScaledThumbnailMaker} without the * scaling factor specified. * </p> * <p> * To use this {@code ScaledThumbnailMaker}, one must specify the * scaling factor to use by calling the {@link #scale(double)} method * before generating a thumbnail. * </p> */ public ScaledThumbnailMaker() { super(); ready.unset(PARAM_SCALE); } /** * Creates an instance of {@code ScaledThumbnailMaker} with the specified * scaling factor. * * @param factor The scaling factor to apply when resizing an * image to create a thumbnail. */ public ScaledThumbnailMaker(double factor) { this(); scale(factor); } /** * Creates an instance of {@code ScaledThumbnailMaker} with the specified * scaling factors for the width and height. * * @param widthFactor The scaling factor to apply to the width when * resizing an image to create a thumbnail. * @param heightFactor The scaling factor to apply to the height when * resizing an image to create a thumbnail. * @since 0.3.10 */ public ScaledThumbnailMaker(double widthFactor, double heightFactor) { this(); scale(widthFactor, heightFactor); } /** * <p> * Sets the scaling factor for the thumbnail. * </p> * <p> * The aspect ratio of the resulting image is unaltered from the original. * </p> * * @param factor The scaling factor to apply when resizing an * image to create a thumbnail. * @return A reference to this object. * @throws IllegalStateException If the scaling factor has already * been previously set. */ public ScaledThumbnailMaker scale(double factor) { if (ready.isSet(PARAM_SCALE)) { throw new IllegalStateException( "The scaling factor has already been set." ); } this.widthFactor = factor; this.heightFactor = factor; ready.set(PARAM_SCALE); return this; } /** * <p> * Sets the scaling factors for the thumbnail. * </p> * * @param widthFactor The scaling factor to apply to the width when * resizing an image to create a thumbnail. * @param heightFactor The scaling factor to apply to the height when * resizing an image to create a thumbnail. * @return A reference to this object. * @throws IllegalStateException If the scaling factor has already * been previously set. * @since 0.3.10 */ public ScaledThumbnailMaker scale(double widthFactor, double heightFactor) { if (ready.isSet(PARAM_SCALE)) { throw new IllegalStateException( "The scaling factor has already been set." ); } this.widthFactor = widthFactor; this.heightFactor = heightFactor; ready.set(PARAM_SCALE); return this; } @Override public BufferedImage make(BufferedImage img) { int width = (int)(img.getWidth() * widthFactor); int height = (int)(img.getHeight() * heightFactor); return super.makeThumbnail(img, width, height); } }
zyslovely-thumb
src/net/coobird/thumbnailator/makers/ScaledThumbnailMaker.java
Java
mit
4,699
package net.coobird.thumbnailator.geometry; import java.awt.Point; /** * This interface is implemented by classes which calculate how to position an * object inside of an enclosing object. * * @author coobird * */ public interface Position { /** * Calculates the position of an object enclosed by an enclosing object. * * @param enclosingWidth The width of the enclosing object that is * to contain the enclosed object. * @param enclosingHeight The height of the enclosing object that is * to contain the enclosed object. * @param width The width of the object that is to be * placed inside an enclosing object. * @param height The height of the object that is to be * placed inside an enclosing object. * @param insetLeft The inset on the left-hand side of the * object to be enclosed. * @param insetRight The inset on the right-hand side of the * object to be enclosed. * @param insetTop The inset on the top side of the * object to be enclosed. * @param insetBottom The inset on the bottom side of the * object to be enclosed. * @return The position to place the object. */ public Point calculate( int enclosingWidth, int enclosingHeight, int width, int height, int insetLeft, int insetRight, int insetTop, int insetBottom ); }
zyslovely-thumb
src/net/coobird/thumbnailator/geometry/Position.java
Java
mit
1,423
package net.coobird.thumbnailator.geometry; import java.awt.Point; /** * This class calculates the position of an image which is to be enclosed, * using an absolute coordinate at which the image should be located. * * @author coobird * */ public final class Coordinate implements Position { /** * The horizontal position of the image to be enclosed. */ private final int x; /** * The vertical position of the image to be enclosed. */ private final int y; /** * Instantiates an object which calculates the position of an image, using * the given coordinates. * * @param x The horizontal component of the top-left corner of the * image to be enclosed. * @param y The vertical component of the top-left corner of the * image to be enclosed. */ public Coordinate(int x, int y) { this.x = x; this.y = y; } public Point calculate(int enclosingWidth, int enclosingHeight, int width, int height, int insetLeft, int insetRight, int insetTop, int insetBottom) { int x = this.x + insetLeft; int y = this.y + insetTop; return new Point(x, y); } }
zyslovely-thumb
src/net/coobird/thumbnailator/geometry/Coordinate.java
Java
mit
1,166
/** * This package contains classes used to specify positioning of watermarks and * other objects in Thumbnailator. */ package net.coobird.thumbnailator.geometry;
zyslovely-thumb
src/net/coobird/thumbnailator/geometry/package-info.java
Java
mit
171
package net.coobird.thumbnailator.geometry; import java.awt.Dimension; /** * A {@link Size} object which indicates that the size of the enclosed object * should be the specified absolute size. * * @author coobird * @since 0.3.4 * */ public class AbsoluteSize implements Size { /** * The size of the object. */ private final Dimension size; /** * Instantiates an object which indicates size of an object. * * @param size Size of the enclosed object. * @throws NullPointerException If the size is {@code null}. */ public AbsoluteSize(Dimension size) { if (size == null) { throw new NullPointerException("Size cannot be null."); } this.size = new Dimension(size); } /** * Instantiates an object which indicates size of an object. * * @param width Width of the enclosed object. * @param height Height of the enclosed object. * @throws IllegalArgumentException If the width and/or height is less * than or equal to {@code 0}. */ public AbsoluteSize(int width, int height) { if (width <= 0 || height <= 0) { throw new IllegalArgumentException( "Width and height must be greater than 0." ); } this.size = new Dimension(width, height); } public Dimension calculate(int width, int height) { if (width <= 0 || height <= 0) { throw new IllegalArgumentException( "Width and height must be greater than 0." ); } return new Dimension(size); } /** * Returns a {@code String} representation of this object. * * @return {@code String} representation of this object. */ @Override public String toString() { return "AbsoluteSize [width=" + size.width + ", height=" + size.height + "]"; } }
zyslovely-thumb
src/net/coobird/thumbnailator/geometry/AbsoluteSize.java
Java
mit
1,786
package net.coobird.thumbnailator.geometry; import java.awt.Dimension; /** * Calculates the size of an enclosed object relative to the enclosing object. * * @author coobird * @since 0.3.4 * */ public class RelativeSize implements Size { /** * The scaling factor to use for the enclosed object. */ private final double scalingFactor; /** * Instantiates an object which calculates the size of an object, using * the given scaling factor. * * @param scalingFactor The scaling factor to use to determine the * size of the enclosing object. * @throws IllegalArgumentException When the scaling factor is not within * the range of {@code 0.0d} and * {@code 1.0d}, inclusive. */ public RelativeSize(double scalingFactor) { super(); if (scalingFactor < 0.0d || scalingFactor > 1.0d) { throw new IllegalArgumentException( "The scaling factor must be between 0.0d and 1.0d, inclusive." ); } this.scalingFactor = scalingFactor; } public Dimension calculate(int width, int height) { if (width <= 0 || height <= 0) { throw new IllegalArgumentException( "Width and height must be greater than 0." ); } int newWidth = (int)Math.round(width * scalingFactor); int newHeight = (int)Math.round(height * scalingFactor); return new Dimension(newWidth, newHeight); } /** * Returns a {@code String} representation of this object. * * @return {@code String} representation of this object. */ @Override public String toString() { return "RelativeSize [scalingFactor=" + scalingFactor + "]"; } }
zyslovely-thumb
src/net/coobird/thumbnailator/geometry/RelativeSize.java
Java
mit
1,669
package net.coobird.thumbnailator.geometry; import java.awt.Dimension; import java.awt.Point; import java.awt.Rectangle; /** * A representation of a region, using a {@link Position} object and a * {@link Dimension} object. * * @author coobird * @since 0.3.4 * */ public final class Region { /** * Position of the region. */ private final Position position; /** * Size of the region. */ private final Size size; /** * Instantiates a representation of a region from a {@link Position} and * {@link Size}. * * @param position Position of the region. * @param size Size of the region. * @throws NullPointerException When the position and/or the size is * {@code null}. */ public Region(Position position, Size size) { super(); if (position == null) { throw new NullPointerException("Position cannot be null."); } if (size == null) { throw new NullPointerException("Size cannot be null."); } this.position = position; this.size = size; } /** * Returns the position of the region. * * @return Position of the region. */ public Position getPosition() { return position; } /** * Returns the size of the region. * * @return Size of the region. */ public Size getSize() { return size; } /** * Calculates the position and size of the enclosed region, relative to the * enclosing region. * <p> * The portions of the enclosed region which lies outside of the enclosing * region are ignored. Effectively, the {@link Rectangle} returned by this * method is a intersection of the enclosing and enclose regions. * * @param width Width of the enclosing region. * @param height Height of the enclosing region. * @return Position and size of the enclosed region. */ public Rectangle calculate(int width, int height) { Dimension d = size.calculate(width, height); Point p = position.calculate( width, height, d.width, d.height, 0, 0, 0, 0 ); Rectangle outerRectangle = new Rectangle(0, 0, width, height); Rectangle innerRectangle = new Rectangle(p, d); return outerRectangle.intersection(innerRectangle); } /** * Returns a {@code String} representation of this region. * * @return {@code String} representation of this region. */ @Override public String toString() { return "Region [position=" + position + ", size=" + size + "]"; } }
zyslovely-thumb
src/net/coobird/thumbnailator/geometry/Region.java
Java
mit
2,526
package net.coobird.thumbnailator.geometry; import java.awt.Point; import net.coobird.thumbnailator.filters.Caption; import net.coobird.thumbnailator.filters.ImageFilter; import net.coobird.thumbnailator.filters.Watermark; /** * An enum of predefined {@link Position}s. * <p> * Primary use of this enum is for selecting a position to place watermarks * (using the {@link Watermark} class), captions (using the {@link Caption} * class) and other {@link ImageFilter}s. * * @author coobird * */ public enum Positions implements Position { /** * Calculates the {@link Point} at which an enclosed image should be placed * if it is to be placed at the top left-hand corner of the enclosing * image. */ TOP_LEFT() { public Point calculate(int enclosingWidth, int enclosingHeight, int width, int height, int insetLeft, int insetRight, int insetTop, int insetBottom) { int x = insetLeft; int y = insetTop; return new Point(x, y); } }, /** * Calculates the {@link Point} at which an enclosed image should be placed * if it is to be horizontally centered at the top of the enclosing image. */ TOP_CENTER() { public Point calculate(int enclosingWidth, int enclosingHeight, int width, int height, int insetLeft, int insetRight, int insetTop, int insetBottom) { int x = (enclosingWidth / 2) - (width / 2); int y = insetTop; return new Point(x, y); } }, /** * Calculates the {@link Point} at which an enclosed image should be placed * if it is to be placed at the top right-hand corner of the enclosing * image. */ TOP_RIGHT() { public Point calculate(int enclosingWidth, int enclosingHeight, int width, int height, int insetLeft, int insetRight, int insetTop, int insetBottom) { int x = enclosingWidth - width - insetRight; int y = insetTop; return new Point(x, y); } }, /** * Calculates the {@link Point} at which an enclosed image should be placed * if it is to be placed vertically centered at the left-hand corner of * the enclosing image. */ CENTER_LEFT() { public Point calculate(int enclosingWidth, int enclosingHeight, int width, int height, int insetLeft, int insetRight, int insetTop, int insetBottom) { int x = insetLeft; int y = (enclosingHeight / 2) - (height / 2); return new Point(x, y); } }, /** * Calculates the {@link Point} at which an enclosed image should be placed * horizontally and vertically centered in the enclosing image. */ CENTER() { public Point calculate(int enclosingWidth, int enclosingHeight, int width, int height, int insetLeft, int insetRight, int insetTop, int insetBottom) { int x = (enclosingWidth / 2) - (width / 2); int y = (enclosingHeight / 2) - (height / 2); return new Point(x, y); } }, /** * Calculates the {@link Point} at which an enclosed image should be placed * if it is to be placed vertically centered at the right-hand corner of * the enclosing image. */ CENTER_RIGHT() { public Point calculate(int enclosingWidth, int enclosingHeight, int width, int height, int insetLeft, int insetRight, int insetTop, int insetBottom) { int x = enclosingWidth - width - insetRight; int y = (enclosingHeight / 2) - (height / 2); return new Point(x, y); } }, /** * Calculates the {@link Point} at which an enclosed image should be placed * if it is to be placed at the bottom left-hand corner of the enclosing * image. */ BOTTOM_LEFT() { public Point calculate(int enclosingWidth, int enclosingHeight, int width, int height, int insetLeft, int insetRight, int insetTop, int insetBottom) { int x = insetLeft; int y = enclosingHeight - height - insetBottom; return new Point(x, y); } }, /** * Calculates the {@link Point} at which an enclosed image should be placed * if it is to be horizontally centered at the bottom of the enclosing * image. */ BOTTOM_CENTER() { public Point calculate(int enclosingWidth, int enclosingHeight, int width, int height, int insetLeft, int insetRight, int insetTop, int insetBottom) { int x = (enclosingWidth / 2) - (width / 2); int y = enclosingHeight - height - insetBottom; return new Point(x, y); } }, /** * Calculates the {@link Point} at which an enclosed image should be placed * if it is to be placed at the bottom right-hand corner of the enclosing * image. */ BOTTOM_RIGHT() { public Point calculate(int enclosingWidth, int enclosingHeight, int width, int height, int insetLeft, int insetRight, int insetTop, int insetBottom) { int x = enclosingWidth - width - insetRight; int y = enclosingHeight - height - insetBottom; return new Point(x, y); } }, ; }
zyslovely-thumb
src/net/coobird/thumbnailator/geometry/Positions.java
Java
mit
4,936
package net.coobird.thumbnailator.geometry; import java.awt.Dimension; /** * This interface is implemented by classes which calculate the size of an * object inside of an enclosing object. * * @author coobird * @since 0.3.4 * */ public interface Size { /** * Calculates the size of the object. * * @param width Width of the object which encloses the object * for which the size should be determined. * @param height Height of the object which encloses the object * for which the size should be determined. * @return Calculated size of the object. * @throws IllegalArgumentException If the width and/or height is less than * or equal to {@code 0}. */ public Dimension calculate(int width, int height); }
zyslovely-thumb
src/net/coobird/thumbnailator/geometry/Size.java
Java
mit
794
package net.coobird.thumbnailator; import java.awt.Dimension; import java.awt.Rectangle; import java.awt.RenderingHints; import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.net.URL; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import net.coobird.thumbnailator.filters.ImageFilter; import net.coobird.thumbnailator.filters.Pipeline; import net.coobird.thumbnailator.filters.Rotation; import net.coobird.thumbnailator.filters.Watermark; import net.coobird.thumbnailator.geometry.AbsoluteSize; import net.coobird.thumbnailator.geometry.Coordinate; import net.coobird.thumbnailator.geometry.Position; import net.coobird.thumbnailator.geometry.Positions; import net.coobird.thumbnailator.geometry.Region; import net.coobird.thumbnailator.geometry.Size; import net.coobird.thumbnailator.name.Rename; import net.coobird.thumbnailator.resizers.BicubicResizer; import net.coobird.thumbnailator.resizers.BilinearResizer; import net.coobird.thumbnailator.resizers.ProgressiveBilinearResizer; import net.coobird.thumbnailator.resizers.Resizer; import net.coobird.thumbnailator.resizers.Resizers; import net.coobird.thumbnailator.resizers.configurations.AlphaInterpolation; import net.coobird.thumbnailator.resizers.configurations.Antialiasing; import net.coobird.thumbnailator.resizers.configurations.Dithering; import net.coobird.thumbnailator.resizers.configurations.Rendering; import net.coobird.thumbnailator.resizers.configurations.ScalingMode; import net.coobird.thumbnailator.tasks.SourceSinkThumbnailTask; import net.coobird.thumbnailator.tasks.io.BufferedImageSink; import net.coobird.thumbnailator.tasks.io.BufferedImageSource; import net.coobird.thumbnailator.tasks.io.FileImageSink; import net.coobird.thumbnailator.tasks.io.FileImageSource; import net.coobird.thumbnailator.tasks.io.ImageSource; import net.coobird.thumbnailator.tasks.io.InputStreamImageSource; import net.coobird.thumbnailator.tasks.io.OutputStreamImageSink; import net.coobird.thumbnailator.tasks.io.URLImageSource; import net.coobird.thumbnailator.util.ThumbnailatorUtils; /** * This class provides a fluent interface to create thumbnails. * <DL> * <DT><B>Usage:</B></DT> * <DD> * The following example code demonstrates how to use the fluent interface * to create a thumbnail from multiple files from a directory, resizing them to * a maximum of 200 pixels by 200 pixels while preserving the aspect ratio of * the original, then saving the resulting thumbnails as JPEG images with file * names having {@code thumbnail.} appended to the beginning of the file name. * <p> * <pre> Thumbnails.of(directory.listFiles()) .size(200, 200) .outputFormat("jpeg") .asFiles(Rename.PREFIX_DOT_THUMBNAIL); * </pre> * </DD> * </DL> * For more examples, please visit the <a href="http://code.google.com/p/thumbnailator/"> * Thumbnailator</a> project page. * * @author coobird * */ public final class Thumbnails { /** * This class is not intended to be instantiated. */ private Thumbnails() {} /** * Performs validation on the specified dimensions. * <p> * If any of the dimensions are less than or equal to 0, an * {@code IllegalArgumentException} is thrown with an message specifying the * reason for the exception. * <p> * This method is used to perform a check on the output dimensions of a * thumbnail for the {@link Thumbnails#createThumbnail} methods. * * @param width The width to validate. * @param height The height to validate. */ private static void validateDimensions(int width, int height) { if (width <= 0 && height <= 0) { throw new IllegalArgumentException( "Destination image dimensions must not be less than " + "0 pixels." ); } else if (width <= 0 || height <= 0) { String dimension = width == 0 ? "width" : "height"; throw new IllegalArgumentException( "Destination image " + dimension + " must not be " + "less than or equal to 0 pixels." ); } } private static void checkForNull(Object o, String message) { if (o == null) { throw new NullPointerException(message); } } private static void checkForEmpty(Object[] o, String message) { if (o.length == 0) { throw new IllegalArgumentException(message); } } private static void checkForEmpty(Iterable<?> o, String message) { if (!o.iterator().hasNext()) { throw new IllegalArgumentException(message); } } /** * Indicate to make thumbnails for images with the specified filenames. * * @param files File names of image files for which thumbnails * are to be produced for. * @return Reference to a builder object which is used to * specify the parameters for creating the thumbnail. * @throws NullPointerException If the argument is {@code null}. * @throws IllegalArgumentException If the argument is an empty array. */ public static Builder<File> of(String... files) { checkForNull(files, "Cannot specify null for input files."); checkForEmpty(files, "Cannot specify an empty array for input files."); return Builder.ofStrings(Arrays.asList(files)); } /** * Indicate to make thumbnails from the specified {@link File}s. * * @param files {@link File} objects of image files for which thumbnails * are to be produced for. * @return Reference to a builder object which is used to * specify the parameters for creating the thumbnail. * @throws NullPointerException If the argument is {@code null}. * @throws IllegalArgumentException If the argument is an empty array. */ public static Builder<File> of(File... files) { checkForNull(files, "Cannot specify null for input files."); checkForEmpty(files, "Cannot specify an empty array for input files."); return Builder.ofFiles(Arrays.asList(files)); } /** * Indicate to make thumbnails from the specified {@link URL}s. * * @param urls {@link URL} objects of image files for which thumbnails * are to be produced for. * @return Reference to a builder object which is used to * specify the parameters for creating the thumbnail. * @throws NullPointerException If the argument is {@code null}. * @throws IllegalArgumentException If the argument is an empty array. */ public static Builder<URL> of(URL... urls) { checkForNull(urls, "Cannot specify null for input URLs."); checkForEmpty(urls, "Cannot specify an empty array for input URLs."); return Builder.ofUrls(Arrays.asList(urls)); } /** * Indicate to make thumbnails from the specified {@link InputStream}s. * * @param inputStreams {@link InputStream}s which provide the images * for which thumbnails are to be produced for. * @return Reference to a builder object which is used to * specify the parameters for creating the thumbnail. * @throws NullPointerException If the argument is {@code null}. * @throws IllegalArgumentException If the argument is an empty array. */ public static Builder<? extends InputStream> of(InputStream... inputStreams) { checkForNull(inputStreams, "Cannot specify null for InputStreams."); checkForEmpty(inputStreams, "Cannot specify an empty array for InputStreams."); return Builder.ofInputStreams(Arrays.asList(inputStreams)); } /** * Indicate to make thumbnails from the specified {@link BufferedImage}s. * * @param images {@link BufferedImage}s for which thumbnails * are to be produced for. * @return Reference to a builder object which is used to * specify the parameters for creating the thumbnail. * @throws NullPointerException If the argument is {@code null}. * @throws IllegalArgumentException If the argument is an empty array. */ public static Builder<BufferedImage> of(BufferedImage... images) { checkForNull(images, "Cannot specify null for images."); checkForEmpty(images, "Cannot specify an empty array for images."); return Builder.ofBufferedImages(Arrays.asList(images)); } /** * Indicate to make thumbnails for images with the specified filenames. * * @param files File names of image files for which thumbnails * are to be produced for. * @return Reference to a builder object which is used to * specify the parameters for creating the thumbnail. * @throws NullPointerException If the argument is {@code null}. * @throws IllegalArgumentException If the argument is an empty collection. * @deprecated use {@link #fromFilenames(Iterable)}. <b> This method * will be removed in Thumbnailator 0.4.0.</b> */ @Deprecated public static Builder<File> fromFilenames(Collection<String> files) { return fromFilenames((Iterable<String>)files); } /** * Indicate to make thumbnails from the specified {@link File}s. * * @param files {@link File} objects of image files for which thumbnails * are to be produced for. * @return Reference to a builder object which is used to * specify the parameters for creating the thumbnail. * @throws NullPointerException If the argument is {@code null}. * @throws IllegalArgumentException If the argument is an empty collection. * @deprecated use {@link #fromFiles(Iterable)}. <b> This method * will be removed in Thumbnailator 0.4.0.</b> */ @Deprecated public static Builder<File> fromFiles(Collection<File> files) { return fromFiles((Iterable<File>)files); } /** * Indicate to make thumbnails for images with the specified {@link URL}s. * * @param urls URLs of the images for which thumbnails * are to be produced. * @return Reference to a builder object which is used to * specify the parameters for creating the thumbnail. * @throws NullPointerException If the argument is {@code null}. * @throws IllegalArgumentException If the argument is an empty collection. * @deprecated use {@link #fromURLs(Iterable)}. <b> This method * will be removed in Thumbnailator 0.4.0.</b> */ @Deprecated public static Builder<URL> fromURLs(Collection<URL> urls) { return fromURLs((Iterable<URL>)urls); } /** * Indicate to make thumbnails for images obtained from the specified * {@link InputStream}s. * * @param inputStreams {@link InputStream}s which provide images for * which thumbnails are to be produced. * @return Reference to a builder object which is used to * specify the parameters for creating the thumbnail. * @throws NullPointerException If the argument is {@code null}. * @throws IllegalArgumentException If the argument is an empty collection. * @deprecated use {@link #fromInputStreams(Iterable)}. <b> This method * will be removed in Thumbnailator 0.4.0.</b> */ @Deprecated public static Builder<InputStream> fromInputStreams(Collection<? extends InputStream> inputStreams) { return fromInputStreams((Iterable<? extends InputStream>)inputStreams); } /** * Indicate to make thumbnails from the specified {@link BufferedImage}s. * * @param images {@link BufferedImage}s for which thumbnails * are to be produced for. * @return Reference to a builder object which is used to * specify the parameters for creating the thumbnail. * @throws NullPointerException If the argument is {@code null}. * @throws IllegalArgumentException If the argument is an empty collection. * @deprecated use {@link #fromImages(Iterable)}. <b> This method * will be removed in Thumbnailator 0.4.0.</b> */ @Deprecated public static Builder<BufferedImage> fromImages(Collection<BufferedImage> images) { return fromImages((Iterable<BufferedImage>)images); } /** * Indicate to make thumbnails for images with the specified filenames. * * @param files File names of image files for which thumbnails * are to be produced for. * @return Reference to a builder object which is used to * specify the parameters for creating the thumbnail. * @throws NullPointerException If the argument is {@code null}. * @throws IllegalArgumentException If the argument is an empty collection. * @since 0.3.1 */ public static Builder<File> fromFilenames(Iterable<String> files) { checkForNull(files, "Cannot specify null for input files."); checkForEmpty(files, "Cannot specify an empty collection for input files."); return Builder.ofStrings(files); } /** * Indicate to make thumbnails from the specified {@link File}s. * * @param files {@link File} objects of image files for which thumbnails * are to be produced for. * @return Reference to a builder object which is used to * specify the parameters for creating the thumbnail. * @throws NullPointerException If the argument is {@code null}. * @throws IllegalArgumentException If the argument is an empty collection. * @since 0.3.1 */ public static Builder<File> fromFiles(Iterable<File> files) { checkForNull(files, "Cannot specify null for input files."); checkForEmpty(files, "Cannot specify an empty collection for input files."); return Builder.ofFiles(files); } /** * Indicate to make thumbnails for images with the specified {@link URL}s. * * @param urls URLs of the images for which thumbnails * are to be produced. * @return Reference to a builder object which is used to * specify the parameters for creating the thumbnail. * @throws NullPointerException If the argument is {@code null}. * @throws IllegalArgumentException If the argument is an empty collection. * @since 0.3.1 */ public static Builder<URL> fromURLs(Iterable<URL> urls) { checkForNull(urls, "Cannot specify null for input URLs."); checkForEmpty(urls, "Cannot specify an empty collection for input URLs."); return Builder.ofUrls(urls); } /** * Indicate to make thumbnails for images obtained from the specified * {@link InputStream}s. * * @param inputStreams {@link InputStream}s which provide images for * which thumbnails are to be produced. * @return Reference to a builder object which is used to * specify the parameters for creating the thumbnail. * @throws NullPointerException If the argument is {@code null}. * @throws IllegalArgumentException If the argument is an empty collection. * @since 0.3.1 */ public static Builder<InputStream> fromInputStreams(Iterable<? extends InputStream> inputStreams) { checkForNull(inputStreams, "Cannot specify null for InputStreams."); checkForEmpty(inputStreams, "Cannot specify an empty collection for InputStreams."); return Builder.ofInputStreams(inputStreams); } /** * Indicate to make thumbnails from the specified {@link BufferedImage}s. * * @param images {@link BufferedImage}s for which thumbnails * are to be produced for. * @return Reference to a builder object which is used to * specify the parameters for creating the thumbnail. * @throws NullPointerException If the argument is {@code null}. * @throws IllegalArgumentException If the argument is an empty collection. * @since 0.3.1 */ public static Builder<BufferedImage> fromImages(Iterable<BufferedImage> images) { checkForNull(images, "Cannot specify null for images."); checkForEmpty(images, "Cannot specify an empty collection for images."); return Builder.ofBufferedImages(images); } /** * A builder interface for Thumbnailator. * <p> * An instance of this class is obtained by calling one of: * <ul> * <li>{@link Thumbnails#of(BufferedImage...)}</li> * <li>{@link Thumbnails#of(File...)}</li> * <li>{@link Thumbnails#of(String...)}</li> * <li>{@link Thumbnails#of(InputStream...)}</li> * <li>{@link Thumbnails#of(URL...)}</li> * <li>{@link Thumbnails#fromImages(Iterable)}</li> * <li>{@link Thumbnails#fromFiles(Iterable)}</li> * <li>{@link Thumbnails#fromFilenames(Iterable)}</li> * <li>{@link Thumbnails#fromInputStreams(Iterable)}</li> * <li>{@link Thumbnails#fromURLs(Iterable)}</li> * </ul> * * @author coobird * */ public static class Builder<T> { private final Iterable<ImageSource<T>> sources; private Builder(Iterable<ImageSource<T>> sources) { this.sources = sources; statusMap.put(Properties.OUTPUT_FORMAT, Status.OPTIONAL); } private static final class StringImageSourceIterator implements Iterable<ImageSource<File>> { private final Iterable<String> filenames; private StringImageSourceIterator(Iterable<String> filenames) { this.filenames = filenames; } public Iterator<ImageSource<File>> iterator() { return new Iterator<ImageSource<File>>() { Iterator<String> iter = filenames.iterator(); public boolean hasNext() { return iter.hasNext(); } public ImageSource<File> next() { return new FileImageSource(iter.next()); } public void remove() { throw new UnsupportedOperationException(); } }; } } private static final class FileImageSourceIterator implements Iterable<ImageSource<File>> { private final Iterable<File> files; private FileImageSourceIterator(Iterable<File> files) { this.files = files; } public Iterator<ImageSource<File>> iterator() { return new Iterator<ImageSource<File>>() { Iterator<File> iter = files.iterator(); public boolean hasNext() { return iter.hasNext(); } public ImageSource<File> next() { return new FileImageSource(iter.next()); } public void remove() { throw new UnsupportedOperationException(); } }; } } private static final class URLImageSourceIterator implements Iterable<ImageSource<URL>> { private final Iterable<URL> urls; private URLImageSourceIterator(Iterable<URL> urls) { this.urls = urls; } public Iterator<ImageSource<URL>> iterator() { return new Iterator<ImageSource<URL>>() { Iterator<URL> iter = urls.iterator(); public boolean hasNext() { return iter.hasNext(); } public ImageSource<URL> next() { return new URLImageSource(iter.next()); } public void remove() { throw new UnsupportedOperationException(); } }; } } private static final class InputStreamImageSourceIterator implements Iterable<ImageSource<InputStream>> { private final Iterable<? extends InputStream> inputStreams; private InputStreamImageSourceIterator(Iterable<? extends InputStream> inputStreams) { this.inputStreams = inputStreams; } public Iterator<ImageSource<InputStream>> iterator() { return new Iterator<ImageSource<InputStream>>() { Iterator<? extends InputStream> iter = inputStreams.iterator(); public boolean hasNext() { return iter.hasNext(); } public ImageSource<InputStream> next() { return new InputStreamImageSource(iter.next()); } public void remove() { throw new UnsupportedOperationException(); } }; } } private static final class BufferedImageImageSourceIterator implements Iterable<ImageSource<BufferedImage>> { private final Iterable<BufferedImage> image; private BufferedImageImageSourceIterator(Iterable<BufferedImage> images) { this.image = images; } public Iterator<ImageSource<BufferedImage>> iterator() { return new Iterator<ImageSource<BufferedImage>>() { Iterator<BufferedImage> iter = image.iterator(); public boolean hasNext() { return iter.hasNext(); } public ImageSource<BufferedImage> next() { return new BufferedImageSource(iter.next()); } public void remove() { throw new UnsupportedOperationException(); } }; } } private static Builder<File> ofStrings(Iterable<String> filenames) { Iterable<ImageSource<File>> iter = new StringImageSourceIterator(filenames); return new Builder<File>(iter); } private static Builder<File> ofFiles(Iterable<File> files) { Iterable<ImageSource<File>> iter = new FileImageSourceIterator(files); return new Builder<File>(iter); } private static Builder<URL> ofUrls(Iterable<URL> urls) { Iterable<ImageSource<URL>> iter = new URLImageSourceIterator(urls); return new Builder<URL>(iter); } private static Builder<InputStream> ofInputStreams(Iterable<? extends InputStream> inputStreams) { Iterable<ImageSource<InputStream>> iter = new InputStreamImageSourceIterator(inputStreams); return new Builder<InputStream>(iter); } private static Builder<BufferedImage> ofBufferedImages(Iterable<BufferedImage> images) { Iterable<ImageSource<BufferedImage>> iter = new BufferedImageImageSourceIterator(images); return new Builder<BufferedImage>(iter); } private final class BufferedImageIterable implements Iterable<BufferedImage> { public Iterator<BufferedImage> iterator() { return new Iterator<BufferedImage>() { Iterator<ImageSource<T>> sourceIter = sources.iterator(); public boolean hasNext() { return sourceIter.hasNext(); } public BufferedImage next() { ImageSource<T> source = sourceIter.next(); BufferedImageSink destination = new BufferedImageSink(); try { Thumbnailator.createThumbnail( new SourceSinkThumbnailTask<T, BufferedImage>(makeParam(), source, destination) ); } catch (IOException e) { return null; } return destination.getSink(); } public void remove() { throw new UnsupportedOperationException( "Cannot remove elements from this iterator." ); } }; } } /** * Status of each property. * * @author coobird * */ private static enum Status { OPTIONAL, READY, NOT_READY, ALREADY_SET, CANNOT_SET, } /** * Interface used by {@link Properties}. * * @author coobird * */ private static interface Property { public String getName(); } /** * Enum of properties which can be set by this builder. * * @author coobird * */ private static enum Properties implements Property { SIZE("size"), WIDTH("width"), HEIGHT("height"), SCALE("scale"), IMAGE_TYPE("imageType"), SCALING_MODE("scalingMode"), ALPHA_INTERPOLATION("alphaInterpolation"), ANTIALIASING("antialiasing"), DITHERING("dithering"), RENDERING("rendering"), KEEP_ASPECT_RATIO("keepAspectRatio"), OUTPUT_FORMAT("outputFormat"), OUTPUT_FORMAT_TYPE("outputFormatType"), OUTPUT_QUALITY("outputQuality"), RESIZER("resizer"), SOURCE_REGION("sourceRegion"), ALLOW_OVERWRITE("allowOverwrite"), ; private final String name; private Properties(String name) { this.name = name; } public String getName() { return name; } } /** * Map to keep track of whether a property has been properly set or not. */ private final Map<Properties, Status> statusMap = new HashMap<Properties, Status>(); /** * Populates the property map. */ { statusMap.put(Properties.SIZE, Status.NOT_READY); statusMap.put(Properties.WIDTH, Status.OPTIONAL); statusMap.put(Properties.HEIGHT, Status.OPTIONAL); statusMap.put(Properties.SCALE, Status.NOT_READY); statusMap.put(Properties.SOURCE_REGION, Status.OPTIONAL); statusMap.put(Properties.IMAGE_TYPE, Status.OPTIONAL); statusMap.put(Properties.SCALING_MODE, Status.OPTIONAL); statusMap.put(Properties.ALPHA_INTERPOLATION, Status.OPTIONAL); statusMap.put(Properties.ANTIALIASING, Status.OPTIONAL); statusMap.put(Properties.DITHERING, Status.OPTIONAL); statusMap.put(Properties.RENDERING, Status.OPTIONAL); statusMap.put(Properties.KEEP_ASPECT_RATIO, Status.OPTIONAL); statusMap.put(Properties.OUTPUT_FORMAT, Status.OPTIONAL); statusMap.put(Properties.OUTPUT_FORMAT_TYPE, Status.OPTIONAL); statusMap.put(Properties.OUTPUT_QUALITY, Status.OPTIONAL); statusMap.put(Properties.RESIZER, Status.OPTIONAL); statusMap.put(Properties.ALLOW_OVERWRITE, Status.OPTIONAL); } /** * Updates the property status map. * * @param property The property to update. * @param newStatus The new status. */ private void updateStatus(Properties property, Status newStatus) { if (statusMap.get(property) == Status.ALREADY_SET) { throw new IllegalStateException( property.getName() + " is already set."); } if (statusMap.get(property) == Status.CANNOT_SET) { throw new IllegalStateException( property.getName() + " cannot be set."); } statusMap.put(property, newStatus); } /** * An constant used to indicate that the imageType has not been * specified. When this constant is encountered, one should use the * {@link ThumbnailParameter#DEFAULT_IMAGE_TYPE} as the value for * imageType. */ private static int IMAGE_TYPE_UNSPECIFIED = -1; private static final int DIMENSION_NOT_SPECIFIED = -1; /* * Defines the fields for the builder interface, and assigns the * default values. */ private int width = DIMENSION_NOT_SPECIFIED; private int height = DIMENSION_NOT_SPECIFIED; private double scaleWidth = Double.NaN; private double scaleHeight = Double.NaN; private Region sourceRegion; private int imageType = IMAGE_TYPE_UNSPECIFIED; private boolean keepAspectRatio = true; private String outputFormat = ThumbnailParameter.ORIGINAL_FORMAT; private String outputFormatType = ThumbnailParameter.DEFAULT_FORMAT_TYPE; private float outputQuality = ThumbnailParameter.DEFAULT_QUALITY; private ScalingMode scalingMode = ScalingMode.PROGRESSIVE_BILINEAR; private AlphaInterpolation alphaInterpolation = AlphaInterpolation.DEFAULT; private Dithering dithering = Dithering.DEFAULT; private Antialiasing antialiasing = Antialiasing.DEFAULT; private Rendering rendering = Rendering.DEFAULT; private Resizer resizer = Resizers.PROGRESSIVE; private boolean allowOverwrite = true; /** * The {@link ImageFilter}s that should be applied when creating the * thumbnail. */ private Pipeline filterPipeline = new Pipeline(); /** * Sets the size of the thumbnail. * <p> * Once this method is called, calling the {@link #scale(double)} method * will result in an {@link IllegalStateException}. * <p> * Calling this method multiple times will result in an * {@link IllegalStateException} to be thrown. * * @param width The width of the thumbnail. * @param height The height of the thumbnail. * @return Reference to this object. */ public Builder<T> size(int width, int height) { updateStatus(Properties.SIZE, Status.ALREADY_SET); updateStatus(Properties.SCALE, Status.CANNOT_SET); validateDimensions(width, height); this.width = width; this.height = height; return this; } /** * Sets the width of the thumbnail. * <p> * The thumbnail will have the dimensions constrained by the specified * width, and the aspect ratio of the original image will be preserved * by the thumbnail. * <p> * Once this method is called, calling the {@link #size(int, int)} or * the {@link #scale(double)} method will result in an * {@link IllegalStateException}. * <p> * Calling this method multiple times will result in an * {@link IllegalStateException} to be thrown. * * @param width The width of the thumbnail. * @return Reference to this object. * @since 0.3.5 */ public Builder<T> width(int width) { if (statusMap.get(Properties.SIZE) != Status.CANNOT_SET) { updateStatus(Properties.SIZE, Status.CANNOT_SET); } if (statusMap.get(Properties.SCALE) != Status.CANNOT_SET) { updateStatus(Properties.SCALE, Status.CANNOT_SET); } updateStatus(Properties.WIDTH, Status.ALREADY_SET); validateDimensions(width, Integer.MAX_VALUE); this.width = width; return this; } /** * Sets the height of the thumbnail. * <p> * The thumbnail will have the dimensions constrained by the specified * height, and the aspect ratio of the original image will be preserved * by the thumbnail. * <p> * Once this method is called, calling the {@link #size(int, int)} or * the {@link #scale(double)} method will result in an * {@link IllegalStateException}. * <p> * Calling this method multiple times will result in an * {@link IllegalStateException} to be thrown. * * @param height The height of the thumbnail. * @return Reference to this object. * @since 0.3.5 */ public Builder<T> height(int height) { if (statusMap.get(Properties.SIZE) != Status.CANNOT_SET) { updateStatus(Properties.SIZE, Status.CANNOT_SET); } if (statusMap.get(Properties.SCALE) != Status.CANNOT_SET) { updateStatus(Properties.SCALE, Status.CANNOT_SET); } updateStatus(Properties.HEIGHT, Status.ALREADY_SET); validateDimensions(Integer.MAX_VALUE, height); this.height = height; return this; } /** * Sets the size of the thumbnail. * <p> * The thumbnails will be forced to the specified size, therefore, * the aspect ratio of the original image will not be preserved in * the thumbnails. Calling this method will be equivalent to calling * the {@link #size(int, int)} method in conjunction with the * {@link #keepAspectRatio(boolean)} method with the value {@code false}. * <p> * Once this method is called, calling the {@link #scale(double)} method * will result in an {@link IllegalStateException}. * <p> * Calling this method multiple times will result in an * {@link IllegalStateException} to be thrown. * * @param width The width of the thumbnail. * @param height The height of the thumbnail. * @return Reference to this object. * @since 0.3.2 */ public Builder<T> forceSize(int width, int height) { updateStatus(Properties.SIZE, Status.ALREADY_SET); updateStatus(Properties.KEEP_ASPECT_RATIO, Status.ALREADY_SET); updateStatus(Properties.SCALE, Status.CANNOT_SET); validateDimensions(width, height); this.width = width; this.height = height; this.keepAspectRatio = false; return this; } /** * Sets the scaling factor of the thumbnail. * <p> * Once this method is called, calling the {@link #size(int, int)} * method, or the {@link #scale(double, double)} method, or the * {@link #keepAspectRatio(boolean)} method will result in an * {@link IllegalStateException}. * <p> * Calling this method multiple times will result in an * {@link IllegalStateException} to be thrown. * * @param scale The scaling factor to use when creating a * thumbnail. * <p> * The value must be a {@code double} which is * greater than {@code 0.0}, and not * {@link Double#POSITIVE_INFINITY}. * @return Reference to this object. */ public Builder<T> scale(double scale) { return scale(scale, scale); } /** * Sets the scaling factor for the width and height of the thumbnail. * <p> * If the scaling factor for the width and height are not equal, then * the thumbnail will not preserve the aspect ratio of the original * image. * <p> * Once this method is called, calling the {@link #size(int, int)} * method, or the {@link #scale(double)} method, or the * {@link #keepAspectRatio(boolean)} method will result in an * {@link IllegalStateException}. * <p> * Calling this method multiple times will result in an * {@link IllegalStateException} to be thrown. * * @param scaleWidth The scaling factor to use for the width when * creating a thumbnail. * <p> * The value must be a {@code double} which is * greater than {@code 0.0}, and not * {@link Double#POSITIVE_INFINITY}. * @param scaleHeight The scaling factor to use for the height when * creating a thumbnail. * <p> * The value must be a {@code double} which is * greater than {@code 0.0}, and not * {@link Double#POSITIVE_INFINITY}. * @return Reference to this object. * @since 0.3.10 */ public Builder<T> scale(double scaleWidth, double scaleHeight) { updateStatus(Properties.SCALE, Status.ALREADY_SET); updateStatus(Properties.SIZE, Status.CANNOT_SET); updateStatus(Properties.KEEP_ASPECT_RATIO, Status.CANNOT_SET); if (scaleWidth <= 0.0 || scaleHeight <= 0.0) { throw new IllegalArgumentException( "The scaling factor is equal to or less than 0." ); } if (Double.isNaN(scaleWidth) || Double.isNaN(scaleHeight)) { throw new IllegalArgumentException( "The scaling factor is not a number." ); } if (Double.isInfinite(scaleWidth) || Double.isInfinite(scaleHeight)) { throw new IllegalArgumentException( "The scaling factor cannot be infinity." ); } this.scaleWidth = scaleWidth; this.scaleHeight = scaleHeight; return this; } /** * Specifies the source region from which the thumbnail is to be * created from. * <p> * Calling this method multiple times will result in an * {@link IllegalStateException} to be thrown. * * @param sourceRegion Source region to use when creating a thumbnail. * <p> * @return Reference to this object. * @throws NullPointerException If the source region object is * {@code null}. * @since 0.3.4 */ public Builder<T> sourceRegion(Region sourceRegion) { if (sourceRegion == null) { throw new NullPointerException("Region cannot be null."); } updateStatus(Properties.SOURCE_REGION, Status.ALREADY_SET); this.sourceRegion = sourceRegion; return this; } /** * Specifies the source region from which the thumbnail is to be * created from. * <p> * Calling this method multiple times will result in an * {@link IllegalStateException} to be thrown. * * @param position Position of the source region. * @param size Size of the source region. * @return Reference to this object. * @throws NullPointerException If the position and/or size is * {@code null}. * @since 0.3.4 */ public Builder<T> sourceRegion(Position position, Size size) { if (position == null) { throw new NullPointerException("Position cannot be null."); } if (size == null) { throw new NullPointerException("Size cannot be null."); } return sourceRegion(new Region(position, size)); } /** * Specifies the source region from which the thumbnail is to be * created from. * <p> * Calling this method multiple times will result in an * {@link IllegalStateException} to be thrown. * * @param x The horizontal-compoennt of the top left-hand * corner of the source region. * @param y The vertical-compoennt of the top left-hand * corner of the source region. * @param width Width of the source region. * @param height Height of the source region. * @return Reference to this object. * @throws IllegalArgumentException If the width and/or height is * less than or equal to {@code 0}. * @since 0.3.4 */ public Builder<T> sourceRegion(int x, int y, int width, int height) { if (width <= 0 || height <= 0) { throw new IllegalArgumentException( "Width and height must be greater than 0." ); } return sourceRegion( new Coordinate(x, y), new AbsoluteSize(width, height) ); } /** * Specifies the source region from which the thumbnail is to be * created from. * <p> * Calling this method multiple times will result in an * {@link IllegalStateException} to be thrown. * * @param position Position of the source region. * @param width Width of the source region. * @param height Height of the source region. * @return Reference to this object. * @throws NullPointerException If the position and/or size is * {@code null}. * @throws IllegalArgumentException If the width and/or height is * less than or equal to {@code 0}. * @since 0.3.4 */ public Builder<T> sourceRegion(Position position, int width, int height) { if (position == null) { throw new NullPointerException("Position cannot be null."); } if (width <= 0 || height <= 0) { throw new IllegalArgumentException( "Width and height must be greater than 0." ); } return sourceRegion( position, new AbsoluteSize(width, height) ); } /** * Specifies the source region from which the thumbnail is to be * created from. * <p> * Calling this method multiple times will result in an * {@link IllegalStateException} to be thrown. * * @param region A rectangular region which specifies the source * region to use when creating the thumbnail. * @throws NullPointerException If the region is {@code null}. * @since 0.3.4 */ public Builder<T> sourceRegion(Rectangle region) { if (region == null) { throw new NullPointerException("Region cannot be null."); } return sourceRegion( new Coordinate(region.x, region.y), new AbsoluteSize(region.getSize()) ); } /** * Specifies whether or not to overwrite files which already exist if * they have been specified as destination files. * <p> * This method will change the output behavior of the following methods: * <ul> * <li>{@link #toFile(File)}</li> * <li>{@link #toFile(String)}</li> * <li>{@link #toFiles(Iterable)}</li> * <li>{@link #toFiles(Rename)}</li> * <li>{@link #asFiles(Iterable)}</li> * <li>{@link #asFiles(Rename)}</li> * </ul> * The behavior of methods which are not listed above will not be * affected by calling this method. * <p> * Calling this method multiple times will result in an * {@link IllegalStateException} to be thrown. * * @param allowOverwrite If {@code true} then existing files will be * overwritten if specified as a destination. * If {@code false}, then the existing files * will not be altered. For specific behavior, * please refer to the specific output methods * listed above. * * @since 0.3.7 */ public Builder<T> allowOverwrite(boolean allowOverwrite) { updateStatus(Properties.ALLOW_OVERWRITE, Status.ALREADY_SET); this.allowOverwrite = allowOverwrite; return this; } /** * Sets the image type of the thumbnail. * <p> * Calling this method to set this parameter is optional. * <p> * Calling this method multiple times will result in an * {@link IllegalStateException} to be thrown. * * @param type The image type of the thumbnail. * @return Reference to this object. */ public Builder<T> imageType(int type) { updateStatus(Properties.IMAGE_TYPE, Status.ALREADY_SET); imageType = type; return this; } /** * Sets the resizing scaling mode to use when creating the thumbnail. * <p> * Calling this method to set this parameter is optional. * <p> * Calling this method multiple times will result in an * {@link IllegalStateException} to be thrown. * * @param config The scaling mode to use. * @return Reference to this object. */ public Builder<T> scalingMode(ScalingMode config) { checkForNull(config, "Scaling mode is null."); updateStatus(Properties.SCALING_MODE, Status.ALREADY_SET); updateStatus(Properties.RESIZER, Status.CANNOT_SET); scalingMode = config; return this; } /** * Sets the resizing operation to use when creating the thumbnail. * <p> * Calling this method to set this parameter is optional. * <p> * Calling this method multiple times will result in an * {@link IllegalStateException} to be thrown. * * @param resizer The scaling operation to use. * @return Reference to this object. */ public Builder<T> resizer(Resizer resizer) { checkForNull(resizer, "Resizer is null."); updateStatus(Properties.RESIZER, Status.ALREADY_SET); updateStatus(Properties.SCALING_MODE, Status.CANNOT_SET); this.resizer = resizer; return this; } /** * Sets the alpha interpolation mode when performing the resizing * operation to generate the thumbnail. * <p> * Calling this method to set this parameter is optional. * <p> * Calling this method multiple times will result in an * {@link IllegalStateException} to be thrown. * * @param config The alpha interpolation mode. * @return Reference to this object. */ public Builder<T> alphaInterpolation(AlphaInterpolation config) { checkForNull(config, "Alpha interpolation is null."); updateStatus(Properties.ALPHA_INTERPOLATION, Status.ALREADY_SET); alphaInterpolation = config; return this; } /** * Sets the dithering mode when performing the resizing * operation to generate the thumbnail. * <p> * Calling this method to set this parameter is optional. * <p> * Calling this method multiple times will result in an * {@link IllegalStateException} to be thrown. * * @param config The dithering mode. * @return Reference to this object. */ public Builder<T> dithering(Dithering config) { checkForNull(config, "Dithering is null."); updateStatus(Properties.DITHERING, Status.ALREADY_SET); dithering = config; return this; } /** * Sets the antialiasing mode when performing the resizing * operation to generate the thumbnail. * <p> * Calling this method to set this parameter is optional. * <p> * Calling this method multiple times will result in an * {@link IllegalStateException}. * * @param config The antialiasing mode. * @return Reference to this object. */ public Builder<T> antialiasing(Antialiasing config) { checkForNull(config, "Antialiasing is null."); updateStatus(Properties.ANTIALIASING, Status.ALREADY_SET); antialiasing = config; return this; } /** * Sets the rendering mode when performing the resizing * operation to generate the thumbnail. * <p> * Calling this method to set this parameter is optional. * <p> * Calling this method multiple times will result in an * {@link IllegalStateException} to be thrown. * * @param config The rendering mode. * @return Reference to this object. */ public Builder<T> rendering(Rendering config) { checkForNull(config, "Rendering is null."); updateStatus(Properties.RENDERING, Status.ALREADY_SET); rendering = config; return this; } /** * Sets whether or not to keep the aspect ratio of the original image * for the thumbnail. * <p> * Calling this method without first calling the {@link #size(int, int)} * method will result in an {@link IllegalStateException} to be thrown. * <p> * If this method is not called when, by default the aspect ratio of * the original image is preserved for the thumbnail. * <p> * Calling this method after calling the {@link #scale(double)} method * or the {@link #scale(double, double)} method will result in a * {@link IllegalStateException}. * * @param keep {@code true} if the thumbnail is to maintain * the aspect ratio of the original image, * {@code false} otherwise. * @return Reference to this object. * * @throws IllegalStateException If * <ol> * <li>the {@link #size(int, int)} has * not yet been called to specify the * size of the thumbnail, or</li> * <li>the {@link #scale(double)} * method has been called, or</li> * <li>the * {@link #scale(double, double)} * method has been called, or</li> * <li>the {@link #width(int)} and/or * {@link #height(int)} has been called * and not preserving the aspect ratio * is desired.</li> * </ol> */ public Builder<T> keepAspectRatio(boolean keep) { if (statusMap.get(Properties.SCALE) == Status.ALREADY_SET) { throw new IllegalStateException("Cannot specify whether to " + "keep the aspect ratio if the scaling factor has " + "already been specified."); } if (statusMap.get(Properties.SIZE) == Status.NOT_READY) { throw new IllegalStateException("Cannot specify whether to " + "keep the aspect ratio unless the size parameter has " + "already been specified."); } if ((statusMap.get(Properties.WIDTH) == Status.ALREADY_SET || statusMap.get(Properties.HEIGHT) == Status.ALREADY_SET) && !keep ) { throw new IllegalStateException("The aspect ratio must be " + "preserved when the width and/or height parameter " + "has already been specified."); } updateStatus(Properties.KEEP_ASPECT_RATIO, Status.ALREADY_SET); keepAspectRatio = keep; return this; } /** * Sets the compression output quality of the thumbnail. * <p> * The value is a {@code float} between {@code 0.0f} and {@code 1.0f} * where {@code 0.0f} indicates the minimum quality and {@code 1.0f} * indicates the maximum quality settings should be used for by the * compression codec. * <p> * Calling this method to set this parameter is optional. * <p> * Calling this method multiple times, or the * {@link #outputQuality(double)} in conjunction with this method will * result in an {@link IllegalStateException} to be thrown. * * @param quality The quality of the * @return Reference to this object. * @throws IllegalArgumentException If the argument is less than * {@code 0.0f} or is greater than * {@code 1.0f}. */ public Builder<T> outputQuality(float quality) { if (quality < 0.0f || quality > 1.0f) { throw new IllegalArgumentException( "The quality setting must be in the range 0.0f and " + "1.0f, inclusive." ); } updateStatus(Properties.OUTPUT_QUALITY, Status.ALREADY_SET); outputQuality = quality; return this; } /** * Sets the compression output quality of the thumbnail. * <p> * The value is a {@code double} between {@code 0.0d} and {@code 1.0d} * where {@code 0.0d} indicates the minimum quality and {@code 1.0d} * indicates the maximum quality settings should be used for by the * compression codec. * <p> * This method is a convenience method for {@link #outputQuality(float)} * where the {@code double} argument type is accepted instead of a * {@code float}. * <p> * Calling this method to set this parameter is optional. * <p> * Calling this method multiple times, or the * {@link #outputQuality(float)} in conjunction with this method will * result in an {@link IllegalStateException} to be thrown. * * @param quality The quality of the * @return Reference to this object. * @throws IllegalArgumentException If the argument is less than * {@code 0.0d} or is greater than * {@code 1.0d}. */ public Builder<T> outputQuality(double quality) { if (quality < 0.0d || quality > 1.0d) { throw new IllegalArgumentException( "The quality setting must be in the range 0.0d and " + "1.0d, inclusive." ); } updateStatus(Properties.OUTPUT_QUALITY, Status.ALREADY_SET); outputQuality = (float)quality; if (outputQuality < 0.0f) { outputQuality = 0.0f; } else if (outputQuality > 1.0f) { outputQuality = 1.0f; } return this; } /** * Sets the compression format to use when writing the thumbnail. * <p> * Calling this method to set this parameter is optional. * <p> * Calling this method multiple times will result in an * {@link IllegalStateException} to be thrown. * * @param format The compression format. * @return Reference to this object. * @throws IllegalArgumentException If an unsupported format is * specified. */ public Builder<T> outputFormat(String format) { if (!ThumbnailatorUtils.isSupportedOutputFormat(format)) { throw new IllegalArgumentException( "Specified format is not supported: " + format ); } updateStatus(Properties.OUTPUT_FORMAT, Status.ALREADY_SET); outputFormat = format; return this; } /** * Sets the compression format type of the thumbnail to write. * <p> * If the default type for the compression codec should be used, a * value of {@link ThumbnailParameter#DEFAULT_FORMAT_TYPE} should be * used. * <p> * Calling this method to set this parameter is optional. * <p> * Calling this method multiple times will result in an * {@link IllegalStateException} to be thrown. * <p> * Furthermore, if this method is called, then calling the * {@link #outputFormat} method is disabled, in order to prevent * cases where the output format type does not exist in the format * specified for the {@code outputFormat} method. * * @param formatType The compression format type * @return Reference to this object. * @throws IllegalArgumentException If an unsupported format type is * specified for the current output * format type. Or, if the output * format has not been specified before * this method was called. */ public Builder<T> outputFormatType(String formatType) { /* * If the output format is the original format, and the format type * is being specified, it's going to be likely that the specified * type will not be present in all the formats, so we'll disallow * it. (e.g. setting type to "JPEG", and if the original formats * were JPEG and PNG, then we'd have a problem. */ if (formatType != ThumbnailParameter.DEFAULT_FORMAT_TYPE && outputFormat == ThumbnailParameter.ORIGINAL_FORMAT) { throw new IllegalArgumentException( "Cannot set the format type if a specific output " + "format has not been specified." ); } if (!ThumbnailatorUtils.isSupportedOutputFormatType(outputFormat, formatType)) { throw new IllegalArgumentException( "Specified format type (" + formatType + ") is not " + " supported for the format: " + outputFormat ); } /* * If the output format type is set, then we'd better make the * output format unchangeable, or else we'd risk having a type * that is not part of the output format. */ updateStatus(Properties.OUTPUT_FORMAT_TYPE, Status.ALREADY_SET); if (!statusMap.containsKey(Properties.OUTPUT_FORMAT)) { updateStatus(Properties.OUTPUT_FORMAT, Status.CANNOT_SET); } outputFormatType = formatType; return this; } /** * Sets the watermark to apply on the thumbnail. * <p> * This method can be called multiple times to apply multiple * watermarks. * <p> * If multiple watermarks are to be applied, the watermarks will be * applied in the order that this method is called. * <p> * Calling this method to set this parameter is optional. * * @param w The watermark to apply to the thumbnail. * @return Reference to this object. */ public Builder<T> watermark(Watermark w) { if (w == null) { throw new NullPointerException("Watermark is null."); } filterPipeline.add(w); return this; } /** * Sets the image of the watermark to apply on the thumbnail. * <p> * This method is a convenience method for the * {@link #watermark(Position, BufferedImage, float)} method, where * the opacity is 50%, and the position is set to center of the * thumbnail: * <p> * <pre> watermark(Positions.CENTER, image, 0.5f); * </pre> * This method can be called multiple times to apply multiple * watermarks. * <p> * If multiple watermarks are to be applied, the watermarks will be * applied in the order that this method is called. * <p> * Calling this method to set this parameter is optional. * * @param image The image of the watermark. * @return Reference to this object. */ public Builder<T> watermark(BufferedImage image) { return watermark(Positions.CENTER, image, 0.5f); } /** * Sets the image and opacity of the watermark to apply on * the thumbnail. * <p> * This method is a convenience method for the * {@link #watermark(Position, BufferedImage, float)} method, where * the opacity is 50%: * <p> * <pre> watermark(Positions.CENTER, image, opacity); * </pre> * This method can be called multiple times to apply multiple * watermarks. * <p> * If multiple watermarks are to be applied, the watermarks will be * applied in the order that this method is called. * <p> * Calling this method to set this parameter is optional. * * @param image The image of the watermark. * @param opacity The opacity of the watermark. * <p> * The value should be between {@code 0.0f} and * {@code 1.0f}, where {@code 0.0f} is completely * transparent, and {@code 1.0f} is completely * opaque. * @return Reference to this object. */ public Builder<T> watermark(BufferedImage image, float opacity) { return watermark(Positions.CENTER, image, opacity); } /** * Sets the image and opacity and position of the watermark to apply on * the thumbnail. * <p> * This method can be called multiple times to apply multiple * watermarks. * <p> * If multiple watermarks are to be applied, the watermarks will be * applied in the order that this method is called. * <p> * Calling this method to set this parameter is optional. * * @param position The position of the watermark. * @param image The image of the watermark. * @param opacity The opacity of the watermark. * <p> * The value should be between {@code 0.0f} and * {@code 1.0f}, where {@code 0.0f} is completely * transparent, and {@code 1.0f} is completely * opaque. * @return Reference to this object. */ public Builder<T> watermark(Position position, BufferedImage image, float opacity) { filterPipeline.add(new Watermark(position, image, opacity)); return this; } /* * rotation */ /** * Sets the amount of rotation to apply to the thumbnail. * <p> * The thumbnail will be rotated clockwise by the angle specified. * <p> * This method can be called multiple times to apply multiple * rotations. * <p> * If multiple rotations are to be applied, the rotations will be * applied in the order that this method is called. * <p> * Calling this method to set this parameter is optional. * * @param angle Angle in degrees. * @return Reference to this object. */ public Builder<T> rotate(double angle) { filterPipeline.add(Rotation.newRotator(angle)); return this; } /* * other filters */ /** * Adds a {@link ImageFilter} to apply to the thumbnail. * <p> * This method can be called multiple times to apply multiple * filters. * <p> * If multiple filters are to be applied, the filters will be * applied in the order that this method is called. * <p> * Calling this method to set this parameter is optional. * * @param filter An image filter to apply to the thumbnail. * @return Reference to this object. */ public Builder<T> addFilter(ImageFilter filter) { if (filter == null) { throw new NullPointerException("Filter is null."); } filterPipeline.add(filter); return this; } /** * Adds multiple {@link ImageFilter}s to apply to the thumbnail. * <p> * This method can be called multiple times to apply multiple * filters. * <p> * If multiple filters are to be applied, the filters will be * applied in the order that this method is called. * <p> * Calling this method to set this parameter is optional. * * @param filters A list of filters to apply to the thumbnail. * @return Reference to this object. */ public Builder<T> addFilters(List<ImageFilter> filters) { if (filters == null) { throw new NullPointerException("Filters is null."); } filterPipeline.addAll(filters); return this; } /** * Checks whether the builder is ready to create thumbnails. * * @throws IllegalStateException If the builder is not ready to * create thumbnails, due to some * parameters not being set. */ private void checkReadiness() { for (Map.Entry<Properties, Status> s : statusMap.entrySet()) { if (s.getValue() == Status.NOT_READY) { throw new IllegalStateException(s.getKey().getName() + " is not set."); } } } /** * Returns a {@link Resizer} which is suitable for the current * builder state. * * @return The {@link Resizer} which is suitable for the * current builder state. */ private Resizer makeResizer() { /* * If the scalingMode has been set, then use scalingMode to obtain * a resizer, else, use the resizer field. */ if (statusMap.get(Properties.SCALING_MODE) == Status.ALREADY_SET) { return makeResizer(scalingMode); } else { return this.resizer; } } /** * Returns a {@link Resizer} which is suitable for the current * builder state. * * @param mode The scaling mode to use to create thumbnails. * @return The {@link Resizer} which is suitable for the * specified scaling mode and builder state. */ private Resizer makeResizer(ScalingMode mode) { Map<RenderingHints.Key, Object> hints = new HashMap<RenderingHints.Key, Object>(); hints.put(RenderingHints.KEY_ALPHA_INTERPOLATION, alphaInterpolation.getValue()); hints.put(RenderingHints.KEY_DITHERING, dithering.getValue()); hints.put(RenderingHints.KEY_ANTIALIASING, antialiasing.getValue()); hints.put(RenderingHints.KEY_RENDERING, rendering.getValue()); if (mode == ScalingMode.BILINEAR) { return new BilinearResizer(hints); } else if (mode == ScalingMode.BICUBIC) { return new BicubicResizer(hints); } else if (mode == ScalingMode.PROGRESSIVE_BILINEAR) { return new ProgressiveBilinearResizer(hints); } else { return new ProgressiveBilinearResizer(hints); } } /** * Returns a {@link ThumbnailParameter} from the current builder state. * * @return A {@link ThumbnailParameter} from the current * builder state. */ private ThumbnailParameter makeParam() { Resizer resizer = makeResizer(); int imageTypeToUse = imageType; if (imageType == IMAGE_TYPE_UNSPECIFIED) { imageTypeToUse = ThumbnailParameter.ORIGINAL_IMAGE_TYPE; } if (Double.isNaN(scaleWidth)) { // If the dimensions were specified, do the following. // Check that at least one dimension is specified. // If it's not, it's a bug. if ( width == DIMENSION_NOT_SPECIFIED && height == DIMENSION_NOT_SPECIFIED ) { throw new IllegalStateException( "The width or height must be specified. If this " + "exception is thrown, it is due to a bug in the " + "Thumbnailator library." ); } // Set the unspecified dimension to a default value. if (width == DIMENSION_NOT_SPECIFIED) { width = Integer.MAX_VALUE; } if (height == DIMENSION_NOT_SPECIFIED) { height = Integer.MAX_VALUE; } return new ThumbnailParameter( new Dimension(width, height), sourceRegion, keepAspectRatio, outputFormat, outputFormatType, outputQuality, imageTypeToUse, filterPipeline.getFilters(), resizer ); } else { // If the scaling factor was specified return new ThumbnailParameter( scaleWidth, scaleHeight, sourceRegion, keepAspectRatio, outputFormat, outputFormatType, outputQuality, imageTypeToUse, filterPipeline.getFilters(), resizer ); } } /** * Create the thumbnails and return as a {@link Iterable} of * {@link BufferedImage}s. * <p> * For situations where multiple thumbnails are being generated, this * method is preferred over the {@link #asBufferedImages()} method, * as (1) the processing does not have to complete before the method * returns and (2) the thumbnails can be retrieved one at a time, * potentially reducing the number of thumbnails which need to be * retained in the heap memory, potentially reducing the chance of * {@link OutOfMemoryError}s from occurring. * <p> * If an {@link IOException} occurs during the processing of the * thumbnail, the {@link Iterable} will return a {@code null} for that * element. * * @return An {@link Iterable} which will provide an * {@link Iterator} which returns thumbnails as * {@link BufferedImage}s. */ public Iterable<BufferedImage> iterableBufferedImages() { checkReadiness(); /* * TODO To get the precise error information, there would have to * be an event notification mechanism. */ return new BufferedImageIterable(); } /** * Create the thumbnails and return as a {@link List} of * {@link BufferedImage}s. * <p> * <h3>Note about performance</h3> * If there are many thumbnails generated at once, it is possible that * the Java virtual machine's heap space will run out and an * {@link OutOfMemoryError} could result. * <p> * If many thumbnails are being processed at once, then using the * {@link #iterableBufferedImages()} method would be preferable. * * @return A list of thumbnails. * @throws IOException If an problem occurred during * the reading of the original * images. */ public List<BufferedImage> asBufferedImages() throws IOException { checkReadiness(); List<BufferedImage> thumbnails = new ArrayList<BufferedImage>(); // Create thumbnails for (ImageSource<T> source : sources) { BufferedImageSink destination = new BufferedImageSink(); Thumbnailator.createThumbnail( new SourceSinkThumbnailTask<T, BufferedImage>(makeParam(), source, destination) ); thumbnails.add(destination.getSink()); } return thumbnails; } /** * Creates a thumbnail and returns it as a {@link BufferedImage}. * <p> * To call this method, the thumbnail must have been created from a * single source. * * @return A thumbnail as a {@link BufferedImage}. * @throws IOException If an problem occurred during * the reading of the original * image. * @throws IllegalArgumentException If multiple original images are * specified. */ public BufferedImage asBufferedImage() throws IOException { checkReadiness(); Iterator<ImageSource<T>> iter = sources.iterator(); ImageSource<T> source = iter.next(); if (iter.hasNext()) { throw new IllegalArgumentException("Cannot create one thumbnail from multiple original images."); } BufferedImageSink destination = new BufferedImageSink(); Thumbnailator.createThumbnail( new SourceSinkThumbnailTask<T, BufferedImage>(makeParam(), source, destination) ); return destination.getSink(); } /** * Creates the thumbnails and stores them to the files, and returns * a {@link List} of {@link File}s to the thumbnails. * <p> * When the destination file exists, and overwriting files has been * disabled by calling the {@link #allowOverwrite(boolean)} method * with {@code false}, then the thumbnail with the destination file * already existing will not be written and the corresponding * {@code File} object will not be included in the {@code List} returned * by this method. * <p> * The file names for the thumbnails are obtained from the given * {@link Iterable}. * * @param iterable An {@link Iterable} which returns an * {@link Iterator} which returns file names * which should be assigned to each thumbnail. * @return A list of {@link File}s of the thumbnails * which were created. * @throws IOException If a problem occurs while reading the * original images or writing the thumbnails * to files. * @since 0.3.7 */ public List<File> asFiles(Iterable<File> iterable) throws IOException { checkReadiness(); if (iterable == null) { throw new NullPointerException("File name iterable is null."); } List<File> destinationFiles = new ArrayList<File>(); ThumbnailParameter param = makeParam(); Iterator<File> filenameIter = iterable.iterator(); for (ImageSource<T> source : sources) { if (!filenameIter.hasNext()) { throw new IndexOutOfBoundsException( "Not enough file names provided by iterator." ); } FileImageSink destination = new FileImageSink(filenameIter.next(), allowOverwrite); try { Thumbnailator.createThumbnail( new SourceSinkThumbnailTask<T, File>(param, source, destination) ); destinationFiles.add(destination.getSink()); } catch (IllegalArgumentException e) { /* * Handle the IllegalArgumentException which is thrown when * the destination file already exists by not adding the * current file to the destinationFiles list. */ } } return destinationFiles; } /** * Creates the thumbnails and stores them to the files. * <p> * When the destination file exists, and overwriting files has been * disabled by calling the {@link #allowOverwrite(boolean)} method * with {@code false}, then the thumbnail with the destination file * already existing will not be written. * <p> * The file names for the thumbnails are obtained from the given * {@link Iterable}. * * @param iterable An {@link Iterable} which returns an * {@link Iterator} which returns file names * which should be assigned to each thumbnail. * @throws IOException If a problem occurs while reading the * original images or writing the thumbnails * to files. * @since 0.3.7 */ public void toFiles(Iterable<File> iterable) throws IOException { asFiles(iterable); } /** * Creates the thumbnails and stores them to the files, using the * {@code Rename} function to determine the filenames. The files * are returned as {@link List}. * <p> * When the destination file exists, and overwriting files has been * disabled by calling the {@link #allowOverwrite(boolean)} method * with {@code false}, then the thumbnail with the destination file * already existing will not be written and the corresponding * {@code File} object will not be included in the {@code List} returned * by this method. * <p> * To call this method, the thumbnails must have been creates from * files by calling the {@link Thumbnails#of(File...)} method. * * @param rename The rename function which is used to * determine the filenames of the thumbnail * files to write. * @return A list of {@link File}s of the thumbnails * which were created. * @throws IOException If a problem occurs while reading the * original images or writing the thumbnails * to files. * @throws IllegalStateException If the original images are not * from files. * @since 0.3.7 */ public List<File> asFiles(Rename rename) throws IOException { checkReadiness(); if (rename == null) { throw new NullPointerException("Rename is null."); } List<File> destinationFiles = new ArrayList<File>(); ThumbnailParameter param = makeParam(); for (ImageSource<T> source : sources) { if (!(source instanceof FileImageSource)) { throw new IllegalStateException("Cannot create thumbnails to files if original images are not from files."); } File f = ((FileImageSource)source).getSource(); File destinationFile = new File(f.getParent(), rename.apply(f.getName())); FileImageSink destination = new FileImageSink(destinationFile, allowOverwrite); try { Thumbnailator.createThumbnail( new SourceSinkThumbnailTask<T, File>(param, source, destination) ); destinationFiles.add(destination.getSink()); } catch (IllegalArgumentException e) { /* * Handle the IllegalArgumentException which is thrown when * the destination file already exists by not adding the * current file to the destinationFiles list. */ } } return destinationFiles; } /** * Creates the thumbnails and stores them to the files, using the * {@code Rename} function to determine the filenames. * <p> * When the destination file exists, and overwriting files has been * disabled by calling the {@link #allowOverwrite(boolean)} method * with {@code false}, then the thumbnail with the destination file * already existing will not be written. * <p> * To call this method, the thumbnails must have been creates from * files by calling the {@link Thumbnails#of(File...)} method. * * @param rename The rename function which is used to * determine the filenames of the thumbnail * files to write. * @throws IOException If a problem occurs while reading the * original images or writing the thumbnails * to files. * thumbnails to files. * @throws IllegalStateException If the original images are not * from files. * @since 0.3.7 */ public void toFiles(Rename rename) throws IOException { asFiles(rename); } /** * Create a thumbnail and writes it to a {@link File}. * <p> * When the destination file exists, and overwriting files has been * disabled by calling the {@link #allowOverwrite(boolean)} method * with {@code false}, then an {@link IllegalArgumentException} will * be thrown. * <p> * To call this method, the thumbnail must have been created from a * single source. * * @param outFile The file to which the thumbnail is to be * written to. * @throws IOException If a problem occurs while reading the * original images or writing the thumbnails * to files. * @throws IllegalArgumentException If multiple original image files * are specified, or if the * destination file exists, and * overwriting files is disabled. */ public void toFile(File outFile) throws IOException { checkReadiness(); Iterator<ImageSource<T>> iter = sources.iterator(); ImageSource<T> source = iter.next(); if (iter.hasNext()) { throw new IllegalArgumentException("Cannot output multiple thumbnails to one file."); } FileImageSink destination = new FileImageSink(outFile, allowOverwrite); Thumbnailator.createThumbnail( new SourceSinkThumbnailTask<T, File>(makeParam(), source, destination) ); } /** * Create a thumbnail and writes it to a {@link File}. * <p> * When the destination file exists, and overwriting files has been * disabled by calling the {@link #allowOverwrite(boolean)} method * with {@code false}, then an {@link IllegalArgumentException} will * be thrown. * <p> * To call this method, the thumbnail must have been created from a * single source. * * @param outFilepath The file to which the thumbnail is to be * written to. * @throws IOException If a problem occurs while reading the * original images or writing the thumbnails * to files. * @throws IllegalArgumentException If multiple original image files * are specified, or if the * destination file exists, and * overwriting files is disabled. */ public void toFile(String outFilepath) throws IOException { checkReadiness(); Iterator<ImageSource<T>> iter = sources.iterator(); ImageSource<T> source = iter.next(); if (iter.hasNext()) { throw new IllegalArgumentException("Cannot output multiple thumbnails to one file."); } FileImageSink destination = new FileImageSink(outFilepath, allowOverwrite); Thumbnailator.createThumbnail( new SourceSinkThumbnailTask<T, File>(makeParam(), source, destination) ); } /** * Create a thumbnail and writes it to a {@link OutputStream}. * <p> * To call this method, the thumbnail must have been created from a * single source. * * @param os The output stream to which the thumbnail * is to be written to. * @throws IOException If a problem occurs while reading the * original images or writing the thumbnails. * @throws IllegalArgumentException If multiple original image files * are specified. * @throws IllegalStateException If the output format has not * been specified through the * {@link #outputFormat(String)} * method. */ public void toOutputStream(OutputStream os) throws IOException { checkReadiness(); Iterator<ImageSource<T>> iter = sources.iterator(); ImageSource<T> source = iter.next(); if (iter.hasNext()) { throw new IllegalArgumentException("Cannot output multiple thumbnails to a single OutputStream."); } /* * if the image is from a BufferedImage, then we require that the * output format be set. (or else, we can't tell what format to * output as!) */ if (source instanceof BufferedImageSource) { if (outputFormat == ThumbnailParameter.ORIGINAL_FORMAT) { throw new IllegalStateException( "Output format not specified." ); } } OutputStreamImageSink destination = new OutputStreamImageSink(os); Thumbnailator.createThumbnail( new SourceSinkThumbnailTask<T, OutputStream>(makeParam(), source, destination) ); } /** * Creates the thumbnails and writes them to {@link OutputStream}s * provided by the {@link Iterable}. * * @param iterable An {@link Iterable} which returns an * {@link Iterator} which returns the * output stream which should be assigned to * each thumbnail. * @throws IOException If a problem occurs while reading the * original images or writing the thumbnails. * @throws IllegalStateException If the output format has not * been specified through the * {@link #outputFormat(String)} * method. */ public void toOutputStreams(Iterable<? extends OutputStream> iterable) throws IOException { checkReadiness(); if (iterable == null) { throw new NullPointerException("OutputStream iterable is null."); } Iterator<? extends OutputStream> osIter = iterable.iterator(); for (ImageSource<T> source : sources) { /* * if the image is from a BufferedImage, then we require that the * output format be set. (or else, we can't tell what format to * output as!) */ if (source instanceof BufferedImageSource) { if (outputFormat == ThumbnailParameter.ORIGINAL_FORMAT) { throw new IllegalStateException( "Output format not specified." ); } } if (!osIter.hasNext()) { throw new IndexOutOfBoundsException( "Not enough file names provided by iterator." ); } OutputStreamImageSink destination = new OutputStreamImageSink(osIter.next()); Thumbnailator.createThumbnail( new SourceSinkThumbnailTask<T, OutputStream>(makeParam(), source, destination) ); } } } }
zyslovely-thumb
src/net/coobird/thumbnailator/Thumbnails.java
Java
mit
79,332
/** * This package contains classes which provide the core functionalities of * Thumbnailator. */ package net.coobird.thumbnailator;
zyslovely-thumb
src/net/coobird/thumbnailator/package-info.java
Java
mit
141
package net.coobird.thumbnailator.tasks; import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; import net.coobird.thumbnailator.ThumbnailParameter; import net.coobird.thumbnailator.tasks.io.FileImageSink; import net.coobird.thumbnailator.tasks.io.FileImageSource; /** * A thumbnail generation task which reads and writes data from and to a * {@link File}. * <p> * Only the first image included in the image file will be read. Subsequent * images included in the image file will be ignored. * * @author coobird * */ public class FileThumbnailTask extends ThumbnailTask<File, File> { /** * The {@link SourceSinkThumbnailTask} used to perform the task. */ private final SourceSinkThumbnailTask<File, File> task; /** * Creates a {@link ThumbnailTask} in which image data is read from the * specified {@link File} and is output to a specified {@link File}, using * the parameters provided in the specified {@link ThumbnailParameter}. * * @param param The parameters to use to create the thumbnail. * @param sourceFile The {@link File} from which image data is read. * @param destinationFile The {@link File} to which thumbnail is written. * @throws NullPointerException If the parameter is {@code null}. */ public FileThumbnailTask(ThumbnailParameter param, File sourceFile, File destinationFile) { super(param); this.task = new SourceSinkThumbnailTask<File, File>( param, new FileImageSource(sourceFile), new FileImageSink(destinationFile) ); } @Override public BufferedImage read() throws IOException { return task.read(); } @Override public void write(BufferedImage img) throws IOException { task.write(img); } @Override public ThumbnailParameter getParam() { return task.getParam(); } @Override public File getSource() { return task.getSource(); } @Override public File getDestination() { return task.getDestination(); } }
zyslovely-thumb
src/net/coobird/thumbnailator/tasks/FileThumbnailTask.java
Java
mit
2,037
package net.coobird.thumbnailator.tasks; import java.io.IOException; /** * An exception used to indicate that the specified format could not be * used in an operation. * * @author coobird * */ public class UnsupportedFormatException extends IOException { /** * An ID used for serialization. */ private static final long serialVersionUID = 1254432584303852552L; /** * The format name which was not supported. */ private final String formatName; /** * A constant which is used to indicate an unknown format. */ public static final String UNKNOWN = "<unknown>"; /** * Instantiates a {@link UnsupportedFormatException} with the unsupported * format. * * @param formatName Format name. */ public UnsupportedFormatException(String formatName) { super(); this.formatName = formatName; } /** * Instantiates a {@link UnsupportedFormatException} with the unsupported * format and a detailed message. * * @param formatName Format name. * @param s A message detailing the exception. */ public UnsupportedFormatException(String formatName, String s) { super(s); this.formatName = formatName; } /** * Returns the format name which is not supported. * * @return Format name. */ public String getFormatName() { return formatName; } }
zyslovely-thumb
src/net/coobird/thumbnailator/tasks/UnsupportedFormatException.java
Java
mit
1,374
/** * This package provides classes which perform image input and output * operations, which can be used to aid in creating and writing thumbnails * to and from external sources. */ package net.coobird.thumbnailator.tasks;
zyslovely-thumb
src/net/coobird/thumbnailator/tasks/package-info.java
Java
mit
233
package net.coobird.thumbnailator.tasks; import java.awt.image.BufferedImage; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import net.coobird.thumbnailator.ThumbnailParameter; import net.coobird.thumbnailator.tasks.io.InputStreamImageSource; import net.coobird.thumbnailator.tasks.io.OutputStreamImageSink; /** * A thumbnail generation task which streams data from an {@link InputStream} * to an {@link OutputStream}. * <p> * This class does not close the {@link InputStream} and {@link OutputStream} * upon the completion of processing. * <p> * Only the first image obtained from the data stream will be read. Subsequent * images will be ignored. * * @author coobird * */ public class StreamThumbnailTask extends ThumbnailTask<InputStream, OutputStream> { /** * The {@link SourceSinkThumbnailTask} used to perform the task. */ private final SourceSinkThumbnailTask<InputStream, OutputStream> task; /** * Creates a {@link ThumbnailTask} in which streamed image data from the * specified {@link InputStream} is output to a specified * {@link OutputStream}, using the parameters provided in the specified * {@link ThumbnailParameter}. * * @param param The parameters to use to create the thumbnail. * @param is The {@link InputStream} from which to obtain image data. * @param os The {@link OutputStream} to send thumbnail data to. * @throws NullPointerException If the parameter is {@code null}. */ public StreamThumbnailTask(ThumbnailParameter param, InputStream is, OutputStream os) { super(param); this.task = new SourceSinkThumbnailTask<InputStream, OutputStream>( param, new InputStreamImageSource(is), new OutputStreamImageSink(os) ); } @Override public BufferedImage read() throws IOException { return task.read(); } @Override public void write(BufferedImage img) throws IOException { task.write(img); } @Override public ThumbnailParameter getParam() { return task.getParam(); } @Override public InputStream getSource() { return task.getSource(); } @Override public OutputStream getDestination() { return task.getDestination(); } }
zyslovely-thumb
src/net/coobird/thumbnailator/tasks/StreamThumbnailTask.java
Java
mit
2,267
package net.coobird.thumbnailator.tasks; import java.awt.image.BufferedImage; import java.io.IOException; import net.coobird.thumbnailator.ThumbnailParameter; import net.coobird.thumbnailator.tasks.io.ImageSink; import net.coobird.thumbnailator.tasks.io.ImageSource; /** * A {@link ThumbnailTask} which holds an {@link ImageSource} from which the * image is read or retrieved, and an {@link ImageSink} to which the thumbnail * is stored or written. * * @author coobird * * @param <S> The source class from which the source image is retrieved * or read. * @param <D> The destination class to which the thumbnail is stored * or written. */ public class SourceSinkThumbnailTask<S, D> extends ThumbnailTask<S, D> { /** * The source from which the image is retrieved or read. */ private final ImageSource<S> source; /** * The destination to which the thumbnail is stored or written. */ private final ImageSink<D> destination; /** * Creates a {@link ThumbnailTask} in which an image is retrived from the * specified {@link ImageSource} and written to the specified * {@link ImageSink}, using the parameters provided in the specified * {@link ThumbnailParameter}. * * @param param The parameters to use to create the thumbnail. * @param source The source from which the image is retrieved * or read from. * @param destination The destination to which the thumbnail is * stored or written to. * @throws NullPointerException If either the parameter, * {@link ImageSource} or {@link ImageSink} * is {@code null}. */ public SourceSinkThumbnailTask(ThumbnailParameter param, ImageSource<S> source, ImageSink<D> destination) { super(param); if (source == null) { throw new NullPointerException("ImageSource cannot be null."); } if (destination == null) { throw new NullPointerException("ImageSink cannot be null."); } source.setThumbnailParameter(param); this.source = source; destination.setThumbnailParameter(param); this.destination = destination; } @Override public BufferedImage read() throws IOException { BufferedImage img = source.read(); inputFormatName = source.getInputFormatName(); return img; } @Override public void write(BufferedImage img) throws IOException { String formatName; if (param.getOutputFormat() == ThumbnailParameter.ORIGINAL_FORMAT) { formatName = inputFormatName; } else { formatName = param.getOutputFormat(); } destination.setOutputFormatName(formatName); destination.write(img); } @Override public S getSource() { return source.getSource(); } @Override public D getDestination() { return destination.getSink(); } }
zyslovely-thumb
src/net/coobird/thumbnailator/tasks/SourceSinkThumbnailTask.java
Java
mit
2,854
package net.coobird.thumbnailator.tasks; import java.awt.image.BufferedImage; import java.io.IOException; import net.coobird.thumbnailator.ThumbnailParameter; /** * This class is used by {@link ThumbnailTask} implementations which is used * when creating thumbnails from external sources and destinations. * <p> * If the image handled by a {@link ThumbnailTask} contains multiple images, * only the first image will be read by the {@link #read()} method. Any * subsequent images will be ignored. * * @param <S> The class from which the image is retrieved or read. * @param <D> The class to which the thumbnail is stored or written. * * @author coobird * */ public abstract class ThumbnailTask<S, D> { /** * The parameters to use when creating a thumbnail. */ protected final ThumbnailParameter param; /** * String indicating the image format of the input image. * <p> * To be used for situtions where the output image format should be the * same as the input image format. */ protected String inputFormatName; /** * Constant used to obtain the first image when reading an image file. */ protected static final int FIRST_IMAGE_INDEX = 0; /** * Instantiates a {@link ThumbnailTask} with the parameters to use when * creating thumbnails. * * @param param The parameters to use when creating thumbnails. * @throws NullPointerException If the parameter is {@code null}. */ protected ThumbnailTask(ThumbnailParameter param) { if (param == null) { throw new NullPointerException("The parameter is null."); } this.param = param; } /** * Reads a source image. * * @return The image which was obtained from the source. * @throws IOException Thrown when an I/O problem occurs when reading * from the image source. */ /* * Future changes note: The public interface of this method may have to be * changed to support reading images tile-by-tile. This change may be * required in order to support large images. */ public abstract BufferedImage read() throws IOException; /** * Writes the thumbnail to the destination. * * @param img The image to write. * @throws UnsupportedFormatException When an image file which is to be * read or written is unsupported. * @throws IOException Thrown when an I/O problem occurs when writing the * image. */ public abstract void write(BufferedImage img) throws IOException; /** * Returns the {@link ThumbnailParameter} for this {@link ThumbnailTask}, * used when performing a thumbnail generation operation. * * @return The parameters to use when generating thumbnails. */ public ThumbnailParameter getParam() { return param; } /** * Returns the source from which the source image is retrieved or read. * * @return The source. */ public abstract S getSource(); /** * Returns the destination to which the thumbnail is stored or written. * * @return The destination. */ public abstract D getDestination(); }
zyslovely-thumb
src/net/coobird/thumbnailator/tasks/ThumbnailTask.java
Java
mit
3,145