$titleBlock = new CTitleBlock('Files', 'folder5.png', $m, $m . '.' . $a); $titleBlock->addCell($AppUI->_('Filter') . ':'); $titleBlock->addCell(arraySelect($projects, 'project_id', 'onchange="javascript:document.pickProject.submit()" size="1" class="text"', $project_id), '', '<form name="pickProject" action="?m=files" method="post">', '</form>'); /* * override the file module's $canEdit variable passed from the main index.php * in order to check on file folder permissions */ $canAuthor_folders = getPermission('file_folders', 'add'); if ($canAuthor) { $titleBlock->addCell('<input type="submit" class="button" value="' . $AppUI->_('new file') . '" />', '', '<form action="?m=files&a=addedit&folder=' . $folder . '" method="post">', '</form>'); } if ($canAuthor_folders) { $titleBlock->addCell('<input type="submit" class="button" value="' . $AppUI->_('new folder') . '" />', '', '<form action="?m=files&a=addedit_folder" method="post">', '</form>'); } $titleBlock->show(); $file_types = dPgetSysVal('FileType'); $fts = $file_types; if ($tab != -1) { array_unshift($file_types, 'All Files'); } $tabBox = new CTabBox('?m=files', DP_BASE_DIR . '/modules/files/', $tab); $tabbed = $tabBox->isTabbed(); $i = 0; foreach ($file_types as $file_type) { $tabBox->add('index_table', $file_type); ++$i; } if ($canAccess_folders) { $tabBox->add('folders_table', 'Folder Explorer'); } $tabBox->show();
<?php if (!defined('W2P_BASE_DIR')) { die('You should not access this file directly.'); } $tab = $AppUI->processIntState('ResourceTypeTab', $_GET, 'tab', 0); $obj = new CResource(); $perms =& $AppUI->acl(); $canEdit = canEdit('resources'); $titleBlock = new w2p_Theme_TitleBlock('Resources', 'icon.png', $m); if ($canEdit) { $titleBlock->addButton('new resource', '?m=resources&a=addedit'); } $titleBlock->show(); $resource_types = w2PgetSysVal('ResourceTypes'); $tabBox = new CTabBox('?m=resources', W2P_BASE_DIR . '/modules/resources/', $tab); if ($tabBox->isTabbed()) { array_unshift($resource_types, $AppUI->_('All Resources', UI_OUTPUT_RAW)); } foreach ($resource_types as $resource_type) { $tabBox->add('vw_resources', $resource_type); } $tabBox->show();