Having the "add argument" link in the standard links line

ekrispin - October 12, 2007 - 00:08
Project:Pro and Con arguments
Version:5.x-1.x-dev
Component:Code
Category:support request
Priority:normal
Assigned:Unassigned
Status:closed
Description

For those who wish to have the "Add argument" link placed in the standard links lines rather than in a separate line above the arguments (as it is implemented in the module), do the following:

(1) In function theme_procon_arguments() comment the line:
$output = theme('procon_add_argument');

(2) Add the following to the beginning of function procon_link():

global $user;
  if ($node->procon_is_enabled) {
                  if (user_access('create procon_argument content')) {
                      $links['add-argument'] = array(
                           'title' => t('Add new argument'),
                           'href' => "node/$node->nid/add/procon-argument",
                           'attributes' => array('title' => t('Add a new pro or con argument.')),
      );
                  }
                  elseif($user->uid == 0) {
                      $links['add-argument'] = array(
                           'title' => t('<a href="@login">Login</a> or <a href="@register">register</a> to post arguments', array('@login' => url('user/login', drupal_get_destination()), '@register' => url('user/register', drupal_get_destination()))),
                           'html' => TRUE,
      );
                 }
  }

#1

fajerstarter - October 12, 2007 - 07:49
Category:feature request» support request
Status:active» fixed

And for bonus points this is done in your custom theme + custom module, to have an easy upgrade.

#2

Anonymous - October 26, 2007 - 07:51
Status:fixed» closed
 
 

Drupal is a registered trademark of Dries Buytaert.