includes/template.php
changeset 906 c949e82b8f49
parent 892 668e6a9adf99
child 915 91f4da84966f
equal deleted inserted replaced
905:1e40b33f2e3e 906:c949e82b8f49
   730     }
   730     }
   731     
   731     
   732     // Protect button
   732     // Protect button
   733     if($perms->get_permissions('read') && $session->check_acl_scope('protect', $local_namespace) && $paths->wiki_mode && $local_page_exists && $perms->get_permissions('protect'))
   733     if($perms->get_permissions('read') && $session->check_acl_scope('protect', $local_namespace) && $paths->wiki_mode && $local_page_exists && $perms->get_permissions('protect'))
   734     {
   734     {
       
   735       switch($local_cdata['protected'])
       
   736       {
       
   737         case PROTECT_FULL: $protect_status = $lang->get('onpage_btn_protect_on'); break;
       
   738         case PROTECT_SEMI: $protect_status = $lang->get('onpage_btn_protect_semi'); break;
       
   739         case PROTECT_NONE: $protect_status = $lang->get('onpage_btn_protect_off'); break;
       
   740       }
   735       
   741       
   736       $label = $this->makeParserText($tplvars['toolbar_label']);
   742       $label = $this->makeParserText($tplvars['toolbar_label']);
   737       $label->assign_vars(array('TEXT' => $lang->get('onpage_lbl_protect')));
   743       $label->assign_vars(array('TEXT' => $lang->get('onpage_lbl_protect') . ' ' . "<b><span id=\"tb_ajax_protect_status\">$protect_status</span></b>"));
   738       $t0 = $label->run();
   744       $t0 = $label->run();
   739       
   745       
   740       $ctmp = ''; 
       
   741       if ( $local_cdata['protected'] == 1 )
       
   742       {
       
   743         $ctmp=' style="text-decoration: underline;"';
       
   744       }
       
   745       $menubtn->assign_vars(array(
   746       $menubtn->assign_vars(array(
   746           'FLAGS' => 'accesskey="i" onclick="if ( !KILL_SWITCH ) { ajaxProtect(1); return false; }" id="protbtn_1" title="' . $lang->get('onpage_tip_protect_on') . '"'.$ctmp,
   747           'FLAGS' => 'accesskey="p" onclick="ajaxProtect(' . $local_cdata['protected'] . '); return false;" id="tb_ajax_protect_btn" title="' . $lang->get('onpage_tip_protect') . '"',
   747           'HREF'  => makeUrl($local_page, 'do=protect&level=1', true),
   748           'HREF' => makeUrl($local_page, 'do=protect', true),
   748           'TEXT'  => $lang->get('onpage_btn_protect_on')
   749           'TEXT' => $lang->get('onpage_btn_protect_change')
   749         ));
   750         ));
   750       $t1 = $menubtn->run();
   751       $t1 = $menubtn->run();
   751       
       
   752       $ctmp = '';
       
   753       if ( $local_cdata['protected'] == 0 )
       
   754       {
       
   755         $ctmp=' style="text-decoration: underline;"';
       
   756       }
       
   757       $menubtn->assign_vars(array(
       
   758           'FLAGS' => 'accesskey="o" onclick="if ( !KILL_SWITCH ) { ajaxProtect(0); return false; }" id="protbtn_0" title="' . $lang->get('onpage_tip_protect_off') . '"'.$ctmp,
       
   759           'HREF'  => makeUrl($local_page, 'do=protect&level=0', true),
       
   760           'TEXT'  => $lang->get('onpage_btn_protect_off')
       
   761         ));
       
   762       $t2 = $menubtn->run();
       
   763       
       
   764       $ctmp = '';
       
   765       if ( $local_cdata['protected'] == 2 )
       
   766       {
       
   767         $ctmp = ' style="text-decoration: underline;"';
       
   768       }
       
   769       $menubtn->assign_vars(array(
       
   770           'FLAGS' => 'accesskey="p" onclick="if ( !KILL_SWITCH ) { ajaxProtect(2); return false; }" id="protbtn_2" title="' . $lang->get('onpage_tip_protect_semi') . '"'.$ctmp,
       
   771           'HREF'  => makeUrl($local_page, 'do=protect&level=2', true),
       
   772           'TEXT'  => $lang->get('onpage_btn_protect_semi')
       
   773         ));
       
   774       $t3 = $menubtn->run();
       
   775       
   752       
   776       $this->toolbar_menu .= '        <table border="0" cellspacing="0" cellpadding="0">
   753       $this->toolbar_menu .= '        <table border="0" cellspacing="0" cellpadding="0">
   777           <tr>
   754           <tr>
   778             <td>'.$t0.'</td>
   755             <td>'.$t0.'</td>
   779             <td>'.$t1.'</td>
   756             <td>'.$t1.'</td>
   780             <td>'.$t2.'</td>
       
   781             <td>'.$t3.'</td>
       
   782           </tr>
   757           </tr>
   783         </table>';
   758         </table>';
   784     }
   759     }
   785     
   760     
   786     // Wiki mode button
   761     // Wiki mode button