Ignore:
Timestamp:
Apr 25, 2010, 2:36:35 AM (14 years ago)
Author:
patdenice
Message:

Square option is available for thumbnail creation page and upload form.

File:
1 edited

Legend:

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

    r5943 r5962  
    1313define('SQUARE_THUMB_PATH' , PHPWG_PLUGINS_PATH . basename(dirname(__FILE__)) . '/');
    1414
    15 function change_admin_thumb_link($menu)
     15if (defined('IN_ADMIN'))
    1616{
    17   global $template;
     17  add_event_handler('init', 'square_thumbnails_init');
    1818
    19   $template->assign('U_THUMBNAILS',
    20     get_admin_plugin_menu_link(SQUARE_THUMB_PATH.'thumbnail.php')
    21   );
     19  function square_thumbnails_init()
     20  {
     21    global $conf;
    2222
    23   return $menu;
     23    // Thumbnail creation page
     24    if (isset($_GET['page']) and $_GET['page'] == 'thumbnail')
     25    {
     26      include(SQUARE_THUMB_PATH.'thumbnail.php');
     27    }
     28
     29    // Upload Form
     30    if (isset($_GET['page']) and $_GET['page'] == 'photos_add')
     31    {
     32      if (isset($_POST['submit_upload']) and @$conf['upload_form_thumb_square'])
     33      {
     34        include(SQUARE_THUMB_PATH.'functions.inc.php');
     35      }
     36
     37      if (isset($_GET['section']) and $_GET['section'] == 'settings')
     38      {
     39        include(SQUARE_THUMB_PATH.'photo_add_settings.php');
     40      }
     41    }
     42
     43    // Uploadify
     44    if (script_basename() == 'uploadify' and @$conf['upload_form_thumb_square'])
     45    {
     46      include(SQUARE_THUMB_PATH.'functions.inc.php');
     47    }
     48  }
    2449}
    2550
    26 add_event_handler('get_admin_plugin_menu_links', 'change_admin_thumb_link');
    27 
    28 
    2951?>
Note: See TracChangeset for help on using the changeset viewer.