Commit cd94c105 authored by webchick's avatar webchick

Issue #2002246 by tompagabor, floretan, lauriii, pakmanlh, rbomhof | pixelite:...

Issue #2002246 by tompagabor, floretan, lauriii, pakmanlh, rbomhof | pixelite: Capitalize operations links in the comment and taxonomy term admin UI.
parent 2084cd35
......@@ -97,7 +97,7 @@ public function save(array $form, array &$form_state) {
}
}
else {
watchdog('aggregator', 'Feed %feed added.', array('%feed' => $feed->label()), WATCHDOG_NOTICE, l($this->t('view'), 'admin/config/services/aggregator'));
watchdog('aggregator', 'Feed %feed added.', array('%feed' => $feed->label()), WATCHDOG_NOTICE, l($this->t('View'), 'admin/config/services/aggregator'));
drupal_set_message($this->t('The feed %feed has been added.', array('%feed' => $feed->label())));
}
}
......
......@@ -63,7 +63,7 @@ public function buildForm(array $form, array &$form_state, $default_ip = '') {
$row[] = $ip->ip;
$links = array();
$links['delete'] = array(
'title' => $this->t('delete'),
'title' => $this->t('Delete'),
'route_name' => 'ban.delete',
'route_parameters' => array('ban_id' => $ip->iid),
);
......
......@@ -119,7 +119,7 @@ public function submitForm(array &$form, array &$form_state) {
$node->book['link_title'] = $values['title'];
$node->setNewRevision();
$node->save();
watchdog('content', 'book: updated %title.', array('%title' => $node->label()), WATCHDOG_NOTICE, l($this->t('view'), 'node/' . $node->id()));
watchdog('content', 'book: updated %title.', array('%title' => $node->label()), WATCHDOG_NOTICE, l($this->t('View'), 'node/' . $node->id()));
}
}
}
......
......@@ -391,7 +391,7 @@ public function save(array $form, array &$form_state) {
$form_state['values']['cid'] = $comment->id();
// Add an entry to the watchdog log.
watchdog('content', 'Comment posted: %subject.', array('%subject' => $comment->getSubject()), WATCHDOG_NOTICE, l(t('view'), 'comment/' . $comment->id(), array('fragment' => 'comment-' . $comment->id())));
watchdog('content', 'Comment posted: %subject.', array('%subject' => $comment->getSubject()), WATCHDOG_NOTICE, l(t('View'), 'comment/' . $comment->id(), array('fragment' => 'comment-' . $comment->id())));
// Explain the approval queue if necessary.
if (!$comment->isPublished()) {
......
......@@ -215,7 +215,7 @@ public function buildForm(array $form, array &$form_state, $type = 'new') {
$comment_uri_options = $comment->urlInfo()->getOptions();
$links = array();
$links['edit'] = array(
'title' => $this->t('edit'),
'title' => $this->t('Edit'),
'route_name' => 'comment.edit_page',
'route_parameters' => array('comment' => $comment->id()),
'options' => $comment_uri_options,
......@@ -223,7 +223,7 @@ public function buildForm(array $form, array &$form_state, $type = 'new') {
);
if ($this->moduleHandler->invoke('content_translation', 'translate_access', array($comment))) {
$links['translate'] = array(
'title' => $this->t('translate'),
'title' => $this->t('Translate'),
'route_name' => 'content_translation.translation_overview_comment',
'route_parameters' => array('comment' => $comment->id()),
'options' => $comment_uri_options,
......
......@@ -101,7 +101,7 @@ public function render(ResultRow $values) {
* Returns a string for the link text.
*/
protected function renderLink($data, ResultRow $values) {
$text = !empty($this->options['text']) ? $this->options['text'] : t('view');
$text = !empty($this->options['text']) ? $this->options['text'] : t('View');
/** @var \Drupal\comment\CommentInterface $comment */
$comment = $data;
$cid = $comment->id();
......
......@@ -61,7 +61,7 @@ public function render(ResultRow $values) {
*/
protected function renderLink(EntityInterface $entity, ResultRow $values) {
if (content_translation_translate_access($entity)) {
$text = !empty($this->options['text']) ? $this->options['text'] : t('translate');
$text = !empty($this->options['text']) ? $this->options['text'] : t('Translate');
$this->options['alter']['make_link'] = TRUE;
$this->options['alter']['path'] = $entity->getSystemPath('drupal:content-translation-overview');
......
......@@ -82,13 +82,13 @@ public function save(array $form, array &$form_state) {
switch ($status) {
case SAVED_NEW:
drupal_set_message($this->t('Created new @type %term.', array('%term' => $term->getName(), '@type' => $this->forumFormType)));
watchdog('forum', 'Created new @type %term.', array('%term' => $term->getName(), '@type' => $this->forumFormType), WATCHDOG_NOTICE, l($this->t('edit'), 'admin/structure/forum/edit/' . $this->urlStub . '/' . $term->id()));
watchdog('forum', 'Created new @type %term.', array('%term' => $term->getName(), '@type' => $this->forumFormType), WATCHDOG_NOTICE, l($this->t('Edit'), 'admin/structure/forum/edit/' . $this->urlStub . '/' . $term->id()));
$form_state['values']['tid'] = $term->id();
break;
case SAVED_UPDATED:
drupal_set_message($this->t('The @type %term has been updated.', array('%term' => $term->getName(), '@type' => $this->forumFormType)));
watchdog('taxonomy', 'Updated @type %term.', array('%term' => $term->getName(), '@type' => $this->forumFormType), WATCHDOG_NOTICE, l($this->t('edit'), 'admin/structure/forum/edit/' . $this->urlStub . '/' . $term->id()));
watchdog('taxonomy', 'Updated @type %term.', array('%term' => $term->getName(), '@type' => $this->forumFormType), WATCHDOG_NOTICE, l($this->t('Edit'), 'admin/structure/forum/edit/' . $this->urlStub . '/' . $term->id()));
// Clear the page and block caches to avoid stale data.
Cache::invalidateTags(array('content' => TRUE));
break;
......
......@@ -91,12 +91,12 @@ public function form(array $form, array &$form_state) {
$is_configurable = $effect instanceof ConfigurableImageEffectInterface;
if ($is_configurable) {
$links['edit'] = array(
'title' => $this->t('edit'),
'title' => $this->t('Edit'),
'href' => 'admin/config/media/image-styles/manage/' . $this->entity->id() . '/effects/' . $key,
);
}
$links['delete'] = array(
'title' => $this->t('delete'),
'title' => $this->t('Delete'),
'href' => 'admin/config/media/image-styles/manage/' . $this->entity->id() . '/effects/' . $key . '/delete',
);
$form['effects'][$key]['operations'] = array(
......@@ -105,13 +105,13 @@ public function form(array $form, array &$form_state) {
);
$form['effects'][$key]['configure'] = array(
'#type' => 'link',
'#title' => $this->t('edit'),
'#title' => $this->t('Edit'),
'#href' => 'admin/config/media/image-styles/manage/' . $this->entity->id() . '/effects/' . $key,
'#access' => $is_configurable,
);
$form['effects'][$key]['remove'] = array(
'#type' => 'link',
'#title' => $this->t('delete'),
'#title' => $this->t('Delete'),
'#href' => 'admin/config/media/image-styles/manage/' . $this->entity->id() . '/effects/' . $key . '/delete',
);
}
......
......@@ -331,7 +331,7 @@ function testEditEffect() {
$this->assertText(t('Scale and crop 300x200'));
// There should normally be only one edit link on this page initially.
$this->clickLink(t('edit'));
$this->clickLink(t('Edit'));
$this->drupalPostForm(NULL, array('data[width]' => '360', 'data[height]' => '240'), t('Update effect'));
$this->assertText(t('Scale and crop 360x240'));
......@@ -345,7 +345,7 @@ function testEditEffect() {
$this->drupalPostForm(NULL, array('data[width]' => '12', 'data[height]' => '19'), t('Add effect'));
// Edit the scale effect that was just added.
$this->clickLink(t('edit'));
$this->clickLink(t('Edit'));
$this->drupalPostForm(NULL, array('data[width]' => '24', 'data[height]' => '19'), t('Update effect'));
$this->drupalPostForm(NULL, array('new' => 'image_scale'), t('Add'));
......
......@@ -442,7 +442,7 @@ public function save(array $form, array &$form_state) {
$node = $this->entity;
$insert = $node->isNew();
$node->save();
$node_link = l(t('view'), 'node/' . $node->id());
$node_link = l(t('View'), 'node/' . $node->id());
$watchdog_args = array('@type' => $node->getType(), '%title' => $node->label());
$t_args = array('@type' => node_get_type_label($node), '%title' => $node->label());
......
......@@ -200,7 +200,7 @@ public function save(array $form, array &$form_state) {
}
elseif ($status == SAVED_NEW) {
drupal_set_message(t('The content type %name has been added.', $t_args));
watchdog('node', 'Added content type %name.', $t_args, WATCHDOG_NOTICE, l(t('view'), 'admin/structure/types'));
watchdog('node', 'Added content type %name.', $t_args, WATCHDOG_NOTICE, l(t('View'), 'admin/structure/types'));
}
$form_state['redirect_route']['route_name'] = 'node.overview_types';
......
......@@ -76,7 +76,7 @@ protected function renderLink($node, ResultRow $values) {
if ($node->access('view')) {
$this->options['alter']['make_link'] = TRUE;
$this->options['alter']['path'] = 'node/' . $node->id();
$text = !empty($this->options['text']) ? $this->options['text'] : t('view');
$text = !empty($this->options['text']) ? $this->options['text'] : t('View');
return $text;
}
}
......
......@@ -40,7 +40,7 @@ protected function renderLink($node, ResultRow $values) {
$this->options['alter']['path'] = $node->getSystemPath('delete-form');
$this->options['alter']['query'] = drupal_get_destination();
$text = !empty($this->options['text']) ? $this->options['text'] : t('delete');
$text = !empty($this->options['text']) ? $this->options['text'] : t('Delete');
return $text;
}
......
......@@ -40,7 +40,7 @@ protected function renderLink($node, ResultRow $values) {
$this->options['alter']['path'] = "node/" . $node->id() . "/edit";
$this->options['alter']['query'] = drupal_get_destination();
$text = !empty($this->options['text']) ? $this->options['text'] : t('edit');
$text = !empty($this->options['text']) ? $this->options['text'] : t('Edit');
return $text;
}
......
......@@ -63,12 +63,12 @@ function path_admin_overview($keys = NULL) {
$operations = array();
$operations['edit'] = array(
'title' => t('edit'),
'title' => t('Edit'),
'href' => "admin/config/search/path/edit/$data->pid",
'query' => $destination,
);
$operations['delete'] = array(
'title' => t('delete'),
'title' => t('Delete'),
'href' => "admin/config/search/path/delete/$data->pid",
'query' => $destination,
);
......
......@@ -253,17 +253,17 @@ public function buildForm(array $form, array &$form_state, VocabularyInterface $
);
$operations = array(
'edit' => array(
'title' => $this->t('edit'),
'title' => $this->t('Edit'),
'query' => $destination,
) + $term->urlInfo('edit-form')->toArray(),
'delete' => array(
'title' => $this->t('delete'),
'title' => $this->t('Delete'),
'query' => $destination,
) + $term->urlInfo('delete-form')->toArray(),
);
if ($this->moduleHandler->moduleExists('content_translation') && content_translation_translate_access($term)) {
$operations['translate'] = array(
'title' => $this->t('translate'),
'title' => $this->t('Translate'),
'query' => $destination,
) + $term->urlInfo('drupal:content-translation-overview')->toArray();
}
......
......@@ -66,7 +66,7 @@ public function render(ResultRow $values) {
'vid' => $values->{$this->aliases['vid']},
));
if ($term->access('update')) {
$text = !empty($this->options['text']) ? $this->options['text'] : t('edit');
$text = !empty($this->options['text']) ? $this->options['text'] : t('Edit');
return l($text, 'taxonomy/term/'. $tid . '/edit', array('query' => drupal_get_destination()));
}
}
......
......@@ -174,11 +174,11 @@ public function save(array $form, array &$form_state) {
switch ($term->save()) {
case SAVED_NEW:
drupal_set_message($this->t('Created new term %term.', array('%term' => $term->getName())));
watchdog('taxonomy', 'Created new term %term.', array('%term' => $term->getName()), WATCHDOG_NOTICE, l($this->t('edit'), 'taxonomy/term/' . $term->id() . '/edit'));
watchdog('taxonomy', 'Created new term %term.', array('%term' => $term->getName()), WATCHDOG_NOTICE, l($this->t('Edit'), 'taxonomy/term/' . $term->id() . '/edit'));
break;
case SAVED_UPDATED:
drupal_set_message($this->t('Updated term %term.', array('%term' => $term->getName())));
watchdog('taxonomy', 'Updated term %term.', array('%term' => $term->getName()), WATCHDOG_NOTICE, l($this->t('edit'), 'taxonomy/term/' . $term->id() . '/edit'));
watchdog('taxonomy', 'Updated term %term.', array('%term' => $term->getName()), WATCHDOG_NOTICE, l($this->t('Edit'), 'taxonomy/term/' . $term->id() . '/edit'));
// Clear the page and block caches to avoid stale data.
Cache::invalidateTags(array('content' => TRUE));
break;
......
......@@ -316,7 +316,7 @@ function testTermInterface() {
// Test edit link as accessed from Taxonomy administration pages.
// Because Simpletest creates its own database when running tests, we know
// the first edit link found on the listing page is to our term.
$this->clickLink(t('edit'));
$this->clickLink(t('Edit'), 1);
$this->assertRaw($edit['name[0][value]'], 'The randomly generated term name is present.');
$this->assertText($edit['description[0][value]'], 'The randomly generated term description is present.');
......@@ -332,7 +332,7 @@ function testTermInterface() {
// Check that the term is still present at admin UI after edit.
$this->drupalGet('admin/structure/taxonomy/manage/' . $this->vocabulary->id() . '/overview');
$this->assertText($edit['name[0][value]'], 'The randomly generated term name is present.');
$this->assertLink(t('edit'));
$this->assertLink(t('Edit'));
// Check the term link can be clicked through to the term page.
$this->clickLink($edit['name[0][value]']);
......
......@@ -47,7 +47,7 @@ function testVocabularyInterface() {
// Edit the vocabulary.
$this->drupalGet('admin/structure/taxonomy');
$this->assertText($edit['name'], 'Vocabulary found in the vocabulary overview listing.');
$this->clickLink(t('edit vocabulary'));
$this->clickLink(t('Edit vocabulary'));
$edit = array();
$edit['name'] = $this->randomName();
$this->drupalPostForm(NULL, $edit, t('Save'));
......
......@@ -136,7 +136,7 @@ public function save(array $form, array &$form_state) {
$vocabulary->name = trim($vocabulary->name);
$status = $vocabulary->save();
$edit_link = \Drupal::linkGenerator()->generateFromUrl($this->t('edit'), $this->entity->urlInfo());
$edit_link = \Drupal::linkGenerator()->generateFromUrl($this->t('Edit'), $this->entity->urlInfo());
switch ($status) {
case SAVED_NEW:
drupal_set_message($this->t('Created new vocabulary %name.', array('%name' => $vocabulary->name)));
......
......@@ -36,15 +36,15 @@ public function getOperations(EntityInterface $entity) {
$operations = parent::getOperations($entity);
if (isset($operations['edit'])) {
$operations['edit']['title'] = t('edit vocabulary');
$operations['edit']['title'] = t('Edit vocabulary');
}
$operations['list'] = array(
'title' => t('list terms'),
'title' => t('List terms'),
'weight' => 0,
) + $entity->urlInfo('overview-form')->toArray();
$operations['add'] = array(
'title' => t('add terms'),
'title' => t('Add terms'),
'weight' => 10,
) + $entity->urlInfo('add-form')->toArray();
unset($operations['delete']);
......
......@@ -106,7 +106,7 @@ public function save(array $form, array &$form_state) {
$form_state['user'] = $account;
$form_state['values']['uid'] = $account->id();
watchdog('user', 'New user: %name %email.', array('%name' => $form_state['values']['name'], '%email' => '<' . $form_state['values']['mail'] . '>'), WATCHDOG_NOTICE, l($this->t('edit'), 'user/' . $account->id() . '/edit'));
watchdog('user', 'New user: %name %email.', array('%name' => $form_state['values']['name'], '%email' => '<' . $form_state['values']['mail'] . '>'), WATCHDOG_NOTICE, l($this->t('Edit'), 'user/' . $account->id() . '/edit'));
// Add plain text password into user account to generate mail tokens.
$account->password = $pass;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment