示例#1
0
/**
 *nest_form() appends a dropdown at the bottom of
 *      the collections edit form. Containing a list of a possible parent to
 *      the chosen collection.
 * @param <type> $collection
 */
function nest_form($collection)
{
    $s = get_db()->getTable('Nest');
    $select = $s->get_collections($collection['id']);
    echo '<h2>Collection\'s Parent</h2>';
    $html = '<div class="field">' . __v()->formLabel('nest', 'Collections') . '<div class="inputs">' . __v()->formSelect('nested', null, null, $select) . '</div></div>';
    echo $html;
}
/**
 * Render the map partial.
 *
 * @param Omeka_record $item The parent item.
 *
 * @return string $text The element text content.
 */
function nlwms_renderMap($item)
{
    // Get table.
    $_db = get_db();
    $_servicesTable = $_db->getTable('NeatlineMapsService');
    // Try to get the service.
    $service = $_servicesTable->findByItem($item);
    // If a service exists, render it.
    if ($service) {
        try {
            // Create the renderer.
            $map = new GeoserverMap_WMS($service);
            if ($map->_isValid()) {
                return __v()->partial('show.php', array('mapTitle' => $map->mapTitle, 'wmsAddress' => $map->wmsAddress, 'layers' => $map->layers, 'boundingBox' => $map->boundingBox, 'epsg' => $map->epsg));
            }
        } catch (Exception $e) {
        }
    }
}
 public static function filterItemForm($html, $inputNameStem, $value, $options, $record, $element)
 {
     //TODO: grab the stored data about terms and build up the array for each Element
     $controlledVocabs = get_db()->getTable('ControlledVocab_Term')->findByCollectionAndElementForSelect($record->collection_id, $element->id);
     $taOptions = array('rows' => '2', 'cols' => '50');
     $html .= __v()->formTextarea($inputNameStem . '[text]', $value, $taOptions);
     if (count($controlledVocabs) != 0) {
         $html .= "<br/>";
         $html .= "<div class='controlled-vocab-vocabs'>";
         $html .= "<h3 class='controlled-vocab-heading'>Controlled Vocabularies</h3>";
         $html .= radio(array('class' => 'controlled-vocab-vocabs', 'onchange' => 'ControlledVocab.showTerms(event)', 'name' => 'controlled-vocab-radio-' . $inputNameStem), array_keys($controlledVocabs), null, null);
         $vocabCount = 0;
         foreach ($controlledVocabs as $vocab => $termPairs) {
             //have to do inline style to make jQuery play nicely with hiding and showing.
             $html .= select(array('name' => 'controlled-vocab-select-' . $inputNameStem . '-' . $vocabCount, 'class' => 'controlled-vocab-terms', 'style' => 'display:none;', 'onchange' => 'ControlledVocab.updateField(event)'), $termPairs, null);
             $vocabCount++;
         }
         $html .= "</div><div class='controlled-vocab-clear'></div>";
     }
     return $html;
 }
示例#4
0
function spreadsheet_config_form()
{
    if (!($path = get_option('spreadsheet_php_path'))) {
        // Get the path to the PHP-CLI command. This does not account for
        // servers without a PHP CLI or those with a different command name for
        // PHP, such as "php5".
        $command = 'which php 2>&0';
        $lastLineOutput = exec($command, $output, $returnVar);
        $path = $returnVar == 0 ? trim($lastLineOutput) : '';
    }
    ?>
  <div class="field">
      <label for="spreadsheet_php_path">Path to PHP-CLI</label>
      <?php 
    echo __v()->formText('spreadsheet_php_path', $path, null);
    ?>
      <p class="explanation">Path to your server's PHP-CLI command. The PHP
      version must correspond to normal Omeka requirements. Some web hosts use PHP
      4.x for their default PHP-CLI, but many provide an alternative path to a
      PHP-CLI 5 binary. Check with your web host for more information.</p>
  </div>
<?php 
}
echo '<h3>Decide What Omeka Content to Include:</h3>';
echo '<div class="field">';
echo '<label for="xml_sitemap_include_simple_pages">Include Public Simple Pages:</label>';
echo __v()->formCheckbox('xml_sitemap_include_simple_pages', true, array('checked' => (bool) get_option('xml_sitemap_include_simple_pages')));
echo "</div>";
echo '<div class="field">';
echo '<label for="xml_sitemap_include_tags">Include Tags:</label>';
echo __v()->formCheckbox('xml_sitemap_include_tags', true, array('checked' => (bool) get_option('xml_sitemap_include_tags')));
echo "</div>";
echo '<div class="field">';
echo '<label for="xml_sitemap_include_category_browser">Include Browsing Categories:</label>';
echo __v()->formCheckbox('xml_sitemap_include_category_browser', true, array('checked' => (bool) get_option('xml_sitemap_include_category_browser')));
echo "</div>";
echo '<div class="field">';
echo '<label for="xml_sitemap_include_exhibits">Include Exhibits:</label>';
echo __v()->formCheckbox('xml_sitemap_include_exhibits', true, array('checked' => (bool) get_option('xml_sitemap_include_exhibits')));
echo "</div>";
echo "<h3>Assign Sitemap Ranking Priority for Content (0.1-1.0):</h3>";
echo xml_sitemap_set_rank('xml_sitemap_home_ranking', 'Homepage');
echo xml_sitemap_set_rank('xml_sitemap_main_ranking', 'Main Navigational Choices and Simple Pages');
echo xml_sitemap_set_rank('xml_sitemap_item_ranking', 'Items');
echo xml_sitemap_set_rank('xml_sitemap_exhibit_ranking', 'Exhibits');
echo xml_sitemap_set_rank('xml_sitemap_collection_ranking', 'Collections');
echo xml_sitemap_set_rank('xml_sitemap_catsandtags_ranking', 'Categories and Tags');
echo "<h3>Assign Expected Update Frequency for Content:</h3>";
// for the change frequencies
echo xml_sitemap_set_freq('xml_sitemap_change_home_freq', 'Home Page');
echo xml_sitemap_set_freq('xml_sitemap_change_main_freq', 'Main Navigation Choices and Simple Pages');
echo xml_sitemap_set_freq('xml_sitemap_change_item_freq', 'Items');
echo xml_sitemap_set_freq('xml_sitemap_change_exhibit_freq', 'Exhibits');
echo xml_sitemap_set_freq('xml_sitemap_change_collection_freq', 'Collections');
<?php

// create a form for metadata browsing configuration options
echo '<div id="metadata_browser_config_form">';
echo '<label for="metadata_browser_configuration">Activate Menu</label>';
echo __v()->formCheckbox('metadata_browser_configuration', true, array('checked' => (bool) get_option('metadata_browser_configuration')));
//echo text(array('name'=>'metadata_browser_browse_points'), get_option('metadata_browser_browse_points'), null);
echo "<label for='metadata_browser_browse_points'>List Elements to Be Browsed (Use ID Values):</label>";
echo "<br/>";
echo text(array('name' => 'metadata_browser_browse_points'), get_option('metadata_browser_browse_points'), null);
echo '</div>';
 /**
  * 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;
 }
<?php

if ($this->pageCount > 1) {
    $feed_id = __v()->feed_id;
    ?>
<ul class="pagination_list">
    
    <?php 
    if ($this->first != $this->current) {
        ?>
    <!-- First page link --> 
    <li class="pagination_first">
    <a href="<?php 
        echo html_escape($this->url(array('feed_id' => $feed_id, 'page' => $this->first), 'feed_importer_tag_config_action_pages', $_GET));
        ?>
">First</a>
    </li>
    <?php 
    }
    ?>
    
    <?php 
    if (isset($this->previous)) {
        ?>
    <!-- Previous page link --> 
    <li class="pagination_previous">
    <a href="<?php 
        echo html_escape($this->url(array('feed_id' => $feed_id, 'page' => $this->previous), 'feed_importer_tag_config_action_pages', $_GET));
        ?>
">Previous</a>
    </li>
	<label for="item_map_height">Height for Item Map</label>
	<div class="inputs">
		<input type="text" class="textinput"  name="item_map_height" size="8" value="<?php 
echo get_option('geolocation_item_map_height');
?>
" id="item_map_height" />
        <p class="explanation">The height of the map displayed on your items/show page. If left blank, the default height of 300px will be used.</p>
	</div>
</div>

<div class="field">
    <label for="geolocation_link_to_nav">Add Link to Map on Items/Browse Navigation</label>
    <div class="inputs">
        <?php 
echo __v()->formCheckbox('geolocation_link_to_nav', true, array('checked' => (bool) get_option('geolocation_link_to_nav')));
?>
         <p class="explanation">Add a link to the items map on all the items/browse pages.</p>
    </div>
</div>

<div class="field">
    <label for="geolocation_add_map_to_contribution_form">Add Map To Contribution Form</label>
    <div class="inputs">
        <?php 
echo __v()->formCheckbox('geolocation_add_map_to_contribution_form', true, array('checked' => (bool) get_option('geolocation_add_map_to_contribution_form')));
?>
         <p class="explanation">If the Contribution plugin is installed and activated, Geolocation  will add a geolocation map field to the contribution form to associate a location to a contributed item.</p>
    </div>
</div>