[dokuwiki] Re: tpl_actionlink little bug for Namespace changes subscription ?

  • From: Olivier Lumineau <olivier.lumineau@xxxxxx>
  • To: dokuwiki@xxxxxxxxxxxxx, Guy Brand <gb@xxxxxxxxxxxxxxxxx>
  • Date: Thu, 29 May 2008 11:57:47 +0200

Michael Klier a écrit :
Olivier Lumineau wrote:
   in last release the new functinnality "namespace changes subscription"
   is very nice !  :-)
   but isn't there a little bug with tpl_actionlink ? Because in
   templates (arctic, default) when using tpl_button both buttons
   "Subscribe page changes" and "Subscribe namespace changes" appear, but
   using tpl_actionlink only "Subscribe page changes" appears...
   but maybe I didn't see a sp?cial parameter...

Nope, there's no special parameter, that's just the way it's implemented at
the moment, there's already a bug report about it [1] though.

Regards,
    Michi

[1] http://bugs.splitbrain.org/index.php?do=details&task_id=1408

hi,
I tried to find why it didn't work in template.php, in function tpl_actionlink. I looked at tpl_button function, copy the method for "case subscription", and it seems to work... :-)

Below the modifications I did in inc/template.php, in tpl_actionlink function:


     /*   case 'subscribe': */     comment this code

  case 'subscription':
if($conf['useacl'] && $auth && $ACT == 'show' && $conf['subscribers'] == 1){
       if($_SERVER['REMOTE_USER']){
         if($INFO['subscribed']) {
           tpl_link(wl($ID,'do=unsubscribe'),
                    $pre.(($inner)?$inner:$lang['btn_unsubscribe']).$suf,
                    'class="action unsubscribe" rel="nofollow"');
         } else {
           tpl_link(wl($ID,'do=subscribe'),
                    $pre.(($inner)?$inner:$lang['btn_subscribe']).$suf,
                    'class="action subscribe" rel="nofollow"');
         }

/* added code */

         if($INFO['subscribedns']) {
           tpl_link(wl($ID,'do=unsubscribens'),
                    $pre.(($inner)?$inner:$lang['btn_unsubscribens']).$suf,
'class="action unsubscribens" rel="nofollow"') . 'nbsp;';
         } else {
           tpl_link(wl($ID,'do=subscribens'),
                    $pre.(($inner)?$inner:$lang['btn_subscribens']).$suf,
                    'class="action subscribe" rel="nofollow"');
         }

/*  end of added */


         return true;
       }
     }
     return false;


     /*  comment this code

  case 'subscribens':
if($conf['useacl'] && $auth && $ACT == 'show' && $conf['subscribers'] == 1){
       if($_SERVER['REMOTE_USER']){
         if($INFO['subscribedns']) {
           tpl_link(wl($ID,'do=unsubscribens'),
                    $pre.(($inner)?$inner:$lang['btn_unsubscribens']).$suf,
                    'class="action unsubscribens" rel="nofollow"');
         } else {
           tpl_link(wl($ID,'do=subscribens'),
                    $pre.(($inner)?$inner:$lang['btn_subscribens']).$suf,
                    'class="action subscribens" rel="nofollow"');
         }
         return true;
       }
     }
     return false;

  end of comment   */


Regards,

Olivier


-------
Comité Réseau des Universités |-->  www.cru.fr <http://www.cru.fr/>
-------
Tél : 02 23 23 69 05
Fax : 02 23 23 71 11
mail : olivier.lumineau@xxxxxx


Other related posts: