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