plugins/admin/PageGroups.php
changeset 80 cb7dde69c301
parent 75 1f85c1c609fd
child 81 d7fc25acd3f3
equal deleted inserted replaced
79:5faff33a6580 80:cb7dde69c301
   502         foreach ( $vals as $id )
   502         foreach ( $vals as $id )
   503         {
   503         {
   504           if ( strval(intval($id)) == $id )
   504           if ( strval(intval($id)) == $id )
   505             $good[] = $id;
   505             $good[] = $id;
   506         }
   506         }
   507         $subquery = 'pg_member_id=' . implode(' OR pg_member_id=', $good);
   507         $subquery = ( count($good) > 0 ) ? 'pg_member_id=' . implode(' OR pg_member_id=', $good) : "'foo'='foo'";
   508         $sql = 'DELETE FROM '.table_prefix."page_group_members WHERE ( $subquery ) AND pg_id=$edit_id;";
   508         $sql = 'DELETE FROM '.table_prefix."page_group_members WHERE ( $subquery ) AND pg_id=$edit_id;";
   509         if ( !$db->sql_query($sql) )
   509         if ( !$db->sql_query($sql) )
   510         {
   510         {
   511           $db->_die();
   511           $db->_die();
   512         }
   512         }
   596           echo '<tr><th colspan="2" class="subhead" style="width: 70%;"><input type="submit" name="action[edit_save][do_rm]" value="Remove selected" /></th></tr>';
   596           echo '<tr><th colspan="2" class="subhead" style="width: 70%;"><input type="submit" name="action[edit_save][do_rm]" value="Remove selected" /></th></tr>';
   597           
   597           
   598           // More javascript magic!
   598           // More javascript magic!
   599           ?>
   599           ?>
   600           <script type="text/javascript">
   600           <script type="text/javascript">
   601             var __pg_edit_submitAuthorized = true;;
   601             var __pg_edit_submitAuthorized = true;
   602             var __ol_pg_edit_setup = function()
   602             var __ol_pg_edit_setup = function()
   603             {
   603             {
   604               var input = document.getElementById('inptext_pg_add_member');
   604               var input = document.getElementById('inptext_pg_add_member');
   605               input.onkeyup = function(e) { ajaxPageNameComplete(this); };
   605               input.onkeyup = function(e) { ajaxPageNameComplete(this); };
   606               input.onkeypress = function(e) { if ( e.keyCode == 13 ) { setTimeout('__pg_edit_ajaxadd(document.getElementById(\'' + this.id + '\'));', 500); } };
   606               input.onkeypress = function(e) { if ( e.keyCode == 13 ) { setTimeout('__pg_edit_ajaxadd(document.getElementById(\'' + this.id + '\'));', 500); } };
   686           <?php
   686           <?php
   687           
   687           
   688           $ajax_page_add = true;
   688           $ajax_page_add = true;
   689           
   689           
   690           break;
   690           break;
       
   691         case PAGE_GRP_TAGGED:
       
   692           break;
   691       }
   693       }
   692       
   694       
   693       if ( $ajax_page_add )
   695       if ( $ajax_page_add )
   694       {
   696       {
   695         echo '<tr><th colspan="3"><input type="submit" name="action[noop]" value="Cancel all changes" /></th></tr>';
   697         echo '<tr><th colspan="3"><input type="submit" name="action[noop]" value="Cancel all changes" /></th></tr>';
   696       }
   698       }
   697       else
   699       else
   698       {
   700       {
   699         
   701         echo '<tr><th colspan="3" class="subhead">
       
   702                 <input type="submit" name="action[edit_save]" value="Save and update" />
       
   703                 <input type="submit" name="action[noop]" value="Cancel all changes" />
       
   704               </th></tr>';
   700       }
   705       }
   701       
   706       
   702       echo '  </table>
   707       echo '  </table>
   703             </div>';
   708             </div>';
   704       echo '</form>';
   709       echo '</form>';
   705       
   710       
   706       // This needs to be outside of the form.
   711       if ( $ajax_page_add )
   707       echo '<div class="tblholder"><table border="0" cellspacing="1" cellpadding="4"><tr>';
   712       {
   708       echo '<th colspan="2">On-the-fly tools</th></tr>';
   713         // This needs to be outside of the form.
   709       echo '<tr>';
   714         echo '<div class="tblholder"><table border="0" cellspacing="1" cellpadding="4"><tr>';
   710       // Add pages AJAX form
   715         echo '<th colspan="2">On-the-fly tools</th></tr>';
   711       echo '<td class="row2">Add page:<br /><small>You can add multiple pages by entering part of a page title, and it will be auto-completed. Press Enter to quickly add the page. This only works if you a really up-to-date browser.</small></td>';
   716         echo '<tr>';
   712       echo '<td class="row1"><input type="text" size="30" name="pg_add_member" id="inptext_pg_add_member" /></td>';
   717         // Add pages AJAX form
   713       echo '</tr></table></div>';
   718         echo '<td class="row2">Add page:<br /><small>You can add multiple pages by entering part of a page title, and it will be auto-completed. Press Enter to quickly add the page. This only works if you a really up-to-date browser.</small></td>';
       
   719         echo '<td class="row1"><input type="text" size="30" name="pg_add_member" id="inptext_pg_add_member" /></td>';
       
   720         echo '</tr></table></div>';
       
   721       }
   714       
   722       
   715       return;
   723       return;
   716     }
   724     }
   717     else if ( isset($_POST['action']['noop']) )
   725     else if ( isset($_POST['action']['noop']) )
   718     {
   726     {