Ignore:
Timestamp:
May 28, 2011, 6:37:55 PM (13 years ago)
Author:
flop25
Message:

adding an admin page, language files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/imgpreview/main.inc.php

    r11079 r11086  
    44Version: auto
    55Description: give an image preview when the mouve is over a thumbnail
    6 Plugin URI: http://phpwebgallery.net/ext/extension_view.php?eid=
     6Plugin URI: http://phpwebgallery.net/ext/extension_view.php?eid=551
    77Author: Flop25
    88Author URI: http://www.planete-flop.fr/
    99*/
    10 
     10if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
     11define('IMGP_DIR' , basename(dirname(__FILE__)));
     12define('IMGP_PATH' , PHPWG_PLUGINS_PATH . IMGP_DIR . '/');
     13add_event_handler('get_admin_plugin_menu_links', 'imgpreview_lien_menu');
     14function imgpreview_lien_menu($menu)
     15{
     16       
     17    array_push(
     18                        $menu,
     19                        array('NAME' => 'Image Preview',
     20            'URL'  => get_admin_plugin_menu_link(get_root_url().'plugins/'.IMGP_DIR.'/admin/admin.php')
     21                                                )
     22                );
     23    return $menu;
     24}
    1125/** thumbnails.tpl **/
    1226add_event_handler('loc_end_index_thumbnails', 'imgpreview_thumbnails');
    1327function imgpreview_thumbnails($tpl_thumbnails_var)
    1428{
    15         global $template;
     29        global $template, $conf ;
     30
     31        $conf_imgp = explode("#" , $conf['imgpreview']);
     32        $imgpreview=array( 'width' => $conf_imgp[0], 'height' => $conf_imgp[1] );
     33        $template->assign(array(
     34                'imgpreview' => $imgpreview
     35        ));
     36
    1637        $template->set_prefilter('index_thumbnails', 'imgpreview_prefilter_thumbnails');
    1738        $template->set_prefilter('stuffs', 'imgpreview_prefilter_thumbnails');
    18         /*
    19         $UrlJs = get_root_url().'plugins/imgpreview/js/imgpreview.js';
    20         $UrlCss = get_root_url().'plugins/imgpreview/css/imgpreview.css';
    21         $template->append(
    22         'head_elements',
    23         '<script type="text/javascript" src="'.$UrlJs.'"></script>'."\n".
    24         "\t".'<link rel="stylesheet" type="text/css" href="'.$UrlCss.'">'."\n"
    25         );
    26         $template->append(
    27         'footer_elements',
    28         '<script type="text/javascript" src="'.get_root_url().'plugins/imgpreview/js/init.js"></script>'."\n"
    29         );
    30         */
    3139        $dir=dirname(__FILE__).'/css_js.tpl';
    3240        $template->set_filenames(array(
    3341                'imgpreview_css_js' => realpath($dir),
    3442          )  );
    35         //die('_'.realpath($dir).'_');
    36         //$imgpreview_css_js = $template->parse('imgpreview_css_js', true);
    3743        $template->assign_var_from_handle('IMGPREVIEW', 'imgpreview_css_js');
    3844
    39         //define('IMGPREVIEW',$imgpreview_css_js);
    40         //die(IMGPREVIEW);
    4145        return $tpl_thumbnails_var;
    4246}
Note: See TracChangeset for help on using the changeset viewer.