function rex_warning($message, $cssClass = null, $sorround_tag = null)
{
    if (!$cssClass) {
        $cssClass = 'rex-warning';
    }
    if (!$sorround_tag) {
        $sorround_tag = 'p';
    }
    return rex_message($message, $cssClass, $sorround_tag);
}
Пример #2
0
/**
 * @author Jens Fuchs <fuchs at d-mind.de>
 * @project Redaxo-News-Addon
 * @date 12.11.2012
 * @param int
 * @return 
 */
function news_copyArticle($addEntry)
{
    $qry = 'SELECT * FROM ' . TBL_NEWS . ' WHERE id=' . $addEntry;
    $sql = new rex_sql();
    $sql->debugsql = true;
    $data = $sql->getArray($qry);
    $fields = array('name', 'online_date', 'archive_date', 'offline_date', 'teaser', 'article', 'author', 'image', 'image_descr', 'thumb', 'image_header', 'filelist', 'category', 'flag');
    #print_r($fields);
    $keys = $values = "";
    $j = 1;
    foreach ($fields as $value) {
        $keys .= $value;
        $values .= "'" . $data[0][$value] . "'";
        if ($j < sizeof($fields)) {
            $keys .= ", ";
            $values .= ", ";
        }
        $j++;
    }
    $qry = 'INSERT INTO ' . TBL_NEWS . ' (' . $keys . ') VALUES (' . $values . ')';
    $k = new rex_sql();
    $k->setQuery($qry);
    if ($k->getRows() == 1) {
        $last_insert_id = $k->last_insert_id;
        header('Location: index.php?page=news&func=edit&id=' . $last_insert_id . '&clang=0');
    } else {
        print rex_message('Der Datensatz konnte nicht übernommen werden', 'rex-warning', 'div');
    }
}