plugins/admin/PageGroups.php
changeset 1021 5990ac411f34
parent 801 eb8b23f11744
child 1081 745200a9cc2a
equal deleted inserted replaced
1020:0867b9d38c38 1021:5990ac411f34
   382                   <small>' . $lang->get('acppg_field_target_regex_hint') . '</small>
   382                   <small>' . $lang->get('acppg_field_target_regex_hint') . '</small>
   383               </td>';
   383               </td>';
   384             
   384             
   385       echo '  <td class="row1">
   385       echo '  <td class="row1">
   386                 <div id="pg_create_normal_2" />
   386                 <div id="pg_create_normal_2" />
   387                   <input type="text" style="margin-top: 3px;" name="member_page_0" id="pg_create_member_0" onkeyup="return ajaxPageNameComplete(this);" size="30" /><br />
   387                   <input type="text" style="margin-top: 3px;" name="member_page_0" id="pg_create_member_0" class="autofill page" size="30" /><br />
   388                   <input type="text" style="margin-top: 3px;" name="member_page_1" id="pg_create_member_1" onkeyup="return ajaxPageNameComplete(this);" size="30" /><br />
   388                   <input type="text" style="margin-top: 3px;" name="member_page_1" id="pg_create_member_1" class="autofill page" size="30" /><br />
   389                   <input type="text" style="margin-top: 3px;" name="member_page_2" id="pg_create_member_2" onkeyup="return ajaxPageNameComplete(this);" size="30" /><br />
   389                   <input type="text" style="margin-top: 3px;" name="member_page_2" id="pg_create_member_2" class="autofill page" size="30" /><br />
   390                   <input type="text" style="margin-top: 3px;" name="member_page_3" id="pg_create_member_3" onkeyup="return ajaxPageNameComplete(this);" size="30" /><br />
   390                   <input type="text" style="margin-top: 3px;" name="member_page_3" id="pg_create_member_3" class="autofill page" size="30" /><br />
   391                   <input type="text" style="margin-top: 3px;" name="member_page_4" id="pg_create_member_4" onkeyup="return ajaxPageNameComplete(this);" size="30" /><br />
   391                   <input type="text" style="margin-top: 3px;" name="member_page_4" id="pg_create_member_4" class="autofill page" size="30" /><br />
   392                   <input type="button" onclick="pg_create_more_fields(); return false;" style="margin-top: 5px;" value="&nbsp;&nbsp;+&nbsp;&nbsp;" />
   392                   <input type="button" onclick="pg_create_more_fields(); return false;" style="margin-top: 5px;" value="&nbsp;&nbsp;+&nbsp;&nbsp;" />
   393                 </div>
   393                 </div>
   394                 <div id="pg_create_tagged_2">
   394                 <div id="pg_create_tagged_2">
   395                   <input type="text" name="member_tag" size="30" />
   395                   <input type="text" name="member_tag" size="30" />
   396                 </div>
   396                 </div>
   778           <script type="text/javascript">
   778           <script type="text/javascript">
   779             var __pg_edit_submitAuthorized = true;
   779             var __pg_edit_submitAuthorized = true;
   780             var __ol_pg_edit_setup = function()
   780             var __ol_pg_edit_setup = function()
   781             {
   781             {
   782               var input = document.getElementById('inptext_pg_add_member');
   782               var input = document.getElementById('inptext_pg_add_member');
   783               input.onkeyup = function(e) { ajaxPageNameComplete(this); };
   783               input.onkeypress = function(e) {
   784               <?php
   784                   if ( e.keyCode == 13 )
   785               // stupid jEdit hack
   785                   {
   786               echo "input.onkeypress = function(e) { if ( e.keyCode == 13 ) { setTimeout('__pg_edit_ajaxadd(document.getElementById(\'' + this.id + '\'));', 500); } };";
   786                     setTimeout('__pg_edit_ajaxadd(document.getElementById(\'' + this.id + '\'));', 500);
   787               ?>
   787                   } 
       
   788                 };
   788             }
   789             }
   789             addOnloadHook(__ol_pg_edit_setup);
   790             addOnloadHook(__ol_pg_edit_setup);
   790             var __pg_edit_objcache = false;
   791             var __pg_edit_objcache = false;
   791             function __pg_edit_ajaxadd(obj)
   792             function __pg_edit_ajaxadd(obj)
   792             {
   793             {
   801                   obj.parentNode.removeChild(obj.nextSibling);
   802                   obj.parentNode.removeChild(obj.nextSibling);
   802                 }
   803                 }
   803               }
   804               }
   804               
   805               
   805               // set width on parent, to prevent wrapping of ajax loading image
   806               // set width on parent, to prevent wrapping of ajax loading image
   806               var w = $(obj).Width();
   807               var w = $dynano(obj).Width();
   807               w = w + 24;
   808               w = w + 24;
   808               obj.parentNode.style.width = w + 'px';
   809               obj.parentNode.style.width = w + 'px';
   809               
   810               
   810               // append the ajaxy loading image
   811               // append the ajaxy loading image
   811               var img = document.createElement('img');
   812               var img = document.createElement('img');
   814               insertAfter(obj.parentNode, img, obj);
   815               insertAfter(obj.parentNode, img, obj);
   815               
   816               
   816               var url = makeUrlNS('Admin', 'PageGroups', 'src=ajax');
   817               var url = makeUrlNS('Admin', 'PageGroups', 'src=ajax');
   817               var page_add = escape(obj.value);
   818               var page_add = escape(obj.value);
   818               var pg_id = document.forms.pg_edit_frm['action[edit]'].value;
   819               var pg_id = document.forms.pg_edit_frm['action[edit]'].value;
       
   820               
   819               ajaxPost(url, 'action[edit][add_page]=&pg_id=' + pg_id + '&new_page=' + page_add, function()
   821               ajaxPost(url, 'action[edit][add_page]=&pg_id=' + pg_id + '&new_page=' + page_add, function()
   820                 {
   822                 {
   821                   if ( ajax.readyState == 4 )
   823                   if ( ajax.readyState == 4 )
   822                   {
   824                   {
   823                     var obj = __pg_edit_objcache;
   825                     var obj = __pg_edit_objcache;
   947         echo '<div class="tblholder"><table border="0" cellspacing="1" cellpadding="4"><tr>';
   949         echo '<div class="tblholder"><table border="0" cellspacing="1" cellpadding="4"><tr>';
   948         echo '<th colspan="2">' . $lang->get('acppg_th_onthefly') . '</th></tr>';
   950         echo '<th colspan="2">' . $lang->get('acppg_th_onthefly') . '</th></tr>';
   949         echo '<tr>';
   951         echo '<tr>';
   950         // Add pages AJAX form
   952         // Add pages AJAX form
   951         echo '<td class="row2">' . $lang->get('acppg_field_add_page') . '<br /><small>' . $lang->get('acppg_field_add_page_hint') . '</small></td>';
   953         echo '<td class="row2">' . $lang->get('acppg_field_add_page') . '<br /><small>' . $lang->get('acppg_field_add_page_hint') . '</small></td>';
   952         echo '<td class="row1"><input type="text" size="30" name="pg_add_member" id="inptext_pg_add_member" /></td>';
   954         echo '<td class="row1"><input type="text" size="30" name="pg_add_member" id="inptext_pg_add_member" class="autofill page" /></td>';
   953         echo '</tr></table></div>';
   955         echo '</tr></table></div>';
   954       }
   956       }
   955       
   957       
   956       return;
   958       return;
   957     }
   959     }