Changeset 28883


Ignore:
Timestamp:
07/01/14 11:23:45 (5 years ago)
Author:
mistic100
Message:

add menu_link parameter, add identifier for menu link

Location:
extensions/GuestBook
Files:
42 edited

Legend:

Unmodified
Added
Removed
  • extensions/GuestBook/admin/config.php

    r28841 r28883  
    55{ 
    66  $conf['guestbook'] = array( 
    7     'comments_validation' => isset($_POST['comments_validation']), 
     7    'comments_validation' =>    isset($_POST['comments_validation']), 
    88    'email_admin_on_comment' => isset($_POST['email_admin_on_comment']), 
    99    'email_admin_on_comment_validation' => isset($_POST['email_admin_on_comment_validation']), 
    10     'nb_comment_page' => $_POST['nb_comment_page'], 
    11     'activate_rating' => isset($_POST['activate_rating']), 
    12     'guest_can_view' => isset($_POST['guest_can_view']), 
    13     'guest_can_add' => isset($_POST['guest_can_add']), 
     10    'nb_comment_page' =>        $_POST['nb_comment_page'], 
     11    'activate_rating' =>        isset($_POST['activate_rating']), 
     12    'guest_can_view' =>         isset($_POST['guest_can_view']), 
     13    'guest_can_add' =>          isset($_POST['guest_can_add']), 
     14    'menu_link' =>              isset($_POST['menu_link']), 
    1415    ); 
    1516     
     
    1819} 
    1920 
    20 $template->assign($conf['guestbook']); 
     21$template->assign('gb', $conf['guestbook']); 
    2122 
    2223$template->set_filename('guestbook', realpath(GUESTBOOK_PATH . 'admin/template/config.tpl')); 
  • extensions/GuestBook/admin/template/config.tpl

    r26065 r28883  
    2424    <li> 
    2525      <label> 
     26        <input type="checkbox" name="menu_link" value="1" {if $gb.menu_link}checked="checked"{/if}> 
     27        {'Add link in menu'|translate} 
     28      </label> 
     29    </li> 
     30       
     31    <li> 
     32      <label> 
    2633        <b>{'Number of comments per page'|translate}</b> 
    27         <input type="text" size="3" maxlength="4" name="nb_comment_page" id="nb_comment_page" value="{$nb_comment_page}"> 
     34        <input type="text" size="3" maxlength="4" name="nb_comment_page" value="{$gb.nb_comment_page}"> 
    2835      </label> 
    2936    </li> 
     
    3138    <li> 
    3239      <label> 
    33         <input type="checkbox" name="activate_rating" {if ($activate_rating)}checked="checked"{/if}> 
     40        <input type="checkbox" name="activate_rating" {if ($gb.activate_rating)}checked="checked"{/if}> 
    3441        <b>{'Activate rating'|translate}</b> 
    3542      </label> 
     
    3845    <li> 
    3946      <label> 
    40         <input type="checkbox" name="comments_validation" {if ($comments_validation)}checked="checked"{/if}> 
     47        <input type="checkbox" name="comments_validation" {if ($gb.comments_validation)}checked="checked"{/if}> 
    4148        <b>{'Validation'|translate}</b> 
    4249      </label> 
     
    4754 
    4855      <label> 
    49         <input type="checkbox" name="email_admin_on_comment" {if ($email_admin_on_comment)}checked="checked"{/if}> {'added'|translate} 
     56        <input type="checkbox" name="email_admin_on_comment" {if ($gb.email_admin_on_comment)}checked="checked"{/if}> {'added'|translate} 
    5057      </label> 
    5158 
    5259      <label id="email_admin_on_comment_validation"> 
    53         <input type="checkbox" name="email_admin_on_comment_validation" {if ($email_admin_on_comment_validation)}checked="checked"{/if}> {'pending validation'|translate} 
     60        <input type="checkbox" name="email_admin_on_comment_validation" {if ($gb.email_admin_on_comment_validation)}checked="checked"{/if}> {'pending validation'|translate} 
    5461      </label> 
    5562    </li> 
     
    5966 
    6067      <label> 
    61         <input type="checkbox" name="guest_can_view" {if ($guest_can_view)}checked="checked"{/if}> {'view comments'|translate} 
     68        <input type="checkbox" name="guest_can_view" {if ($gb.guest_can_view)}checked="checked"{/if}> {'view comments'|translate} 
    6269      </label> 
    6370 
    6471      <label id="guest_can_add"> 
    65         <input type="checkbox" name="guest_can_add" {if ($guest_can_add)}checked="checked"{/if}> {'add comment'|translate} 
     72        <input type="checkbox" name="guest_can_add" {if ($gb.guest_can_add)}checked="checked"{/if}> {'add comment'|translate} 
    6673      </label> 
    6774    </li> 
  • extensions/GuestBook/include/events.inc.php

    r26065 r28883  
    2222  $menu = &$menu_ref_arr[0]; 
    2323   
    24   if ( ($block = $menu->get_block('mbMenu')) != null ) 
     24  if (($block = $menu->get_block('mbMenu')) != null) 
    2525  { 
    26     $block->data[] = array( 
     26    $block->data['guestbook'] = array( 
    2727      'URL' => GUESTBOOK_URL, 
    2828      'TITLE' => l10n('GuestBook'), 
  • extensions/GuestBook/language/ar_SA/plugin.lang.php

    r24933 r28883  
    3636$lang['add comment'] = 'إضافة تعليق'; 
    3737$lang['view comments'] = 'مشاهدة التعليقات'; 
    38 ?> 
     38$lang['Add link in menu'] = 'اضف رابط في القائمة'; 
  • extensions/GuestBook/language/bg_BG/plugin.lang.php

    r28053 r28883  
    3838$lang['Rate'] = 'Оценка'; 
    3939$lang['Send'] = 'Изпращане'; 
     40$lang['Add link in menu'] = 'Добави линк в менюто'; 
  • extensions/GuestBook/language/ca_ES/plugin.lang.php

    r27918 r28883  
    3838$lang['Rate'] = 'Valora'; 
    3939$lang['Send'] = 'Envia'; 
     40$lang['Add link in menu'] = 'Afegeix un enllaç al menú'; 
  • extensions/GuestBook/language/cs_CZ/plugin.lang.php

    r24977 r28883  
    3636$lang['add comment'] = 'přidat komentář'; 
    3737$lang['Guests (not registered) permissions :'] = 'Oprávnění hostů (neregistrovaných uživatelů):'; 
    38 ?> 
     38$lang['Add link in menu'] = 'Vložit odkaz do menu'; 
  • extensions/GuestBook/language/da_DK/plugin.lang.php

    r27910 r28883  
    3838$lang['Rate'] = 'Bedøm'; 
    3939$lang['Send'] = 'Send'; 
     40$lang['Add link in menu'] = 'Tilføj link i menu'; 
  • extensions/GuestBook/language/de_DE/plugin.lang.php

    r27927 r28883  
    3838$lang['Rate'] = 'Rate'; 
    3939$lang['Send'] = 'Senden'; 
     40$lang['Add link in menu'] = 'Füge einen Link im Menü hinzu'; 
  • extensions/GuestBook/language/el_GR/plugin.lang.php

    r27922 r28883  
    3838$lang['Send'] = 'Αποστολή'; 
    3939$lang['Rate'] = 'Βαθμολόγιση'; 
     40$lang['Add link in menu'] = 'Προσθέστε ένα σύνδεσμο στο μενού'; 
  • extensions/GuestBook/language/en_UK/plugin.lang.php

    r27895 r28883  
    1818$lang['Send'] = 'Send'; 
    1919$lang['Rate'] = 'Rate'; 
    20  
    21 ?> 
     20$lang['Add link in menu'] = 'Add link in menu'; 
  • extensions/GuestBook/language/eo_EO/plugin.lang.php

    r28014 r28883  
    3838$lang['Rate'] = 'Takso'; 
    3939$lang['Send'] = 'Sendi'; 
     40$lang['Add link in menu'] = 'Aldoni ligilon en menuon'; 
  • extensions/GuestBook/language/es_ES/plugin.lang.php

    r27919 r28883  
    3838$lang['Rate'] = 'Puntuar'; 
    3939$lang['Send'] = 'Enviar'; 
     40$lang['Add link in menu'] = 'Añadir el lazo en el menú'; 
  • extensions/GuestBook/language/et_EE/plugin.lang.php

    r28151 r28883  
    3838$lang['Send'] = 'Saada'; 
    3939$lang['Rate'] = 'Hinda'; 
     40$lang['Add link in menu'] = 'Lisa menüüsse link'; 
  • extensions/GuestBook/language/fa_IR/plugin.lang.php

    r27911 r28883  
    3838$lang['Rate'] = 'رتبه'; 
    3939$lang['Send'] = 'فرستادن'; 
     40$lang['Add link in menu'] = 'افزودن یک پیوند در منو'; 
  • extensions/GuestBook/language/fi_FI/plugin.lang.php

    r25345 r28883  
    3636$lang['add comment'] = 'kommentoi'; 
    3737$lang['view comments'] = 'näytä kommentit'; 
    38 ?> 
     38$lang['Add link in menu'] = 'Lisää linkki valikkoon'; 
  • extensions/GuestBook/language/fr_CA/plugin.lang.php

    r25452 r28883  
    1313$lang['Activate rating'] = 'Activer la notation'; 
    1414$lang['%s says on %s :'] = '%s a dit le %s :'; 
    15  
    1615$lang['Guests (not registered) permissions :'] = 'Droits des visiteurs (non enregistrés) :'; 
    1716$lang['add comment'] = 'ajouter un commentaire'; 
    1817$lang['view comments'] = 'voir les commentaires'; 
    19 ?> 
     18$lang['Add link in menu'] = 'Ajouter le lien dans le menu'; 
  • extensions/GuestBook/language/fr_FR/plugin.lang.php

    r27895 r28883  
    1818$lang['Send'] = 'Envoyer'; 
    1919$lang['Rate'] = 'Note'; 
    20  
    21 ?> 
     20$lang['Add link in menu'] = 'Ajouter le lien dans le menu'; 
  • extensions/GuestBook/language/gl_ES/plugin.lang.php

    r28103 r28883  
    3838$lang['add comment'] = 'engadir comentario'; 
    3939$lang['view comments'] = 'visualizar comentarios'; 
     40$lang['Add link in menu'] = 'Engadir ligazón ó menú'; 
  • extensions/GuestBook/language/hu_HU/plugin.lang.php

    r28175 r28883  
    3838$lang['Rate'] = 'Értékelés'; 
    3939$lang['Send'] = 'Küldés'; 
     40$lang['Add link in menu'] = 'Kapcsolat elem hozzáadása a menühöz'; 
  • extensions/GuestBook/language/it_IT/plugin.lang.php

    r27930 r28883  
    3838$lang['Rate'] = 'Voto'; 
    3939$lang['Send'] = 'Invia'; 
     40$lang['Add link in menu'] = 'Aggiungere un link nel menu'; 
  • extensions/GuestBook/language/lv_LV/plugin.lang.php

    r27951 r28883  
    3838$lang['Rate'] = 'likme'; 
    3939$lang['Send'] = 'Sūtīt'; 
     40$lang['Add link in menu'] = 'Pievienot saiti izvēlnē'; 
  • extensions/GuestBook/language/nb_NO/plugin.lang.php

    r28162 r28883  
    3838$lang['Rate'] = 'Vurder'; 
    3939$lang['Send'] = 'Send'; 
     40$lang['Add link in menu'] = 'Legg til link i menyen'; 
  • extensions/GuestBook/language/nl_NL/plugin.lang.php

    r28083 r28883  
    3838$lang['Rate'] = 'Waarderen'; 
    3939$lang['Send'] = 'Verstuur'; 
     40$lang['Add link in menu'] = 'Voeg link aan menu toe'; 
  • extensions/GuestBook/language/nn_NO/plugin.lang.php

    r25079 r28883  
    3636$lang['add comment'] = 'legg til kommentar'; 
    3737$lang['view comments'] = 'vis kommentar'; 
    38 ?> 
     38$lang['Add link in menu'] = 'Legg lenke til meny'; 
  • extensions/GuestBook/language/pl_PL/plugin.lang.php

    r24907 r28883  
    3636$lang['add comment'] = 'dodawanie komentarzy'; 
    3737$lang['view comments'] = 'oglądanie komentarzy'; 
    38 ?> 
     38$lang['Add link in menu'] = 'Dodaj link do menu'; 
  • extensions/GuestBook/language/pt_BR/plugin.lang.php

    r27928 r28883  
    3838$lang['Rate'] = 'avaliar'; 
    3939$lang['Send'] = 'enviar'; 
     40$lang['Add link in menu'] = 'Adicionar link ao menu'; 
  • extensions/GuestBook/language/pt_PT/plugin.lang.php

    r27920 r28883  
    3838$lang['Rate'] = 'Câmbio'; 
    3939$lang['Send'] = 'Enviar'; 
     40$lang['Add link in menu'] = 'Adicionar link no menú'; 
  • extensions/GuestBook/language/ro_RO/plugin.lang.php

    r27984 r28883  
    3838$lang['Rate'] = 'Evaluează'; 
    3939$lang['Send'] = 'Trimite'; 
     40$lang['Add link in menu'] = 'Adaugă legătură în meniu'; 
  • extensions/GuestBook/language/ru_RU/plugin.lang.php

    r27907 r28883  
    3838$lang['Rate'] = 'Rate'; 
    3939$lang['Send'] = 'Отправить'; 
     40$lang['Add link in menu'] = 'Добавить ссылку в меню'; 
  • extensions/GuestBook/language/sk_SK/plugin.lang.php

    r27924 r28883  
    3838$lang['Send'] = 'Poslať'; 
    3939$lang['Rate'] = 'Hodnotenie'; 
     40$lang['Add link in menu'] = 'Pridať link do menu'; 
  • extensions/GuestBook/language/sl_SI/plugin.lang.php

    r28078 r28883  
    3838$lang['Rate'] = 'Oceni'; 
    3939$lang['Send'] = 'Pošlji'; 
     40$lang['Add link in menu'] = 'Dodaj povezavo v meni'; 
  • extensions/GuestBook/language/sv_SE/plugin.lang.php

    r27946 r28883  
    3838$lang['Rate'] = 'Betyg'; 
    3939$lang['Send'] = 'Skicka'; 
     40$lang['Add link in menu'] = 'Inkludera länk i menyn'; 
  • extensions/GuestBook/language/th_TH/plugin.lang.php

    r20747 r28883  
    3333$lang['Please enter a message'] = 'กรุณากรอกข้อความก่อนทำการส่ง'; 
    3434$lang['Please enter your e-mail'] = 'กรุณากรอกอีเมลของคุณ'; 
    35 ?> 
     35$lang['Add link in menu'] = 'เพิ่มลิงค์ในเมนู'; 
  • extensions/GuestBook/language/tr_TR/plugin.lang.php

    r28292 r28883  
    3838$lang['Rate'] = 'Değerlendir'; 
    3939$lang['Send'] = 'Gönder'; 
     40$lang['Add link in menu'] = 'Menüye bağlantı ekle'; 
  • extensions/GuestBook/language/uk_UA/plugin.lang.php

    r24936 r28883  
    3636$lang['add comment'] = 'додайте коментар'; 
    3737$lang['view comments'] = 'перегляньте коментарі'; 
    38 ?> 
     38$lang['Add link in menu'] = 'Додати посилання в меню'; 
  • extensions/GuestBook/language/vi_VN/plugin.lang.php

    r24930 r28883  
    3636$lang['add comment'] = 'thêm bình luận'; 
    3737$lang['view comments'] = 'xem bình luận'; 
    38 ?> 
     38$lang['Add link in menu'] = 'Thêm liên kết vào trình đơn'; 
  • extensions/GuestBook/language/zh_CN/plugin.lang.php

    r28099 r28883  
    3838$lang['Rate'] = '评分'; 
    3939$lang['Send'] = '发送'; 
     40$lang['Add link in menu'] = '在菜单中添加链接'; 
  • extensions/GuestBook/language/zh_HK/plugin.lang.php

    r28251 r28883  
    3838$lang['Rate'] = '比率'; 
    3939$lang['Send'] = '發送'; 
     40$lang['Add link in menu'] = '在功能表添加連結'; 
  • extensions/GuestBook/language/zh_TW/plugin.lang.php

    r28543 r28883  
    3838$lang['Rate'] = '評級'; 
    3939$lang['Send'] = '發送'; 
     40$lang['Add link in menu'] = '選單中新增連結'; 
  • extensions/GuestBook/main.inc.php

    r28841 r28883  
    1212 
    1313// TODO akismet 
    14 global $prefixeTable; 
     14global $conf, $prefixeTable; 
    1515 
    1616define('GUESTBOOK_ID',      basename(dirname(__FILE__))); 
     
    1919define('GUESTBOOK_ADMIN',   get_root_url().'admin.php?page=plugin-' . GUESTBOOK_ID); 
    2020define('GUESTBOOK_URL',     get_absolute_root_url() . make_index_url(array('section' => 'guestbook'))); 
     21 
     22$conf['guestbook'] = safe_unserialize($conf['guestbook']); 
    2123 
    2224include_once(GUESTBOOK_PATH . 'include/events.inc.php'); 
     
    2931  add_event_handler('get_admin_plugin_menu_links', 'gb_admin_menu'); 
    3032} 
     33else 
     34{ 
     35  add_event_handler('loc_end_section_init', 'gb_section_init'); 
     36  add_event_handler('loc_end_index', 'gb_index'); 
     37} 
    3138 
    32 add_event_handler('blockmanager_apply', 'gb_menubar_apply', EVENT_HANDLER_PRIORITY_NEUTRAL+10); 
    33  
    34 add_event_handler('loc_end_section_init', 'gb_section_init'); 
    35 add_event_handler('loc_end_index', 'gb_index'); 
     39if ($conf['guestbook']['menu_link']) 
     40{ 
     41  add_event_handler('blockmanager_apply', 'gb_menubar_apply', EVENT_HANDLER_PRIORITY_NEUTRAL+10); 
     42} 
    3643 
    3744 
    3845function guestbook_init() 
    3946{ 
    40   global $conf; 
    41   $conf['guestbook'] = safe_unserialize($conf['guestbook']); 
    42    
    4347  load_language('plugin.lang', GUESTBOOK_PATH); 
    4448} 
  • extensions/GuestBook/maintain.class.php

    r28841 r28883  
    1414    'guest_can_view' => true, 
    1515    'guest_can_add' => true, 
     16    'menu_link' => true, 
    1617    ); 
    1718   
     
    4041        $old_conf['guest_can_view'] = true; 
    4142        $old_conf['guest_can_add'] = true; 
     43      } 
     44      if (!isset($old_conf['menu_link'])) 
     45      { 
     46        $old_conf['menu_link'] = true; 
    4247      } 
    4348       
Note: See TracChangeset for help on using the changeset viewer.