You are here

function theme_wikitools_create_notice in Wikitools 5

Same name and namespace in other branches
  1. 6 wikitools.pages.inc \theme_wikitools_create_notice()
  2. 7 wikitools.pages.inc \theme_wikitools_create_notice()
3 theme calls to theme_wikitools_create_notice()
theme_wikitools_page_does_not_exist in ./wikitools.module
theme_wikitools_page_found in ./wikitools.module
theme_wikitools_page_moved in ./wikitools.module

File

./wikitools.module, line 799
A non-intrusive module to have some wiki-like behaviour.

Code

function theme_wikitools_create_notice($page_name) {
  $output = '';
  $node_types = wikitools_node_types();
  if (wikitools_node_creation() && count($node_types)) {
    $create = '';
    foreach ($node_types as $type) {
      $type = node_get_types('type', $type);
      if (node_access('create', $type->type)) {
        $create .= '<dt><a href="' . wikitools_create_url($type->type, $page_name) . '">' . $type->name . '</a></dt>';
        $create .= '<dd>' . filter_xss_admin($type->description) . '</dd>';
      }
    }
    if ($create) {
      $output .= '<p>' . t('You can create the page as:') . '</p>';
      $output .= '<dl>' . $create . '</dl>';
    }
  }
  return $output;
}