me_node_creation.placeholder.inc 974 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. /**
  3. * Page callback for mlid/%menu_link/under-construction
  4. *
  5. * @param array $item
  6. * The menu link, as returned by menu_link_load()
  7. * @return string
  8. * Rendered HTML
  9. * TODO: We could instead return a renderable array.
  10. */
  11. function menu_editor_placeholder_page($item) {
  12. drupal_set_title(t('!link_title - Under Construction', array(
  13. '!link_title' => $item['link_title'],
  14. )));
  15. $html = '';
  16. foreach (node_type_get_types() as $type_name => $type_info) {
  17. if (me_node_creation_create_node_access($type_info)) {
  18. $link_html = l($type_info->name, "node/add/$type_name/mlid/$item[mlid]");
  19. $html .= "<li>$link_html</li>";
  20. }
  21. }
  22. // TODO: Provide themeable output, or find another solution.
  23. $txt = t('We are working on it.');
  24. if ($html) {
  25. $txt_admin = t("Replace this placeholder link with real content:");
  26. return <<<EOT
  27. <p>$txt</p>
  28. <p>$txt_admin</p>
  29. <ul>$html</ul>
  30. EOT;
  31. } else {
  32. return <<<EOT
  33. <p>$txt</p>
  34. EOT;
  35. }
  36. }