/** * Set ups up for each test. * * @return void * @author Eric Rochester <*****@*****.**> **/ public function setUp() { parent::setUp(); $this->_todel = array(); $this->user = $this->db->getTable('user')->find(1); $this->_authenticateUser($this->user); $this->phelper = new Omeka_Test_Helper_Plugin(); $this->phelper->setUp('NeatlineFeatures'); $this->_dbHelper = Omeka_Test_Helper_Db::factory($this->application); // Retrieve the element for some DC fields. $el_table = get_db()->getTable('Element'); $this->_title = $el_table->findByElementSetNameAndElementName('Dublin Core', 'Title'); $this->_subject = $el_table->findByElementSetNameAndElementName('Dublin Core', 'Subject'); $this->_coverage = $el_table->findByElementSetNameAndElementName('Dublin Core', 'Coverage'); $this->_cutil = new NeatlineFeatures_Utils_View(); $this->_cutil->setEditOptions(null, $this->_coverage, "", "Elements[38][0]", 0); $this->_item = new Item(); $this->_item->save(); $this->toDelete($this->_item); $t1 = $this->addElementText($this->_item, $this->_title, '<b>A Title</b>', 1); $t2 = $this->addElementText($this->_item, $this->_subject, 'Subject'); $this->toDelete($t1); $this->toDelete($t2); $this->_item->save(); }
/** * This tests the isMap predicate outside of a POST request, when it is * false. * * @return void * @author Eric Rochester <*****@*****.**> **/ public function testIsMapNoPostFalse() { $sutil = new NeatlineFeatures_Utils_View(); $sutil->setEditOptions($this->_item, $this->_subject, "", "Elements[38][0]", 0); $this->assertFalse((bool) $sutil->isMap()); }
/** * This overrides the definition for the coverage form input. * * @param string $html An empty string. * @param string $inputNameStem The stem of the input name. * @param string $value The initial value for the input. * @param array $options Additional options. * @param Omeka_Record $record The element's record. * @param Element $element The Element. * * @return string The string containing the HTML for the customized element * form. * @author Eric Rochester <*****@*****.**> **/ public function filterInputItemDublinCoreCoverage($components, $args) { // $args keys => input_name_stem, value, record, element, index, is_html $util = new NeatlineFeatures_Utils_View(); $util->setEditOptions($args['record'], $args['element'], $args['value'], $args['input_name_stem'], $args['index']); // Default $components['inputs']: // <div class="input-block"><div class="input"><textarea name="Elements[38][0][text]" id="Elements-38-0-text" rows="3" cols="50"></textarea></div><div class="controls"><input type="submit" name="" value="Remove" class="remove-element red button"></div><label class="use-html">Use HTML<input type="hidden" name="Elements[38][0][html]" value="0"><input type="checkbox" name="Elements[38][0][html]" id="Elements-38-0-html" value="1" class="use-html-checkbox"></label></div> $components['input'] = $util->getEditControl(); return $components; }