Beispiel #1
0
    if ($fPath != '') {
        getCollectionRecord($fPath, &$collectionRecord);
        $returnText .= $collectionRecord['collection_full'];
    }
    $returnText .= '</option>';
}
$returnText .= '</select>';
$returnText .= SYS_DBL_SPACE . '<input class="action" type="image" src="' . DCTL_IMAGES . 'action_refresh_blue.gif" />';
$returnText .= '<input type="hidden" name="selectColl" value="seleziona" />';
$returnText .= '<input type="hidden" name="posx" value="' . $fDiv0 . '" />';
$returnText .= '</fieldset>';
$returnText .= '</form>';
$prosecute = in_array($collectionPath, $collectionList['path']);
if ($prosecute) {
    getCollectionRecord($collectionPath, &$collectionRecord);
    $collection_short = $collectionRecord['collection_short'];
    $returnText .= '<h2>Collection "' . $collectionRecord['collection_short'] . ' - ' . $collectionRecord['collection_work'] . '"</h2>';
    $header = $collectionPath . DCTL_FILE_HEADER;
    $contents = cleanUpIndentation(file_get_contents($header));
    $select = $COLLECTION_FIELDS['label'];
    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
    $returnText .= getManagementOfImages('divImagesCollection', 'dei Media', $collection_id, $collection_short, $loc4msg, &$fCount, $resultMsg);
}
$returnText .= '</div>';
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
$returnText .= '</div>';
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
$returnText .= '</div>';
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
echo $returnText;
/* NO ?> IN FILE .INC */
Beispiel #2
0
function dctl_insertContent($complete_id, $param)
{
    $complete_id = explode('-', $complete_id);
    $collection_id = $complete_id[0];
    $package_id = $complete_id[1];
    $text = '';
    $fSelectorX = trim($param);
    $fSelectorX = str_ireplace('"', '', $fSelectorX);
    $fSelectorX = str_ireplace('item=', '', $fSelectorX);
    $dPath = DCTL_PROJECT_PATH . $collection_id;
    if ($package_id != '') {
        $dPath .= SYS_PATH_SEP . $package_id;
    }
    $isMultiPart = stripos($fSelectorX, '$') !== FALSE;
    if ($isMultiPart) {
        $regexp = str_ireplace(DCTL_PACKAGE_BODY_REGEXP1, DCTL_PACKAGE_BODY_REGEXP2, $fSelectorX);
    } else {
        $regexp = $fSelectorX;
    }
    $variants = array();
    if (is_dir($dPath)) {
        $handle = opendir($dPath);
        while ($entry = readdir($handle)) {
            if (substr($entry, 0, 1) != '.') {
                $variants[] = $entry;
            }
        }
    }
    $variants = array_values(preg_grep('/^' . $regexp . '/', $variants));
    sort($variants);
    $max = count($variants) - 1;
    foreach ($variants as $vKey => $fSelector) {
        if (!$isMultiPart || $isMultiPart && ($vKey > 0 && $vKey < $max)) {
            $fPath = $dPath . SYS_PATH_SEP . $fSelector;
            $textContent = cleanUpIndentation(charset_decode_utf_8(file_get_contents($fPath)));
            $header = '<!-- %BEGIN% -->';
            $textContent = substr($textContent, stripos($textContent, $header) + strlen($header));
            $footer = '<!-- %END% -->';
            $textContent = substr($textContent, 0, stripos($textContent, $footer));
            $textContent = preg_replace('/(<!--' . WS . '*BEGIN' . WS . '*-->)/', '', $textContent);
            $textContent = preg_replace('/(<!--' . WS . '*END' . WS . '*-->)/', '', $textContent);
            $textContent = preg_replace('/' . WS . '+/', ' ', $textContent);
            $textContent = forceUTF8($textContent);
            $checkContent = preg_replace('/\\w+:(\\w+)/', '$1', $textContent);
            $checkContent = '<?xml version="1.0" encoding="UTF-8" ?><test>' . translateLiteral2NumericEntities($checkContent) . '</test>';
            if ($e = simplexml_load_string($checkContent, 'SimpleXMLElement', DCTL_XML_LOADER)) {
                $checkChildren = count($e->children());
                if ($checkChildren < 1) {
                    $textContent = '<div type="part" />';
                }
            }
            $text .= $textContent;
        }
    }
    return strval($text);
}