[geeklog-cvs] Geeklog-1.x/public_html/admin/plugins/links category.php, 1.8, 1.9

Dirk Haun dhaun at qs1489.pair.com
Sun Dec 30 05:02:27 EST 2007


Update of /cvsroot/geeklog/Geeklog-1.x/public_html/admin/plugins/links
In directory qs1489.pair.com:/tmp/cvs-serv80564/public_html/admin/plugins/links

Modified Files:
	category.php 
Log Message:
Added delete confirmation


Index: category.php
===================================================================
RCS file: /cvsroot/geeklog/Geeklog-1.x/public_html/admin/plugins/links/category.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** category.php	30 Dec 2007 09:45:44 -0000	1.8
--- category.php	30 Dec 2007 10:02:25 -0000	1.9
***************
*** 155,160 ****
  function links_edit_category ($cid,$pid)
  {
!     global $_CONF, $_TABLES, $_USER,
!            $LANG_LINKS_ADMIN, $LANG_ADMIN, $LANG_ACCESS;
  
      $retval = '';
--- 155,160 ----
  function links_edit_category ($cid,$pid)
  {
!     global $_CONF, $_TABLES, $_USER, $MESSAGE,
!            $LANG_LINKS_ADMIN, $LANG_ADMIN, $LANG_ACCESS, $_LI_CONF;
  
      $retval = '';
***************
*** 163,168 ****
          // have parent id, so making a new subcategory
          // get parent access rights
!         $result = DB_Query("SELECT group_id,perm_owner,perm_group, perm_members,perm_anon
!                             FROM {$_TABLES['linkcategories']} WHERE cid='{$pid}'");
          $A = DB_fetchArray($result);
          $A['username'] = DB_getItem ($_TABLES['users'], 'username', "uid={$_USER['uid']}");
--- 163,167 ----
          // have parent id, so making a new subcategory
          // get parent access rights
!         $result = DB_query("SELECT group_id,perm_owner,perm_group,perm_members,perm_anon FROM {$_TABLES['linkcategories']} WHERE cid='{$pid}'");
          $A = DB_fetchArray($result);
          $A['username'] = DB_getItem ($_TABLES['users'], 'username', "uid={$_USER['uid']}");
***************
*** 171,177 ****
      } elseif ($cid <> '') {
          // have category id, so editing a category
!         $sql = "SELECT * FROM {$_TABLES['linkcategories']}
!                 WHERE cid='{$cid}'" . COM_getPermSQL('AND');
!         $result = DB_Query($sql);
          $A = DB_fetchArray($result);
          $A['username'] = DB_getItem ($_TABLES['users'], 'username', "uid={$A['owner_id']}");
--- 170,176 ----
      } elseif ($cid <> '') {
          // have category id, so editing a category
!         $sql = "SELECT * FROM {$_TABLES['linkcategories']} WHERE cid='{$cid}'"
!              . COM_getPermSQL('AND');
!         $result = DB_query($sql);
          $A = DB_fetchArray($result);
          $A['username'] = DB_getItem ($_TABLES['users'], 'username', "uid={$A['owner_id']}");
***************
*** 218,221 ****
--- 217,225 ----
      if (!empty($cid)) {
          $T->set_var('delete_option', '<input type="submit" value="'.$LANG_ADMIN['delete'].'" name="mode"' . XHTML . '>');
+         $delbutton = '<input type="submit" value="' . $LANG_ADMIN['delete']
+                    . '" name="mode"%s' . XHTML . '>';
+         $jsconfirm = ' onclick="return confirm(\'' . $MESSAGE[76] . '\');"';
+         $T->set_var('delete_option', sprintf($delbutton, $jsconfirm));
+         $T->set_var('delete_option_no_confirmation', sprintf($delbutton, ''));
      } else {
          $T->set_var('delete_option', '');




More information about the geeklog-cvs mailing list