Changeset 23583
- Timestamp:
- Jun 27, 2013, 12:47:39 AM (11 years ago)
- Location:
- extensions/add_head_element
- Files:
-
- 3 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
extensions/add_head_element/admin.php
r23582 r23583 13 13 //-------------------------------------------------------- sections definitions 14 14 15 // Gestion des onglets16 if (!isset($_GET['tab']))17 $page['tab'] = 'Management';18 else19 $page['tab'] = $_GET['tab'];20 21 15 $tabsheet = new tabsheet(); 22 $tabsheet->add('Management', 23 l10n('Management'), 24 $my_base_url.'&tab=Management'); 25 $tabsheet->select($page['tab']); 16 $tabsheet->add('Management', l10n('Management'), ''); 17 $tabsheet->select('Management'); 26 18 $tabsheet->assign(); 27 19 28 switch ($page['tab'])20 if (isset($conf['add_head_element_apply_on'])) 29 21 { 30 case 'Management': 31 global $template, $conf; 32 33 $template->assign( 34 'gestA', 35 array('AHEBASE' => $conf['add_head_element'],)); 22 $conf['add_head_element_apply_on'] = explode(',', $conf['add_head_element_apply_on']); 23 } 24 else 25 { 26 $conf['add_head_element_apply_on'] = array('gallery', 'admin'); 27 } 28 29 $template->assign( 30 array( 31 'AHEBASE' => $conf['add_head_element'], 32 'gallery' => in_array('gallery', $conf['add_head_element_apply_on']), 33 'admin' => in_array('admin', $conf['add_head_element_apply_on']), 34 ) 35 ); 36 36 37 37 if (isset($_POST['submitahe'])) 38 38 { 39 39 conf_update_param('add_head_element', $_POST['ahe']); 40 41 $conf['add_head_element_apply_on'] = array(); 42 43 if (!empty($_POST['apply_on_gallery'])) 44 { 45 $conf['add_head_element_apply_on'][] = 'gallery'; 46 } 47 48 if (!empty($_POST['apply_on_admin'])) 49 { 50 $conf['add_head_element_apply_on'][] = 'admin'; 51 } 52 53 conf_update_param('add_head_element_apply_on', implode(',', $conf['add_head_element_apply_on'])); 54 40 55 $template->assign( 41 'gestA', 42 array('AHEBASE' => stripslashes($_POST['ahe']),)); 43 } 44 break; 45 } 56 array( 57 'AHEBASE' => stripslashes($_POST['ahe']), 58 'gallery' => in_array('gallery', $conf['add_head_element_apply_on']), 59 'admin' => in_array('admin', $conf['add_head_element_apply_on']), 60 ) 61 ); 62 } 46 63 47 64 $template->set_filenames(array('plugin_admin_content' => dirname(__FILE__) . '/admin.tpl')); -
extensions/add_head_element/admin.tpl
r23582 r23583 1 {html_style}{literal} 2 form p {text-align:left;margin:0 0 1.5em 1.5em;line-height:20px;} 3 {/literal}{/html_style} 4 1 5 <div class="titrePage"> 2 6 <h2>{'ahe_h2'|@translate}</h2> 3 7 </div> 4 <div id="configContent"> 5 {if isset ($gestA)} 6 <form method="post" > 7 <fieldset id="mainConf"> 8 <span class="property"> 9 <label for="aheperso">{'ahe_perso'|@translate}</label><br><br> 10 </span> 11 <textarea rows="5" cols="50" class="description" name="ahe" id="ahe">{$gestA.AHEBASE}</textarea> 8 9 <form method="post"> 10 <p> 11 <strong>{'ahe_perso'|@translate}</strong><br> 12 <textarea rows="5" cols="50" class="description" name="ahe" id="ahe">{$AHEBASE}</textarea> 13 </p> 14 15 <p> 16 <strong>{'Apply on'|@translate}</strong><br> 17 <label><input type="checkbox" name="apply_on_gallery"{if $gallery} checked="checked"{/if}> {'Gallery'|@translate}</label> 18 <label><input type="checkbox" name="apply_on_admin"{if $admin} checked="checked"{/if}> {'Administration'|@translate}</label> 19 </p> 20 12 21 <p> 13 22 <input class="submit" type="submit" name="submitahe" value="{'Submit'|@translate}"> 14 <input class="submit" type="reset" name="reset" value="{'Reset'|@translate}">15 23 </p> 16 </form> 17 {/if} 18 </div> 24 </form> -
extensions/add_head_element/language/en_UK/plugin.lang.php
r12496 r23583 4 4 //Tab Management 5 5 $lang['Management'] = 'Management'; 6 $lang['ahe_perso'] = 'add < head > element'; 7 6 $lang['ahe_perso'] = 'Add elements in < head > HTML section'; 7 $lang['Apply on'] = 'Apply on'; 8 $lang['Gallery'] = 'Gallery'; 8 9 ?> -
extensions/add_head_element/language/fr_FR/plugin.lang.php
r12496 r23583 5 5 $lang['Management'] = 'Gestion'; 6 6 $lang['ahe_perso'] = 'Ajout d\'éléments dans les balise < head >'; 7 8 7 $lang['Apply on'] = 'Appliquer sur'; 8 $lang['Gallery'] = 'Galerie'; 9 9 ?> -
extensions/add_head_element/main.inc.php
r14969 r23583 19 19 function AHE_admin_menu($menu) 20 20 { 21 array_push($menu, array( 22 'NAME' => 'Add < head > element', 23 'URL' => get_admin_plugin_menu_link(AHE_PATH . 'admin/admin.php'))); 21 array_push( 22 $menu, 23 array( 24 'NAME' => 'Add < head > element', 25 'URL' => get_root_url().'admin.php?page=plugin-add_head_element' 26 ) 27 ); 28 24 29 return $menu; 25 30 } … … 31 36 function AHE1() 32 37 { 38 global $template,$conf; 33 39 34 global $template,$conf; 40 if (isset($conf['add_head_element_apply_on'])) 41 { 42 if (!is_array($conf['add_head_element_apply_on'])) 43 { 44 $conf['add_head_element_apply_on'] = explode(',', $conf['add_head_element_apply_on']); 45 } 35 46 47 if (defined('IN_ADMIN') and IN_ADMIN) 48 { 49 // we are in the administration 50 if (!in_array('admin', $conf['add_head_element_apply_on'])) 51 { 52 return; 53 } 54 } 55 else 56 { 57 // we are in the gallery 58 if (!in_array('gallery', $conf['add_head_element_apply_on'])) 59 { 60 return; 61 } 62 } 63 64 } 65 36 66 if (!empty($conf['add_head_element'])) 37 67 { 38 68 $template->append('head_elements', $conf['add_head_element']); 39 69 } 40 70 } 41 71 ?>
Note: See TracChangeset
for help on using the changeset viewer.