source/Application/Controller/Admin/ContentMain.php
public function render()
    {
        $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();

        parent::render();

        $soxId = $this->_aViewData["oxid"] = $this->getEditObjectId();

        // categorie tree
        $oCatTree = oxNew(\OxidEsales\Eshop\Application\Model\CategoryList::class);
        $oCatTree->loadList();

        $oContent = oxNew(\OxidEsales\Eshop\Application\Model\Content::class);
        if (isset($soxId) && $soxId != "-1") {
            // load object
            $oContent->loadInLang($this->_iEditLang, $soxId);

            $oOtherLang = $oContent->getAvailableInLangs();
            if (!isset($oOtherLang[$this->_iEditLang])) {
                // echo "language entry doesn't exist! using: ".key($oOtherLang);
                $oContent->loadInLang(key($oOtherLang), $soxId);
            }

            // remove already created languages
            $aLang = array_diff(\OxidEsales\Eshop\Core\Registry::getLang()->getLanguageNames(), $oOtherLang);
            if (count($aLang)) {
                $this->_aViewData["posslang"] = $aLang;
            }
            foreach ($oOtherLang as $id => $language) {
                $oLang = new stdClass();
                $oLang->sLangDesc = $language;
                $oLang->selected = ($id == $this->_iEditLang);
                $this->_aViewData["otherlang"][$id] = clone $oLang;
            }
            // mark selected
            if ($oContent->oxcontents__oxcatid->value && isset($oCatTree[$oContent->oxcontents__oxcatid->value])) {
                $oCatTree[$oContent->oxcontents__oxcatid->value]->selected = 1;
            }
        } else {
            // create ident to make life easier
            $sUId = \OxidEsales\Eshop\Core\Registry::getUtilsObject()->generateUId();
            $oContent->oxcontents__oxloadid = new \OxidEsales\Eshop\Core\Field($sUId);
        }

        $this->_aViewData["edit"] = $oContent;
        $this->_aViewData["link"] = "[{ oxgetseourl ident=&quot;" . $oContent->oxcontents__oxloadid->value . "&quot; type=&quot;oxcontent&quot; }]";
        $this->_aViewData["cattree"] = $oCatTree;

        // generate editor
        $sCSS = "content.tpl.css";
        if ($oContent->oxcontents__oxsnippet->value == '1') {
            $sCSS = null;
        }

        $this->_aViewData["editor"] = $this->_generateTextEditor("100%", 300, $oContent, "oxcontents__oxcontent", $sCSS);
        $this->_aViewData["afolder"] = $myConfig->getConfigParam('aCMSfolder');

        return "content_main.tpl";
    }
public function render()
    {
        $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();

        parent::render();

        $soxId = $this->_aViewData["oxid"] = $this->getEditObjectId();

        // categorie tree
        $oCatTree = oxNew(\OxidEsales\Eshop\Application\Model\CategoryList::class);
        $oCatTree->loadList();

        $oContent = oxNew(\OxidEsales\Eshop\Application\Model\Content::class);
        if (isset($soxId) && $soxId != "-1") {
            // load object
            $oContent->loadInLang($this->_iEditLang, $soxId);

            $oOtherLang = $oContent->getAvailableInLangs();
            if (!isset($oOtherLang[$this->_iEditLang])) {
                // echo "language entry doesn't exist! using: ".key($oOtherLang);
                $oContent->loadInLang(key($oOtherLang), $soxId);
            }

            // remove already created languages
            $aLang = array_diff(\OxidEsales\Eshop\Core\Registry::getLang()->getLanguageNames(), $oOtherLang);
            if (count($aLang)) {
                $this->_aViewData["posslang"] = $aLang;
            }
            foreach ($oOtherLang as $id => $language) {
                $oLang = new stdClass();
                $oLang->sLangDesc = $language;
                $oLang->selected = ($id == $this->_iEditLang);
                $this->_aViewData["otherlang"][$id] = clone $oLang;
            }
            // mark selected
            if ($oContent->oxcontents__oxcatid->value && isset($oCatTree[$oContent->oxcontents__oxcatid->value])) {
                $oCatTree[$oContent->oxcontents__oxcatid->value]->selected = 1;
            }
        } else {
            // create ident to make life easier
            $sUId = \OxidEsales\Eshop\Core\Registry::getUtilsObject()->generateUId();
            $oContent->oxcontents__oxloadid = new \OxidEsales\Eshop\Core\Field($sUId);
        }

        $this->_aViewData["edit"] = $oContent;
        $this->_aViewData["link"] = "[{ oxgetseourl ident=&quot;" . $oContent->oxcontents__oxloadid->value . "&quot; type=&quot;oxcontent&quot; }]";
        $this->_aViewData["cattree"] = $oCatTree;

        // generate editor
        $sCSS = "content.tpl.css";
        if ($oContent->oxcontents__oxsnippet->value == '1') {
            $sCSS = null;
        }

        $this->_aViewData["editor"] = $this->_generateTextEditor("100%", 300, $oContent, "oxcontents__oxcontent", $sCSS);
        $this->_aViewData["afolder"] = $myConfig->getConfigParam('aCMSfolder');

        return "content_main.tpl";
    }
public function render ( ) { $ myConfig = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) ; parent :: render ( ) ; $ soxId = $ this -> _aViewData [ "oxid" ] = $ this -> getEditObjectId ( ) ; // categorie tree $ oCatTree = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ CategoryList :: class ) ; $ oCatTree -> loadList ( ) ; $ oContent = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ Content :: class ) ; if ( isset ( $ soxId ) && $ soxId != "-1" ) { // load object $ oContent -> loadInLang ( $ this -> _iEditLang , $ soxId ) ; $ oOtherLang = $ oContent -> getAvailableInLangs ( ) ; if ( ! isset ( $ oOtherLang [ $ this -> _iEditLang ] ) ) { // echo "language entry doesn't exist! using: ".key($oOtherLang); $ oContent -> loadInLang ( key ( $ oOtherLang ) , $ soxId ) ; } // remove already created languages $ aLang = array_diff ( \ OxidEsales \ Eshop \ Core \ Registry :: getLang ( ) -> getLanguageNames ( ) , $ oOtherLang ) ; if ( count ( $ aLang ) ) { $ this -> _aViewData [ "posslang" ] = $ aLang ; } foreach ( $ oOtherLang as $ id => $ language ) { $ oLang = new stdClass ( ) ; $ oLang -> sLangDesc = $ language ; $ oLang -> selected = ( $ id == $ this -> _iEditLang ) ; $ this -> _aViewData [ "otherlang" ] [ $ id ] = clone $ oLang ; } // mark selected if ( $ oContent -> oxcontents__oxcatid -> value && isset ( $ oCatTree [ $ oContent -> oxcontents__oxcatid -> value ] ) ) { $ oCatTree [ $ oContent -> oxcontents__oxcatid -> value ] -> selected = 1 ; } } else { // create ident to make life easier $ sUId = \ OxidEsales \ Eshop \ Core \ Registry :: getUtilsObject ( ) -> generateUId ( ) ; $ oContent -> oxcontents__oxloadid = new \ OxidEsales \ Eshop \ Core \ Field ( $ sUId ) ; } $ this -> _aViewData [ "edit" ] = $ oContent ; $ this -> _aViewData [ "link" ] = "[{ oxgetseourl ident=&quot;" . $ oContent -> oxcontents__oxloadid -> value . "&quot; type=&quot;oxcontent&quot; }]" ; $ this -> _aViewData [ "cattree" ] = $ oCatTree ; // generate editor $ sCSS = "content.tpl.css" ; if ( $ oContent -> oxcontents__oxsnippet -> value == '1' ) { $ sCSS = null ; } $ this -> _aViewData [ "editor" ] = $ this -> _generateTextEditor ( "100%" , 300 , $ oContent , "oxcontents__oxcontent" , $ sCSS ) ; $ this -> _aViewData [ "afolder" ] = $ myConfig -> getConfigParam ( 'aCMSfolder' ) ; return "content_main.tpl" ; }
Loads contents info, passes it to Smarty engine and
returns name of template file "content_main.tpl".

@return string
Loads contents info passes it to Smarty engine and returns name of template file content_main . tpl .