$basics .= "<div class='feed-importer-field'><label>Feed Title</label>" . text(array('name' => 'feed_title', 'value' => $feedimporter_feed->feed_title), $feedimporter_feed->feed_title) . "</div>"; $basics .= "<div class='feed-importer-field'><label>Feed Description</label>" . textarea(array('name' => 'feed_description', 'value' => $feedimporter_feed->feed_description, 'rows' => '5', 'cols' => '50'), $feedimporter_feed->feed_description) . "</div>"; //$basics .= "</div>"; $tabs['Basics'] = $basics; //feed settings sets up start and end dates for importing from feed, and frequency with which to check the feed $feedSettings = "<div class='feed-importer-field'><label>Import Start Date</label><input id='import-start-date' class='date' type='text' /></div>"; //jquery a date popup $feedSettings .= "<div class='feed-importer-field'><label>Import End Date</label><input id='import-end-date' class='date' type='text' /></div>"; //jquery a date popup $updateFreqVals = array('0' => "Manual Updates Only", '1800' => 'Half hour', '3600' => 'Hour', '86400' => 'Daily', '604800' => 'Weekly'); $feedSettings .= "<div class='feed-importer-field'><label>Update Frequency</label>" . select(array('name' => 'update_frequency'), $updateFreqVals, $feedimporter_feed->update_frequency) . "</div>"; $tabs['Feed Settings'] = $feedSettings; $collectionSettings = "<div class='feed-importer-field'><label>Collect by</label>" . select(array('name' => 'collect_by'), array('feed' => 'Feed', 'tag' => 'Tags', 'author' => 'Authors'), $feedimporter_feed->collect_by) . "</div>"; $collectionSettings .= "<div class='feed-importer-field'><label>Collection for items in feed</label>" . select_collection(array('name' => 'collection_id', 'value' => $feedimporter_feed->collection_id), $feedimporter_feed->collection_id); $collectionSettings .= "<p>Or create new collection from feed info " . checkbox(array('name' => 'new_collection')); $collectionSettings .= ajax_create_dialog(array('type' => 'Collection', 'target' => '#collection_id')); $tabs['Collection Handling'] = $collectionSettings; //itemTypeHandling tells what Item Type to use for imported items, and what Element to use if content is imported //TODO: ajax to return the right options for element based on choice of item type $itemTypeTable = $db->getTable('ItemType'); $itemTypesArray = $itemTypeTable->findPairsForSelectForm(); //Dig up all the elements for each item type and make into <option>s for javascript to switch around when user selects an item type //put them into an object, then serialize it to JSON $itemTypeElementsObj = new stdClass(); foreach ($itemTypesArray as $id => $name) { $optionsHTML = ""; $itemType = $itemTypeTable->find($id); foreach ($itemType->Elements as $element) { $optionsHTML .= "<option value='{$element->id}' label='{$element->name}' >{$element->name}</option"; release_object($element); }
<th scope="col"> <div id="feed-importer-item-type-id"> <h3>Push Tagged Items to Item Type</h3> <?php echo ajax_create_dialog(array('type' => 'ItemType', 'target' => '.feed-importer-item-type', 'label' => 'New')); ?> <div class="feed-importer-js-action"> <p class="feed-importer-help" onclick="FI.showHelpText('itemType')">Help</p> </div> </div> </th> <th scope="col"> <div id="feed-importer-tags-map"> <h3>Map Tag to Omeka Tags</h3> <?php echo ajax_create_dialog(array('type' => 'Tag', 'skipDescription' => true, 'target' => '.feed-importer-tag', 'label' => 'New')); ?> <div class="feed-importer-js-action"> <p class="feed-importer-help" onclick="FI.showHelpText('tag')">Help</p> </div> </div> </th> <th scope="col"> <div id="feed-importer-elements-map"> <h3>Map Tag to Elements</h3> <div class="feed-importer-js-action"> <p class="feed-importer-help" onclick="FI.showHelpText('elSet')">Help</p> </div> </div> </th>