Overview

Packages

  • CONTENIDO
  • Core
    • Authentication
    • Backend
    • Cache
    • CEC
    • Chain
    • ContentType
    • Database
    • Debug
    • Exception
    • Frontend
      • Search
      • URI
      • Util
    • GenericDB
      • Model
    • GUI
      • HTML
    • I18N
    • LayoutHandler
    • Log
    • Security
    • Session
    • Util
    • Validation
    • Versioning
    • XML
  • Module
    • ContentRssCreator
    • ContentSitemapHtml
    • ContentSitemapXml
    • ContentUserForum
    • NavigationTop
    • ScriptCookieDirective
  • mpAutoloaderClassMap
  • None
  • Plugin
    • ContentAllocation
    • CronjobOverview
    • FormAssistant
    • FrontendLogic
    • FrontendUsers
    • Linkchecker
    • ModRewrite
    • Newsletter
    • Repository
      • FrontendNavigation
      • KeywordDensity
    • SearchSolr
    • SmartyWrapper
    • UrlShortener
    • UserForum
    • Workflow
  • PluginManager
  • Setup
    • Form
    • GUI
    • Helper
      • Environment
      • Filesystem
      • MySQL
      • PHP
    • UpgradeJob
  • Smarty
    • Cacher
    • Compiler
    • Config
    • Debug
    • PluginsBlock
    • PluginsFilter
    • PluginsFunction
    • PluginsInternal
    • PluginsModifier
    • PluginsModifierCompiler
    • PluginsShared
    • Security
    • Template
    • TemplateResources
  • Swift
    • ByteStream
    • CharacterStream
    • Encoder
    • Events
    • KeyCache
    • Mailer
    • Mime
    • Plugins
    • Transport

Classes

  • Swift_FailoverTransport
  • Swift_LoadBalancedTransport
  • Swift_MailTransport
  • Swift_Plugins_Loggers_ArrayLogger
  • Swift_Plugins_Loggers_EchoLogger
  • Swift_SendmailTransport
  • Swift_SmtpTransport
  • Swift_Transport_AbstractSmtpTransport
  • Swift_Transport_Esmtp_Auth_CramMd5Authenticator
  • Swift_Transport_Esmtp_Auth_LoginAuthenticator
  • Swift_Transport_Esmtp_Auth_PlainAuthenticator
  • Swift_Transport_Esmtp_AuthHandler
  • Swift_Transport_EsmtpTransport
  • Swift_Transport_FailoverTransport
  • Swift_Transport_LoadBalancedTransport
  • Swift_Transport_MailTransport
  • Swift_Transport_SendmailTransport
  • Swift_Transport_SimpleMailInvoker
  • Swift_Transport_StreamBuffer

Interfaces

  • Swift_Plugins_Logger
  • Swift_Plugins_Pop_Pop3Exception
  • Swift_Transport
  • Swift_Transport_Esmtp_Authenticator
  • Swift_Transport_EsmtpHandler
  • Swift_Transport_IoBuffer
  • Swift_Transport_MailInvoker
  • Swift_Transport_SmtpAgent
  • Swift_TransportException
  • Overview
  • Package
  • Function
  • Todo
  • Download
  1: <?php
  2: /**
  3:  * This file contains the file collection and item class.
  4:  *
  5:  * @package Core
  6:  * @subpackage GenericDB_Model
  7:  * @version SVN Revision $Rev:$
  8:  *
  9:  * @author Timo Hummel
 10:  * @copyright four for business AG <www.4fb.de>
 11:  * @license http://www.contenido.org/license/LIZENZ.txt
 12:  * @link http://www.4fb.de
 13:  * @link http://www.contenido.org
 14:  */
 15: 
 16: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
 17: 
 18: /**
 19:  * File collection
 20:  *
 21:  * @package Core
 22:  * @subpackage GenericDB_Model
 23:  */
 24: class cApiFileCollection extends ItemCollection {
 25: 
 26:     /**
 27:      * Constructor
 28:      */
 29:     public function __construct() {
 30:         global $cfg;
 31:         parent::__construct($cfg['tab']['files'], 'idfile');
 32:         $this->_setItemClass('cApiFile');
 33: 
 34:         // set the join partners so that joins can be used via link() method
 35:         $this->_setJoinPartner('cApiAreaCollection');
 36:     }
 37: 
 38:     /**
 39:      * Creates a file item entry
 40:      * @param string $area
 41:      * @param string $filename
 42:      * @param string $filetype
 43:      * @return cApiFile
 44:      */
 45:     public function create($area, $filename, $filetype = 'main') {
 46:         $item = $this->createNewItem();
 47: 
 48:         if (is_string($area)) {
 49:             $c = new cApiArea();
 50:             $c->loadBy('name', $area);
 51: 
 52:             if ($c->isLoaded()) {
 53:                 $area = $c->get('idarea');
 54:             } else {
 55:                 $area = 0;
 56:                 cWarning(__FILE__, __LINE__, "Could not resolve area [$area] passed to method [create], assuming 0");
 57:             }
 58:         }
 59: 
 60:         $item->set('idarea', $area);
 61:         $item->set('filename', $filename);
 62: 
 63:         if ($filetype != 'main') {
 64:             $item->set('filetype', 'inc');
 65:         } else {
 66:             $item->set('filetype', 'main');
 67:         }
 68: 
 69:         $item->store();
 70: 
 71:         return $item;
 72:     }
 73: }
 74: 
 75: /**
 76:  * File item
 77:  *
 78:  * @package Core
 79:  * @subpackage GenericDB_Model
 80:  */
 81: class cApiFile extends Item {
 82: 
 83:     /**
 84:      * Constructor Function
 85:      *
 86:      * @param mixed $mId Specifies the ID of item to load
 87:      */
 88:     public function __construct($mId = false) {
 89:         global $cfg;
 90:         parent::__construct($cfg['tab']['files'], 'idfile');
 91:         $this->setFilters(array(
 92:             'addslashes'
 93:         ), array(
 94:             'stripslashes'
 95:         ));
 96:         if ($mId !== false) {
 97:             $this->loadByPrimaryKey($mId);
 98:         }
 99:     }
100: }
101: 
CMS CONTENIDO 4.9.7 API documentation generated by ApiGen