Overview

Packages

  • Core
    • Authentication
    • Backend
    • Cache
    • CEC
    • Chain
    • ContentType
    • Database
    • Datatype
    • Debug
    • Exception
    • Frontend
      • Search
      • URI
      • Util
    • GenericDB
      • Model
    • GUI
      • HTML
    • I18N
    • LayoutHandler
    • Log
    • Security
    • Session
    • Util
    • Validation
    • Versioning
    • XML
  • Module
    • ContentSitemapHtml
    • ContentSitemapXml
    • ContentUserForum
    • NavigationTop
  • 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

  • cAjaxRequest
  • cAutoload
  • cBackend
  • cEffectiveSetting
  • cGuiScrollListAlltranslations
  • cHTMLValidator
  • cMailer
  • cModuleFileTranslation
  • cModuleHandler
  • cModuleSearch
  • cModuleSynchronizer
  • cModuleTemplateHandler
  • CodeMirror
  • cPasswordRequest
  • cPermission
  • cRegistry
  • cSystemPurge
  • cSystemtest
  • cTinyMCEEditor
  • cWYSIWYGEditor
  • FrontendList
  • HtmlParser
  • TreeItem
  • UploadList
  • UploadSearchResultList

Functions

  • _processCmsTags
  • addArtspec
  • addslashes_deep
  • addSortImages
  • backToMainArea
  • buildArticleSelect
  • buildCategorySelect
  • buildCategorySelectRights
  • buildHeapTable
  • buildStackString
  • buildTree
  • buildUserOrGroupPermsFromRequest
  • callPluginStore
  • cApiCatGetLevelNode
  • cApiImageCheckCachedImageValidity
  • cApiImageCheckImageEditingPosibility
  • cApiImageGetCacheFileName
  • cApiImageGetTargetDimensions
  • cApiImageIsAnimGif
  • cApiImgScale
  • cApiImgScaleGetMD5CacheFile
  • cApiImgScaleHQ
  • cApiImgScaleImageMagick
  • cApiImgScaleLQ
  • cApiIsImageMagickAvailable
  • cApiStrCleanURLCharacters
  • cApiStrNormalizeLineEndings
  • cApiStrRecodeString
  • cApiStrReplaceDiacritics
  • cApiStrTrimAfterWord
  • cApiStrTrimHard
  • cApiStrTrimSentence
  • cDeprecated
  • cDie
  • cError
  • checkLangInClients
  • checkPathInformation
  • cInclude
  • compareUrlStrings
  • conChangeTemplateForCat
  • conCopyArticle
  • conCopyArtLang
  • conCopyContainerConf
  • conCopyContent
  • conCopyMetaTags
  • conCopyTemplateConfiguration
  • conCreateLocationString
  • conDeeperCategoriesArray
  • conDeleteart
  • conEditArt
  • conEditFirstTime
  • conFetchCategoryTree
  • conFlagOnOffline
  • conGenerateCode
  • conGenerateCodeForAllArts
  • conGenerateCodeForAllArtsInCategory
  • conGenerateCodeForAllartsUsingLayout
  • conGenerateCodeForAllartsUsingMod
  • conGenerateCodeForAllArtsUsingTemplate
  • conGenerateCodeForArtInAllCategories
  • conGenerateCodeForClient
  • conGenerateKeywords
  • conGetAvailableMetaTagTypes
  • conGetCategoryArticleId
  • conGetCategoryAssignments
  • conGetContainerConfiguration
  • conGetContentFromArticle
  • conGetHtmlTranslationTable
  • conGetMetaValue
  • conGetTemplateConfigurationIdForArticle
  • conGetTemplateConfigurationIdForCategory
  • conGetTopmostCat
  • conGetUsedModules
  • conHtmlentities
  • conHtmlEntityDecode
  • conHtmlSpecialChars
  • conIsLocked
  • conLock
  • conLockBulkEditing
  • conMakeArticleIndex
  • conMakeCatOnline
  • conMakeOnline
  • conMakeOnlineBulkEditing
  • conMakePublic
  • conMakeStart
  • conMoveArticles
  • conPhp54Check
  • conRemoveOldCategoryArticle
  • conSaveContentEntry
  • conSetCodeFlag
  • conSetCodeFlagBulkEditing
  • conSetMetaValue
  • conSyncArticle
  • copyRightsForElement
  • createBulkEditingFunction
  • createRandomName
  • createRightsForElement
  • cWarning
  • dbGetColumns
  • dbGetIndexes
  • dbGetPrimaryKeyName
  • dbTableExists
  • dbUpgradeTable
  • defineIfNotDefined
  • deleteArtspec
  • deleteRightsForElement
  • deleteSystemProperty
  • displayDatetime
  • emptyLogFile
  • endAndLogTiming
  • endsWith
  • extractNumber
  • generateDisplayFilePath
  • generateJs
  • getAktuellType
  • getAllClientsAndLanguages
  • getArtLang
  • getArtspec
  • getAvailableContentTypes
  • getCanonicalDay
  • getCanonicalMonth
  • getDirectorySize
  • getEffectiveSetting
  • getEffectiveSettingsByType
  • getEncodingByLanguage
  • getFileContents
  • getFileInformation
  • getFileType
  • getGroupOrUserName
  • getIDForArea
  • getJsHelpContext
  • getLanguageNamesByClient
  • getLanguagesByClient
  • getmicrotime
  • getNamedFrame
  • getParam
  • getParentAreaId
  • getSearchResults
  • getStrExpandCollapseButton
  • getSystemProperties
  • getSystemPropertiesByType
  • getSystemProperty
  • getTemplateSelect
  • getUplExpandCollapseButton
  • htmldecode
  • htmlentities_iso88592
  • humanReadableSize
  • includePlugins
  • insertEmptyStrRow
  • ipMatch
  • isAlphanumeric
  • isArchive
  • isArtInMultipleUse
  • isFunctionDisabled
  • isGroup
  • isIPv4
  • isRunningFromWeb
  • isStartArticle
  • isUtf8
  • isValidMail
  • langActivateDeactivateLanguage
  • langDeleteLanguage
  • langEditLanguage
  • langGetTextDirection
  • langNewLanguage
  • langRenameLanguage
  • layDeleteLayout
  • layEditLayout
  • machineReadableSize
  • mailLogBulkEditingFunctions
  • mailLogDecodeAddresses
  • markSubMenuItem
  • mask
  • modDeleteModule
  • modEditModule
  • modTestModule
  • phpInfoToHtml
  • plugin_include
  • prCreateURLNameLocationString
  • prDeleteCacheFileContent
  • prGetCacheFileContent
  • prResolvePathViaCategoryNames
  • prResolvePathViaURLNames
  • prWriteCacheFileContent
  • putFileContents
  • recursiveCopy
  • removeFileInformation
  • renderBackendBreadcrumb
  • renderLabel
  • renderSelectProperty
  • renderTextProperty
  • saveGroupRights
  • saveRights
  • scanDirectory
  • scanPlugins
  • sendEncodingHeader
  • set_magic_quotes_gpc
  • setArtspecDefault
  • setArtspecOnline
  • setHelpContext
  • setSystemProperty
  • showTree
  • startTiming
  • statCreateLocationString
  • statDisplayTopChooser
  • statDisplayYearlyTopChooser
  • statGetAvailableMonths
  • statGetAvailableYears
  • statResetStatistic
  • statsArchive
  • statsDisplayInfo
  • statsOverviewAll
  • statsOverviewTop
  • statsOverviewTopYear
  • statsOverviewYear
  • strAssignTemplate
  • strBuildSqlValues
  • strCheckTreeForErrors
  • strCopyCategory
  • strCopyTree
  • strDeeperCategoriesArray
  • strDeleteCategory
  • strHasArticles
  • strHasStartArticle
  • stripslashes_deep
  • strMakePublic
  • strMakeVisible
  • strMoveCatTargetallowed
  • strMoveDownCategory
  • strMoveSubtree
  • strMoveUpCategory
  • strNewCategory
  • strNewTree
  • strNextBackwards
  • strNextDeeper
  • strNextDeeperAll
  • strNextPost
  • strOrderedPostTreeList
  • strRemakeTreeTable
  • strRenameCategory
  • strRenameCategoryAlias
  • strSortPrePost
  • strSyncCategory
  • systemHavePerm
  • tplAutoFillModules
  • tplBrowseLayoutForContainers
  • tplcfgDuplicate
  • tplDeleteTemplate
  • tplDuplicateTemplate
  • tplEditTemplate
  • tplGetContainerDefault
  • tplGetContainerMode
  • tplGetContainerName
  • tplGetContainerTypes
  • tplGetInUsedData
  • tplIsTemplateInUse
  • tplPreparseLayout
  • updateClientCache
  • updateFileInformation
  • uplCreateFriendlyName
  • uplDirectoryListRecursive
  • uplGetDirectoriesToExclude
  • uplGetFileExtension
  • uplGetFileIcon
  • uplGetFileTypeDescription
  • uplGetThumbnail
  • uplHasFiles
  • uplHasSubdirs
  • uplmkdir
  • uplRecursiveDBDirectoryList
  • uplRecursiveDirectoryList
  • uplRenameDirectory
  • uplSearch
  • uplSyncDirectory
  • uplSyncDirectoryDBFS
  • xmlFileToArray
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo
  1: <?php
  2: /**
  3:  * This file contains the module synchronizer class.
  4:  * TODO: Rework comments of this class.
  5:  *
  6:  * @package    Core
  7:  * @subpackage Backend
  8:  * @version    SVN Revision $Rev:$
  9:  *
 10:  * @author     Rusmir Jusufovic
 11:  * @copyright  four for business AG <www.4fb.de>
 12:  * @license    http://www.contenido.org/license/LIZENZ.txt
 13:  * @link       http://www.4fb.de
 14:  * @link       http://www.contenido.org
 15:  */
 16: 
 17: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
 18: 
 19: cInclude('includes', 'functions.api.string.php');
 20: cInclude('includes', 'functions.con.php');
 21: 
 22: /**
 23:  * This class synchronized the contents of modul dir with the table
 24:  * $cfg['tab']['mod']. If a modul exist in modul dir but not in
 25:  * $cfg['tab']['mod'] this class will insert the modul in the table.
 26:  *
 27:  * @package    Core
 28:  * @subpackage Backend
 29:  */
 30: class cModuleSynchronizer extends cModuleHandler {
 31: 
 32:     /**
 33:      * The last id of the module that had changed or had added.
 34:      *
 35:      * @var int
 36:      */
 37:     private $_lastIdMod = 0;
 38: 
 39:     /**
 40:      * This method insert a new modul in $cfg['tab']['mod'] table, if
 41:      * the name of modul dont exist
 42:      *
 43:      * @param string $dir
 44:      * @param string $oldModulName
 45:      * @param string $newModulName
 46:      */
 47:     private function _syncModule($dir, $oldModulName, $newModulName) {
 48:         global $client;
 49:         // if modul dont exist in the $cfg['tab']['mod'] table.
 50:         if ($this->_isExistInTable($oldModulName, $client) == false) {
 51:             // add new Module in db-tablle
 52:             $this->_addModul($newModulName, $client);
 53:             $notification = new cGuiNotification();
 54:             $notification->displayNotification('info', sprintf(i18n('Module %s successfully synchronized'), $newModulName));
 55:         } else {
 56:             // update the name of the module
 57:             if ($oldModulName != $newModulName) {
 58:                 $this->_updateModulnameInDb($oldModulName, $newModulName, $client);
 59:             }
 60:         }
 61:     }
 62: 
 63:     /**
 64:      * Rename css, js and input/output file
 65:      *
 66:      * @param string $dir
 67:      * @param string $oldModulName
 68:      * @param string $newModulName
 69:      */
 70:     private function _renameFiles($dir, $oldModulName, $newModulName) {
 71:         if (cFileHandler::exists($dir . $newModulName . '/' . $this->_directories['php'] . $oldModulName . '_input.php') == true) {
 72:             rename($dir . $newModulName . '/' . $this->_directories['php'] . $oldModulName . '_input.php', $dir . $newModulName . '/' . $this->_directories['php'] . $newModulName . '_input.php');
 73:         }
 74: 
 75:         if (cFileHandler::exists($dir . $newModulName . '/' . $this->_directories['php'] . $oldModulName . '_output.php') == true) {
 76:             rename($dir . $newModulName . '/' . $this->_directories['php'] . $oldModulName . '_output.php', $dir . $newModulName . '/' . $this->_directories['php'] . $newModulName . '_output.php');
 77:         }
 78: 
 79:         if (cFileHandler::exists($dir . $newModulName . '/' . $this->_directories['css'] . $oldModulName . '.css') == true) {
 80:             rename($dir . $newModulName . '/' . $this->_directories['css'] . $oldModulName . '.css', $dir . $newModulName . '/' . $this->_directories['css'] . $newModulName . '.css');
 81:         }
 82: 
 83:         if (cFileHandler::exists($dir . $newModulName . '/' . $this->_directories['js'] . $oldModulName . '.js') == true) {
 84:             rename($dir . $newModulName . '/' . $this->_directories['js'] . $oldModulName . '.js', $dir . $newModulName . '/' . $this->_directories['js'] . $newModulName . '.js');
 85:         }
 86:     }
 87: 
 88:     /**
 89:      * Rename the Modul files and Modul dir
 90:      *
 91:      * @param string $dir path the the moduls
 92:      * @param string $dirNameOld old dir name
 93:      * @param string $dirNameNew new dir name
 94:      * @param int $client idclient
 95:      * @return boolean true if succes (rename file and directories)
 96:      */
 97:     private function _renameFileAndDir($dir, $dirNameOld, $dirNameNew, $client) {
 98:         if (rename($dir . $dirNameOld, $dir . $dirNameNew) == FALSE) {
 99:             return false;
100:         } else { // change names of the files
101:             $this->_renameFiles($dir, $dirNameOld, $dirNameNew);
102:         }
103:         return true;
104:     }
105: 
106:     /**
107:      * Compare file change timestemp and the timestemp in ['tab']['mod'].
108:      * If file had changed make new code :conGenerateCodeForAllArtsUsingMod
109:      *
110:      * @return int id of last update module
111:      */
112:     public function compareFileAndModuleTimestamp() {
113:         global $cfg, $cfgClient;
114: 
115:         $synchLock = 0;
116: 
117:         $sql = sprintf('SELECT UNIX_TIMESTAMP(mod1.lastmodified) AS lastmodified,mod1.idclient,description,type, mod1.name, mod1.alias, mod1.idmod FROM %s AS mod1 WHERE mod1.idclient = %s', $this->_cfg['tab']['mod'], $this->_client);
118:         $notification = new cGuiNotification();
119: 
120:         $db = cRegistry::getDb();
121:         $db->query($sql);
122:         $retIdMod = 0;
123: 
124:         while ($db->nextRecord()) {
125:             $modulePath = $cfgClient[$db->f('idclient')]['module']['path'] . $db->f('alias') . '/';
126:             $modulePHP = $modulePath . $this->_directories['php'] . $db->f('alias');
127: 
128:             $lastmodified = $db->f('lastmodified');
129: 
130:             $lastmodInput = $lastmodOutput = 0;
131: 
132:             if (cFileHandler::exists($modulePHP . '_input.php')) {
133:                 $lastmodInput = filemtime($modulePHP . '_input.php');
134:             }
135: 
136:             if (cFileHandler::exists($modulePHP . '_output.php')) {
137:                 $lastmodOutput = filemtime($modulePHP . '_output.php');
138:             }
139: 
140:             if (cFileHandler::exists($modulePath . "info.xml")) {
141:                 $lastModInfo = filemtime($modulePath . "info.xml");
142:                 if ($lastModInfo > $lastmodified) {
143:                     $modInfo = cXmlBase::xmlStringToArray(cFileHandler::read($modulePath . "info.xml"));
144:                     $mod = new cApiModule($db->f("idmod"));
145:                     if ($modInfo["description"] != $mod->get("description")) {
146:                         $mod->set("description", $modInfo["description"]);
147:                         $this->setLastModified($lastModInfo, $db->f('idmod'));
148:                     }
149:                     if ($modInfo["type"] != $mod->get("type")) {
150:                         $mod->set("type", $modInfo["type"]);
151:                         $this->setLastModified($lastModInfo, $db->f('idmod'));
152:                     }
153: 
154:                     if ($modInfo["name"] != $mod->get("name")) {
155:                         $mod->set("name", $modInfo["name"]);
156:                         $this->setLastModified($lastModInfo, $db->f('idmod'));
157:                     }
158: 
159:                     if ($modInfo["alias"] != $mod->get("alias")) {
160:                         $mod->set("alias", $modInfo["alias"]);
161:                         $this->setLastModified($lastModInfo, $db->f('idmod'));
162:                     }
163:                     $mod->store();
164:                     $synchLock = 1;
165:                     $notification->displayNotification('info', sprintf(i18n('Module %s successfully synchronized'), $db->f('name')));
166:                 }
167:             }
168: 
169:             if ($lastmodInput < $lastmodOutput) {
170:                 // use output
171:                 if ($lastmodified < $lastmodOutput) {
172:                     // update
173:                     $synchLock = 1;
174:                     $this->setLastModified($lastmodOutput, $db->f('idmod'));
175:                     conGenerateCodeForAllArtsUsingMod($db->f('idmod'));
176:                     $notification->displayNotification('info', sprintf(i18n('Module %s successfully synchronized'), $db->f('name')));
177:                 }
178:             } else {
179:                 // use input
180:                 if ($lastmodified < $lastmodInput) {
181:                     // update
182:                     $synchLock = 1;
183:                     $this->setLastModified($lastmodInput, $db->f('idmod'));
184:                     conGenerateCodeForAllArtsUsingMod($db->f('idmod'));
185:                     $notification->displayNotification('info', sprintf(i18n('Module %s successfully synchronized'), $db->f('name')));
186:                 }
187:             }
188: 
189:             if (($idmod = $this->_synchronizeFilesystemAndDb($db)) != 0) {
190:                 $retIdMod = $idmod;
191:             }
192:         }
193: 
194:         if ($synchLock == 0) {
195:             $notification->displayNotification('info', i18n('All modules are already synchronized'));
196:         }
197: 
198:         // we need it for the update of moduls on the left site (module/backend)
199:         return $retIdMod;
200:     }
201: 
202:     /**
203:      * If someone delete a moduldir with ftp/ssh.
204:      * We have a modul
205:      * in db but not in directory, if the modul in use make a new modul in
206:      * fileystem but if not
207:      * clear it from filesystem.
208:      *
209:      * @return int id of last update module
210:      */
211:     private function _synchronizeFilesystemAndDb($db) {
212:         $returnIdMod = 0;
213:         $this->initWithDatabaseRow($db);
214:         // modul dont exist in filesystem
215:         if ($this->modulePathExists() == false) {
216:             $modul = new cApiModule($db->f('idmod'));
217:             $returnIdMod = $db->f('idmod');
218:             if ($modul->moduleInUse($db->f('idmod')) == true) {
219:                 // modul in use, make new modul in filesystem
220:                 if ($this->createModule() == false) {
221:                     $notification = new cGuiNotification();
222:                     $notification->displayNotification('error', i18n("Can not create module") . " " . $db->f('name'));
223:                 }
224:             } else {
225:                 // modul not in use, delete it
226:                 $sql = sprintf('DELETE  FROM %s WHERE idmod = %s AND idclient = %s', $this->_cfg['tab']['mod'], $db->f('idmod'), $this->_client);
227:                 $myDb = cRegistry::getDb();
228:                 $myDb->query($sql);
229:             }
230:         }
231:         return $returnIdMod;
232:     }
233: 
234:     /**
235:      * If the first char a '.' return false else true
236:      *
237:      * @param string $file
238:      * @return boolean true if the first char !='.' else false
239:      */
240:     private function _isValidFirstChar($file) {
241:         if (substr($file, 0, 1) == '.') {
242:             return false;
243:         } else {
244:             return true;
245:         }
246:     }
247: 
248:     /**
249:      * Depending on the client, this method
250:      * will check the modul dir of the client and if found
251:      * a Modul(Dir) that not exist in Db-table this method will
252:      * insert the Modul in Db-table ([tab][mod]).
253:      *
254:      * @return int last id of synchronized module
255:      */
256:     public function synchronize() {
257:         global $cfg, $cfgClient;
258: 
259:         // get the path to the modul dir from the client
260:         $dir = $cfgClient[$this->_client]['module']['path'];
261: 
262:         if (is_dir($dir)) {
263:             if ($dh = opendir($dir)) {
264:                 while (($file = readdir($dh)) !== false) {
265:                     // is file a dir or not
266:                     if ($this->_isValidFirstChar($file) && is_dir($dir . $file . '/')) {
267:                         $newFile = cApiStrCleanURLCharacters($file);
268:                         // dir is ok
269:                         if ($newFile == $file) {
270:                             $this->_syncModule($dir, $file, $newFile);
271:                         } else { // dir not ok (with not allowed characters)
272:                             if (is_dir($dir . $newFile)) { // exist the new dir
273:                                                            // name?
274:                                                            // make new dirname
275:                                 $newDirName = $newFile . substr(md5(time() . rand(0, time())), 0, 4);
276: 
277:                                 // rename
278:                                 if ($this->_renameFileAndDir($dir, $file, $newDirName, $this->_client) != false) {
279:                                     $this->_syncModule($dir, $file, $newDirName);
280:                                 }
281:                             } else { // $newFile (dir) not exist
282:                                      // rename dir old
283:                                 if ($this->_renameFileAndDir($dir, $file, $newFile, $this->_client) != false) {
284:                                     $this->_syncModule($dir, $file, $newFile);
285:                                 }
286:                             }
287:                         }
288:                     }
289:                 }
290:             }
291: 
292:             // close dir
293:             closedir($dh);
294:         }
295: 
296:         // last Modul Id that will refresh the windows /modul overview
297:         return $this->_lastIdMod;
298:     }
299: 
300:     /**
301:      * This method look in the db-table $cfg['tab']['mod'] for a modul
302:      * name.
303:      * If the modul name exist it will return true
304:      *
305:      * @param string $name name ot the modul
306:      * @param int $idclient idclient
307:      * @return bool if a modul with the $name exist in the $cfg['tab']['mod'] table
308:      *         return true else false
309:      */
310:     private function _isExistInTable($alias, $idclient) {
311:         $db = cRegistry::getDb();
312: 
313:         // Select depending from idclient all moduls wiht the name $name
314:         $sql = sprintf("SELECT * FROM %s WHERE alias='%s' AND idclient=%s", $this->_cfg['tab']['mod'], $alias, $idclient);
315: 
316:         $db->query($sql);
317: 
318:         // a record is found
319:         if ($db->nextRecord()) {
320:             return true;
321:         } else {
322:             return false;
323:         }
324:     }
325: 
326:     /**
327:      * Update the name of module (if the name not allowes)
328:      *
329:      * @param string $oldName old name
330:      * @param string $newName new module name
331:      * @param int $idclient id of client
332:      */
333:     private function _updateModulnameInDb($oldName, $newName, $idclient) {
334:         $db = cRegistry::getDb();
335: 
336:         // Select depending from idclient all moduls wiht the name $name
337:         $sql = sprintf("SELECT * FROM %s WHERE alias='%s' AND idclient=%s", $this->_cfg['tab']['mod'], $oldName, $idclient);
338: 
339:         $db->query($sql);
340: 
341:         // a record is found
342:         if ($db->nextRecord()) {
343:             $sqlUpdateName = sprintf("UPDATE %s SET alias='%s' WHERE idmod=%s", $this->_cfg['tab']['mod'], $newName, $db->f('idmod'));
344:             $db->query($sqlUpdateName);
345:             return;
346:         }
347:     }
348: 
349:     /**
350:      * This method add a new Modul in the table $cfg['tab']['mod'].
351:      *
352:      * @param string $name neme of the new module
353:      * @param int $idclient mandant of the module
354:      */
355:     private function _addModul($name, $idclient) {
356:         // insert new modul in con_mod
357:         $oModColl = new cApiModuleCollection();
358:         $oMod = $oModColl->create($name, $idclient, $name);
359:         if (is_object($oMod)) {
360:             // save the last id from modul
361:             $this->_lastIdMod = $oMod->get('idmod');
362:         }
363:     }
364: 
365:     /**
366:      * Update the con_mod, the field lastmodified
367:      *
368:      * @param int $timestamp timestamp of last modification
369:      * @param int $idmod id of modul
370:      */
371:     public function setLastModified($timestamp, $idmod) {
372:         $oMod = new cApiModule((int) $idmod);
373:         if ($oMod->isLoaded()) {
374:             $oMod->set('lastmodified', date('Y-m-d H:i:s', $timestamp));
375:             $oMod->store();
376:         }
377:     }
378: 
379: }
380: 
CMS CONTENIDO 4.9.2 API documentation generated by ApiGen 2.8.0