select.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. /**
  3. * CRUD -- select UI for object
  4. *
  5. * @package Lorea
  6. * @subpackage CRUD
  7. *
  8. * Copyright 2012-2013 Lorea Faeries <federation@lorea.org>
  9. *
  10. * This program is free software: you can redistribute it and/or
  11. * modify it under the terms of the GNU Affero General Public License
  12. * as published by the Free Software Foundation, either version 3 of
  13. * the License, or (at your option) any later version.
  14. *
  15. * This program is distributed in the hope that it will be useful, but
  16. * WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  18. * Affero General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU Affero General Public
  21. * License along with this program. If not, see
  22. * <http://www.gnu.org/licenses/>.
  23. */
  24. $crud = $vars['crud'];
  25. $options_values = array();
  26. foreach($vars['options'] as $option) {
  27. $options_values[$option] = elgg_echo("$crud->module:$crud->crud_type:$option");
  28. }
  29. unset($vars['options']);
  30. $vars['options_values'] = $options_values;
  31. echo elgg_view('input/dropdown', $vars);