Ignore:
Timestamp:
Aug 30, 2009, 9:31:13 PM (12 years ago)
Author:
nikrou
Message:

Feature 1144 : allow admin to choose mouse event to show medium picture

  • refactoring (only on javascript file)
  • bug fix : allow to choose click !
File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/akBookStyle/trunk/admin.php

    r3802 r3806  
    2525}
    2626
     27$ThumbnailsLocations = array('top','left','bottom','right');
     28$MouseEvents = array('click' => 'ak_event_click',
     29                     'mouseover' => 'ak_event_mouseover');
     30
    2731load_language('plugin.lang', AK_PLUGIN_LANG);
    2832
     
    4347  }
    4448
    45   if (!empty($_POST['ak_show_over']) && $_POST['ak_show_over']!=$me->ak_show_over) {
    46     $me->ak_show_over = ($_POST['ak_show_over']=='true')?'true':'false';
    47     array_push($GLOBALS['page']['infos'], $lang['ak_show_over_changed']);
     49  if (!empty($_POST['ak_mouse_event']) && $_POST['ak_mouse_event']!=$me->ak_mouse_event) {
     50    $me->ak_mouse_event = isset($MouseEvents[$_POST['ak_mouse_event']])?$_POST['ak_mouse_event']:'click';
     51    array_push($GLOBALS['page']['infos'], $lang['ak_mouse_event_changed']);
    4852    $save_config = true;
    4953  }
    5054
    5155  if (!empty($_POST['ak_thumbnails_loc']) && $_POST['ak_thumbnails_loc']!=$me->ak_thumbnails_loc) {
    52     $me->ak_thumbnails_loc = (in_array($_POST['ak_thumbnails_loc'],array('top','left','bottom','right')))?$_POST['ak_thumbnails_loc']:'left';
     56    $me->ak_thumbnails_loc = in_array($_POST['ak_thumbnails_loc'],$ThumbnailsLocations)?$_POST['ak_thumbnails_loc']:'left';
    5357    array_push($GLOBALS['page']['infos'], $lang['ak_thumbnails_loc_changed']);
    5458    $save_config = true;
     
    6367$GLOBALS['template']->assign('AK_BY_LINE', $me->ak_by_line);
    6468$GLOBALS['template']->assign('AK_THUMBNAIL_SIZE', $me->ak_thumbnail_size);
    65 $GLOBALS['template']->assign('AK_SHOW_OVER', $me->ak_show_over);
     69$GLOBALS['template']->assign('AK_MOUSE_EVENT', $me->ak_mouse_event);
     70$GLOBALS['template']->assign('AK_AVAILABLE_EVENTS', array_keys($MouseEvents));
     71$GLOBALS['template']->assign('AK_EVENTS_LABELS', array_values($MouseEvents));
    6672$GLOBALS['template']->assign('AK_THUMBNAILS_LOC', $me->ak_thumbnails_loc);
     73$GLOBALS['template']->assign('AK_THUMBNAILS_LOCATIONS', $ThumbnailsLocations);
    6774$GLOBALS['template']->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
    6875?>
Note: See TracChangeset for help on using the changeset viewer.