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 generic file overviewer class.
  4: *
  5: * @package Core
  6: * @subpackage GUI
  7: * @version SVN Revision $Rev:$
  8: *
  9: * @author Mischa Holz
 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: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
 16: 
 17: /**
 18:  * Displays files in the left bottom frame
 19:  * @package Core
 20:  * @subpackage GUI
 21:  */
 22: class cGuiFileOverview extends cGuiPage {
 23: 
 24:     /**
 25:      * Path to the directory that is being displayed
 26:      * @var string
 27:      */
 28:     protected $directory;
 29: 
 30:     /**
 31:      * Name of the marked up file
 32:      * @var string
 33:      */
 34:     protected $markedFile;
 35: 
 36:     /**
 37:      * Type of the file information in the database
 38:      * @var string
 39:      */
 40:     protected $fileInfoType;
 41: 
 42:     /**
 43:      * Selected file extension
 44:      * @var string
 45:      */
 46:     protected $fileExtension;
 47: 
 48:     /**
 49:      * Default constructor. Initializes the class for the directory
 50:      * @param string $dir
 51:      * @param string $markedFile
 52:      * @param string $fileInfoType
 53:      */
 54:     public function __construct($dir, $markedFile = '', $fileInfoType = '') {
 55:         parent::__construct('generic_file_overview');
 56: 
 57:         // assign properties
 58:         $this->directory = $dir;
 59:         $this->markedFile = $markedFile;
 60:         $this->fileInfoType = $fileInfoType;
 61:     }
 62: 
 63:     /**
 64:      * Display only special file extensions
 65:      *
 66:      * @param array | string $extension Name of extensions
 67:      */
 68:     public function setFileExtension($extension) {
 69:         if (cSecurity::isString($extension)) {
 70:             $extension = array($extension);
 71:         }
 72:         $this->fileExtension = $extension;
 73:     }
 74: 
 75:     /**
 76:      * Renders the page
 77:      * @see cGuiPage::render()
 78:      */
 79:     public function render() {
 80:         global $area, $cfg, $perm;
 81: 
 82:         // create an array of all files in the directory
 83:         $files = array();
 84:         foreach (new DirectoryIterator($this->directory) as $file) {
 85:             if ($file->isDir()) {
 86:                 continue;
 87:             }
 88:             if (!empty($this->fileExtension) && !in_array($file->getExtension(), $this->fileExtension)) {
 89:                 continue;
 90:             }
 91:             $files[] = $file->getBasename();
 92:         }
 93: 
 94:         // sort the files
 95:         sort($files);
 96: 
 97:         // assign variables for the JavaScript
 98:         $this->set('s', 'JS_AREA', $area);
 99:         $this->set('s', 'JS_ACTION_DELETE', $area . '_delete');
100: 
101:         // assign variables for every file
102:         $fileInfos = new cApiFileInformationCollection();
103:         foreach($files as $file) {
104:             if($this->fileInfoType != '') {
105:                 $fileInfo = $fileInfos->getFileInformation($file, $this->fileInfoTyp);
106:                 $this->set('d', 'DESCRIPTION', $fileInfo['description']);
107:             } else {
108:                 $this->set('d', 'DESCRIPTION', '');
109:             }
110:             $this->set('d', 'AREA', $area);
111:             $this->set('d', 'ACTION', $area . '_edit');
112:             $this->set('d', 'FILENAME', $file);
113:             if($file == $this->markedFile) {
114:                 $this->set('d', 'MARKED', 'marked');
115:             } else {
116:                 $this->set('d', 'MARKED', '');
117:             }
118:             if(getEffectiveSetting("client", "readonly", "false") == "true" || (!$perm->have_perm_area_action($area, $area . "_delete"))) {
119:                 $this->set('d', 'DELETE_IMAGE', $cfg['path']['images'] . 'delete_inact.gif');
120:             } else {
121:                 $this->set('d', 'DELETE_IMAGE', $cfg['path']['images'] . 'delete.gif');
122:             }
123: 
124:             $this->next();
125:         }
126: 
127:         // call the render method of cGuiPage to display the webpage
128:         parent::render();
129:     }
130: 
131: }
132: 
CMS CONTENIDO 4.9.7 API documentation generated by ApiGen