Skip to content
Snippets Groups Projects
Select Git revision
  • 631354733a772e99768cef66bfc2e6a191f1a87d
  • 11.x default protected
  • 10.5.x protected
  • 10.6.x protected
  • 11.2.x protected
  • 11.1.x protected
  • 10.4.x protected
  • 11.0.x protected
  • 10.3.x protected
  • 7.x protected
  • 10.2.x protected
  • 10.1.x protected
  • 9.5.x protected
  • 10.0.x protected
  • 9.4.x protected
  • 9.3.x protected
  • 9.2.x protected
  • 9.1.x protected
  • 8.9.x protected
  • 9.0.x protected
  • 8.8.x protected
  • 10.5.1 protected
  • 11.2.2 protected
  • 11.2.1 protected
  • 11.2.0 protected
  • 10.5.0 protected
  • 11.2.0-rc2 protected
  • 10.5.0-rc1 protected
  • 11.2.0-rc1 protected
  • 10.4.8 protected
  • 11.1.8 protected
  • 10.5.0-beta1 protected
  • 11.2.0-beta1 protected
  • 11.2.0-alpha1 protected
  • 10.4.7 protected
  • 11.1.7 protected
  • 10.4.6 protected
  • 11.1.6 protected
  • 10.3.14 protected
  • 10.4.5 protected
  • 11.0.13 protected
41 results

language.inc

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    node.module 17.91 KiB
    <?php
    
    class Node {
      function Node($node) {
        global $user;
        $this->uid = $node[uid] ? $node[uid] : $user->uid;
        $this->nid = $node[nid];
        $this->type = $node[type];
        $this->comment = $node[comment] ? $node[comment] :
        $this->name = $node[name] ? $node[name] : $user->name;
        $this->title = $node[title];
        $this->attributes = $node[attributes];
        $this->timestamp = $node[timestamp] ? $node[timestamp] : time();
      }
    }
    
    function node_help() {
      global $mod;
     ?>
      <P>Todo.</P>
     <?php
    
      if ($mod == "node") {
        foreach (module_list() as $name) {
          if (module_hook($name, "status") && $name != "node") {
            print "<h3>". ucfirst($name) ." type</h3>";
            print module_invoke($name, "help");
          }
        }
      }
    }
    
    function node_perm() {
      return array("administer nodes", "access content", "post content");
    }
    
    function node_conf_options() {
      $output .= form_select("Default number of nodes to display", "default_nodes_main", variable_get("default_nodes_main", 10), array(1 => 1, 2 => 2, 3 => 3, 4 => 4, 5 =>  5, 6 => 6, 7 => 7, 8 => 8, 9 => 9, 10 => 10, 15 => 15, 20 => 20, 25 => 25, 30 => 30), "The default maximum number of nodes to display on the main page.");
      return $output;
    }
    
    function node_conf_filters() {
      $output .= form_select("Enable HTML tags", "filter_html", variable_get("filter_html", 0), array("Disabled", "Enabled"), "Allow HTML and PHP tags in user-contributed content.");
      $output .= form_textfield("Allowed HTML tags", "allowed_html", variable_get("allowed_html", "<A><B><BLOCKQUOTE><DD><DL><DT><I><LI><OL><U><UL>"), 64, 128, "If enabled, optionally specify tags which should not be stripped.  'STYLE' attributes, 'ON' attributes and unclosed tags are always stripped.");
      $output .= "<hr />";
      $output .= form_select("Enable link tags", "filter_link", variable_get("filter_link", 0), array("Disabled", "Enabled"), "Substitute special [[link]] tags.");
      $output .= "<hr />";
      return $output;
    }
    
    function node_filter_html($text) {
      $text = eregi_replace("([ \f\r\t\n\'\"])style=[^>]+", "\\1", $text);
      $text = eregi_replace("([ \f\r\t\n\'\"])on[a-z]+=[^>]+", "\\1", $text);
      $text = strip_tags($text, variable_get("allowed_html", ""));
      return $text;
    }
    
    function node_filter_link($text) {
      $src = array("/\[\[(([^\|]*?)(\|([^\|]*?))?)\]\]/e");  // [link|description]
      $dst = array(format_tag('\\2', '\\4'));                // [link|description]
      return preg_replace($src, $dst, $text);
    }
    
    function node_filter($text) {
      if (variable_get("filter_html", 0)) $text = node_filter_html($text);
      if (variable_get("filter_link", 0)) $text = node_filter_link($text);
      return $text;
    }
    
    function node_cron() {