<?php  // vim:set et ts=4 sw=4 sts=4:
# Copyright (C) 2003-2014 hipplay Inc.
#
# This is UNPUBLISHED PROPRIETARY SOURCE CODE OF hipplay Inc.
# The copyright notice above does not evidence any actual or intended
# publication of such source code. The contents of this file may not
# be disclosed to third parties, copied or duplicated in any form, in
# whole or in part, without the prior written permission of
# hipplay Inc.
#
namespace HipPlayConnect\FileSystem;



use HipPlayConnect\FileSystem\Types\FileTypes;

class AxDocumentFile extends AxRegularFile
{
    public static function getSubType( $name )
    {
        $fileTypes = FileTypes::getInstance();
        $subtype = '';
        
        switch ( strtolower( $fileTypes->getExt( $name ) ) )
        {
            case 'wps':
            case 'wpd':
            case 'wp':
            case 'sdw':
            case 'rtf':
            case 'pages':
            case 'odt':
            case 'doc':
            case 'docx':
            case 'sxw':
                $subtype = '-wordprocessing';
                break;

            case '123':
            case 'xls':
            case 'xlsx':
            case 'xlr':
            case 'wks.numbers':
            case 'ods':
            case 'qpw':
            case 'sdc':
                $subtype = '-spreadsheet';
                break;
                
            case 'odp':
            case 'ppt':
            case 'pptx':
            case 'sxi':
            case 'keynote':
            case 'prc':
                $subtype = '-presentation';
                break;
                
            case 'pdf':
                $subtype = '-pdf';
                break;
        }     
        
        return $subtype;   
    }
    
    public function getViewFSPath( $view )
    {
        return '/var/www/html/html/images/' . $view . 's/document' . self::getSubType( $this->fsPath ) . '.png';
    }
	
}
