Skip to content
Snippets Groups Projects
Select Git revision
  • aed1b0ca9e89d085b557d2d1e61da2cf07ce6072
  • 11.x default protected
  • 11.2.x protected
  • 10.6.x protected
  • 10.5.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

forum.module

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    forum.module 27.85 KiB
    <?php
    // $Id$
    
    /**
     * Implementation of hook_help().
     */
    function forum_help($section) {
      switch ($section) {
        case 'admin/help#forum':
          return t("
          <h3>Creating a forum</h3>
          <p>The forum module uses taxonomy to organize itself. To create a forum you first have to create a <a href=\"%taxonomy\">taxonomy vocabulary</a>. When doing this, choose a sensible name for it (such as \"fora\") and make sure under \"Types\" that \"forum\" is selected. Once you have done this, <a href=\"%taxo-terms\">add some terms</a> to it. Each term will become a forum. If you fill in the description field, users will be given additonal information about the forum on the main forum page. For example: \"troubleshooting\" - \"Please ask your questions here.\"</p>
          <p>When you are happy with your vocabulary, go to <a href=\"%forums\">administer &raquo; settings &raquo; forum</a> and set <strong>Forum vocabulary</strong> to the one you have just created. There will now be fora active on the site. For users to access them they must have the \"access content\" <a href=\"%permission\">permission</a> and to create a topic they must have the \"create forum topics\" <a href=\"%permission\">permission</a>. These permissions can be set in the <a href=\"%permission\">permission</a> pages.</p>
          <h4>Icons</h4>
          <p>To disable icons, set the icon path as blank in <a href=\"%forums\">administer &raquo; settings &raquo; forum</a>.</p>
          <p>All files in the icon directory are assumed to be images. You may use images of whatever size you wish, but it is recommended to use 15x15 or 16x16.</p>", array("%taxonomy" => url('admin/taxonomy/add/vocabulary'), '%taxo-terms' => url('admin/taxonomy'), '%forums' => url('admin/settings/forum'), '%permission' => url('admin/user/configure/permission')));
        case 'admin/modules#description':
          return t('Enable threaded discussions about general topics.');
        case 'admin/settings/forum':
          return t("Forums are threaded discussions based on the taxonomy system.  For the forums to work, the taxonomy module has to be installed and enabled.  When activated, a taxonomy vocabulary (eg. \"forums\") needs to be <a href=\"%created\">created</a> and bound to the node type \"forum topic\".", array('%created' => url('admin/taxonomy/add/vocabulary')));
        case 'node/add/forum':
          return variable_get('forum_help', '');
        case 'node/add#forum':
          return t('A forum is a threaded discussion, enabling users to communicate about a particular topic.');
      }
    }
    
    /**
     * Implementation of hook_node_name().
     */
    function forum_node_name($node) {
      return t('forum topic');
    }
    
    /**
     * Implementation of hook_access().
     */
    function forum_access($op, $node) {
      if ($op == 'view') {
        return $node->status;
      }
      if ($op == 'create') {
        return user_access('create forum topics');
      }
    }
    
    /**
     * Implementation of hook_perm().
     */
    function forum_perm() {
      return array('create forum topics');
    }
    
    /**
     * Implementation of hook_settings().
     */
    function forum_settings() {
    
      if (module_exist('taxonomy')) {
        $vocs[0] = '<'. t('none') .'>';
        foreach (taxonomy_get_vocabularies('forum') as $vid => $voc) {
          $vocs[$vid] = $voc->name;
        }
    
        if ($voc) {
          $group  = form_select(t('Forum vocabulary'), 'forum_nav_vocabulary', variable_get('forum_nav_vocabulary', ''), $vocs, t("The taxonomy vocabulary that will be used as the navigation tree.  The vocabulary's terms define the forums."));
          $group .= _taxonomy_term_select(t('Containers'), 'forum_containers', variable_get('forum_containers', array()), variable_get('forum_nav_vocabulary', ''), t('You can choose forums which will not have topics, but will be just containers for other forums.  This lets you both group and nest forums.'), 1, '<'. t('none') .'>');
    
          $output = form_group(t('Forum structure settings'), $group);