PHP Classes

File: include/common.php

Recommend this page to a friend!
  Classes of Gregory Mage   xmdoc   include/common.php   Download  
File: include/common.php
Role: Example script
Content type: text/plain
Description: Example script
Class: xmdoc
XOOPS CMS module to manage files attached to posts
Author: By
Last change:
Date: 3 years ago
Size: 1,956 bytes
 

Contents

Class file image Download
<?php
/*
 You may not change or alter any portion of this comment or credits
 of supporting developers from this source code or any supporting source code
 which is considered copyrighted (c) material of the original comment or credit authors.

 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/

/**
 * xmdoc module
 *
 * @copyright XOOPS Project (https://xoops.org)
 * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
 * @author Mage Gregory (AKA Mage)
 */
class_exists('\Xmf\Module\Admin') or die('XMF is required.');
use
Xmf\Module\Helper;
$helper = Helper::getHelper(basename(dirname(__DIR__)));

// Get handler
$categoryHandler = $helper->getHandler('xmdoc_category');
$documentHandler = $helper->getHandler('xmdoc_document');
$docdataHandler = $helper->getHandler('xmdoc_docdata');
$downlimitHandler = $helper->getHandler('xmdoc_downlimit');

// Path & url Config

if (method_exists($helper,'uploadUrl')) {
   
$url_logo_category = $helper->uploadUrl('images/category/');
   
$path_logo_category = $helper->uploadPath('images/category/');
   
$url_logo_document = $helper->uploadUrl('images/document/');
   
$path_logo_document = $helper->uploadPath('images/document/');
   
$url_document = $helper->uploadUrl('documents/');
   
$path_document = $helper->uploadPath('documents/');
} else {
   
$url_logo_category = XOOPS_UPLOAD_URL . '/xmdoc/images/category/';
   
$path_logo_category = XOOPS_UPLOAD_PATH . '/xmdoc/images/category/';
   
$url_logo_document = XOOPS_UPLOAD_URL . '/xmdoc/images/document/';
   
$path_logo_document = XOOPS_UPLOAD_PATH . '/xmdoc/images/document/';
   
$url_document = XOOPS_UPLOAD_URL . '/xmdoc/documents/';
   
$path_document = XOOPS_UPLOAD_PATH . '/xmdoc/documents/';
}


$upload_size = $helper->getConfig('general_maxuploadsize', 104858);