See the Mailing lists or Drupal Issue queue. There are also various working groups on groups.drupal.org

Custome link menu feature request

I want to have both custome links and the onece generated by Drupal automaticaly to be displayed displayed in page links.
Right now i will just do a hack to merge custom links array system links in link_page() function.

The right way to do this is add configuration options to page module to add custome links there. There should be ways to position links.

I dont mind working on this if people think its a good idea.
Any ideas ?

Advice on Multiple Roles per User

I will defer readers to http://drupal.org/node/view/5564 for a reason why. There are other good explanations here and there on the forums as well - basically, single users in a user role doesn't scale in a site that might have many types of people visiting.

However I need some clues on how to implement this. Currently, there seem to be two places where user role information is kept.

theme.inc, duplicate code?

I am in the process of designing a new theme so I was looking through the theme.inc file and came across something that I do not really understand. Would appreciate if someone could explain.

In theme.inc these lines can be found

  // includes/theme.inc
  $output .= drupal_get_html_head();
  $output .= " <style type=\"text/css\" media=\"all\">";
  $output .= " @import url(misc/drupal.css);";
  $output .= " </style>";

but to me it seems like the last three lines duplicates what is in the grupal_get_html_head() function (below) but I do not really know what the importance of media=all is. What is it that I am missing?

// includes/common.inc
function drupal_get_html_head() {
  global $base_url;

  $output = "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />";
  $output .= "<base href=\"$base_url/\" />\n";
  $output .= "<style type=\"text/css\">\n";
  $output .= "@import url(misc/drupal.css);\n";
  $output .= "</style>\n";

  return $output . drupal_set_html_head();
}

Patch to node/add in node.module (anonymous users information)

When an annonymous user tries to access the page http://drupal.org/node/add, obtanins the unfinished message:

    Create content
    Choose the appropriate item from the list:

If you wish to put a direct access in a menu to add content, you will find this problem with annonymous users.

Next simple patch, that applies to 4.3.2, will automatically detect if user has not privileges to post content and advise to login or register.

@@ -1235,8 +1235,10 @@
     ** Compile a list with the different node types and their explanation:
     */
 
+    $count=0;
     foreach (module_list() as $name) {
       if (module_hook($name, "node") && node_access("create", $name)) {
+       $count = $count+1;
         $output .= "
  • "; $output .= " ". l(module_invoke($name, "node", "name"), "node/add/$name", array("title" => t("Add a new %s.", array("%s" => module_invoke($name, "node", "name"))))); $output .= "
    ". module_invoke($name, "node", "description") ."
    "; @@ -1244,7 +1246,12 @@ } } - $output = t("Choose the appropriate item from the list:") ."
      $output
    "; + if($count>0) { + $output = t("Choose the appropriate item from the list:") ."
      $output
    "; + } + else { + $output = t("You have not privileges to post content. Please, %login or %register.", array("%login" => l(t("login"), "user/login"), "%register" => l(t("register"), "user/register")));
  • Patch enabling automatic population of subject on comment replies.

    This simple patch (applies to 4.3.2) will automatically populate the comment form's subject field with "Re: whatever" when you post a reply to a comment that has a subject of "whatever".

    --- comment.module.old  Fri Jan 23 12:36:13 2004
    +++ comment.module.new  Fri Jan 23 12:36:26 2004
    @@ -245,7 +245,7 @@
           theme("box", t("Reply"), t("This discussion is closed: you can't post new comments."));
         }
         else if (user_access("post comments")) {
    -      theme("box", t("Reply"), comment_form(array("pid" => $pid, "nid" => $nid)));
    +      theme("box", t("Reply"), comment_form(array("pid" => $pid, "nid" => $nid, "subject" => "Re: " . $comment->subject)));
         }
         else {
           theme("box", t("Reply"), t("You are not authorized to post comments."));
    

    Change to "user" module...

    When you go to "administer/configuration/modules/user" and change the "Public registrations:" under "User settings" to "Only site administrators can create new user accounts." it removes the "Create new account" link under the form fields in the "User Login" block.

    Would it make sense to also remove the "Request new password" link?

    If so, it would just be as simple as moving the "}" in the code after the line that displays the "Request new password" link.

    In "modules/user.module":

    if (variable_get("user_register", 1)) {
      $items[] = l(t("Create new account"), "user/register", array("title" => t("Create a new user account.")));
    }
    $items[] = l(t("Request new password"), "user/password", array("title" => t("Request new password via e-mail.")));
    

    would become:

    if (variable_get("user_register", 1)) {
      $items[] = l(t("Create new account"), "user/register", array("title" => t("Create a new user account.")));
    
      $items[] = l(t("Request new password"), "user/password", array("title" => t("Request new password via e-mail.")));
    }
    

    I hope this isn't a duplicate post as I couldn't find mention of it anywhere else in the forums.

    Cheers

    Pages

    Subscribe with RSS Subscribe to RSS - Deprecated - Drupal core