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

Classes

  • cHTMLAlphaImage
  • cHTMLButtonLink
  • cHTMLErrorMessageList
  • cHTMLFoldableErrorMessage
  • cHTMLInfoMessage
  • cHTMLLanguageLink
  • cSetupMask
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo
  1: <?php
  2: /**
  3:  * This file contains the setup mask class.
  4:  *
  5:  * @package    Setup
  6:  * @subpackage GUI
  7:  * @author     Unknown
  8:  * @copyright  four for business AG <www.4fb.de>
  9:  * @license    http://www.contenido.org/license/LIZENZ.txt
 10:  * @link       http://www.4fb.de
 11:  * @link       http://www.contenido.org
 12:  */
 13: 
 14: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
 15: 
 16: /**
 17:  * Setup mask class.
 18:  *
 19:  * @package Setup
 20:  * @subpackage GUI
 21:  */
 22: class cSetupMask
 23: {
 24:     /**
 25:      * @var cTemplate|null
 26:      */
 27:     protected $_tpl = null;
 28: 
 29:     /**
 30:      * @var cTemplate|null
 31:      */
 32:     protected $_stepTemplateClass = null;
 33: 
 34:     /**
 35:      * @var string
 36:      */
 37:     protected $_stepTemplate = '';
 38: 
 39:     /**
 40:      * @var bool|int
 41:      */
 42:     protected $_step = 0;
 43: 
 44:     /**
 45:      * @var bool
 46:      */
 47:     protected $_navigationEnabled = false;
 48: 
 49:     /**
 50:      * @var string
 51:      */
 52:     protected $_backstep;
 53: 
 54:     /**
 55:      * @var string
 56:      */
 57:     protected $_nextstep;
 58: 
 59:     /**
 60:      * @var string
 61:      */
 62:     protected $_sHeader;
 63: 
 64:     /**
 65:      * cSetupMask constructor.
 66:      * @param string $stepTemplate
 67:      * @param bool $step
 68:      */
 69:     public function __construct($stepTemplate, $step = false) {
 70:         $this->_tpl = new cTemplate();
 71:         $this->_stepTemplateClass = new cTemplate();
 72: 
 73:         $this->_stepTemplate = $stepTemplate;
 74:         $this->_step = $step;
 75:     }
 76: 
 77:     /**
 78:      * Old constructor
 79:      * @deprecated [2016-04-14] This method is deprecated and is not needed any longer. Please use __construct() as constructor function.
 80:      * @param string $stepTemplate
 81:      * @param bool $step
 82:      */
 83:     public function cSetupMask($stepTemplate, $step = false) {
 84:         cDeprecated('This method is deprecated and is not needed any longer. Please use __construct() as constructor function.');
 85:         $this->__construct($stepTemplate, $step);
 86:     }
 87: 
 88:     /**
 89:      * @param $backstep string
 90:      * @param $nextstep string
 91:      */
 92:     public function setNavigation($backstep, $nextstep) {
 93:         $this->_navigationEnabled = true;
 94:         $this->_backstep = $backstep;
 95:         $this->_nextstep = $nextstep;
 96:     }
 97: 
 98:     /**
 99:      * @param $header string
100:      */
101:     public function setHeader($header) {
102:         if (isset($_SESSION['setuptype'])) {
103:             $setupType = $_SESSION['setuptype'];
104:         } else {
105:             $setupType = '';
106:         }
107: 
108:         switch ($setupType) {
109:             case "setup":
110:                 $this->_sHeader = 'Setup - ' . $header;
111:                 break;
112:             case "upgrade":
113:                 $this->_sHeader = 'Upgrade - ' . $header;
114:                 break;
115:             default:
116:                 $this->_sHeader = $header;
117:                 break;
118:         }
119:     }
120: 
121:     protected function _createNavigation() {
122:         $link = new cHTMLLink("#");
123: 
124:         $link->attachEventDefinition("pageAttach", "onclick", "document.setupform.step.value = '".$this->_nextstep."';");
125:         $link->attachEventDefinition("submitAttach", "onclick", "document.setupform.submit();");
126:         $link->setClass("nav");
127:         $link->setContent("<span>&raquo;</span>");
128: 
129:         if ($this->_nextstep != "") {
130:             $this->_stepTemplateClass->set("s", "NEXT", $link->render());
131:         } else {
132:             $this->_stepTemplateClass->set("s", "NEXT", '');
133:         }
134: 
135:         $backlink = new cHTMLLink("#");
136:         $backlink->attachEventDefinition("pageAttach", "onclick", "document.setupform.step.value = '".$this->_backstep."';");
137:         $backlink->attachEventDefinition("submitAttach", "onclick", "document.setupform.submit();");
138:         $backlink->setClass("nav navBack");
139:         $backlink->setContent("<span>&laquo;</span>");
140:         $this->_stepTemplateClass->set("s", "BACK", $backlink->render());
141:     }
142: 
143:     public function render() {
144:         if ($this->_navigationEnabled) {
145:             $this->_createNavigation();
146:         }
147: 
148:         if ($this->_step !== false) {
149:             $this->_tpl->set("s", "STEPS", cGenerateSetupStepsDisplay($this->_step));
150:         } else {
151:             $this->_tpl->set("s", "STEPS", "");
152:         }
153: 
154:         $this->_tpl->set("s", "HEADER", $this->_sHeader);
155:         $this->_tpl->set("s", "TITLE", "CONTENIDO Setup - " . $this->_sHeader);
156: 
157:         $this->_tpl->set("s", "CONTENT", $this->_stepTemplateClass->generate($this->_stepTemplate, true, false));
158: 
159:         $this->_tpl->generate("templates/setup.tpl", false, false);
160:     }
161: 
162:     public function renderSystemCheck() {
163:         if ($this->_navigationEnabled) {
164:             $this->_createNavigation();
165:         }
166: 
167:         if ($this->_step !== false) {
168:             $this->_tpl->set("s", "STEPS", '');
169:         } else {
170:             $this->_tpl->set("s", "STEPS", '');
171:         }
172: 
173:         $this->_tpl->set("s", "HEADER", '');
174:         $this->_tpl->set("s", "TITLE", '');
175: 
176:         $this->_tpl->set("s", "CONTENT", $this->_stepTemplateClass->generate($this->_stepTemplate, true, false));
177: 
178:         $this->_tpl->generate("templates/systemcheck/setup.tpl", false, false);
179:     }
180: }
181: 
182: ?>
CMS CONTENIDO 4.9.11 API documentation generated by ApiGen 2.8.0