00001 <?php
00002
00010 class Actions_Main extends oxAdminDetails
00011 {
00017 public function render()
00018 {
00019 parent::render();
00020
00021 $soxId = oxConfig::getParameter( "oxid");
00022
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
00029 $this->_aViewData["updatelist"] = "1";
00030 }
00031
00032
00033 $sChosenArtCat = oxConfig::getParameter( "artcat");
00034 if ( $soxId != "-1" && isset( $soxId)) {
00035
00036 $sChosenArtCat = $this->_getCategoryTree( "artcattree", $sChosenArtCat, $soxId);
00037
00038
00039 $oAction = oxNew( "oxactions" );
00040 $oAction->load( $soxId);
00041 $this->_aViewData["edit"] = $oAction;
00042 }
00043 $aColumns = array();
00044 if ( oxConfig::getParameter("aoc") ) {
00045
00046 include_once 'inc/'.strtolower(__CLASS__).'.inc.php';
00047 $this->_aViewData['oxajax'] = $aColumns;
00048
00049 return "popups/actions_main.tpl";
00050 }
00051 return "actions_main.tpl";
00052 }
00053
00059 public function save()
00060 {
00061 $myConfig = $this->getConfig();
00062
00063
00064 $soxId = oxConfig::getParameter( "oxid");
00065 $aParams = oxConfig::getParameter( "editval");
00066
00067 $oAction = oxNew( "oxactions" );
00068 if ( $soxId != "-1" ) {
00069 $oAction->load( $soxId);
00070 } else {
00071 return;
00072 }
00073
00074 if ( !$aParams['oxactions__oxactive'] ) {
00075 $aParams['oxactions__oxactive'] = 0;
00076 }
00077
00078 $oAction->assign( $aParams);
00079 $oAction = oxUtilsFile::getInstance()->processFiles( $oAction );
00080 $oAction->save();
00081 $this->_aViewData["updatelist"] = "1";
00082
00083
00084 if ( $soxId == "-1")
00085 oxSession::setVar( "saved_oxid", $oAction->oxactions__oxid->value);
00086
00087 return $this->autosave();
00088 }
00089 }