usergroup_main.php

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

Generated on Thu Dec 4 12:04:56 2008 for OXID eShop CE by  doxygen 1.5.5