actions_main.php

Go to the documentation of this file.
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         // 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         // copy this tree for our article choose
00033         $sChosenArtCat = oxConfig::getParameter( "artcat");
00034         if ( $soxId != "-1" && isset( $soxId)) {
00035             // generating category tree for select list
00036             $sChosenArtCat = $this->_getCategoryTree( "artcattree", $sChosenArtCat, $soxId);
00037 
00038             // load object
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         // set oxid if inserted
00084         if ( $soxId == "-1")
00085             oxSession::setVar( "saved_oxid", $oAction->oxactions__oxid->value);
00086 
00087         return $this->autosave();
00088     }
00089 }

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