Xaraya / Postnuke CVS Notices - Message

Note: this list is kept only as a demonstration for CVSNotice. For the latest CVS notices, see the Xaraya and Postnuke sites

View Statistics - Next Notice - Previous Notice

Directory filter : [ all ] / postnuke_modules / New_pnadmin / html / modules / administration [ view in CVS ]

Date Directory [filter] File(s) [view] Author [filter]
05 Aug 2002 13:54:36postnuke_modules/New_pnadmin/html/modules/administrationpninit.php,1.1,1.2John Robeson
 more cleanup

Update of /home/cvsroot/postnuke_modules/New_pnadmin/html/modules/administration
In directory ns7.hostnuke.net:/tmp/cvs-serv31621/New_pnadmin/html/modules/administration

Modified Files:
	pninit.php 
Log Message:
more cleanup


Index: pninit.php
===================================================================
RCS file: /home/cvsroot/postnuke_modules/New_pnadmin/html/modules/administration/pninit.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** pninit.php	5 Aug 2002 12:15:29 -0000	1.1
--- pninit.php	5 Aug 2002 13:54:34 -0000	1.2
***************
*** 91,153 ****
  	$modsIDs['Configuration'] 	= array("7","96","11","12","15","17","41","93","21","22","29","31");
     	// ----------------------------------------------------------------------------------------
! 	// Let's loop and create tabs and it's content.
! 	for($x = 0;$x < count($tabNames);$x++){
! 		$newTabName		= $tabNames[$x];
! 		$sortOrder		= $sort[$newTabName];
! 		$listODModIDs	= $modsIDs[$newTabName];
! 		$UseLock		= $lockID[$newTabName];
! 		$default		= $defaultID[$newTabName];
! 		$infotype_cols = &$pntable['group'];
! 		$query = "INSERT INTO ".$pntable['admin_groups']." (". $infotype_cols['id'].",". $infotype_cols['lock'].",".$infotype_cols['order'].",". $infotype_cols['name'].",". $infotype_cols['default'].") VALUES ('','".$UseLock."','".$sortOrder."','".$newTabName."','".$default."')";
! 		mysql_query($query);
!     	if (mysql_error()){
!     	    pnSessionSetVar('errormsg', _CREATETABLEFAILED);
!     	    echo "<p>".nl2br($query). " <br> ".mysql_error()."</p>";
!     	    return false;
!     	}else{
! 			$infotype_cols = &$pntable['members'];
!     		$groupID	= mysql_insert_id();
! 	   		for($i = 0;$i < count($listODModIDs);$i++){
!     			$modID		= $listODModIDs[$i];
! 				$query		= "INSERT INTO ".$pntable['admin_members']." (". $infotype_cols['gid'].",". $infotype_cols['mid'].") VALUES ('".$groupID."','".$modID."')";
! 				mysql_query($query);
! 			}
!     	}
!     }
!    	// ----------------------------------------------------------------------------------------
! 	// Create a Misc tab where all other modules should be stored.
! 	//
!     $infotype_cols = &$pntable['group'];
! 	$newTabName	= "Misc";
! 	$sortOrder	= "";
! 	$default	= 0;
! 	$query = "INSERT INTO ".$pntable['admin_groups']." (". $infotype_cols['id'].",". $infotype_cols['lock'].",".$infotype_cols['order'].",". $infotype_cols['name'].",". $infotype_cols['default'].") VALUES ('','0','".(count($tabNames)+1)."','".$newTabName."','".$default."')";
! 	mysql_query($query);
!     if (mysql_error()){
!         pnSessionSetVar('errormsg', _CREATETABLEFAILED);
!         echo "<p>".nl2br($query). " <br> ".mysql_error()."</p>";
          return false;
!     }else{
!     	$miscID = mysql_insert_id();
      }
      
      
! 	// ----------------------------------------------------------------------------------------
! 	// Modules in group
! 	$infotype_cols	= &$pntable['members'];
      $result = pnModGetAdminMods();			
! 	$num			= mysql_numrows($result);
! 	for ($i = 0 ;$i < $num; $i++){
! 		$modID	= mysql_result($result, $i, "pn_id");
! 		if(isInAGroup($modID) < 1){
! 			$query	= "INSERT INTO ".$pntable['admin_members']." (". $infotype_cols['gid'].",". $infotype_cols['mid'].") VALUES ('".$miscID."','".$modID."')";
! 			mysql_query($query);
! 			if(mysql_error()){
! 				pnSessionSetVar('errormsg', _CREATETABLEFAILED);
! 				echo "<p>".nl2br($sql). " <br> ".mysql_error()."</p>";
! 				return false;
! 			}
! 		}
! 	}
  return true;
  }
--- 91,157 ----
  	$modsIDs['Configuration'] 	= array("7","96","11","12","15","17","41","93","21","22","29","31");
     	// ----------------------------------------------------------------------------------------
!     
!     // Let's loop and create tabs and it's content.
!     for($x = 0;$x < count($tabNames);$x++){
!         $newTabName   = $tabNames[$x];
!         $sortOrder    = $sort[$newTabName];
!         $listODModIDs = $modsIDs[$newTabName];
!         $UseLock      = $lockID[$newTabName];
!         $default      = $defaultID[$newTabName];
! 
!         $query = 'INSERT INTO '.$pntable['admin_groups']." (groupID, groupLock, sortOrder,groupName, groupDefault) VALUES ('','".$UseLock."','".$sortOrder."','".$newTabName."','".$default."')";
!         $dbconn->($query);
!         
!         if($dbconn->ErrorNo() != 0) {
!         pnSessionSetVar('errormsg', 'Insertion of new tabs into '.$pntable['admin_groups'].' table failed');
          return false;
!         }
!         
!     	else{
!              $groupID = mysql_insert_id();
!              for($i = 0;$i < count($listODModIDs);$i++){
!                  $modID	= $listODModIDs[$i];
!                  $query	= "INSERT INTO ".$pntable['admin_members']." (groupID, ,moduleID) VALUES ('".$groupID."','".$modID."')";
!                  $dbconn->Execute($query);
!                  if($dbconn->ErrorNo() != 0) {
!                     pnSessionSetVar('errormsg', 'Insertion of new tabs into '.$pntable['admin_members'].' table failed');
!                     return false;
!                    }
!              }
!     	}
      }
+    	
+     // ----------------------------------------------------------------------------------------
+     // Create a Misc tab where all other modules should be stored
+     $newTabName	= 'Misc';
+     $sortOrder	= '';
+     $default	= 0;
      
+     $query = "INSERT INTO ".$pntable['admin_groups']." (groupID, groupLock, sortOrder, groupName,groupDefault) VALUES ('','0','".(count($tabNames)+1)."','".$newTabName."','".$default."')";
+     $dbconn->Execute($query);
+     if($dbconn->ErrorNo() != 0) {
+        pnSessionSetVar('errormsg', 'Insertion of misc tab into '.$pntable['admin_groups'].' table failed');
+        return false;
+     }
+     else{
+          $miscID = mysql_insert_id();
+         }
      
!     // ----------------------------------------------------------------------------------------
!     // Modules in group
      $result = pnModGetAdminMods();			
!     $num    = mysql_numrows($result);
!     for($i = 0 ;$i < $num; $i++){
!         $modID	= mysql_result($result, $i, 'pn_id');
!         if(isInAGroup($modID) < 1){
!             $query = "INSERT INTO ".$pntable['admin_members']." (groupID, moduleID) VALUES ('".$miscID."','".$modID."')";
!             $dbconn->Execute($query);
!             if($dbconn->ErrorNo() != 0) {
!                 pnSessionSetVar('errormsg', 'Insertion of FIXME into '.$pntable['admin_groups'].' table failed');
!                 return false;
!             }
!         }
!     }
!     
  return true;
  }
***************
*** 190,202 ****
      }
      
-     $query = "INSERT INTO ".$pntable['module_vars']." (pn_modname,pn_name,pn_value) VALUES ('/PNConfig','use_new_admin','1')";
-     $dbconn->($query);
-     if ($dbconn->ErrorNo() != 0) {
-         pnSessionSetVar('errormsg', 'could not add configuration variable use_new_admin');
-         return false;
-     }
  
     if(!restoreToDefault()){
          return false;
     
     //Initialization successful
--- 194,201 ----
      }
      
  
     if(!restoreToDefault()){
          return false;
+    }
     
     //Initialization successful


Directory filter : [ all ] / postnuke_modules / New_pnadmin / html / modules / administration [ view in CVS ]

View Statistics - Next Notice - Previous Notice


Visit Developer Site - Browse CVS Repository Syndicate via backend.rss
(max. once per hour please)
Powered by CVSNotice 0.1.3