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