OSDN Git Service

git-svn-id: https://svn.sourceforge.jp/svnroot/nucleus-jp/plugin@1020 1ca29b6e-896d...
[nucleus-jp/nucleus-plugins.git] / NP_TrackBack / trunk / trackback / japanese-utf8.templates / all_ajax.html
1 <?php global $manager; ?>
2 <h2>
3         All trackbacks
4 </h2>
5
6 <div id="message" style="color: red;"></div>
7
8 <div style="width: 95%">
9 <span id="tb_grid_bookmark"></span>
10
11 <table id="tb_grid" style="border:0; margin:0;">
12         <colgroup>
13                 <col style="width:25px;" />
14                 <col style="width:40px;" />
15                 <col style="width:70px;" />
16                 <col style="width:150px;" />
17                 <col style="width:200px;"/>
18                 <col style="width:25px;" />
19         </colgroup>
20         <thead>
21                 <tr>
22                         <th>&#160;</th>
23                         <th>id</th>
24                         <th>Date</th>
25                         <th>Story</th>
26                         <th>Title, Blog and Excerpt</th>
27                         <th>&#160;</th>
28                 </tr>
29         </thead>
30 </table>
31
32 上記で選択したトラックバックを一括して処理します
33 <a href="javascript:doDelete()" onclick=""><img alt="Delete" border="0" src="<?php echo $plugindirurl?>silk/cross.png" /></a>
34 <a href="javascript:doBlock()" onclick=""><img alt="Block" border="0" src="<?php echo $plugindirurl?>silk/delete.png" /></a>
35 </div>
36
37 <!--
38 <textarea id='tb_grid_debugmsgs' rows='5' cols='80' style='font-size:smaller;'></textarea>
39 -->
40
41 <script type="text/javascript">
42 //<![CDATA[
43         Rico.loadModule('LiveGridAjax');
44         Rico.loadModule('LiveGridMenu');
45         Rico.include('translations/livegrid_ja.js');
46         Rico.include('ricoAjaxEngine.js');
47         
48         Rico.onLoad( function() {
49                 var params = [
50                         'action=ajax',
51                         'type=all',
52                         'ticket=<?php echo $ticket ;?>'
53                 ]; 
54                 
55                 var cb = new Rico.TableColumn.checkbox('1','0');
56                 var colspec = [
57                         {canHide:false, type:'control', control:cb, ClassName:'aligncenter'},
58                         {type:'raw'},
59                         {type:'raw'},
60                         ,
61                         ,
62                         ,
63                 ];
64                 
65                 var opts = {
66                         saveColumnInfo   : {width:true, filter:false, sort:false}, 
67                         menuEvent       : 'none',
68                         frozenColumns   : 2,
69                         canSortDefault  : false,
70                         canHideDefault  : true,
71                         allowColResize  : true,
72                         canFilterDefault: false,
73                         highlightElem   : 'none',
74                         columnSpecs     : colspec
75                 };
76                 
77                 buffer = new Rico.Buffer.AjaxSQL('<?php echo $CONF['PluginURL'].'trackback/';?>grid.php',
78                                 {TimeOut:10, requestParameters:params, sortParmFmt: 'displayName'}
79                 );
80                 orderGrid=new Rico.LiveGrid ('tb_grid', buffer, opts);
81                 orderGrid.menu=new Rico.GridMenu({});
82                 
83                 // ajaxEngine
84                 ajaxEngine = new Rico.AjaxEngine;
85                 ajaxEngine.registerRequest('updateData', '<?php echo $CONF['PluginURL'].'trackback/';?>grid.php' );
86                 ajaxEngine.registerAjaxElement('message');
87         });
88
89         function checkUpdateIds(){
90                 var updateIds = [];
91                 Rico.writeDebugMsg('check updated rows');
92                 for(var i = 0; i < buffer.size; i++){
93                         row = buffer.rows[i];
94                         if( row[0].content && row[0].content == '1' ){
95                                 updateIds.push(row[1].content);
96                                 Rico.writeDebugMsg('id: '+row[1].content+' updated');
97                         }
98                 }
99                 return updateIds;
100         }
101         
102         function doBlock(){
103                 var ids = checkUpdateIds();
104                 if( !(ids.length && ids.length > 0) ) return ;
105                 var params = [
106                         'action=doblock',
107                         'ticket=<?php echo $ticket ;?>',
108                         'ids='+ids.join(',')
109                 ]; 
110                 ajaxEngine.sendRequest('updateData', {parameters: ajaxEngine._createQueryString(params, 0)});
111                 orderGrid.resetContents('tb_grid');
112                 buffer.fetch(-1);
113         }
114         
115         function doDelete(){
116                 var ids = checkUpdateIds();
117                 if( !(ids.length && ids.length > 0) ) return ;
118                 if( !confirm('本当に削除しますか?') ) return ;
119                 
120                 var params = [
121                         'action=dodelete',
122                         'ticket=<?php echo $ticket ;?>',
123                         'ids='+ids.join(',')
124                 ];
125                 ajaxEngine.sendRequest('updateData', {parameters: ajaxEngine._createQueryString(params, 0)});
126                 orderGrid.resetContents('tb_grid');
127                 buffer.fetch(-1);
128         }
129 //]]>
130 </script>