Changeset 19324 for extensions/Media_Icon/admin
- Timestamp:
- Dec 8, 2012, 2:53:06 AM (11 years ago)
- Location:
- extensions/Media_Icon/admin
- Files:
-
- 3 added
- 1 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
extensions/Media_Icon/admin/admin.php
r19284 r19324 2 2 //Chech whether we are indeed included by Piwigo. 3 3 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 4 5 //Load globals 6 global $conf, $page; 7 8 //Library for tabs 9 include_once(PHPWG_ROOT_PATH .'admin/include/tabsheet.class.php'); 4 10 5 11 //Load translation files … … 9 15 check_status(ACCESS_ADMINISTRATOR); 10 16 11 $conf_media_icon = $conf['media_icon']; 12 $ conf_media_icon_unserialize = unserialize($conf['media_icon']);17 //Initialization 18 $my_base_url = get_admin_plugin_menu_link(__FILE__); 13 19 14 //Save config 15 if (isset($_POST['submit'])) { 16 //New parameters 17 $conf_media_icon_unserialize['style'] = $_POST['style']; 18 19 //Save 20 conf_update_param('media_icon', serialize($conf_media_icon_unserialize)); 21 array_push($page['infos'], l10n('Information data registered in database')); 20 //Tab management 21 if (!isset($_GET['tab'])) 22 $page['tab'] = 'general'; 23 else 24 $page['tab'] = $_GET['tab']; 25 26 $tabsheet = new tabsheet(); 27 $tabsheet->add('general', 28 l10n('General'), 29 $my_base_url.'&tab=general'); 30 $tabsheet->add('advanced', 31 l10n('Advanced options'), 32 $my_base_url.'&tab=advanced'); 33 $tabsheet->select($page['tab']); 34 $tabsheet->assign(); 35 36 switch ($page['tab']) { 37 case 'advanced': 38 include_once(dirname(__FILE__).'/admin_advanced.php'); 39 break; 40 default: 41 include_once(dirname(__FILE__).'/admin_general.php'); 42 break; 22 43 } 23 24 //Parameters of the template25 $template->assign('MEDIA_ICON_STYLE_LOGO_SELECTED', ($conf_media_icon_unserialize['style'] == 'logo') ? 'selected="selected"' : null);26 $template->assign('MEDIA_ICON_STYLE_PHOTO_SELECTED', ($conf_media_icon_unserialize['style'] == 'photo') ? 'selected="selected"' : null);27 $template->assign('MEDIA_ICON_STYLE_FOLDER_SELECTED', ($conf_media_icon_unserialize['style'] == 'folder') ? 'selected="selected"' : null);28 $template->assign('MEDIA_ICON_STYLE_FOLDERCOLOR_SELECTED', ($conf_media_icon_unserialize['style'] == 'foldercolor') ? 'selected="selected"' : null);29 30 //Fetch the template.31 global $template;32 33 //add a stylesheet34 $template->append('head_elements', '<link rel="stylesheet" type="text/css" href="'.MEDIA_ICON_PATH.'template/'.$conf_media_icon_unserialize['style'].'_media_icon.css">');35 36 //Add our template to the global template37 $template->set_filenames(38 array(39 'plugin_admin_content' => dirname(__FILE__).'/admin.tpl'40 )41 );42 43 //Assign the template contents to ADMIN_CONTENT44 $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');45 44 ?> -
extensions/Media_Icon/admin/admin_general.tpl
r19284 r19324 1 1 {html_head}{literal} 2 2 <style type="text/css"> 3 div.media_icon_admin_element { 4 width:20%; 5 font-weight:normal; 6 float: left; 7 } 8 .properties p { 9 font-weight: normal; 10 text-align: center; 11 margin-top: 1em; 12 } 3 div.media_icon_admin_element { 4 width: 20%; 5 font-weight: bold; 6 float: left; 7 margin: 1,5em 1,5em; 8 } 13 9 14 .media_icon_important { 15 font-weight: bold; 16 } 10 .properties label { 11 font-weight: bold; 12 text-align: center; 13 } 14 15 .properties p { 16 font-weight: normal; 17 margin-top: 1em; 18 text-align: center; 19 } 20 21 .media_icon_important { 22 font-weight: bold; 23 } 17 24 </style> 18 25 {/literal}{/html_head} … … 29 36 </p> 30 37 <p> 31 <select id="media_icon_select" name=" style">32 <option value="logo" {$MEDIA_ICON_STYLE_LOGO_SELECTED}>{'Logo'|@translate}</option>33 <option value="photo" {$MEDIA_ICON_STYLE_PHOTO_SELECTED}>{'Photo'|@translate}</option>34 <option value="folder" {$MEDIA_ICON_STYLE_FOLDER_SELECTED}>{'Folder'|@translate}</option>35 <option value="foldercolor" {$MEDIA_ICON_STYLE_FOLDERCOLOR_SELECTED}>{'Folder color'|@translate}</option>38 <select id="media_icon_select" name="media_icon_style"> 39 <option value="logo"{if $media_icon_style.logo} selected="selected"{/if}>{'Logo'|@translate}</option> 40 <option value="photo"{if $media_icon_style.photo} selected="selected"{/if}>{'Photo'|@translate}</option> 41 <option value="folder"{if $media_icon_style.folder} selected="selected"{/if}>{'Folder'|@translate}</option> 42 <option value="foldercolor"{if $media_icon_style.foldercolor} selected="selected"{/if}>{'Folder color'|@translate}</option> 36 43 </select> 37 44 </p> … … 44 51 <fieldset> 45 52 <legend>{'Result'|@translate}</legend> 46 <div class="media_icon_admin_element">{'Youtube videos'|@translate} 53 <div class="media_icon_admin_element">{'Youtube videos'|@translate}<span class="media_icon_admin_youtube"></span></div> 47 54 <div class="media_icon_admin_element">{'Vimeo videos'|@translate} <span class="media_icon_admin_vimeo"></span></div> 48 55 <div class="media_icon_admin_element">{'Dailymotion videos'|@translate} <span class="media_icon_admin_dailymotion"></span></div>
Note: See TracChangeset
for help on using the changeset viewer.