示例#1
0
文件: custom.php 项目: chnm/theme-rpi
function rpi_display_custom_element_set($record, $setElements)
{
    $populatedElements = array();
    foreach ($setElements as $element) {
        if (is_array($element) && count($element) == 2) {
            $populatedElements[$element[1]]['texts'] = rpiGetElementText($record, $element[0], $element[1]);
        }
    }
    $html = '';
    foreach ($populatedElements as $elementName => $elementInfo) {
        if (count($elementInfo['texts']) > 0) {
            $html .= '<div id="' . text_to_id(html_escape("{$elementName}")) . '" class="element">';
            $html .= '<h3>' . html_escape(__($elementName)) . '</h3>';
            foreach ($elementInfo['texts'] as $text) {
                $html .= '<div class="element-text">' . $text . '</div>';
            }
            $html .= '</div>';
        }
    }
    return $html;
}
示例#2
0
$tabs['Tags'] = ob_get_contents();
ob_end_clean();
$tabs = apply_filters('admin_items_form_tabs', $tabs, array('item' => $item));
?>

<!-- Create the sections for the various element sets -->

<ul id="section-nav" class="navigation tabs">
    <?php 
foreach ($tabs as $tabName => $tabContent) {
    ?>
        <?php 
    if (!empty($tabContent)) {
        // Don't display tabs with no content. '
        ?>
            <li><a href="#<?php 
        echo html_escape(text_to_id($tabName) . '-metadata');
        ?>
"><?php 
        echo html_escape(__($tabName));
        ?>
</a></li>
        <?php 
    }
    ?>
 
    <?php 
}
?>
</ul>
<?php

foreach ($elementsForDisplay as $setName => $setElements) {
    ?>
<div class="element-set">
    <!-- DOC: "Dublin Core" title used to be here -->
    <?php 
    foreach ($setElements as $elementName => $elementInfo) {
        ?>
    <div id="<?php 
        echo text_to_id(html_escape("{$setName} {$elementName}"));
        ?>
" class="element">
        <h3><?php 
        echo html_escape(__($elementName));
        ?>
</h3>
        <?php 
        foreach ($elementInfo['texts'] as $text) {
            ?>
            <div class="element-text"><?php 
            echo $text;
            ?>
</div>
        <?php 
        }
        ?>
    </div><!-- end element -->
    <?php 
    }
    ?>
示例#4
0
echo flash();
?>
<form method="post" action="">
    <section class="seven columns alpha" id="edit-form">
        <?php 
echo file_markup($file);
?>
        <div id="file-metadata">
            <?php 
foreach ($tabs as $tabName => $tabContent) {
    ?>
            <?php 
    if (!empty($tabContent)) {
        ?>
                <div id="<?php 
        echo text_to_id(html_escape($tabName));
        ?>
-metadata">
                    <fieldset class="set">
                        <h2><?php 
        echo html_escape(__($tabName));
        ?>
</h2>
                        <?php 
        echo $tabContent;
        ?>
                    </fieldset>
                </div>
            <?php 
    }
    ?>
/**
 * Returns a string for neatline_json 'classname' attribute for an item.
 *
 * Default fields included are: 'item', item type name, all DC:Type values.
 *
 * Output can be filtered using the 'neatlinetime_item_class' filter.
 *
 * @return string
 */
function neatlinetime_item_class($item = null)
{
    $classArray = array('item');
    if ($itemTypeName = metadata($item, 'item_type_name')) {
        $classArray[] = text_to_id($itemTypeName);
    }
    if ($dcTypes = metadata($item, array('Dublin Core', 'Type'), array('all' => true))) {
        foreach ($dcTypes as $type) {
            $classArray[] = text_to_id($type);
        }
    }
    $classAttribute = implode(' ', $classArray);
    $classAttribute = apply_filters('neatlinetime_item_class', $classAttribute);
    return $classAttribute;
}