25 $oCatTree =
oxNew(
"oxCategoryList" );
26 $oCatTree->loadList();
28 $oContent =
oxNew(
"oxcontent" );
29 if ( $soxId !=
"-1" && isset( $soxId)) {
31 $oContent->loadInLang( $this->_iEditLang, $soxId );
33 $oOtherLang = $oContent->getAvailableInLangs();
34 if (!isset($oOtherLang[$this->_iEditLang])) {
36 $oContent->loadInLang( key($oOtherLang), $soxId );
42 $this->_aViewData[
"posslang"] =
$aLang;
43 foreach ( $oOtherLang as $id => $language) {
44 $oLang=
new stdClass();
45 $oLang->sLangDesc = $language;
47 $this->_aViewData[
"otherlang"][$id] = clone $oLang;
50 if ( $oContent->oxcontents__oxcatid->value && isset( $oCatTree[$oContent->oxcontents__oxcatid->value] ) ) {
51 $oCatTree[$oContent->oxcontents__oxcatid->value]->selected = 1;
57 $oContent->oxcontents__oxloadid =
new oxField( $sUId );
60 $this->_aViewData[
"edit"] = $oContent;
61 $this->_aViewData[
"link"] =
"[{ oxgetseourl ident="".$oContent->oxcontents__oxloadid->value.
"" type="oxcontent" }]";
62 $this->_aViewData[
"cattree"] = $oCatTree;
65 $sCSS =
"content.tpl.css";
66 if ( $oContent->oxcontents__oxsnippet->value ==
'1') {
70 $this->_aViewData[
"editor"] = $this->
_generateTextEditor(
"100%", 300, $oContent,
"oxcontents__oxcontent", $sCSS);
71 $this->_aViewData[
"afolder"] =
$myConfig->getConfigParam(
'aCMSfolder' );
73 return "content_main.tpl";
90 if ( isset( $aParams[
'oxcontents__oxloadid'] ) ) {
91 $aParams[
'oxcontents__oxloadid'] = $this->
_prepareIdent( $aParams[
'oxcontents__oxloadid'] );
95 if ( $this->
_checkIdent( $aParams[
'oxcontents__oxloadid'], $soxId ) ) {
97 $this->_aViewData[
"blLoadError"] =
true;
99 $oContent =
oxNew(
"oxcontent" );
100 if ( $soxId !=
'-1') {
101 $oContent->load( $soxId );
103 $oContent->assign( $aParams );
104 $this->_aViewData[
"edit"] = $oContent;
109 if ( !isset( $aParams[
'oxcontents__oxactive']))
110 $aParams[
'oxcontents__oxactive'] = 0;
113 if ( $aParams[
'oxcontents__oxtype'] == 0)
114 $aParams[
'oxcontents__oxsnippet'] = 1;
116 $aParams[
'oxcontents__oxsnippet'] = 0;
119 if ( $aParams[
'oxcontents__oxfolder'] ==
'CMSFOLDER_NONE' ) {
120 $aParams[
'oxcontents__oxfolder'] =
'';
125 $aParams[
'oxcontents__oxshopid'] = $sShopID;
126 $oContent =
oxNew(
"oxcontent" );
129 $oContent->loadInLang( $this->_iEditLang, $soxId );
131 $aParams[
'oxcontents__oxid'] = null;
135 $oContent->setLanguage(0);
136 $oContent->assign( $aParams);
137 $oContent->setLanguage($this->_iEditLang);
158 if ( isset( $aParams[
'oxcontents__oxloadid'] ) ) {
159 $aParams[
'oxcontents__oxloadid'] = $this->
_prepareIdent( $aParams[
'oxcontents__oxloadid'] );
163 if ( !isset( $aParams[
'oxcontents__oxactive']))
164 $aParams[
'oxcontents__oxactive'] = 0;
168 $aParams[
'oxcontents__oxshopid'] = $sShopID;
170 $oContent =
oxNew(
"oxcontent" );
173 $oContent->loadInLang( $this->_iEditLang, $soxId );
175 $aParams[
'oxcontents__oxid'] = null;
177 $oContent->setLanguage(0);
178 $oContent->assign( $aParams);
198 return getStr()->preg_replace(
"/[^a-zA-Z0-9_]*/",
"", $sIdent );
215 if ( !strlen( $sIdent ) ) {
217 } elseif ( $oDb->getOne(
"select oxid from oxcontents where oxloadid = ".$oDb->quote( $sIdent ) .
" and oxid != ".$oDb->quote( $sOxId ) .
" and oxshopid = '".$this->
getConfig()->getShopId().
"'",
false, false ) ) {