Hello Hamish,
I get the following error message:
XML-Verarbeitungsfehler: nicht wohlgeformt
Adresse: http://musik-kaiserslautern.de/post/post
Zeile Nr. 84, Spalte 220: <div id="ToID" class="field dropdown "><label class="left" for="Form_PostMessageForm_ToID">Empfänger wählen:</label><div class="middleColumn"><select id="Form_PostMessageForm_ToID" name="ToID"><option value="41">$M&M$</option><option value="21">$Marcel Cool$</option><option value="5">abdullah</option><option value="12">Anni :-)</option><option value="14">assassine</option><option value="29">Bärbel</option><option value="25">Cedi</option><option value="18">chidi</option><option value="24">Clarinette</option><option value="35">Das rebbhuhn</option><option value="26">esig</option><option value="40">Hanna Montana</option><option value="2">Hannes</option><option value="20">Jacobsisters</option><option value="13">janachen =)</option><option value="16">krisi</option><option value="15">larsi</option><option value="30">lenchen</option><option value="28">leni</option><option value="38">Lilli</option><option value="11">Love soccer :-P</option><option value="6">Lucky strike</option><option value="10">Marie :-)</option><option value="22">mausi</option><option value="9">melly </option><option value="1">Mister L</option><option value="34">mori</option><option value="27">Nessi</option><option value="31">PapaMT</option><option value="7">paul</option><option value="37">Pauli</option><option value="3">Räuber</option><option value="23">Renner</option><option value="19">Saibot</option><option value="8">skater@lex:)</option><option value="32">Test</option><option value="39">test1</option><option value="4">tester</option><option value="17">testerer</option><option value="36">The Devil</option><option value="33">vani</option></select></div></div>
Here is the template that displays the nickname:
<% _t('MESSAGES_TO', 'You can send messages to registered users.') %>
<p><a href="$Link"><% _t('INBOX', 'inbox') %></a></p>
$PostMessageForm
This is the method "PostMessageForm":
function PostMessageForm() {
//Nicknames of all members is passed into an array
$members = DataObject::get("Member", "", "Nickname");
$allMembers = array();
foreach($members as $member) {
$allMembers[$member->ID] = "$member->Nickname";
}
$me = Member::currentUser();
return new Form($this, "PostMessageForm", new FieldSet(
new ReadonlyField("From", _t('PrivateMessagePage.FROM', 'From'), "$me->Nickname"),
new DropdownField("ToID", _t('PrivateMessagePage.CHOOSERECEIVER', 'Choose receiver:'), $allMembers),
new TextField("Subject", _t('PrivateMessagePage.SUBJECT', 'Subject')),
new TextareaField("Body", _t('PrivateMessagePage.TEXT', 'Text'))
),
new FieldSet(
new FormAction("doPostMessage", _t('PrivateMessagePage.SUBMIT', 'submit'))
),
//Required fields are named inside the array. Without subject messages can´t be red.
new RequiredFields(array('Subject', 'Body'))
);
}