public function testZipDirectory() { $objFileSystem = new class_filesystem(); echo "\t creating test structure\n"; $objFileSystem->folderCreate("/files/cache/ziptest"); $this->assertFileExists(_realpath_ . "/files/cache/ziptest", __FILE__ . " checkFileNotExists"); $objFileSystem->folderCreate("/files/cache/ziptest/subdir"); $objFileSystem->fileCopy(class_resourceloader::getInstance()->getCorePathForModule("module_system") . "/module_system/metadata.xml", "/files/cache/ziptest/licence_lgpl1.txt"); $objFileSystem->fileCopy(class_resourceloader::getInstance()->getCorePathForModule("module_system") . "/module_system/metadata.xml", "/files/cache/ziptest/licence_lgpl2.txt"); $objFileSystem->fileCopy(class_resourceloader::getInstance()->getCorePathForModule("module_system") . "/module_system/metadata.xml", "/files/cache/ziptest/subdir/licence_lgpl.txt"); echo "\ttesting class_zip...\n"; $objZip = new class_zip(); echo "\topening test.zip\n"; $this->assertTrue($objZip->openArchiveForWriting("/files/cache/test.zip"), __FILE__ . " openArchive"); $this->assertTrue($objZip->addFolder("/files/cache/ziptest"), __FILE__ . " addFolder"); $this->assertTrue($objZip->closeArchive(), __FILE__ . " closeArchive"); $this->assertFileExists(_realpath_ . "/files/cache/test.zip", __FILE__ . " checkFileExists"); echo "\textracting files\n"; $objFileSystem->folderCreate("/files/cache/zipextract"); $this->assertFileExists(_realpath_ . "/files/cache/zipextract", __FILE__ . " checkFileExists"); $objZip = new class_zip(); $this->assertTrue($objZip->extractArchive("/files/cache/test.zip", "/files/cache/zipextract"), __FILE__ . " extractArchive"); $this->assertFileExists(_realpath_ . "/files/cache/zipextract/files/cache/ziptest/licence_lgpl1.txt", __FILE__ . " extractArchive"); $this->assertFileExists(_realpath_ . "/files/cache/zipextract/files/cache/ziptest/licence_lgpl2.txt", __FILE__ . " extractArchive"); $this->assertFileExists(_realpath_ . "/files/cache/zipextract/files/cache/ziptest/subdir/licence_lgpl.txt", __FILE__ . " extractArchive"); echo "\tremoving testfile\n"; $this->assertTrue($objFileSystem->fileDelete("/files/cache/test.zip"), __FILE__ . " deleteFile"); $this->assertFileNotExists(_realpath_ . "/files/cache/test.zip", __FILE__ . " checkFileNotExists"); $objFileSystem->folderDeleteRecursive("/files/cache/ziptest"); $this->assertFileNotExists(_realpath_ . "/files/cache/ziptest", __FILE__ . " checkFileNotExists"); $objFileSystem->folderDeleteRecursive("/files/cache/zipextract"); $this->assertFileNotExists(_realpath_ . "/files/cache/zipextract", __FILE__ . " checkFileNotExists"); }
public function testFileSync() { echo "test mediamanager...\n"; if (class_module_system_module::getModuleByName("samplecontent") == null || !is_file(_realpath_ . "/files/images/samples/IMG_3000.JPG")) { return; } $objFilesystem = new class_filesystem(); $objFilesystem->folderCreate(_filespath_ . "/images/autotest"); $objFilesystem->fileCopy(_filespath_ . "/images/samples/IMG_3000.JPG", _filespath_ . "/images/autotest/IMG_3000.jpg"); $objFilesystem->fileCopy(_filespath_ . "/images/samples/IMG_3000.JPG", _filespath_ . "/images/autotest/IMG_3000.png"); $objFilesystem->fileCopy(_filespath_ . "/images/samples/IMG_3000.JPG", _filespath_ . "/images/autotest/PA021805.JPG"); $objFilesystem->fileCopy(_filespath_ . "/images/samples/IMG_3000.JPG", _filespath_ . "/images/autotest/test.txt"); $objRepo = new class_module_mediamanager_repo(); $objRepo->setStrPath(_filespath_ . "/images/autotest"); $objRepo->setStrTitle("autotest repo"); $objRepo->setStrViewFilter(".jpg,.png"); $objRepo->updateObjectToDb(); $objRepo->syncRepo(); $arrFiles = class_module_mediamanager_file::loadFilesDB($objRepo->getSystemid()); $this->assertEquals(3, count($arrFiles)); foreach ($arrFiles as $objOneFile) { $objOneFile->deleteObjectFromDatabase(); } $objRepo->deleteObjectFromDatabase(); $arrFiles = $objFilesystem->getFilelist(_filespath_ . "/images/autotest"); $this->assertEquals(1, count($arrFiles)); $this->assertEquals("test.txt", array_values($arrFiles)[0]); }
public function install() { $strReturn = ""; $strReturn .= "Installing table packageserver_log...\n"; $arrFields = array(); $arrFields["log_id"] = array("char20", false); $arrFields["log_query"] = array("text", true); $arrFields["log_ip"] = array("char254", true); $arrFields["log_hostname"] = array("char254", true); $arrFields["log_date"] = array("long", true); if (!$this->objDB->createTable("packageserver_log", $arrFields, array("log_id"), array("log_date"), false)) { $strReturn .= "An error occurred! ...\n"; } //register the module $this->registerModule("packageserver", _packageserver_module_id_, "class_module_packageserver_portal.php", "class_module_packageserver_admin.php", $this->objMetadata->getStrVersion(), true); $strReturn .= "creating package-upload-repository...\n"; $objFilesytem = new class_filesystem(); $objFilesytem->folderCreate("/files/packages"); $objRepo = new class_module_mediamanager_repo(); $objRepo->setStrPath("/files/packages"); $objRepo->setStrViewFilter(".zip"); $objRepo->setStrUploadFilter(".zip"); $objRepo->setStrTitle("Packageserver packages"); $objRepo->updateObjectToDb(); class_carrier::getInstance()->getObjRights()->addGroupToRight(class_module_system_setting::getConfigValue("_guests_group_id_"), $objRepo->getSystemid(), class_rights::$STR_RIGHT_RIGHT2); $strReturn .= "Registering system-constants...\n"; $this->registerConstant("_packageserver_repo_id_", "", class_module_system_setting::$int_TYPE_STRING, _packageserver_module_id_); $strReturn .= "Setting aspect assignments...\n"; if (class_module_system_aspect::getAspectByName("content") != null) { $objModule = class_module_system_module::getModuleByName($this->objMetadata->getStrTitle()); $objModule->setStrAspect(class_module_system_aspect::getAspectByName("content")->getSystemid()); $objModule->updateObjectToDb(); } return $strReturn; }
public function testExtractAndMove() { $objFilesystem = new class_filesystem(); $objFilesystem->folderCreate(_projectpath_ . "/temp/moduletest"); file_put_contents(_realpath_ . _projectpath_ . "/temp/moduletest/metadata.xml", $this->getStrMetadata()); $objFilesystem->folderCreate(_projectpath_ . "/temp/moduletest/system"); file_put_contents(_realpath_ . _projectpath_ . "/temp/moduletest/system/test.txt", $this->getStrMetadata()); $objZip = new class_zip(); $objZip->openArchiveForWriting(_projectpath_ . "/temp/autotest.zip"); $objZip->addFile(_projectpath_ . "/temp/moduletest/metadata.xml", "/metadata.xml"); $objZip->addFile(_projectpath_ . "/temp/moduletest/system/test.txt", "/system/test.txt"); $objZip->closeArchive(); $objFilesystem->folderDeleteRecursive(_projectpath_ . "/temp/moduletest/"); $objManager = new class_module_packagemanager_manager(); $objPackageManager = $objManager->getPackageManagerForPath(_projectpath_ . "/temp/autotest.zip"); $this->assertEquals(get_class($objPackageManager), "class_module_packagemanager_packagemanager_module"); $objPackageManager = $objManager->extractPackage(_projectpath_ . "/temp/autotest.zip"); $this->assertEquals(get_class($objPackageManager), "class_module_packagemanager_packagemanager_module"); $objPackageManager->move2Filesystem(); $this->assertFileExists(_realpath_ . "/core/module_autotest/metadata.xml"); $this->assertFileExists(_realpath_ . "/core/module_autotest/system/test.txt"); $objMetadata = new class_module_packagemanager_metadata(); $objMetadata->autoInit("/core/module_autotest/"); $this->assertEquals("Autotest", $objMetadata->getStrTitle()); $this->assertEquals("", $objMetadata->getStrDescription()); $this->assertEquals("3.9.1", $objMetadata->getStrVersion()); $this->assertEquals("Kajona Team", $objMetadata->getStrAuthor()); $this->assertEquals("module_autotest", $objMetadata->getStrTarget()); $this->assertEquals(class_module_packagemanager_manager::STR_TYPE_MODULE, $objMetadata->getStrType()); $this->assertEquals(false, $objMetadata->getBitProvidesInstaller()); $arrRequired = $objMetadata->getArrRequiredModules(); $arrModules = array_keys($arrRequired); $arrVersion = array_values($arrRequired); $this->assertEquals("system", $arrModules[0]); $this->assertEquals("3.4.1", $arrVersion[0]); $this->assertEquals("pages", $arrModules[1]); $this->assertEquals("3.4.2", $arrVersion[1]); $arrImages = $objMetadata->getArrScreenshots(); $this->assertEquals(1, count($arrImages)); $this->assertEquals("/test.jpg", $arrImages[0]); $objFilesystem->folderDeleteRecursive("/core/module_autotest"); $objFilesystem->fileDelete(_projectpath_ . "/temp/autotest.zip"); }
public function testJsonList() { $objFilesystem = new class_filesystem(); $objFilesystem->folderCreate("/files/packageservertest"); $objFilesystem->folderCreate("/files/packageservertest/t"); file_put_contents(_realpath_ . "/files/packageservertest/t/metadata.xml", $this->getStrMetadata()); $objFilesystem->folderCreate("/files/packageservertest/t/system"); file_put_contents(_realpath_ . "/files/packageservertest/t/system/test.txt", $this->getStrMetadata()); $objZip = new class_zip(); $objZip->openArchiveForWriting("/files/packageservertest/autotest.zip"); $objZip->addFile("/files/packageservertest/t/metadata.xml", "/metadata.xml"); $objZip->addFile("/files/packageservertest/t/system/test.txt", "/system/test.txt"); $objZip->closeArchive(); $objFilesystem->folderDeleteRecursive("/files/packageservertest/t"); $objMediamanagerRepo = new class_module_mediamanager_repo(); $objMediamanagerRepo->setStrPath("/files/packageservertest"); $objMediamanagerRepo->setStrTitle("autotest packages"); $objMediamanagerRepo->updateObjectToDb(); class_module_mediamanager_file::syncRecursive($objMediamanagerRepo->getSystemid(), $objMediamanagerRepo->getStrPath()); /** @var $objPortalServer class_module_packageserver_portal */ $objPortalServer = class_module_system_module::getModuleByName("packageserver")->getPortalInstanceOfConcreteModule(); $strJson = $objPortalServer->action("list"); $this->assertNotNull($strJson); $arrData = json_decode($strJson, true); $this->assertTrue(isset($arrData["numberOfTotalItems"])); $this->assertTrue(isset($arrData["items"])); $this->assertTrue(isset($arrData["protocolVersion"])); $this->assertEquals(1, count($arrData["items"])); $arrItem = $arrData["items"][0]; $this->assertTrue(isset($arrItem["systemid"])); $this->assertTrue(isset($arrItem["title"])); $this->assertTrue(isset($arrItem["version"])); $this->assertTrue(isset($arrItem["description"])); $this->assertTrue(isset($arrItem["type"])); $this->assertEquals("Autotest", $arrItem["title"]); $this->assertEquals("3.9.1", $arrItem["version"]); $this->assertEquals("demo", $arrItem["description"]); $this->assertEquals("MODULE", $arrItem["type"]); $objMediamanagerRepo->deleteObjectFromDatabase(); $objFilesystem->fileDelete("/files/packageservertest/autotest.zip"); }
/** * @permissions edit * @return string */ protected function actionCopyPack() { $objForm = $this->getPackAdminForm(); $strPackName = $this->getParam("pack_name"); $strPackName = createFilename($strPackName, true); if ($strPackName != "" && is_dir(_realpath_ . _templatepath_ . "/" . $strPackName)) { $objForm->addValidationError("name", $this->getLang("pack_folder_existing")); } if (!$objForm->validateForm()) { return $this->actionNew($objForm); } $objFilesystem = new class_filesystem(); $objFilesystem->folderCreate(_templatepath_ . "/" . $strPackName); $objFilesystem->folderCreate(_templatepath_ . "/" . $strPackName . "/tpl"); $objFilesystem->folderCreate(_templatepath_ . "/" . $strPackName . "/css"); $objFilesystem->folderCreate(_templatepath_ . "/" . $strPackName . "/js"); $arrModules = $this->getParam("pack_modules"); foreach ($arrModules as $strName => $strValue) { if ($strValue != "") { $objFilesystem->folderCopyRecursive(class_resourceloader::getInstance()->getCorePathForModule($strName) . "/" . $strName . "/templates/default", _templatepath_ . "/" . $strPackName); } } class_resourceloader::getInstance()->flushCache(); class_classloader::getInstance()->flushCache(); class_reflection::flushCache(); $this->adminReload(class_link::getLinkAdminHref($this->getArrModule("modul"), "listTemplates")); return ""; }
/** * Tries to save the passed file. * Therefore, the following post-params should be given: * action = fileUpload * folder = the folder to store the file within * systemid = the filemanagers' repo-id * inputElement = name of the inputElement * * @return string * @permissions right1 */ protected function actionFileupload() { $strReturn = ""; /** @var class_module_mediamanager_repo|class_module_mediamanager_file $objFile */ $objFile = class_objectfactory::getInstance()->getObject($this->getSystemid()); /** * @var class_module_mediamanager_repo */ $objRepo = null; if ($objFile instanceof class_module_mediamanager_file) { $strFolder = $objFile->getStrFilename(); if (!$objFile->rightEdit() || $objFile->getIntType() != class_module_mediamanager_file::$INT_TYPE_FOLDER) { class_response_object::getInstance()->setStrStatusCode(class_http_statuscodes::SC_UNAUTHORIZED); $strReturn .= "<message><error>" . xmlSafeString($this->getLang("commons_error_permissions")) . "</error></message>"; return $strReturn; } $objRepo = class_objectfactory::getInstance()->getObject($objFile->getPrevId()); while (!$objRepo instanceof class_module_mediamanager_repo) { $objRepo = class_objectfactory::getInstance()->getObject($objRepo->getPrevId()); } } elseif ($objFile instanceof class_module_mediamanager_repo) { $objRepo = $objFile; $strFolder = $objFile->getStrPath(); if (!$objFile->rightEdit()) { class_response_object::getInstance()->setStrStatusCode(class_http_statuscodes::SC_UNAUTHORIZED); $strReturn .= "<message><error>" . xmlSafeString($this->getLang("commons_error_permissions")) . "</error></message>"; return $strReturn; } } else { class_response_object::getInstance()->setStrStatusCode(class_http_statuscodes::SC_UNAUTHORIZED); $strReturn .= "<message><error>" . xmlSafeString($this->getLang("commons_error_permissions")) . "</error></message>"; return $strReturn; } //Handle the fileupload $arrSource = $this->getParam($this->getParam("inputElement")); $bitJsonResponse = $this->getParam("jsonResponse") != ""; $bitPostData = false; if (is_array($arrSource)) { $strFilename = $arrSource["name"]; } else { $bitPostData = getPostRawData() != ""; $strFilename = $arrSource; } $strTarget = $strFolder . "/" . createFilename($strFilename); $objFilesystem = new class_filesystem(); if (!file_exists(_realpath_ . "/" . $strFolder)) { $objFilesystem->folderCreate($strFolder, true); } if ($objFilesystem->isWritable($strFolder)) { //Check file for correct filters $arrAllowed = explode(",", $objRepo->getStrUploadFilter()); $strSuffix = uniStrtolower(uniSubstr($strFilename, uniStrrpos($strFilename, "."))); if ($objRepo->getStrUploadFilter() == "" || in_array($strSuffix, $arrAllowed)) { if ($bitPostData) { $objFilesystem = new class_filesystem(); $objFilesystem->openFilePointer($strTarget); $bitCopySuccess = $objFilesystem->writeToFile(getPostRawData()); $objFilesystem->closeFilePointer(); } else { $bitCopySuccess = $objFilesystem->copyUpload($strTarget, $arrSource["tmp_name"]); } if ($bitCopySuccess) { if ($bitJsonResponse) { $strReturn = json_encode(array('success' => true)); } else { $strReturn .= "<message>" . $this->getLang("xmlupload_success") . "</message>"; } class_logger::getInstance()->addLogRow("uploaded file " . $strTarget, class_logger::$levelInfo); $objRepo->syncRepo(); } else { if ($bitJsonResponse) { $strReturn .= json_encode(array('error' => $this->getLang("xmlupload_error_copyUpload"))); } else { $strReturn .= "<message><error>" . $this->getLang("xmlupload_error_copyUpload") . "</error></message>"; } } } else { class_response_object::getInstance()->setStrStatusCode(class_http_statuscodes::SC_BADREQUEST); if ($bitJsonResponse) { $strReturn .= json_encode(array('error' => $this->getLang("xmlupload_error_filter"))); } else { $strReturn .= "<message><error>" . $this->getLang("xmlupload_error_filter") . "</error></message>"; } } } else { class_response_object::getInstance()->setStrStatusCode(class_http_statuscodes::SC_INTERNAL_SERVER_ERROR); if ($bitJsonResponse) { $strReturn .= json_encode(array('error' => $this->getLang("xmlupload_error_notWritable"))); } else { $strReturn .= "<message><error>" . xmlSafeString($this->getLang("xmlupload_error_notWritable")) . "</error></message>"; } } if ($bitJsonResponse) { //disabled for ie. otherwise the upload won't work due to the headers. class_response_object::getInstance()->setStrResponseType(class_http_responsetypes::STR_TYPE_HTML); //class_response_object::getInstance()->setStResponseType(class_http_responsetypes::STR_TYPE_JSON); } @unlink($arrSource["tmp_name"]); return $strReturn; }
public function test() { echo "\ttesting class_image...\n"; $objImage = new class_image(); $objImage->setIntHeight(10); $objImage->setIntWidth(10); $objImage->createBlankImage(); $objColor = $objImage->registerColor(0, 0, 0); $objImage->drawFilledRectangle(0, 0, 10, 10, $objColor); if (!is_dir(_realpath_ . "/files/images/samples/")) { $objFS = new class_filesystem(); $objFS->folderCreate("/files/images/samples/", true); } $objImage->saveImage("/files/images/samples/testimage.JPG"); echo "\tloading an image from the samplecontent\n"; $strImage = "/files/images/samples/testimage.JPG"; //$strImage = "<img src=\""._webpath_."/portal/pics/upload/samples/IMG_3000.JPG\"/>"; echo "\timage: " . $strImage . "\n"; $objImage = new class_image(); $objImage->preLoadImage($strImage); //resize the image echo "\tresizing the image to 150 x 150\n"; $objImage->resizeImage(150, 150, 0, true); $objImage->saveImage("", true); $strResizeCacheName1 = $objImage->getCachename(); $this->assertNotEquals($strResizeCacheName1, "", __FILE__ . " getCachenameAfterResize"); echo "\tcachename: " . $strResizeCacheName1 . "\n"; echo "<img src=\"" . _webpath_ . _images_cachepath_ . $strResizeCacheName1 . "\"/>"; $this->assertFileExists(_realpath_ . _images_cachepath_ . $strResizeCacheName1, __FILE__ . " getCachenameAfterResize"); echo "\treplay test...\n"; echo "\timage: " . $strImage . "\n"; $objImage = new class_image(); $objImage->preLoadImage($strImage); //resize the image echo "\tresizing the image to 150 x 150\n"; $objImage->resizeImage(150, 150, 0, true); $objImage->saveImage("", true); $strResizeCacheName2 = $objImage->getCachename(); $this->assertEquals($strResizeCacheName2, $strResizeCacheName2, __FILE__ . " getCachenameAfterResize"); echo "\tcachename: " . $strResizeCacheName2 . "\n"; //echo "<img src=\""._webpath_._images_cachepath_.$strResizeCacheName2."\"/>"; $this->assertFileExists(_realpath_ . _images_cachepath_ . $strResizeCacheName2, __FILE__ . " getCachenameAfterResize"); echo "\tresize & text...\n"; echo "\timage: " . $strImage . "\n"; $objImage = new class_image("test1020"); $objImage->preLoadImage($strImage); //resize the image $objImage->resizeImage(150, 150, 0, true); $objImage->imageText("test", 10, 20); $objImage->saveImage("", true); $strResizeCacheName3 = $objImage->getCachename(); $this->assertTrue($strResizeCacheName3 != "", __FILE__ . " getCachenameAfterResize&Text"); echo "\tcachename: " . $strResizeCacheName3 . "\n"; echo "<img src=\"" . _webpath_ . _images_cachepath_ . $strResizeCacheName3 . "\"/>"; $this->assertFileExists(_realpath_ . _images_cachepath_ . $strResizeCacheName3, __FILE__ . " getCachenameAfterResize"); echo "\tresize & text...\n"; echo "\timage: " . $strImage . "\n"; $objImage = new class_image("test2030"); $objImage->preLoadImage($strImage); //resize the image $objImage->resizeImage(150, 150, 0, true); $objImage->imageText("test", 20, 30); $objImage->saveImage("", true); $strResizeCacheName4 = $objImage->getCachename(); $this->assertNotEquals($strResizeCacheName3, $strResizeCacheName4, __FILE__ . " getCachenameAfterResize&Text"); echo "\tcachename: " . $strResizeCacheName3 . "\n"; echo "<img src=\"" . _webpath_ . _images_cachepath_ . $strResizeCacheName4 . "\"/>"; $this->assertFileExists(_realpath_ . _images_cachepath_ . $strResizeCacheName4, __FILE__ . " getCachenameAfterResize"); echo "\ttest image overlay.\n"; $objImage = new class_image("overlay" . $strResizeCacheName4); $objImage->preLoadImage($strImage); $objImage->resizeAndCropImage(300, 300, 300, 300); $objImage->overlayImage(_images_cachepath_ . $strResizeCacheName4, 10, 10, true); $objImage->saveImage("", true); $strResizeCacheName5 = $objImage->getCachename(); echo "\tcachename: " . $strResizeCacheName5 . "\n"; echo "<img src=\"" . _webpath_ . _images_cachepath_ . $strResizeCacheName5 . "\"/>"; $this->assertFileExists(_realpath_ . _images_cachepath_ . $strResizeCacheName5, __FILE__ . " getCachenameAfterResize"); }
private function update_42_43() { $strReturn = "Updating 4.2 to 4.3...\n"; $strReturn .= "Changing placeholder column data-type...\n"; $strReturn .= "Creating temp-table...\n"; $strReturn .= "Installing table page_element...\n"; $arrFields = array(); $arrFields["page_element_id"] = array("char20", false); $arrFields["page_element_ph_placeholder"] = array("text", true); $arrFields["page_element_ph_name"] = array("char254", true); $arrFields["page_element_ph_element"] = array("char254", true); $arrFields["page_element_ph_title"] = array("char254", true); $arrFields["page_element_ph_language"] = array("char20", true); if (!$this->objDB->createTable("page_element_temp", $arrFields, array("page_element_id"), array("page_element_ph_language", "page_element_ph_element"))) { $strReturn .= "An error occurred! ...\n"; } $strReturn .= "Copying table content...\n"; $strQuery = "INSERT INTO " . _dbprefix_ . "page_element_temp\n (page_element_id, page_element_ph_placeholder, page_element_ph_name, page_element_ph_element, page_element_ph_title, page_element_ph_language)\n SELECT page_element_id, page_element_ph_placeholder, page_element_ph_name, page_element_ph_element, page_element_ph_title, page_element_ph_language FROM " . _dbprefix_ . "page_element"; if (!$this->objDB->_query($strQuery)) { $strReturn .= "An error occurred! ...\n"; } $strReturn .= "Dropping old table...\n"; $strQuery = "DROP TABLE " . $this->objDB->encloseTableName(_dbprefix_ . "page_element") . ""; if (!$this->objDB->_query($strQuery)) { $strReturn .= "An error occurred! ...\n"; } $strReturn .= "Renaming new table...\n"; $strQuery = "ALTER TABLE " . $this->objDB->encloseTableName(_dbprefix_ . "page_element_temp") . " RENAME TO " . $this->objDB->encloseTableName(_dbprefix_ . "page_element") . ""; if (!$this->objDB->_query($strQuery)) { $strReturn .= "An error occurred! ...\n"; } $strReturn .= "Copying default-template, if in use. Placeholders changed in 4.3\n"; if (class_module_system_setting::getConfigValue("_packagemanager_defaulttemplate_") == "default") { $objFS = new class_filesystem(); $objFS->folderCreate("/templates/kajona42/tpl/module_pages", true); $objFS->fileCopy("/core/module_pages/installer/standard.tpl.42", "/templates/kajona42/tpl/module_pages/standard.tpl"); class_module_packagemanager_template::syncTemplatepacks(); /** @var $objOnePack class_module_packagemanager_template */ foreach (class_module_packagemanager_template::getObjectList() as $objOnePack) { if ($objOnePack->getStrName() == "kajona42") { $objOnePack->setIntRecordStatus(1); $objOnePack->updateObjectToDb(); } } $objSetting = class_module_system_setting::getConfigByName("_packagemanager_defaulttemplate_"); $objSetting->setStrValue("kajona42"); $objSetting->updateObjectToDb(); } $strReturn .= "Updating module-versions...\n"; $this->updateModuleVersion("", "4.3"); $strReturn .= "Updating element-version...\n"; $this->updateElementVersion("row", "4.3"); $this->updateElementVersion("paragraph", "4.3"); $this->updateElementVersion("image", "4.3"); return $strReturn; }