getFiles() публичный Метод

Get all the files and directories of a relative path.
public getFiles ( string $p_articleId, $p_languageId = null ) : array
$p_articleId string
Результат array of file and path information. array('url'=>'full url', 'storage'=>'full file path')
Пример #1
0
require_once('config.inc.php');
require_once($GLOBALS['g_campsiteDir']."/$ADMIN_DIR/lib_campsite.php");
require_once('classes/AttachmentManager.php');

$manager = new AttachmentManager($AMConfig);

$languageSelected = (isset($_REQUEST['language_selected']) && is_numeric($_REQUEST['language_selected']))
    ? $_REQUEST['language_selected'] : null;
$articleId = (isset($_REQUEST['article_id']) && is_numeric($_REQUEST['article_id']))
    ? $_REQUEST['article_id'] : null;

// Get the list of files and directories
$list = array();
if (!is_null($articleId)) {
    $list = $manager->getFiles($articleId, $languageSelected);
}


/**
 * Draw the files in a table.
 */
function drawFiles($list, &$manager)
{
    global $languageSelected, $Campsite;

    $counter = 0;
    foreach($list as $entry => $file)
    {
        $counter++;
        $languageId = ($file['attachment']->getLanguageId()) ? $file['attachment']->getLanguageId() : $languageSelected;