usergroup_main.php

Go to the documentation of this file.
00001 <?php
00002 
00008 class UserGroup_Main extends oxAdminDetails
00009 {
00017     public function render()
00018     {
00019         parent::render();
00020 
00021         $soxId = oxConfig::getParameter( "oxid");
00022         // check if we right now saved a new entry
00023         $sSavedID = oxConfig::getParameter( "saved_oxid");
00024         if ( ($soxId == "-1" || !isset( $soxId)) && isset( $sSavedID) ) {
00025             $soxId = $sSavedID;
00026             oxSession::deleteVar( "saved_oxid");
00027             $this->_aViewData["oxid"] =  $soxId;
00028             // for reloading upper frame
00029             $this->_aViewData["updatelist"] =  "1";
00030         }
00031 
00032         if ( $soxId != "-1" && isset( $soxId)) {
00033             // load object
00034             $oGroup = oxNew( "oxgroups" );
00035             $oGroup->load( $soxId);
00036             $this->_aViewData["edit"] =  $oGroup;
00037         }
00038         if ( oxConfig::getParameter("aoc") ) {
00039 
00040             $aColumns = array();
00041             include_once 'inc/'.strtolower(__CLASS__).'.inc.php';
00042             $this->_aViewData['oxajax'] = $aColumns;
00043 
00044             return "popups/usergroup_main.tpl";
00045         }
00046         return "usergroup_main.tpl";
00047     }
00048 
00054     public function save()
00055     {
00056 
00057         $soxId      = oxConfig::getParameter( "oxid");
00058         $aParams    = oxConfig::getParameter( "editval");
00059         // checkbox handling
00060         if ( !isset( $aParams['oxgroups__oxactive']))
00061             $aParams['oxgroups__oxactive'] = 0;
00062 
00063         $oGroup = oxNew( "oxgroups" );
00064         if ( $soxId != "-1")
00065             $oGroup->load( $soxId);
00066         else
00067             $aParams['oxgroups__oxid'] = null;
00068         //$aParams = $oGroup->ConvertNameArray2Idx( $aParams);
00069         $oGroup->assign( $aParams);
00070         $oGroup->save();
00071         // set oxid if inserted
00072         if ( $soxId == "-1")
00073             oxSession::setVar( "saved_oxid", $oGroup->oxgroups__oxid->value);
00074     }
00075 }

Generated on Tue Apr 21 15:45:44 2009 for OXID eShop CE by  doxygen 1.5.5