source: branches/MootoolsFileManager-Update/plugins/MootoolsFileManager/XinhaFileManager.php @ 1308

Last change on this file since 1308 was 1308, checked in by gogo, 8 years ago

Part 1: removing old mfm code

File size: 2.1 KB
Line 
1<?php
2/*
3 * Script: XinhaFileManager.php
4 *   MooTools FileManager - Backend for the Xinha editor
5 *
6 *   Derived class which includes special tweaks to make MFM work with Xinha.
7 *
8 * Note: derive from FileManagerWithAlias instead when you need aliasing support; this is left as an exercise
9 *       for the reader. (A non-trivial exercise. You'll need to alias images_dir to images_url
10 *           and files_dir to files_url, at least.
11 *
12 * Authors:
13 *  - Ger Hobbelt (http://hebbut.net)
14 *
15 * License:
16 *   MIT-style license.
17 *
18 * Copyright:
19 *   Copyright (c) 2011 [Ger Hobbelt](http://hobbelt.com)
20 *
21 * Dependencies:
22 *   - FileManager.php
23 */
24
25require_once(str_replace('\\', '/', dirname(__FILE__)) . '/mootools-filemanager/Assets/Connector/FileManagerWithAliasSupport.php');
26
27
28class XinhaFileManager extends FileManagerWithAliasSupport
29{
30        public function __construct($options)
31        {
32    if(isset($options['images_dir']) && isset($options['images_url']))
33    {
34      $options['Aliases'][$options['images_url']] = $options['images_dir'];
35      $options['directory'] = $options['images_url'];
36    }
37   
38    if(isset($options['files_dir']) && isset($options['files_url']))
39    {
40      $options['Aliases'][$options['files_url']] = $options['files_dir'];
41      $options['directory'] = $options['files_url'];
42    }
43   
44    if(isset($options['thumbs_dir']) && isset($options['thumbs_url']))
45    {
46      $options['Aliases'][$options['thumbs_url']] = $options['thumbs_dir'];
47      $options['thumbnailPath'] = $options['thumbs_url'];
48    }
49   
50    if(isset($options['suggestedMaxImageDimension']))
51    {
52      $options['maxImageDimension'] = $options['suggestedMaxImageDimension'];
53    }
54       
55                parent::__construct($options);
56        }
57
58        // when you want img.preview style max-width = 164px (was before: max-width: 140px)
59        //
60        // Note that this will force all 250px thumbnails to a maximum width of 140px
61        /*
62        public function getThumb($meta, $path, $width, $height, $onlyIfExistsInCache = false)
63        {
64                return parent::getThumb($meta, $path, min(164, $width), $height, $onlyIfExistsInCache);
65        }
66        */
67}
68
69
Note: See TracBrowser for help on using the repository browser.