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
  • Function
  • Tree
  • Deprecated
  • Todo
  1: <?php
  2: /**
  3:  * This file contains the backend page for editing meta information of file in upload section.
  4:  *
  5:  * @package          Core
  6:  * @subpackage       Backend
  7:  * @version          SVN Revision $Rev:$
  8:  *
  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.upl.php');
 19: 
 20: $isZipFile = isArchive($_REQUEST['file']);
 21: 
 22: $page = new cGuiPage('upl_edit');
 23: 
 24: $page->addStyle('jquery/plugins/timepicker.css');
 25: $page->addScript('jquery/plugins/timepicker.js');
 26: $page->addScript('include.upl_edit.js');
 27: 
 28: //get language js files
 29: if (($lang_short = substr(strtolower($belang), 0, 2)) != 'en') {
 30:     $page->addScript('jquery/plugins/timepicker-' . $lang_short . '.js');
 31:     $page->addScript('jquery/plugins/datepicker-' . $lang_short . '.js');
 32: }
 33: 
 34: $form = new cGuiTableForm('properties');
 35: $form->setVar('frame', $frame);
 36: $form->setVar('area', 'upl');
 37: $form->setVar('path', $_REQUEST['path']);
 38: $form->setVar('file', $_REQUEST['file']);
 39: $form->setVar('action', 'upl_modify_file');
 40: $form->setVar('startpage', $_REQUEST['startpage']);
 41: $form->setVar('sortby', $_REQUEST['sortby']);
 42: $form->setVar('sortmode', $_REQUEST['sortmode']);
 43: $form->setVar('thumbnailmode', $_REQUEST['thumbnailmode']);
 44: // $form->setVar('zip', (isArchive( $_REQUEST['file'])) ? '1' : '0');
 45: $form->addHeader(i18n('Edit'));
 46: 
 47: if (isset($_REQUEST['zip'])) {
 48:     var_dump('zip');
 49: }
 50: $properties = new cApiPropertyCollection();
 51: $uploads = new cApiUploadCollection();
 52: 
 53: if (cApiDbfs::isDbfs($_REQUEST['path'])) {
 54:     $qpath = $_REQUEST['path'] . '/';
 55: } else {
 56:     $qpath = $_REQUEST['path'];
 57: }
 58: 
 59: if ((is_writable($cfgClient[$client]['upl']['path'] . $path) || cApiDbfs::isDbfs($path)) && (int) $client > 0) {
 60:     $bDirectoryIsWritable = true;
 61: } else {
 62:     $bDirectoryIsWritable = false;
 63: }
 64: 
 65: $uploads->select("idclient = '" . $client . "' AND dirname = '" . $qpath . "' AND filename='" . $_REQUEST['file'] . "'");
 66: 
 67: if ($upload = $uploads->next()) {
 68: 
 69:     // Which rows to display?
 70:     $aListRows = array();
 71:     $aListRows['filename'] = i18n('File name');
 72:     $aListRows['path'] = i18n('Path');
 73:     $aListRows['replacefile'] = i18n('Replace file');
 74:     $aListRows['medianame'] = i18n('Media name');
 75:     $aListRows['description'] = i18n('Description');
 76:     $aListRows['keywords'] = i18n('Keywords');
 77:     $aListRows['medianotes'] = i18n('Internal notes');
 78:     $aListRows['copyright'] = i18n('Copyright');
 79:     $aListRows['protected'] = i18n('Protection');
 80:     $aListRows['timecontrol'] = i18n('Time control');
 81:     $aListRows['preview'] = i18n('Preview');
 82:     $aListRows['author'] = i18n('Author');
 83:     $aListRows['modified'] = i18n('Last modified by');
 84: 
 85:     if ($isZipFile) {
 86:         $id = $_GET['user_id'];
 87:         //echo '<input type="button" value="test";
 88: 
 89:         if (isset($_SESSION['zip']) && $_SESSION['zip'] === 'extract') {
 90: 
 91:         }
 92: 
 93:         $link = new cHTMLLink();
 94:         $link->appendContent(i18n('extract'));
 95:         $aListRows['zip'] = $link;
 96:     }
 97:     ($isZipFile) ? $aListRows['extractFolder'] = '<label class="ZipExtract">' . i18n('extractTo') . '</label>' : '';
 98: 
 99:     // Delete dbfs specific rows
100:     if (!cApiDbfs::isDbfs($_REQUEST['path'])) {
101:         unset($aListRows['protected']);
102:         unset($aListRows['timecontrol']);
103:     }
104: 
105:     // Call chains to process the rows
106:     $_cecIterator = $_cecRegistry->getIterator('Contenido.Upl_edit.Rows');
107:     if ($_cecIterator->count() > 0) {
108:         while ($chainEntry = $_cecIterator->next()) {
109:             $newRowList = $chainEntry->execute($aListRows);
110:             if (is_array($newRowList)) {
111:                 $aListRows = $newRowList;
112:             }
113:         }
114:     }
115: 
116:     $iIdupl = $upload->get('idupl');
117: 
118:     $uploadMeta = new cApiUploadMeta();
119:     $uploadMeta->loadByUploadIdAndLanguageId($iIdupl, $lang);
120: 
121:     // Add rows to $form
122:     foreach ($aListRows as $sListRow => $sTitle) {
123:         $sCell = '';
124:         switch ($sListRow) {
125:             case 'filename':
126:                 $sCell = $_REQUEST['file'];
127:                 break;
128: 
129:             case 'zip':
130:                 $sCell = new cHTMLCheckbox('extractZip', '');
131:                 $sCell->setEvent('onclick', 'show();');
132:                 // $sCell->setClass('ZipExtract');
133:                 break;
134: 
135:             case 'extractFolder':
136:                 $box = new cHTMLTextbox('efolder');
137:                 $box->setID('extractFolder');
138:                 $box->setValue(strstr($_REQUEST['file'], '.', TRUE));
139:                 $box->setClass('ZipExtract');
140:                 $sCell = $box;
141:                 $checkbox = new cHTMLCheckbox('overwrite', i18n('overwrite'));
142:                 $checkbox->setID('overwrite');
143:                 $checkbox->setLabelText(i18n('overwrite'));
144:                 $checkbox->setClass('ZipExtract');
145: 
146:                 $sCell .= $checkbox;
147:                 break;
148: 
149:             case 'path':
150:                 $sCell = generateDisplayFilePath($qpath, 65);
151:                 break;
152: 
153:             case 'replacefile':
154:                 $uplelement = new cHTMLUpload('file', 40);
155:                 $uplelement->setDisabled(!$bDirectoryIsWritable);
156:                 $sCell = $uplelement->render();
157:                 break;
158: 
159:             case 'medianame':
160:                 if ($uploadMeta->get('medianame')) {
161:                     $medianame = cSecurity::unFilter($uploadMeta->get('medianame'));
162:                 } else {
163:                     $medianame = $properties->getValue('upload', $qpath . $_REQUEST['file'], 'file', 'medianame');
164:                 }
165: 
166:                 $mnedit = new cHTMLTextbox('medianame', $medianame, 60);
167:                 $sCell = $mnedit->render();
168:                 break;
169: 
170:             case 'description':
171:                 if ($uploadMeta->get('description')) {
172:                     $description = cSecurity::unFilter($uploadMeta->get('description'));
173:                 } else {
174:                     $description = '';
175:                 }
176: 
177:                 $dsedit = new cHTMLTextarea('description', $description);
178:                 $sCell = $dsedit->render();
179:                 break;
180: 
181:             case 'keywords':
182:                 if ($uploadMeta->get('keywords')) {
183:                     $keywords = cSecurity::unFilter($uploadMeta->get('keywords'));
184:                 } else {
185:                     $keywords = $properties->getValue('upload', $qpath . $_REQUEST['file'], 'file', 'keywords');
186:                 }
187: 
188:                 $kwedit = new cHTMLTextarea('keywords', $keywords);
189:                 $sCell = $kwedit->render();
190:                 break;
191: 
192:             case 'medianotes':
193:                 if ($uploadMeta->get('internal_notice')) {
194:                     $medianotes = cSecurity::unFilter($uploadMeta->get('internal_notice'));
195:                 } else {
196:                     $medianotes = $properties->getValue('upload', $qpath . $_REQUEST['file'], 'file', 'medianotes');
197:                 }
198: 
199:                 $moedit = new cHTMLTextarea('medianotes', $medianotes);
200:                 $sCell = $moedit->render();
201:                 break;
202: 
203:             case 'copyright':
204:                 if ($uploadMeta->get('copyright')) {
205:                     $copyright = cSecurity::unFilter($uploadMeta->get('copyright'));
206:                 } else {
207:                     $copyright = $properties->getValue('upload', $qpath . $_REQUEST['file'], 'file', 'copyright');
208:                 }
209: 
210:                 $copyrightEdit = new cHTMLTextarea('copyright', $copyright);
211:                 $sCell = $copyrightEdit->render();
212:                 break;
213: 
214:             case 'protected':
215:                 $vprotected = $properties->getValue('upload', $qpath . $_REQUEST['file'], 'file', 'protected');
216:                 $protected = new cHTMLCheckbox('protected', '1');
217:                 $protected->setChecked($vprotected);
218:                 $protected->setLabelText(i18n('Protected for non-logged in users'));
219:                 $sCell = $protected->render();
220:                 break;
221: 
222:             case 'timecontrol':
223:                 $iTimeMng = (int) $properties->getValue('upload', $qpath . $_REQUEST['file'], 'file', 'timemgmt');
224:                 $sStartDate = $properties->getValue('upload', $qpath . $_REQUEST['file'], 'file', 'datestart');
225:                 $sEndDate = $properties->getValue('upload', $qpath . $_REQUEST['file'], 'file', 'dateend');
226: 
227:                 $oTimeCheckbox = new cHTMLCheckbox('timemgmt', i18n('Use time control'));
228:                 $oTimeCheckbox->setChecked($iTimeMng);
229: 
230:                 $sHtmlTimeMng = $oTimeCheckbox->render();
231:                 $sHtmlTimeMng .= "<table id='dbfsTimecontrol' class='borderless' border='0' cellpadding='0' cellspacing='0'>\n";
232:                 $sHtmlTimeMng .= "<tr><td><label for='datestart'>" . i18n('Start date') . "</label></td>\n";
233:                 $sHtmlTimeMng .= '<td><input type="text" name="datestart" id="datestart" value="' . $sStartDate . '"  size="20" maxlength="40" class="text_medium">' .
234:                         '</td></tr>';
235:                 $sHtmlTimeMng .= "<tr><td><label for='dateend'>" . i18n('End date') . "</label></td>\n";
236:                 $sHtmlTimeMng .= '<td><input type="text" name="dateend" id="dateend" value="' . $sEndDate . '"  size="20" maxlength="40" class="text_medium">' .
237:                         '</td></tr>';
238:                 $sHtmlTimeMng .= "</table>\n";
239: 
240:                 $sCell = $sHtmlTimeMng;
241:                 break;
242: 
243:             case 'preview':
244:                 if (cApiDbfs::isDbfs($_REQUEST['path'])) {
245:                     $sCell = '<a target="_blank" href="' . $sess->url(cRegistry::getFrontendUrl() . "dbfs.php?file=" . $qpath . $_REQUEST['file']) . '"><img class="bordered" src="' . uplGetThumbnail($qpath . $_REQUEST['file'], 350) . '"></a>';
246:                 } else {
247:                     $sCell = '<a target="_blank" href="' . $cfgClient[$client]['upl']['htmlpath'] . $qpath . $_REQUEST['file'] . '"><img class="bordered" src="' . uplGetThumbnail($qpath . $_REQUEST['file'], 350) . '"></a>';
248:                 }
249:                 break;
250: 
251:             case 'author':
252:                 $oUser = new cApiUser($upload->get('author'));
253:                 $sCell = $oUser->get('username') . ' (' . displayDatetime($upload->get('created')) . ')';
254:                 break;
255: 
256:             case 'modified':
257:                 $oUser = new cApiUser($upload->get('modifiedby'));
258:                 $sCell = $oUser->get('username') . ' (' . displayDatetime($upload->get('lastmodified')) . ')';
259:                 break;
260: 
261:             default:
262:                 // Call chain to retrieve value
263:                 $_cecIterator = $_cecRegistry->getIterator('Contenido.Upl_edit.RenderRows');
264: 
265:                 if ($_cecIterator->count() > 0) {
266:                     $contents = array();
267:                     while ($chainEntry = $_cecIterator->next()) {
268:                         $contents[] = $chainEntry->execute($iIdupl, $qpath, $_REQUEST['file'], $sListRow);
269:                     }
270:                 }
271:                 $sCell = implode('', $contents);
272:         }
273:         $form->add($sTitle, $sCell);
274:     }
275: 
276:     $sScript = '';
277:     if (cApiDbfs::isDbfs($_REQUEST['path'])) {
278:         $sScript = '
279: 
280:        <script type="text/javascript">
281:        var startcal = new calendar1(document.properties.elements["datestart"]);
282:        startcal.year_scroll = true;
283:        startcal.time_comp = true;
284:        var endcal = new calendar1(document.properties.elements["dateend"]);
285:        endcal.year_scroll = true;
286:        endcal.time_comp = true;
287: 
288:        </script>
289: 
290:        ';
291:     }
292: 
293:     if ($bDirectoryIsWritable == false) {
294:         $pager->displayError(i18n('Directory not writable') . ' (' . $cfgClient[$client]['upl']['path'] . $path . ')');
295:     }
296: 
297:     $page->set('s', 'FORM', $form->render() . $sScript);
298: } else {
299:     $page->displayCriticalError(sprintf(i18n('Could not load file %s'), $_REQUEST['file']));
300: }
301: 
302: $page->render();
303: 
304: function isArchive($fileName) {
305: 
306:     if (substr(strrchr($fileName, '.'), 1) === 'zip') {
307:         return true;
308:     } else {
309:         return false;
310:     }
311: }
312: 
CMS CONTENIDO 4.9.2 API documentation generated by ApiGen 2.8.0