getPreviewArticleData() public method

If no article was found create an empty one.
public getPreviewArticleData ( ) : object
return object
Example #1
0
        // and also the number of translations associated with an article number
        global $g_ado_db;
        $sql = "SELECT * FROM X$f_src WHERE NrArticle=$f_cur_preview";
        $rows = $g_ado_db->GetAll($sql);
        if (!count($rows)) {
            $errMsgs[] = getGS('There is no article associated with the preview.');
            $ok = false;
        }
    }

    if ($ok) {
        $numberOfTranslations = count($rows);
        $firstLanguage = $rows[0]['IdLanguage'];
        $curPreview = new Article($firstLanguage, $f_cur_preview);
        $articleCreator = new User($curPreview->getCreatorId());
        $articleData = $dest->getPreviewArticleData();
        $dbColumns = $articleData->getUserDefinedColumns(1, true);
        $srcArticleData = $curPreview->getArticleData();
        $srcDbColumns = $srcArticleData->getUserDefinedColumns(1, true);
        $getString = '';
        foreach ($_GET as $k => $v) {
            if ( ($k != 'f_action') && ($k != 'f_preview_action') ) {
                $getString .= "&$k=$v";
            }
        }
        foreach ($_POST as $k => $v) {
            if ( ($k != 'f_action') && ($k != 'f_prev_action') ) {
                $getString .= "&$k=$v";
            }
        }
        $getString = substr($getString, 1);