function evt__mostrar_opciones() { $objeto_cmd = $this->get_objeto_comando($this->seleccion); $this->opciones = $objeto_cmd->inspeccionar_opciones(); $this->comp['label_info']->set_markup($objeto_cmd->get_info_extra()); //------ Cambia algunas cosas de lugar if ($objeto_cmd instanceof comando_base) { $opciones_a_sacar = array('listar', 'registrar'); $hay_que_sacar = $objeto_cmd->tiene_definido_base(); foreach (array_keys($this->opciones) as $id) { $existe = in_array($id, $opciones_a_sacar); if ($existe && $hay_que_sacar) { unset($this->opciones[$id]); } if (!$existe && !$hay_que_sacar) { unset($this->opciones[$id]); } } } //----------------------------------- $i = 0; foreach ($this->opciones as $opcion => $atributos) { if (!isset($atributos['tags']['gtk_no_mostrar'])) { $nombre = ucwords(str_replace('_', ' ', $opcion)); $boton = new GtkToolButton(); $boton->set_label($nombre); if (isset($atributos['tags']['gtk_icono'])) { $archivo = $atributos['tags']['gtk_icono']; $img = GtkImage::new_from_file(toba_dir() . '/www/img/' . $archivo); $boton->set_property('icon-widget', $img); } $boton->set_tooltip($this->tooltips, $atributos['ayuda']); $boton->connect('clicked', array($this, 'evt__ejecutar'), $opcion, $atributos); $this->comp['caja_opciones']->insert($boton, $i); //--- Desactivar algunos if ($objeto_cmd instanceof comando_instalacion && ($opcion == 'instalar' || $opcion == 'crear') && toba_modelo_instalacion::existe_info_basica()) { $boton->set_sensitive(false); } //---- $i++; } if (isset($atributos['tags']['gtk_separador'])) { $boton = new GtkSeparatorToolItem(); $this->comp['caja_opciones']->insert($boton, $i); $i++; } } $this->comp['caja_opciones']->show_all(); }