Changeset View
Changeset View
Standalone View
Standalone View
src/applications/phame/editor/PhameBlogEditor.php
Show First 20 Lines • Show All 154 Lines • ▼ Show 20 Lines | switch ($type) { | ||||
$type, | $type, | ||||
pht('Required'), | pht('Required'), | ||||
pht('Name is required.'), | pht('Name is required.'), | ||||
nonempty(last($xactions), null)); | nonempty(last($xactions), null)); | ||||
$error->setIsMissingFieldError(true); | $error->setIsMissingFieldError(true); | ||||
$errors[] = $error; | $errors[] = $error; | ||||
} | } | ||||
foreach ($xactions as $xaction) { | |||||
$new = $xaction->getNewValue(); | |||||
if (phutil_utf8_strlen($new) > 64) { | |||||
$errors[] = new PhabricatorApplicationTransactionValidationError( | |||||
$type, | |||||
pht('Invalid'), | |||||
pht( | |||||
'The selected blog title is too long. The maximum length '. | |||||
'of a blog title is 64 characters.'), | |||||
$xaction); | |||||
} | |||||
} | |||||
break; | |||||
case PhameBlogTransaction::TYPE_SUBTITLE: | |||||
foreach ($xactions as $xaction) { | |||||
$new = $xaction->getNewValue(); | |||||
if (phutil_utf8_strlen($new) > 64) { | |||||
$errors[] = new PhabricatorApplicationTransactionValidationError( | |||||
$type, | |||||
pht('Invalid'), | |||||
pht( | |||||
'The selected blog subtitle is too long. The maximum length '. | |||||
'of a blog subtitle is 64 characters.'), | |||||
$xaction); | |||||
} | |||||
} | |||||
break; | break; | ||||
case PhameBlogTransaction::TYPE_PARENTDOMAIN: | case PhameBlogTransaction::TYPE_PARENTDOMAIN: | ||||
if (!$xactions) { | if (!$xactions) { | ||||
continue; | continue; | ||||
} | } | ||||
$parent_domain = last($xactions)->getNewValue(); | $parent_domain = last($xactions)->getNewValue(); | ||||
if (empty($parent_domain)) { | if (empty($parent_domain)) { | ||||
continue; | continue; | ||||
▲ Show 20 Lines • Show All 143 Lines • Show Last 20 Lines |