public function hookPublicAppendToItemsShow()
 {
     //usually, this hook is used to display additional data related to an item that your plugin keeps track of
     $item = get_current_item();
     echo "I'm item number " . $item->id;
 }
/**
 * Corresponds to old regular function item_belongs_to_collection().
 *
 * @see item_belongs_to_collection
 * @param unknown_type $name
 * @param unknown_type $item
 * @return boolean
 */
function multicollections_item_belongs_to_collection($collectionName = null, $item = null)
{
    if (is_null($item)) {
        $item = get_current_item();
    }
    $collections = multicollections_get_collections_for_item($item);
    if ($collectionName) {
        foreach ($collections as $collection) {
            if (metadata($collection, array('Dublin Core', 'Title')) == $collectionName && ($collection->public || has_permission('Collections', 'showNotPublic'))) {
                return true;
            }
        }
    } else {
        return !empty($collections);
    }
    return false;
}
 /**
  * Add tab to items add/edit.
  *
  * @param array $tabs Associative array with tab name => markup.
  *
  * @return array The tabs array with the Web Map Service tab.
  */
 public function adminItemsFormTabs($tabs)
 {
     // Set service false by default.
     $service = false;
     // Get item.
     $item = get_current_item();
     // If there is an item, try to get a service.
     if (!is_null($item->id)) {
         $service = $this->servicesTable->findByItem($item);
     }
     // Insert tab.
     $tabs[__('Web Map Service')] = __v()->partial('items/_serviceForm.php', array('service' => $service));
     return $tabs;
 }
/* Here is the styling for the balloon that appears on the map */
?>
        <Style id="item-info-balloon">
            <BalloonStyle>
                <text><![CDATA[
                    <div class="geolocation_balloon">
                        <div class="geolocation_balloon_title">$[namewithlink]</div>
                        <div class="body">$[description]</div>
                        <div class="geolocation_balloon_description">$[Snippet]</div>
                    </div>
                ]]></text>
            </BalloonStyle>
        </Style>
        <?php 
while (loop_items()) {
    $item = get_current_item();
    $location = $locations[$item->id];
    ?>
        <Placemark>
            <name><![CDATA[<?php 
    echo item('Dublin Core', 'Title');
    ?>
]]></name>
            <namewithlink><![CDATA[<?php 
    echo link_to_item(item('Dublin Core', 'Title'), array('class' => 'view-item'));
    ?>
]]></namewithlink>
            <Snippet maxLines="2"><![CDATA[<?php 
    echo item('Dublin Core', 'Description', array('snippet' => 150));
    ?>
]]></Snippet>    
示例#5
0
function geolocation_public_show_item_map($width = null, $height = null, $item = null)
{
    if (!$width) {
        $width = get_option('geolocation_item_map_width') ? get_option('geolocation_item_map_width') : '100%';
    }
    if (!$height) {
        $height = get_option('geolocation_item_map_height') ? get_option('geolocation_item_map_height') : '300px';
    }
    if (!$item) {
        $item = get_current_item();
    }
    $location = geolocation_get_location_for_item($item, true);
    if ($location) {
        echo geolocation_scripts() . '<h2>Geolocation</h2>' . geolocation_google_map_for_item();
    }
}
示例#6
0
function item_show_log_admin_append_to_items_show_secondary()
{
    $item = get_current_item();
    $log_count = get_db()->getTable('ItemShowLogLog')->findCountByItemId($item->id);
    echo "<div class='info-panel'><h2>Log data</h2><p>Viewed {$log_count} times in public view.</p></div>";
}