1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12:
13:
14: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
15:
16: 17: 18: 19: 20: 21:
22: class cSetupClientMode extends cSetupMask {
23:
24: 25: 26: 27: 28: 29:
30: public function __construct($step, $previous, $next) {
31:
32: cSetupMask::__construct("templates/setup/forms/clientmode.tpl", $step);
33: $this->setHeader(i18n("Example Client", "setup"));
34: $this->_stepTemplateClass->set("s", "TITLE", i18n("Example Client", "setup"));
35: $this->_stepTemplateClass->set("s", "DESCRIPTION", i18n("If you are new to CONTENIDO, you should create an example client to start working with.", "setup"));
36:
37: cArray::initializeKey($_SESSION, "clientmode", "");
38:
39: $folders = "";
40: $moduleFolderNotEmpty = false;
41: if (cFileHandler::exists("../cms/css")) {
42: if (!cDirHandler::isDirectoryEmpty("../cms/css")) {
43: $folders .= "cms/css/, ";
44: }
45: }
46: if (cFileHandler::exists("../cms/js")) {
47: if (!cDirHandler::isDirectoryEmpty("../cms/js")) {
48: $folders .= "cms/js/, ";
49: }
50: }
51: if (cFileHandler::exists("../cms/templates")) {
52: if (!cDirHandler::isDirectoryEmpty("../cms/templates")) {
53: $folders .= "cms/templates/, ";
54: }
55: }
56: if (cFileHandler::exists("../cms/data/modules")) {
57: if (!cDirHandler::isDirectoryEmpty("../cms/data/modules")) {
58: $folders .= "cms/data/modules/, ";
59: $moduleFolderNotEmpty = true;
60: }
61: }
62: if (cFileHandler::exists("../cms/data/layouts")) {
63: if (!cDirHandler::isDirectoryEmpty("../cms/data/layouts")) {
64: $folders .= "cms/data/layouts/, ";
65: }
66: }
67:
68: $this->_stepTemplateClass->set("s", "FOLDER_MESSAGE_EXAMPLES", "");
69: $this->_stepTemplateClass->set("s", "FOLDER_MESSAGE_MODULES", "");
70: if (cString::getStringLength($folders) > 0) {
71: $folders = cString::getPartOfString($folders, 0, cString::getStringLength($folders) - 2);
72: }
73:
74: $exampleMessage = i18n("PLEASE NOTE: Some folders (%s) which are used by the example client aren't empty. THESE WILL BE OVERWRITTEN", "setup");
75: $moduleMessage = i18n("PLEASE NOTE: The cms/data/modules folder is not empty. IT WILL BE OVERWRITTEN", "setup");
76:
77: $aChoices = array(
78: "CLIENTEXAMPLES" => i18n("Client with example modules and example content", "setup") . ((cString::getStringLength($folders) > 0) ? " <span class='additionalInfo'>(" . sprintf($exampleMessage, $folders) . ")</span>" : ""),
79: "CLIENTMODULES" => i18n("Client with example modules, but without example content", "setup") . (($moduleFolderNotEmpty) ? " <span class='additionalInfo'>(" . $moduleMessage . ")</span>" : ""),
80: "NOCLIENT" => i18n("Don't create client", "setup")
81: );
82:
83: foreach ($aChoices as $sKey => $sChoice) {
84: $oRadio = new cHTMLRadiobutton("clientmode", $sKey);
85: $oRadio->setLabelText(" ");
86: $oRadio->setStyle('width:auto;border:0;');
87:
88: if ($_SESSION["clientmode"] == $sKey || ($_SESSION["clientmode"] == "" && $sKey == "CLIENTEXAMPLES")) {
89: $oRadio->setChecked("checked");
90: }
91:
92: $oLabel = new cHTMLLabel($sChoice, $oRadio->getID());
93:
94: $this->_stepTemplateClass->set("s", "CONTROL_" . $sKey, $oRadio->render());
95: $this->_stepTemplateClass->set("s", "LABEL_" . $sKey, $oLabel->render());
96: }
97:
98: $this->setNavigation($previous, $next);
99: }
100:
101: 102: 103: 104: 105: 106: 107:
108: function cSetupClientMode($step, $previous, $next) {
109: cDeprecated('This method is deprecated and is not needed any longer. Please use __construct() as constructor function.');
110: $this->__construct($step, $previous, $next);
111: }
112:
113: }
114:
115: ?>