NAVIGATION
This is an old revision of the document!
Mit diesem Hack kann ein Contentpart im BE als Standardauswahl in der Liste definiert werden, der Fokus (selected) liegt bei der Auswahl auf dem eingetragenen CP.
- dazu sind:
Docu: –
Forum: Default Content Part?
Autor: K.Heermann (flip-flop) http://planmatrix.de
(17.08.2010)
CMS Version: >= 1.4
Version: V1.0
Dateiname: * include/inc_lib/backend.functions.inc.php
Mit diesem Schalter wird bestimmt, ob und welcher Contentpart mit “selected” gekennzeichnet wird. (Ist der Schaltet nicht vorhanden ist das gleichbedeutend ”” = aus, der default-Zustand des Systems wird generiert).
In der config/phpwcms/conf.inc.php wird eingefügt z.B. für den CP “Bilder = Nr 2”
$phpwcms['custom_cp_select'] = 2; // set selected cp no, list in "include/inc_lib/article.contenttype.inc.php" - default = '' - +KH170810
Siehe hierzu die Nummern der Content Part Typen.
Erweiterung der Datei include/inc_lib/backend.functions.inc.php in der Funktion “getContentPartOptionTag” etwa ab Zeile 454.
Ersetzt wird:
} else { $result .= '<option value="'.$value.'"'; if($value == $selected) { $result .= ' selected="selected"'; $GLOBALS['contentpart_temp_selected'] = $GLOBALS['temp_count']; } $result .= '>'.$text.'</option>'.LF; }
durch
} else { // ------ +KH 17.08.2010 Patch: set selected cp no if ($selected === '' AND isset($GLOBALS['phpwcms']['custom_cp_select'])) $selected = $GLOBALS['phpwcms']['custom_cp_select']; // ------ +KH end $result .= '<option value="'.$value.'"'; if($value == $selected) { $result .= ' selected="selected"'; $GLOBALS['contentpart_temp_selected'] = $GLOBALS['temp_count']; } $result .= '>'.$text.'</option>'.LF; }