actions_main.php

Go to the documentation of this file.
00001 <?php
00002 
00009 class Actions_Main extends oxAdminDetails
00010 {
00016     public function render()
00017     {
00018         parent::render();
00019 
00020         $soxId = oxConfig::getParameter( "oxid");
00021         // check if we right now saved a new entry
00022         $sSavedID = oxConfig::getParameter( "saved_oxid");
00023         if ( ($soxId == "-1" || !isset( $soxId)) && isset( $sSavedID) ) {
00024             $soxId = $sSavedID;
00025             oxSession::deleteVar( "saved_oxid");
00026             $this->_aViewData["oxid"] =  $soxId;
00027             // for reloading upper frame
00028             $this->_aViewData["updatelist"] =  "1";
00029         }
00030 
00031         // copy this tree for our article choose
00032         $sChosenArtCat = oxConfig::getParameter( "artcat");
00033         if ( $soxId != "-1" && isset( $soxId)) {
00034             // generating category tree for select list
00035             $sChosenArtCat = $this->_getCategoryTree( "artcattree", $sChosenArtCat, $soxId);
00036 
00037             // load object
00038             $oAction = oxNew( "oxactions" );
00039             $oAction->load( $soxId);
00040             $this->_aViewData["edit"] =  $oAction;
00041         }
00042         $aColumns = array();
00043         if ( oxConfig::getParameter("aoc") ) {
00044 
00045             include_once 'inc/'.strtolower(__CLASS__).'.inc.php';
00046             $this->_aViewData['oxajax'] = $aColumns;
00047 
00048             return "popups/actions_main.tpl";
00049         }
00050         return "actions_main.tpl";
00051     }
00052 
00058     public function save()
00059     {
00060         $myConfig  = $this->getConfig();
00061 
00062 
00063         $soxId   = oxConfig::getParameter( "oxid");
00064         $aParams = oxConfig::getParameter( "editval");
00065 
00066         $oAction = oxNew( "oxactions" );
00067         if ( $soxId != "-1" ) {
00068             $oAction->load( $soxId);
00069         } else {
00070             return;
00071         }
00072 
00073         if ( !$aParams['oxactions__oxactive'] ) {
00074             $aParams['oxactions__oxactive'] = 0;
00075         }
00076 
00077         $oAction->assign( $aParams);
00078         $oAction = oxUtilsFile::getInstance()->processFiles( $oAction );
00079         $oAction->save();
00080         $this->_aViewData["updatelist"] = "1";
00081 
00082         // set oxid if inserted
00083         if ( $soxId == "-1")
00084             oxSession::setVar( "saved_oxid", $oAction->oxactions__oxid->value);
00085     }
00086 }

Generated on Wed Apr 22 12:26:29 2009 for OXID eShop CE by  doxygen 1.5.5