X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fchi-teck%2Fdrupal-code-generator%2Ftemplates%2Fd7%2Fhook%2Fuser_view.twig;fp=vendor%2Fchi-teck%2Fdrupal-code-generator%2Ftemplates%2Fd7%2Fhook%2Fuser_view.twig;h=7c427d765a623783677041c9179a105c63c094a6;hp=0000000000000000000000000000000000000000;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0 diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/user_view.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/user_view.twig new file mode 100644 index 000000000..7c427d765 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/user_view.twig @@ -0,0 +1,13 @@ +/** + * Implements hook_user_view(). + */ +function {{ machine_name }}_user_view($account, $view_mode, $langcode) { + if (user_access('create blog content', $account)) { + $account->content['summary']['blog'] = array( + '#type' => 'user_profile_item', + '#title' => t('Blog'), + '#markup' => l(t('View recent blog entries'), "blog/$account->uid", array('attributes' => array('title' => t("Read !username's latest blog entries.", array('!username' => format_username($account)))))), + '#attributes' => array('class' => array('blog')), + ); + } +}