Changeset 5432 for extensions/akBookStyle/trunk/admin.php
- Timestamp:
- Mar 28, 2010, 9:46:21 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/akBookStyle/trunk/admin.php
r3843 r5432 3 3 // | akBookStyle - a plugin for Piwigo | 4 4 // +-----------------------------------------------------------------------+ 5 // | Copyright(C) 2009 5 // | Copyright(C) 2009-2010 Nicolas Roudaire http://www.nikrou.net | 6 6 // | Copyright(C) 2009 vdigital | 7 7 // +-----------------------------------------------------------------------+ … … 25 25 } 26 26 27 $ThumbnailsLocations = array('top','left','bottom','right'); 28 $MouseEvents = array('click' => 'ak_event_click', 29 'mouseover' => 'ak_event_mouseover'); 30 31 load_language('plugin.lang', AK_PLUGIN_LANG); 27 $ThumbnailsLocations = array('top' => 'Top', 28 'left' => 'Left', 29 'bottom' => 'Bottom', 30 'right' => 'Right'); 31 $MouseEvents = array('click' => 'Click', 32 'mouseover' => 'Mouseover'); 32 33 33 34 $me = get_plugin_data($plugin_id); … … 37 38 if (!empty($_POST['ak_categories']) && $_POST['ak_categories']!=$me->ak_categories) { 38 39 $me->ak_categories = $_POST['ak_categories']; 39 if ( $_POST['ak_categories'] == '') $me->ak_categories = '<!--Book-->'; 40 array_push($GLOBALS['page']['infos'], $lang['ak_categories_changed']); 40 array_push($GLOBALS['page']['infos'], 41 l10n_dec('Applicable category has been updated', 42 'Applicable categories have been updated', 43 count($_POST['ak_categories']))); 41 44 $save_config = true; 42 45 } … … 44 47 if (!empty($_POST['ak_by_page']) && intval($_POST['ak_by_page'])!=$me->ak_by_page) { 45 48 $me->ak_by_page = intval($_POST['ak_by_page']); 46 array_push($GLOBALS['page']['infos'], $lang['ak_by_page_changed']);49 array_push($GLOBALS['page']['infos'], l10n('Thumbnails per page has been updated')); 47 50 $save_config = true; 48 51 } … … 50 53 if (!empty($_POST['ak_by_line']) && intval($_POST['ak_by_line'])!=$me->ak_by_line) { 51 54 $me->ak_by_line = intval($_POST['ak_by_line']); 52 array_push($GLOBALS['page']['infos'], $lang['ak_by_line_changed']);55 array_push($GLOBALS['page']['infos'], l10n('Number of column has been updated')); 53 56 $save_config = true; 54 57 } … … 56 59 if (!empty($_POST['ak_thumbnail_size']) && $_POST['ak_thumbnail_size']!=$me->ak_thumbnail_size) { 57 60 $me->ak_thumbnail_size = (int) $_POST['ak_thumbnail_size']; 58 array_push($GLOBALS['page']['infos'], $lang['ak_thumbnail_size_changed']);61 array_push($GLOBALS['page']['infos'], l10n('Thumbnail size has been updated')); 59 62 $save_config = true; 60 63 } 61 64 62 65 if (!empty($_POST['ak_mouse_event']) && $_POST['ak_mouse_event']!=$me->ak_mouse_event) { 63 $me->ak_mouse_event = isset($MouseEvents[$_POST['ak_mouse_event']])?$_POST['ak_mouse_event']:'click'; 64 array_push($GLOBALS['page']['infos'], $lang['ak_mouse_event_changed']); 66 if (isset($MouseEvents[$_POST['ak_mouse_event']])) { 67 $me->ak_mouse_event = $_POST['ak_mouse_event']; 68 } else { 69 $me->ak_mouse_event = 'click'; 70 } 71 array_push($GLOBALS['page']['infos'], l10n('Event to show medium picture has been updated.')); 65 72 $save_config = true; 66 73 } 67 74 68 75 if (!empty($_POST['ak_thumbnails_loc']) && $_POST['ak_thumbnails_loc']!=$me->ak_thumbnails_loc) { 69 $me->ak_thumbnails_loc = in_array($_POST['ak_thumbnails_loc'],$ThumbnailsLocations)?$_POST['ak_thumbnails_loc']:'left'; 70 array_push($GLOBALS['page']['infos'], $lang['ak_thumbnails_loc_changed']); 76 if (isset($ThumbnailsLocations[$_POST['ak_thumbnails_loc']])) { 77 $me->ak_thumbnails_loc = $_POST['ak_thumbnails_loc']; 78 } else { 79 $me->ak_thumbnails_loc = 'left'; } 80 array_push($GLOBALS['page']['infos'], l10n('Thumbnails location has been changed')); 71 81 $save_config = true; 72 82 } … … 76 86 } 77 87 } 88 89 $query = ' 90 SELECT id,name 91 FROM '.CATEGORIES_TABLE; 92 93 $all_categories = simple_hash_from_query($query, 'id', 'name'); 94 78 95 $GLOBALS['template']->set_filenames(array('plugin_admin_content' => AK_PLUGIN_TEMPLATE . '/admin.tpl')); 79 $GLOBALS['template']->assign('AK_PLUGIN_CSS', AK_PLUGIN_CSS); 96 $GLOBALS['template']->assign('AK_PLUGIN_CSS', AK_PLUGIN_CSS); 97 $GLOBALS['template']->assign('ALL_CATEGORIES', $all_categories); 80 98 $GLOBALS['template']->assign('AK_CATEGORIES', $me->ak_categories); 81 99 $GLOBALS['template']->assign('AK_BY_PAGE', $me->ak_by_page); … … 86 104 $GLOBALS['template']->assign('AK_EVENTS_LABELS', array_values($MouseEvents)); 87 105 $GLOBALS['template']->assign('AK_THUMBNAILS_LOC', $me->ak_thumbnails_loc); 88 $GLOBALS['template']->assign('AK_THUMBNAILS_LOCATIONS', $ThumbnailsLocations); 106 $GLOBALS['template']->assign('AK_THUMBNAILS_LOCATIONS_KEYS', array_keys($ThumbnailsLocations)); 107 $GLOBALS['template']->assign('AK_THUMBNAILS_LOCATIONS_VALUES', array_values($ThumbnailsLocations)); 89 108 $GLOBALS['template']->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); 90 109 ?>
Note: See TracChangeset
for help on using the changeset viewer.