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