etwas erweitert:
- Code: Alles auswählen
<?php
class rex_xform_article extends rex_xform_abstract
{
function enterObject(&$email_elements,&$sql_elements,&$warning,&$form_output,$send = 0)
{
$artikel = new rex_article;
$artikel->setArticleId($this->elements[1]);
$form_output[] = '<div class="article">' . $artikel->getArticle() . '</div>';
if (isset($this->elements[2]) && $this->elements[2]=="REQUEST" && isset($_REQUEST[$this->elements[1]]))
{
$this->value = $_REQUEST[$this->elements[1]];
$artikel = new rex_article;
$artikel->setArticleId($this->value);
$form_output[] = '<div class="article">' . $artikel->getArticle() . '</div>';
}
}
function getDescription()
{
return "
article -> Beispiel: article|article_id
<br /> article -> Beispiel: article|job_id|REQUEST
";
}
}
?>
somit kann man jetzt auch eine article(id) in die xForm per
URL-Übergabe einsetzten (oder so
article|article_id (article_id fester Wert)
article|job_id|REQUEST (article|url_var|REQUEST)
Jetzt ist noch das Problem mit der Email.
Wie bekomm ich nun bestimmte $slice->getValue() des Artikels
in die email? ...
- Code: Alles auswählen
if (isset($this->elements[2]) && $this->elements[2]=="REQUEST" && isset($_REQUEST[$this->elements[1]]))
{
$this->value = $_REQUEST[$this->elements[1]];
$artikel = new rex_article;
$artikel->setArticleId($this->value);
$form_output[] = '<div class="article">' . $artikel->getArticle() . '</div>';
}else
{
$this->value = $_REQUEST[$this->elements[1]];
$slice = OOArticleSlice::getFirstSliceForArticle($this->value);
$email_elements[$this->elements[1]] = $slice->getValue(1);
}
funktioniert leider nicht ...
Danke schonmal. gruß Chris

