Overview

Packages

  • CONTENIDO
  • Core
    • Authentication
    • Backend
    • Cache
    • CEC
    • Chain
    • ContentType
    • Database
    • Debug
    • Exception
    • Frontend
      • Search
      • URI
      • Util
    • GenericDB
      • Model
    • GUI
      • HTML
    • I18N
    • LayoutHandler
    • Log
    • Security
    • Session
    • Util
    • Validation
    • Versioning
    • XML
  • Module
    • ContentSitemapHtml
    • ContentSitemapXml
    • ContentUserForum
    • NavigationTop
    • ScriptCookieDirective
  • mpAutoloaderClassMap
  • None
  • PHP
  • Plugin
    • ContentAllocation
    • CronjobOverview
    • FormAssistant
    • FrontendLogic
    • FrontendUsers
    • Linkchecker
    • ModRewrite
    • Newsletter
    • Repository
      • FrontendNavigation
      • KeywordDensity
    • 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
  • cTinymce4Configuration
  • cTinyMCE4Editor
  • cTinyMCEEditor
  • cWYSIWYGEditor
  • FrontendList
  • HtmlParser
  • TODOBackendList
  • TreeItem
  • UploadList
  • UploadSearchResultList

Functions

  • addArtspec
  • addSortImages
  • backToMainArea
  • buildArticleSelect
  • buildCategorySelect
  • buildCategorySelectRights
  • buildHeapTable
  • buildStackString
  • buildTree
  • buildUserOrGroupPermsFromRequest
  • callPluginStore
  • cApiCatGetLevelNode
  • cApiImageCheckCachedImageValidity
  • cApiImageCheckImageEditingPosibility
  • cApiImageCheckImageEditingPossibility
  • 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
  • conGetUniqueArticleUrlname
  • conGetUsedModules
  • conHtmlentities
  • conHtmlEntityDecode
  • conHtmlSpecialChars
  • conIsArticleUrlnameUnique
  • conIsLocked
  • conLock
  • conLockBulkEditing
  • conMakeArticleIndex
  • conMakeCatOnline
  • conMakeInlineScript
  • conMakeOnline
  • conMakeOnlineBulkEditing
  • conMakePublic
  • conMakeStart
  • conMoveArticles
  • conPhp54Check
  • conRemoveOldCategoryArticle
  • conSaveContentEntry
  • conSetCodeFlag
  • conSetCodeFlagBulkEditing
  • conSetMetaValue
  • conSetStartArticle
  • consoleLog
  • conSyncArticle
  • copyRightsForElement
  • createBulkEditingFunction
  • createRandomName
  • createRightsForElement
  • cWarning
  • dbGetColumns
  • dbGetIndexes
  • dbGetPrimaryKeyName
  • dbTableExists
  • dbUpgradeTable
  • defineIfNotDefined
  • deleteArtspec
  • deleteRightsForElement
  • deleteSystemProperty
  • displayDatetime
  • emptyLogFile
  • endAndLogTiming
  • extractNumber
  • generateDisplayFilePath
  • generateJs
  • getAllClientsAndLanguages
  • getArtLang
  • getArtspec
  • getAvailableContentTypes
  • getCanonicalDay
  • getCanonicalMonth
  • getDirectorySize
  • getEffectiveSetting
  • getEffectiveSettingsByType
  • getEncodingByLanguage
  • getFileInformation
  • getFileType
  • getGroupOrUserName
  • getIDForArea
  • getJsHelpContext
  • getLanguageNamesByClient
  • getLanguagesByClient
  • getmicrotime
  • getNamedFrame
  • getParentAreaId
  • getRightsList
  • 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
  • phpInfoToHtml
  • plugin_include
  • prCreateURLNameLocationString
  • prDeleteCacheFileContent
  • prGetCacheFileContent
  • prResolvePathViaCategoryNames
  • prResolvePathViaURLNames
  • prWriteCacheFileContent
  • recursiveCopy
  • removeFileInformation
  • renderBackendBreadcrumb
  • renderLabel
  • renderSelectProperty
  • renderTextProperty
  • saveGroupRights
  • saveRights
  • scanDirectory
  • scanPlugins
  • sendEncodingHeader
  • set_magic_quotes_gpc
  • setArtspecDefault
  • setArtspecOnline
  • setSystemProperty
  • showTree
  • startTiming
  • statCreateLocationString
  • statDisplayTopChooser
  • statDisplayYearlyTopChooser
  • statGetAvailableMonths
  • statGetAvailableYears
  • statResetStatistic
  • statsArchive
  • statsDisplayInfo
  • statsOverviewAll
  • statsOverviewTop
  • statsOverviewTopYear
  • statsOverviewYear
  • strAssignTemplate
  • strBuildSqlValues
  • strCheckAlias
  • strCheckTreeForErrors
  • strCopyCategory
  • strCopyTree
  • strDeeperCategoriesArray
  • strDeleteCategory
  • strHasArticles
  • strHasStartArticle
  • 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
  • tplGetContainerNumbersInLayout
  • tplGetContainerTypes
  • tplGetInUsedData
  • tplIsTemplateInUse
  • tplPreparseLayout
  • tplProcessSendContainerConfiguration
  • updateClientCache
  • updateFileInformation
  • uplCreateFriendlyName
  • uplDirectoryListRecursive
  • uplGetDirectoriesToExclude
  • uplGetFileExtension
  • uplGetFileIcon
  • uplGetFileTypeDescription
  • uplGetThumbnail
  • uplHasFiles
  • uplHasSubdirs
  • uplmkdir
  • uplRecursiveDBDirectoryList
  • uplRecursiveDirectoryList
  • uplRenameDirectory
  • uplSearch
  • uplSyncDirectory
  • uplSyncDirectoryDBFS
  • Overview
  • Package
  • Function
  • Tree
  • Deprecated
  • Todo
  1: <?php
  2: 
  3: /**
  4:  * This file contains the backend page for the directory overview in upload
  5:  * section.
  6:  *
  7:  * @package Core
  8:  * @subpackage Backend
  9:  * @author Timo Hummel
 10:  * @copyright four for business AG <www.4fb.de>
 11:  * @license http://www.contenido.org/license/LIZENZ.txt
 12:  * @link http://www.4fb.de
 13:  * @link http://www.contenido.org
 14:  */
 15: 
 16: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
 17: 
 18: cInclude('includes', 'functions.con.php');
 19: cInclude('includes', 'functions.str.php');
 20: 
 21: // display critical error if no valid client is selected
 22: if ((int) $client < 1) {
 23:     $oPage = new cGuiPage('upl_dirs_overview');
 24:     $oPage->displayCriticalError(i18n("No Client selected"));
 25:     $oPage->render();
 26:     return;
 27: }
 28: 
 29: $appendparameters = !empty($_REQUEST['appendparameters']) ? $_REQUEST['appendparameters'] : '';
 30: $collapse = !empty($_REQUEST['collapse']) ? $_REQUEST['collapse'] : '';
 31: $expand = !empty($_REQUEST['expand']) ? $_REQUEST['expand'] : '';
 32: 
 33: /**
 34:  *
 35:  * @param TreeItem $item
 36:  *
 37:  * @return string
 38:  *
 39:  * @throws cException
 40:  */
 41: function getUplExpandCollapseButton($item) {
 42:     global $sess, $frame, $area, $appendparameters;
 43:     $selflink = 'main.php';
 44: 
 45:     if (count($item->getSubItems()) > 0) {
 46:         if ($item->isCollapsed() == true) {
 47:             $expandlink = $sess->url($selflink . "?area=$area&frame=$frame&appendparameters=$appendparameters&expand=" . $item->getId());
 48:             return ('<a href="' . $expandlink . '" alt="' . i18n('Open category') . '" title="' . i18n('Open category') . '"><img src="' . $item->getCollapsedIcon() . '" alt="" border="0" align="middle" width="18"></a>');
 49:         } else {
 50:             $collapselink = $sess->url($selflink . "?area=$area&appendparameters=$appendparameters&frame=$frame&collapse=" . $item->getId());
 51:             return ('<a href="' . $collapselink . '" alt="' . i18n('Close category') . '" title="' . i18n('Close category') . '"><img src="' . $item->getExpandedIcon() . '" alt="" border="0" align="middle" width="18"></a>');
 52:         }
 53:     } else {
 54:         if ($item->getCustom('lastitem')) {
 55:             return '<img class="vAlignMiddle" alt="" src="images/but_lastnode.gif" width="18" height="18">';
 56:         } else {
 57:             return '<img class="vAlignMiddle" alt="" src="images/grid_collapse.gif" width="18" height="18">';
 58:         }
 59:     }
 60: }
 61: 
 62: // Create Folder
 63: // ixxed by Timo Trautmann double database entries also called by action upl_mkdir
 64: // Use remembered path from upl_last_path (from session)
 65: if (!isset($path) && $sess->isRegistered('upl_last_path')) {
 66:     $path = $upl_last_path;
 67: }
 68: 
 69: if (!isset($action)) {
 70:     $action = '';
 71: }
 72: 
 73: if (empty($tmp_area)) {
 74:     $tmp_area = $area; // $tmp_area used at two places for unknown reasons...
 75: }
 76: 
 77: $uplexpandedList = unserialize($currentuser->getUserProperty('system', 'upl_expandstate'));
 78: $upldbfsexpandedList = unserialize($currentuser->getUserProperty('system', 'upl_dbfs_expandstate'));
 79: 
 80: if (!is_array($uplexpandedList)) {
 81:     $uplexpandedList = array();
 82: }
 83: 
 84: if (!is_array($upldbfsexpandedList)) {
 85:     $upldbfsexpandedList = array();
 86: }
 87: 
 88: $dbfs = new cApiDbfsCollection();
 89: 
 90: if ($action == 'upl_delete') {
 91:     if (cApiDbfs::isDbfs($path)) {
 92:         $dbfs->remove($path . '/.');
 93:     } else {
 94:         $failedFiles = array();
 95: 
 96:         // Check for files
 97:         if (uplHasFiles($path)) {
 98:             if (is_dir($cfgClient[$client]['upl']['path'] . $path)) {
 99:                 if (false !== ($directory = cDirHandler::read($uploadPath))) {
100:                     foreach ($directory as $dir_entry) {
101:                         if (cFileHandler::fileNameIsDot($dir_entry) === false) {
102:                             $res = cFileHandler::remove($cfgClient[$client]['upl']['path'] . $path . $dir_entry);
103: 
104:                             if ($res == false) {
105:                                 $failedFiles[] = $dir_entry;
106:                             }
107:                         }
108:                     }
109:                 }
110:             }
111:         }
112: 
113:         if (count($failedFiles) > 0) {
114:             $notification->displayNotification('warning', i18n("Failed to delete the following files:") . '<br><br>' . implode('<br>', $failedFiles));
115:         } else {
116:             $res = @rmdir($cfgClient[$client]['upl']['path'] . $path);
117:             if ($res == false) {
118:                 $notification->displayNotification('warning', sprintf(i18n("Failed to remove directory %s"), $path));
119:             }
120:         }
121:     }
122: }
123: 
124: $tpl->reset();
125: 
126: // Show notification for error in dir name from upl_mkdir.action
127: if (!empty($errno)) {
128:     if ($errno === '0703') {
129:         $tpl->set('s', 'WARNING', $notification->returnNotification('error', i18n('Directories with special characters and spaces are not allowed.')));
130:     } elseif($errno === '0704') {
131:         $tpl->set('s', 'WARNING', $notification->returnNotification('error', i18n('Can not write directory.')));
132:     }
133: }
134: 
135: // Uploadfiles tree on file system
136: 
137: $file = 'Upload';
138: $pathstring = '';
139: 
140: $rootTreeItem = new TreeItem();
141: $rootTreeItem->setCustom('level', 0);
142: $rootTreeItem->setName(i18n("Upload directory"));
143: $aInvalidDirectories = uplRecursiveDirectoryList($cfgClient[$client]["upl"]["path"], $rootTreeItem, 2);
144: if (count($aInvalidDirectories) > 0) {
145:     $sWarningInfo = i18n('The following directories contains invalid characters and were ignored: ');
146:     $sSeperator = '<br>';
147:     $sFiles = implode(', ', $aInvalidDirectories);
148:     $sRenameString = i18n('Please click here in order to rename automatically.');
149:     $sRenameHref = $sess->url("main.php?area=$area&frame=$frame&force_rename=true");
150:     $sRemameLink = '<a href="' . $sRenameHref . '">' . $sRenameString . '</a>';
151:     $sNotificationString = $sWarningInfo . $sSeperator . $sFiles . $sSeperator . $sSeperator . $sRemameLink;
152: 
153:     $sErrorString = $notification->returnNotification('warning', $sNotificationString);
154:     $tpl->set('s', 'WARNING', $sErrorString);
155: } else {
156:     $tpl->set('s', 'WARNING', '');
157: }
158: 
159: // Mark all items in the expandedList as expanded
160: foreach ($uplexpandedList as $key => $value) {
161:     $rootTreeItem->markExpanded($value);
162: }
163: 
164: // Collapse and expand the tree
165: if (!empty($collapse)) {
166:     $rootTreeItem->markCollapsed($collapse);
167: }
168: 
169: if (!empty($expand)) {
170:     $rootTreeItem->markExpanded($expand);
171: }
172: 
173: $uplexpandedList = array();
174: $rootTreeItem->getExpandedList($uplexpandedList);
175: 
176: $currentuser->setUserProperty('system', 'upl_expandstate', serialize($uplexpandedList));
177: 
178: $objects = array();
179: $rootTreeItem->traverse($objects);
180: unset($objects[0]);
181: 
182: if ($appendparameters == 'filebrowser') {
183:     $mtree = new cGuiTree('b58f0ae3-8d4e-4bb3-a754-5f0628863364');
184:     $cattree = conFetchCategoryTree();
185:     $marray = array();
186: 
187:     foreach ($cattree as $key => $catitem) {
188:         $no_start = true;
189:         $no_online = true;
190:         $no_start = !strHasStartArticle($catitem['idcat'], $lang);
191:         $no_online = !$catitem['visible'];
192: 
193:         $icon = 'images/';
194:         if ($catitem['visible'] == 1) {
195:             if ($catitem['public'] == 0) {
196:                 // Category is not public
197:                 $icon .= ($no_start || $no_online) ? 'folder_on_error_locked.gif' : 'folder_on_locked.gif';
198:             } else {
199:                 // Category is public
200:                 $icon .= ($no_start || $no_online) ? 'folder_on_error.gif' : 'folder_on.gif';
201:             }
202:         } else {
203:             // Category is offline
204:             if ($catitem['public'] == 0) {
205:                 // Category is locked
206:                 $icon .= ($no_start || $no_online) ? 'folder_off_error_locked.gif' : 'folder_off_locked.gif';
207:             } else {
208:                 // Category is public
209:                 $icon .= ($no_start || $no_online) ? 'folder_off_error.gif' : 'folder_off.gif';
210:             }
211:         }
212: 
213:         $idcat = $catitem['idcat'];
214: 
215:         $name = '&nbsp;<a href="' . $sess->url("main.php?area=$area&frame=5&idcat=$idcat&appendparameters=$appendparameters") . '" target="right_bottom">' . $catitem['name'] . '</a>';
216:         $marray[] = array(
217:             'id' => $catitem['idcat'],
218:             'name' => $name,
219:             'level' => $catitem['level'],
220:             'attributes' => array(
221:                 'icon' => $icon
222:             )
223:         );
224:     }
225: 
226:     $mtree->setTreeName(i18n("Categories"));
227:     $mtree->setIcon('images/grid_folder.gif');
228:     $mtree->importTable($marray);
229: 
230:     $baselink = new cHTMLLink();
231:     $baselink->setCLink($area, $frame, '');
232:     $baselink->setCustom('appendparameters', $appendparameters);
233: 
234:     $mtree->setBaseLink($baselink);
235:     $mtree->setCollapsed($collapsed);
236:     $mtree->processParameters();
237: 
238:     $collapsed = array();
239:     $mtree->getCollapsedList($collapsed);
240: 
241:     $tpl->set('s', 'CATBROWSER', $mtree->render());
242:     $tpl->set('s', 'APPENDPARAMETERS', '\'&appendparameters=' . $appendparameters . '\'');
243: } else {
244:     $tpl->set('s', 'CATBROWSER', '');
245:     $tpl->set('s', 'APPENDPARAMETERS', '\'&appendparameters=' . $appendparameters . '\'');
246: }
247: 
248: chdir(cRegistry::getBackendPath());
249: 
250: $idFsPathPrefix = 'fs_';
251: 
252: // create javascript multilink
253: $tmp_mstr = '<a id="root" href="javascript:Con.multiLink(\'%s\', \'%s\',\'%s\', \'%s\')">%s</a>';
254: $mstr = sprintf($tmp_mstr, 'right_top', $sess->url("main.php?area=$area&frame=3&path=$pathstring&appendparameters=$appendparameters"), 'right_bottom', $sess->url("main.php?area=$area&frame=4&path=$pathstring&appendparameters=$appendparameters"), '<img class="vAlignMiddle" src="images/ordner_oben.gif" align="middle" alt="" border="0"><img src="images/spacer.gif" width="5" border="0">' . $file);
255: 
256: $tpl->set('d', 'ID_PATH', $idFsPathPrefix . 'root');
257: $tpl->set('d', 'DATA_PATH', $pathstring);
258: $tpl->set('d', 'INDENT', 3);
259: $tpl->set('d', 'DIRNAME', $mstr);
260: $tpl->set('d', 'EDITBUTTON', '');
261: $tpl->set('d', 'DELETEBUTTON', '');
262: $tpl->set('d', 'COLLAPSE', '');
263: $tpl->next();
264: 
265: if (is_array($objects)) {
266:     foreach ($objects as $a_file) {
267:         $file = $a_file->getName();
268:         $depth = $a_file->getCustom('level') - 1;
269:         $pathstring = str_replace($cfgClient[$client]['upl']['path'], '', $a_file->getId());
270:         $a_file->setCollapsedIcon('images/grid_expand.gif');
271:         $a_file->setExpandedIcon('images/grid_collapse.gif');
272:         $dlevels[$depth] = $a_file->getCustom('lastitem');
273:         $imgcollapse = getUplExpandCollapseButton($a_file);
274:         $fileurl = rawurlencode($path . $file . '/');
275:         $pathurl = rawurlencode($path);
276: 
277:         // Indent for every level
278:         $indent = 18 + (($depth - 1) * 18);
279: 
280:         // create javascript multilink
281:         $tmp_mstr = '<a href="javascript:Con.multiLink(\'%s\', \'%s\', \'%s\', \'%s\')">%s</a>';
282:         $mstr = sprintf($tmp_mstr, 'right_top', $sess->url("main.php?area=$area&frame=3&path=$pathstring&appendparameters=$appendparameters"), 'right_bottom', $sess->url("main.php?area=$area&frame=4&path=$pathstring&appendparameters=$appendparameters"), '<img class="vAlignMiddle" src="images/grid_folder.gif" border="0" alt=""><img src="images/spacer.gif" align="middle" width="5" border="0">' . $file);
283: 
284:         $hasFiles = uplHasFiles($pathstring);
285:         $hasSubdirs = uplHasSubdirs($pathstring);
286: 
287:         if ((!$hasSubdirs) && (!$hasFiles) && $perm->have_perm_area_action($tmp_area, "upl_rmdir")) {
288:             // $deletebutton = '
289:             // <a title="' . i18n("Delete directory") . '"
290:             // href="javascript:void(0)"
291:             // onclick="event.cancelBubble=true;Con.showConfirmation(&quot;' .
292:             // i18n("Do you really want to delete the following directory:") .
293:             // '<b>' . $file . '</b>&quot;, function() { deleteDirectory(&quot;'
294:             // . $pathstring . '&quot;); });return false;">
295:             // aa<img src="' . $cfg['path']['images'] . 'delete.gif" border="0"
296:             // title="' . i18n("Delete directory") . '" alt="' . i18n("Delete
297:             // directory") . '">
298:             // </a>';
299:             $deletebutton = '
300:     <a class="jsDelete" title="' . i18n("Delete directory") . '" href="javascript:void(0)">
301:         <img src="' . $cfg['path']['images'] . 'delete.gif" border="0" title="' . i18n("Delete directory") . '" alt="' . i18n("Delete directory") . '">
302:     </a>';
303:         } else {
304:             if ($hasFiles) {
305:                 $message = i18n("Directory contains files");
306:             } else {
307:                 $message = i18n("Permission denied");
308:             }
309:             $deletebutton = '<img src="' . $cfg['path']['images'] . 'delete_inact.gif" border="0" alt="' . $message . '" title="' . $message . '">';
310:         }
311: 
312:         $gline = '';
313:         for ($i = 1; $i < $depth; $i++) {
314:             if ($dlevels[$i] == false && $i != 0) {
315:                 $gline .= '<img class="vAlignMiddle" alt="" src="images/grid_linedown.gif" width="18">';
316:             } else {
317:                 $gline .= '<img class="vAlignMiddle" alt="" src="images/spacer.gif" width="18" height="18">';
318:             }
319:         }
320: 
321:         $parent = str_replace($cfgClient[$client]['upl']['path'], '', $a_file->getCustom('parent'));
322: 
323:         $idAttrPath = str_replace(array(
324:             '/',
325:             ':'
326:         ), array(
327:             '_',
328:             ''
329:         ), trim($pathstring, '/'));
330:         $tpl->set('d', 'ID_PATH', $idFsPathPrefix . $idAttrPath);
331:         $tpl->set('d', 'DATA_PATH', $pathstring);
332:         $tpl->set('d', 'INDENT', 0);
333:         $tpl->set('d', 'DIRNAME', $mstr);
334:         $tpl->set('d', 'EDITBUTTON', '');
335:         $tpl->set('d', 'DELETEBUTTON', $deletebutton);
336:         $tpl->set('d', 'COLLAPSE', $gline . $imgcollapse);
337:         $tpl->next();
338:     }
339: }
340: 
341: $tpl->set('d', 'DELETEBUTTON', '&nbsp;');
342: $tpl->set('d', 'DIRNAME', '');
343: $tpl->set('d', 'EDITBUTTON', '');
344: $tpl->set('d', 'COLLAPSE', "");
345: $tpl->next();
346: 
347: // Database-based filesystem (DBFS)
348: 
349: $idDbfsPathPrefix = 'dbfs_';
350: $file = i18n("Database file system");
351: $pathstring = cApiDbfs::PROTOCOL_DBFS;
352: $rootTreeItem = new TreeItem();
353: $rootTreeItem->setCustom('level', 0);
354: 
355: uplRecursiveDBDirectoryList('', $rootTreeItem, 2, $client);
356: 
357: // Mark all items in the expandedList as expanded
358: foreach ($upldbfsexpandedList as $key => $value) {
359:     $rootTreeItem->markExpanded($value);
360: }
361: 
362: // Collapse and expand the tree
363: if (!empty($collapse)) {
364:     $rootTreeItem->markCollapsed($collapse);
365: }
366: 
367: if (!empty($expand)) {
368:     $rootTreeItem->markExpanded($expand);
369: }
370: 
371: $upldbfsexpandedList = array();
372: $rootTreeItem->getExpandedList($upldbfsexpandedList);
373: 
374: $currentuser->setUserProperty('system', 'upl_dbfs_expandstate', serialize($upldbfsexpandedList));
375: 
376: $objects = array();
377: $rootTreeItem->traverse($objects);
378: 
379: unset($objects[0]);
380: 
381: $tmp_mstr = '<a href="javascript:Con.multiLink(\'%s\', \'%s\', \'%s\', \'%s\')">%s</a>';
382: $mstr = sprintf($tmp_mstr, 'right_top', $sess->url("main.php?area=$area&frame=3&path=$pathstring&appendparameters=$appendparameters"), 'right_bottom', $sess->url("main.php?area=$area&frame=4&path=$pathstring&appendparameters=$appendparameters"), '<img class="vAlignMiddle" src="images/ordner_oben.gif" alt="" border="0"><img src="images/spacer.gif" width="5" border="0">' . $file);
383: 
384: $tpl->set('d', 'ID_PATH', $idDbfsPathPrefix . 'root');
385: $tpl->set('d', 'DATA_PATH', $pathstring);
386: $tpl->set('d', 'INDENT', 3);
387: $tpl->set('d', 'DIRNAME', $mstr);
388: $tpl->set('d', 'EDITBUTTON', '');
389: $tpl->set('d', 'DELETEBUTTON', '');
390: $tpl->set('d', 'COLLAPSE', '');
391: $tpl->next();
392: 
393: $dbfsc = new cApiDbfsCollection();
394: 
395: $dlevels = array();
396: 
397: if (is_array($objects)) {
398:     foreach ($objects as $a_file) {
399:         $file = $a_file->getName();
400:         $depth = $a_file->getCustom('level') - 1;
401:         $pathstring = $a_file->getId();
402:         $a_file->setCollapsedIcon('images/grid_expand.gif');
403:         $a_file->setExpandedIcon('images/grid_collapse.gif');
404:         $dlevels[$depth] = $a_file->getCustom('lastitem');
405:         $collapse = getUplExpandCollapseButton($a_file);
406:         $fileurl = rawurlencode($path . $file . '/');
407:         $pathurl = rawurlencode($path);
408: 
409:         if ($file == 'tmp') {
410:             echo 'tmp2<br>';
411:         }
412: 
413:         // Indent for every level
414:         $indent = 18 + (($depth - 1) * 18);
415: 
416:         // create javascript multilink
417:         $tmp_mstr = '<a href="javascript:Con.multiLink(\'%s\', \'%s\', \'%s\', \'%s\')">%s</a>';
418:         $mstr = sprintf($tmp_mstr, 'right_top', $sess->url("main.php?area=$area&frame=3&path=$pathstring&appendparameters=$appendparameters"), 'right_bottom', $sess->url("main.php?area=$area&frame=4&path=$pathstring&appendparameters=$appendparameters"), '<img class="vAlignMiddle" src="images/grid_folder.gif" border="0" alt=""><img src="images/spacer.gif" align="middle" width="5" border="0">' . $file);
419: 
420:         $hasFiles = $dbfsc->hasFiles($pathstring);
421: 
422:         if (!$hasFiles && $perm->have_perm_area_action($tmp_area, 'upl_rmdir')) {
423:             // $deletebutton = '
424:             // <a title="' . i18n("Delete directory") . '"
425:             // href="javascript:void(0)"
426:             // onclick="event.cancelBubble=true;Con.showConfirmation(&quot;' .
427:             // i18n("Do you really want to delete the following directory:") .
428:             // '<b>' . $file . '</b>' . '&quot;, function() {
429:             // deleteDirectory(&quot;' . $pathstring . '&quot;); });return
430:             // false;">
431:             // <img class="vAlignMiddle" src="' . $cfg['path']['images'] .
432:             // 'delete.gif" border="0" title="' . i18n("Delete directory") . '"
433:             // alt="' . i18n("Delete directory") . '">
434:             // </a>';
435:             $deletebutton = '
436:     <a class="jsDelete" title="' . i18n("Delete directory") . '" href="javascript:void(0)">
437:        <img class="vAlignMiddle" src="' . $cfg['path']['images'] . 'delete.gif" border="0" title="' . i18n("Delete directory") . '" alt="' . i18n("Delete directory") . '">
438:     </a>';
439:         } else {
440:             if ($hasFiles) {
441:                 $message = i18n("Directory contains files");
442:             } else {
443:                 $message = i18n("Permission denied");
444:             }
445:             $deletebutton = '<img class="vAlignMiddle" alt="" src="' . $cfg['path']['images'] . 'delete_inact.gif" border="0" alt="' . $message . '" title="' . $message . '">';
446:         }
447: 
448:         $gline = '';
449:         for ($i = 1; $i < $depth; $i++) {
450:             if ($dlevels[$i] == false && $i != 0) {
451:                 $gline .= '<img class="vAlignMiddle" src="images/grid_linedown.gif" alt="" align="middle">';
452:             } else {
453:                 $gline .= '<img class="vAlignMiddle" src="images/spacer.gif" width="18" height="18" alt="" align="middle">';
454:             }
455:         }
456: 
457:         $parent = str_replace($cfgClient[$client]['upl']['path'], '', $a_file->getCustom('parent'));
458: 
459:         $idAttrPath = str_replace(array(
460:             '/',
461:             ':'
462:         ), array(
463:             '_',
464:             ''
465:         ), trim($pathstring, '/'));
466:         $tpl->set('d', 'ID_PATH', $idDbfsPathPrefix . $idAttrPath);
467:         $tpl->set('d', 'DATA_PATH', $pathstring);
468:         $tpl->set('d', 'INDENT', 0);
469:         $tpl->set('d', 'DIRNAME', $mstr);
470:         $tpl->set('d', 'EDITBUTTON', '');
471:         $tpl->set('d', 'DELETEBUTTON', $deletebutton);
472:         $tpl->set('d', 'COLLAPSE', $gline . $collapse);
473:         $tpl->next();
474:     }
475: }
476: 
477: $pathPrefix = (cApiDbfs::isDbfs($path)) ? $idDbfsPathPrefix : $idFsPathPrefix;
478: $idAttrPath = str_replace(array(
479:     '/',
480:     ':'
481: ), array(
482:     '_',
483:     ''
484: ), trim($path, '/'));
485: $tpl->set('s', 'ID_PATH', $pathPrefix . $idAttrPath);
486: $tpl->set('s', 'DELETE_MSG', i18n("Do you really want to delete the following directory:") . '<b>{path}</b>');
487: 
488: chdir(cRegistry::getBackendPath());
489: 
490: $tpl->generate($cfg['path']['templates'] . $cfg['templates']['upl_dirs_overview']);
491: 
CMS CONTENIDO 4.10.0 API documentation generated by ApiGen 2.8.0