public function testUpdatedOptions()
 {
     set_option('neatlinetime', serialize(array('item_title' => 1, 'item_date' => 2, 'item_description' => 3)));
     $this->assertEquals(neatlinetime_get_option('item_title'), 1);
     $this->assertEquals(neatlinetime_get_option('item_date'), 2);
     $this->assertEquals(neatlinetime_get_option('item_description'), 3);
 }
 /**
  * Filter the items_browse_sql to return only items that have a non-empty
  * value for the DC:Date field, when using the neatlinetime-json context.
  * Uses the ItemSearch model (models/ItemSearch.php) to add the check for
  * a non-empty DC:Date.
  *
  * @param Omeka_Db_Select $select
  */
 public function hookItemBrowseSql()
 {
     $context = Zend_Controller_Action_HelperBroker::getStaticHelper('ContextSwitch')->getCurrentContext();
     if ($context == 'neatlinetime-json') {
         $search = new ItemSearch($select);
         $newParams[0]['element_id'] = neatlinetime_get_option('item_date');
         $newParams[0]['type'] = 'is not empty';
         $search->advanced($newParams);
     }
 }
/**
 * Returns the value of an element set in the NeatlineTime config options.
 *
 * @param string The NeatlineTime option name.
 * @param array An array of options.
 * @param Item
 * @return string|array|null
 */
function neatlinetime_get_item_text($optionName, $options = array(), $item = null)
{
    $element = get_db()->getTable('Element')->find(neatlinetime_get_option($optionName));
    return metadata($item, array($element->getElementSet()->name, $element->name), $options);
}