Overview

Packages

  • Core
    • Authentication
    • Backend
    • Cache
    • CEC
    • Chain
    • ContentType
    • Database
    • Datatype
    • Debug
    • Exception
    • Frontend
      • Search
      • URI
      • Util
    • GenericDB
      • Model
    • GUI
      • HTML
    • I18N
    • LayoutHandler
    • Log
    • Security
    • Session
    • Util
    • Validation
    • Versioning
    • XML
  • Module
    • ContentSitemapHtml
    • ContentSitemapXml
    • ContentUserForum
    • NavigationTop
  • 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

Classes

  • cVersion
  • cVersionFile
  • cVersionLayout
  • cVersionModule
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo
  1: <?php
  2: /**
  3:  * This file contains the module version class.
  4:  *
  5:  * @package    Core
  6:  * @subpackage Versioning
  7:  * @version    SVN Revision $Rev:$
  8:  *
  9:  * @author     Bilal Arslan, Timo Trautmann
 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:  * Super class for revision
 20:  *
 21:  * @package    Core
 22:  * @subpackage Versioning
 23:  */
 24: class cVersionModule extends cVersion {
 25: 
 26:     /**
 27:      * Type of modul
 28:      */
 29:     public $sModType;
 30: 
 31:     /**
 32:      * The class versionStyle object constructor, initializes class variables
 33:      *
 34:      * @param string $iIdMod The name of style file
 35:      * @param array $aCfg
 36:      * @param array $aCfgClient
 37:      * @param cDB $oDB
 38:      * @param int $iClient
 39:      * @param object $sArea
 40:      * @param object $iFrame
 41:      */
 42:     public function __construct($iIdMod, $aCfg, $aCfgClient, $oDB, $iClient, $sArea, $iFrame) {
 43:         // Set globals in main class
 44:         parent::__construct($aCfg, $aCfgClient, $oDB, $iClient, $sArea, $iFrame);
 45: 
 46:         // folder layout
 47:         $this->sType = 'module';
 48: 
 49:         $this->iIdentity = $iIdMod;
 50: 
 51:         $this->prune();
 52: 
 53:         $this->initRevisions();
 54: 
 55:         $this->_storeModuleInformation();
 56:     }
 57: 
 58:     protected function _storeModuleInformation() {
 59:         $iIdMod = cSecurity::toInteger($this->iIdentity);
 60: 
 61:         $oModule = new cApiModule($iIdMod);
 62: 
 63:         // create body node of XML file
 64:         $this->setData('Name', $oModule->getField('name'));
 65:         $this->setData('Type', $oModule->getField('type'));
 66:         $this->setData('Error', $oModule->getField('error'));
 67:         $this->setData('Description', $oModule->getField('description'));
 68:         $this->setData('Deletable', $oModule->getField('deletable'));
 69:         $this->setData('Template', $oModule->getField('template'));
 70:         $this->setData('Static', $oModule->getField('static'));
 71:         $this->setData('PackageGuid', $oModule->getField('package_guid'));
 72:         $this->setData('PackageData', $oModule->getField('package_data'));
 73: 
 74:         // retrieve module code from files
 75:         $oModuleHandler = new cModuleHandler($iIdMod);
 76:         $this->setData('CodeOutput', conHtmlSpecialChars($oModuleHandler->readOutput()));
 77:         $this->setData('CodeInput', conHtmlSpecialChars($oModuleHandler->readInput()));
 78:     }
 79: 
 80:     /**
 81:      * This function read an xml file nodes
 82:      *
 83:      * @param string $sPath Path to file
 84:      *
 85:      * @return array returns array width this four nodes
 86:      */
 87:     public function initXmlReader($sPath) {
 88:         $aResult = array();
 89:         if ($sPath != '') {
 90:             // Output this xml file
 91:             $sXML = simplexml_load_file($sPath);
 92: 
 93:             if ($sXML) {
 94:                 foreach ($sXML->body as $oBodyValues) {
 95:                     // if choose xml file read value an set it
 96:                     $aResult['name'] = $oBodyValues->Name;
 97:                     $aResult['desc'] = $oBodyValues->Description;
 98:                     $aResult['code_input'] = htmlspecialchars_decode($oBodyValues->CodeInput);
 99:                     $aResult['code_output'] = htmlspecialchars_decode($oBodyValues->CodeOutput);
100:                 }
101:             }
102:         }
103: 
104:         return $aResult;
105:     }
106: 
107:     /**
108:      * Function returns javascript which refreshes CONTENIDO frames for file
109:      * list an subnavigation.
110:      * This is neccessary, if filenames where changed, when a history entry is
111:      * restored
112:      *
113:      * @param int $iIdClient id of client which contains this file
114:      * @param string $sArea name of CONTENIDO area in which this procedure
115:      *        should be done
116:      * @param int $iIdLayout Id of layout to highlight
117:      * @param object $sess CONTENIDO session object
118:      *
119:      * @return string - Javascript for refrehing frames
120:      */
121:     public function renderReloadScript($sArea, $iIdModule, $sess) {
122:         $urlLeftBottom = $sess->url("main.php?area=$sArea&frame=2&idmod=$iIdModule");
123:         $sReloadScript = <<<JS
124: <script type="text/javascript">
125: (function(Con, $) {
126:     var frame = Con.getFrame('left_bottom');
127:     if (frame) {
128:         frame.location.href = '{$urlLeftBottom}';
129:     }
130: })(Con, Con.$);
131: </script>
132: JS;
133:         return $sReloadScript;
134:     }
135: 
136: }
137: 
CMS CONTENIDO 4.9.5 API documentation generated by ApiGen 2.8.0