$returnText .= '<div class="lnk_right">'; $returnText .= '<div class="src_col">'; $returnText .= '<div class="lineH1">Selettore Part</div>'; $returnText .= '<div id="xml_tree1" class="src_tree"></div>'; $returnText .= '</div>'; $returnText .= '<div id="lnk_result" class="lnk_result"></div>'; $returnText .= '<div class="imt">' . $flashMarkup . '</div>'; $returnText .= '</div>'; } else { $returnText .= '<div class="lnk_left">'; $returnText .= '<div class="lineH1">Collection</div>'; $returnText .= '<div class="lnk_col">'; $returnText .= '<form>'; $returnText .= '<fieldset>'; $basePath = DCTL_PROJECT_PATH; getCollectionList($basePath, &$collectionList); foreach ($collectionList['path'] as $key => $fPath) { getCollectionRecord($fPath, &$collectionRecord); $returnText .= '<input type="radio" name="collection_id[]" value="' . $collectionRecord['collection_id'] . '" />'; $returnText .= '<label class="text" onclick="$(this).prev().click();"> ' . cleanWebString($collectionRecord['collection_short'], FIELD_STRING_LENGTH) . '</label>'; $returnText .= '<br/>'; } $returnText .= '</fieldset>'; $returnText .= '</form>'; $returnText .= '</div>'; $returnText .= '<div class="lineH1">Codice XML</div>'; $returnText .= '<div id="xml_chunk"></div>'; $returnText .= '</div>'; $returnText .= '<div class="lnk_right">'; $returnText .= '<div class="src_col">'; $returnText .= '<div class="lineH1">Selettore ID</div>';
} else { $resultMsg .= '<span class="error">ERRORE: il file di tipo "' . strtoupper($extToUpload) . '" non è valido...</span><br />'; } } } } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // COLLECTION // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * $returnText .= '<h2>Gestione Collection & Media</h2>'; // // SELEZIONA COLLECTION $fDiv0 = 'divSelectCollection'; $collectionPath = DCTL_PROJECT_PATH . $collection_id . SYS_PATH_SEP; getCollectionList(DCTL_PROJECT_PATH, &$collectionList, true); //putOpenCloseLevel $returnText .= putOpenLevel($fDiv0, $loc4msg, $collection_id != '', 'Seleziona una Collection (' . (count($collectionList['path']) - 1) . ')', &$resultMsg); $returnText .= '<form id="form' . $fDiv0 . '" action="' . $_SERVER['PHP_SELF'] . '" method="' . DCTL_FORM_METHOD . '" enctype="' . DCTL_FORM_ENCTYPE . '">'; $returnText .= '<fieldset>'; $returnText .= '<label>Scegli:</label>'; $returnText .= SYS_DBL_SPACE; $returnText .= '<select name="collection_id" onchange="javascript:submitform(\'form' . $fDiv0 . '\')">'; foreach ($collectionList['path'] as $key => $fPath) { $returnText .= '<option value="' . $fPath . '"'; if ($fPath == $collectionPath) { $returnText .= ' selected="selected"'; } $returnText .= '>'; if ($fPath != '') { getCollectionRecord($fPath, &$collectionRecord);
function ajax_loadFullTree($upToLevel = 0, $collection_id = '', $media_id = '', $package_id = '', $part_id = '') { $resultText = ''; // BEGIN $basePath = DCTL_PROJECT_PATH; $collectionPath = $basePath . $collection_id; if ($collection_id == '' || $upToLevel == 1) { // ALL COLLECTIONS $resultText .= '<ul>'; getCollectionList($basePath, &$collectionList); foreach ($collectionList['path'] as $key => $fPath) { getCollectionRecord($fPath, &$collectionRecord); $selected = $collection_id == $collectionRecord['collection_id']; $resultText .= '<li' . ($selected ? ' class="open"' : '') . '>'; $resultText .= '<span class="text"><span class="collection ' . ($selected ? ' selected' : '') . '">' . $collectionRecord['collection_full'] . '</span></span>'; if ($selected) { $resultText .= ajax_loadTree(2, $collection_id, $media_id, $package_id, $part_id, $what); } else { $resultText .= '<ul' . ($selected ? '' : ' class="ajax"') . '>'; $resultText .= '<li>{url:indexAjax.php?action=ajax_loadFullTree&collection_id=' . $collectionRecord['collection_id'] . '}</li>'; $resultText .= '</ul>'; } $resultText .= '</li>'; } $resultText .= '<li class="add"><span class="text">aggiungi Collection...</span></li>'; $resultText .= '</ul>'; } else { // ONE COLLECTION if ($package_id == '' && $media_id == '' || $upToLevel == 2) { $resultText .= '<ul>'; $resultText .= '<li class="edit"><span class="text">edit Collection...</span></li>'; $resultText .= '<li class="publish"><span class="text">Pubblicazione Web</span>'; $resultText .= '<a href="#" title="Pubblica" class="publish"><span class="hidden">Pubblica</span></a>'; $resultText .= '<a href="#" title="Ritira" class="unpublish"><span class="hidden">Ritira</span></a>'; $resultText .= '</li>'; // LOAD PACKAGES $resultText .= '<li' . ($package_id != '' ? ' class="open"' : '') . '>'; $resultText .= '<span class="text">Gestione Package</span>'; if ($package_id != '') { $resultText .= ajax_loadTree(3, $collection_id, '', $package_id, $part_id, $what); } else { $resultText .= '<ul' . ($package_id == '' ? ' class="ajax"' : '') . '>'; $resultText .= '<li>{url:indexAjax.php?action=ajax_loadFullTree&collection_id=' . $collection_id . '&package_id=*}</li>'; $resultText .= '</ul>'; } $resultText .= '</li>'; // LOAD MEDIA $resultText .= '<li' . ($media_id != '' ? ' class="open"' : '') . '>'; $resultText .= '<span class="text">Gestione Media</span>'; if ($media_id != '') { $resultText .= ajax_loadTree(3, $collection_id, $media_id, '', $part_id, $what); } else { $resultText .= '<ul' . ($media_id == '' ? ' class="ajax"' : '') . '>'; $resultText .= '<li>{url:indexAjax.php?action=ajax_loadFullTree&collection_id=' . $collection_id . '&media_id=*}</li>'; $resultText .= '</ul>'; } $resultText .= '</li>'; $resultText .= '</ul>'; } else { if ($package_id != '') { if ($package_id == '*' || $upToLevel == 3) { // ALL PACKAGES $basePath = $collectionPath; $packagePath = $basePath . $package_id; $resultText .= '<ul>'; getPackageList($basePath, &$packageList); foreach ($packageList['path'] as $key => $fPath) { getPackageRecord($fPath, &$packageRecord); $selected = $package_id == $packageRecord['package_id']; $resultText .= '<li' . ($selected ? ' class="open"' : '') . '>'; $resultText .= '<span class="text"><span class="package' . ($selected ? ' selected' : '') . '">' . $packageRecord['package_full'] . '</span></span>'; if ($selected) { $resultText .= ajax_loadTree(4, $collection_id, '', $package_id, $part_id, $what); } else { $resultText .= '<ul' . ($selected ? '' : ' class="ajax"') . '>'; $resultText .= '<li>{url:indexAjax.php?action=ajax_loadFullTree&collection_id=' . $collection_id . '&package_id=' . $packageRecord['package_id'] . '}</li>'; $resultText .= '</ul>'; } $resultText .= '</li>'; } $resultText .= '<li class="add"><span class="text">aggiungi Package...</span></li>'; $resultText .= '</ul>'; } else { if ($part_id == '' || $upToLevel == 4) { $resultText .= '<ul>'; $resultText .= '<li class="edit"><span class="text">edit Package...</span></li>'; $resultText .= '<li class="publish"><span class="text">Pubblicazione Web</span>'; $resultText .= '<a href="#" title="Pubblica" class="publish"><span class="hidden">Pubblica</span></a>'; $resultText .= '<a href="#" title="Ritira" class="unpublish"><span class="hidden">Ritira</span></a>'; $resultText .= '</li>'; // LOAD PARTS $resultText .= '<li' . ($part_id != '' ? ' class="open"' : '') . '>'; $resultText .= '<span class="text">Gestione Part</span>'; if ($part_id != '') { $resultText .= ajax_loadTree(5, $collection_id, '', $package_id, $part_id, $what); } else { $resultText .= '<ul' . ($part_id == '' ? ' class="ajax"' : '') . '>'; $resultText .= '<li>{url:indexAjax.php?action=ajax_loadFullTree&collection_id=' . $collection_id . '&package_id=' . $package_id . '&part_id=*}</li>'; $resultText .= '</ul>'; } $resultText .= '</li>'; $resultText .= '</ul>'; } else { // ALL PARTS $basePath = $collectionPath . $package_id . SYS_PATH_SEP; $partPath = $basePath . $part_id; $resultText .= '<ul>'; getPartList($basePath, &$partList); foreach ($partList['path'] as $key => $fPath) { getPartRecord($fPath, &$partRecord); $selected = $part_id == $partRecord['part_id']; $resultText .= '<li' . ($selected ? ' class="open"' : '') . '>'; $resultText .= '<span class="text"><span class="part' . ($selected ? ' selected' : '') . '">' . cleanWebString($partRecord['part_short'] . ' - ' . $partRecord['part_work'], FIELD_STRING_LENGTH) . SYS_DBL_SPACE . '</span></span>'; $resultText .= '<a href="#" title="Scarica" class="dnload"><span class="hidden">Scarica</span></a>'; $resultText .= '<a href="#" title="Ricarica" class="upload"><span class="hidden">Ricarica</span></a>'; $resultText .= '</li>'; } $resultText .= '<li class="add"><span class="text">aggiungi Part...</span></li>'; $resultText .= '</ul>'; } } } if ($media_id != '') { // ALL MEDIA $basePath = $collectionPath . DCTL_MEDIA_BIG; $mediaPath = $basePath . $media_id; $resultText .= '<ul>'; getMediaList($basePath, &$mediaList); foreach ($mediaList['path'] as $key => $fPath) { getMediaRecord($fPath, &$mediaRecord); $selected = $media_id == $mediaRecord['media_id']; $resultText .= '<li' . ($selected ? ' class="open"' : '') . '>'; $resultText .= '<span class="text"><span class="media' . ($selected ? ' selected' : '') . '">' . cleanWebString($mediaRecord['media_short'] . ' - ' . $mediaRecord['media_work'], FIELD_STRING_LENGTH) . SYS_DBL_SPACE . '</span></span>'; $resultText .= '<a href="#" title="Aggiorna" class="update"><span class="hidden">Aggiorna</span></a>'; $resultText .= '<a href="#" title="Elimina" class="delete"><span class="hidden">Elimina</span></a>'; $resultText .= '</li>'; } $resultText .= '<li class="add"><span class="text">aggiungi Media...</span></li>'; $resultText .= '</ul>'; } } } return $resultText; }