actions_main.php

Go to the documentation of this file.
00001 <?php
00002 
00009 class Actions_Main extends oxAdminDetails
00010 {
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->loadInLang( $this->_iEditLang, $soxId);
00041 
00042             $oOtherLang = $oAction->getAvailableInLangs();
00043             if (!isset($oOtherLang[$this->_iEditLang])) {
00044                 // echo "language entry doesn't exist! using: ".key($oOtherLang);
00045                 $oAction->loadInLang( key($oOtherLang), $soxId );
00046             }
00047 
00048             $this->_aViewData["edit"] =  $oAction;
00049 
00050             // remove already created languages
00051             $aLang = array_diff ( oxLang::getInstance()->getLanguageNames(), $oOtherLang );
00052 
00053             if ( count( $aLang))
00054                 $this->_aViewData["posslang"] = $aLang;
00055 
00056             foreach ( $oOtherLang as $id => $language) {
00057                 $oLang= new oxStdClass();
00058                 $oLang->sLangDesc = $language;
00059                 $oLang->selected = ($id == $this->_iEditLang);
00060                 $this->_aViewData["otherlang"][$id] = clone $oLang;
00061             }
00062         }
00063         $aColumns = array();
00064         if ( oxConfig::getParameter("aoc") ) {
00065 
00066             include_once 'inc/'.strtolower(__CLASS__).'.inc.php';
00067             $this->_aViewData['oxajax'] = $aColumns;
00068 
00069             return "popups/actions_main.tpl";
00070         }
00071         return "actions_main.tpl";
00072     }
00073 
00079     public function save()
00080     {
00081         $myConfig  = $this->getConfig();
00082 
00083 
00084         $soxId   = oxConfig::getParameter( "oxid");
00085         $aParams = oxConfig::getParameter( "editval");
00086 
00087         $oAction = oxNew( "oxactions" );
00088         if ( $soxId != "-1" && $oAction->load( $soxId ) ) {
00089 
00090             if ( !$aParams['oxactions__oxactive'] ) {
00091                 $aParams['oxactions__oxactive'] = 0;
00092             }
00093 
00094             $oAction->setLanguage( 0 );
00095             $oAction->assign( $aParams );
00096             $oAction->setLanguage( $this->_iEditLang );
00097             $oAction = oxUtilsFile::getInstance()->processFiles( $oAction );
00098             $oAction->save();
00099             $this->_aViewData["updatelist"] = "1";
00100         }
00101     }
00102 
00108     public function saveinnlang()
00109     {
00110         $this->save();
00111     }
00112 }

Generated by  doxygen 1.6.2