*
 * @author jan.kristinus@yakamara.de
 *
 * @package redaxo\yrewrite
 *
 * @var rex_addon $this
 */
// TODO: content/yrewrite_url: { title: 'translate:mode_url', perm: 'yrewrite[url]' }
ob_start();
$addon = rex_addon::get('yrewrite');
$article_id = $params['article_id'];
$clang = $params['clang'];
$ctype = $params['ctype'];
// $yrewrite_url = stripslashes(rex_request('yrewrite_url'));
$domain = rex_yrewrite::getDomainByArticleId($article_id, $clang);
$isStartarticle = rex_yrewrite::isDomainStartArticle($article_id, $clang);
$autoUrl = rex_getUrl();
if (0 === strpos($autoUrl, $domain->getUrl())) {
    $autoUrl = substr($autoUrl, strlen($domain->getUrl()));
} else {
    $autoUrl = substr($autoUrl, strlen($domain->getPath()));
}
if ($isStartarticle) {
    echo rex_view::warning($addon->i18n('startarticleisalways', $domain->getName()));
} else {
    $yform = new rex_yform();
    $yform->setObjectparams('form_action', rex_url::backendController(['page' => 'content/edit', 'article_id' => $article_id, 'clang' => $clang, 'ctype' => $ctype], false));
    $yform->setObjectparams('form_id', 'yrewrite-url');
    $yform->setObjectparams('form_name', 'yrewrite-url');
    $yform->setHiddenField('yrewrite_func', 'url');
    $yform->setObjectparams('form_showformafterupdate', 1);