Implementar hide/show label y special_listbox.  TOPIC_SOLVED

Topics Programming. Not necessarily about the BrazilFW!

Implementar hide/show label y special_listbox.

Mensagempor xtanctp » Ter Mai 20, 2014 1:14 am

Estimad@s:

Ojala me puedan ayudar con samba quiero implementar hide/show label y special_listbox.
estuve revisando quickcad.php de freedom y virtual.php de webadmin y e terminado algo confundido.

pagina a implementar.
sambashare.php
File: 
<?php
include_once("/var/htdocs/framework/framework.php");
$SAMBALNG = language("/var/language/samba/samba");

$html = new html();
$win = new window_simple_config();

$win->reload_command="/etc/init.d/samba restart";
$win->icon="../samba/icons/share.png";
$win->widths=array(35,85,85,85,140);
$win->file="/etc/brazilfw/samba/share.cfg";
$win->file_format="active,folder,public,write,users";
$win->caption="Samba ".$SAMBALNG["SAMBA08"];
$win->headers=array($BFWLNG["BFW0092"],$SAMBALNG["SAMBA08"],$SAMBALNG["SAMBA11"],$SAMBALNG["SAMBA05"],$BFWLNG['BFW0366']);
$win->label($BFWLNG["BFW0092"],yesno("active"),$SAMBALNG["SAMBA09"],0);
$win->label($SAMBALNG["SAMBA08"],text("folder",160,NULL,30,true),$SAMBALNG["SAMBA10"],1);
$win->label($SAMBALNG["SAMBA21"],combobox("public",100,array("yes","no"),array($SAMBALNG["SAMBA23"],$SAMBALNG["SAMBA24"])),$SAMBALNG["SAMBA12"],2);
$win->label($SAMBALNG["SAMBA22"],combobox("write",130,array("yes","no"),array($SAMBALNG["SAMBA25"],$SAMBALNG["SAMBA26"])),$SAMBALNG["SAMBA13"],3);
$win->label($BFWLNG['BFW0366'],text("users",160,NULL,100,false),$SAMBALNG["SAMBA14"]."<br>Ej1: 'user1,user3,user4'<br>Ej2: 'user7'",4);

$html->initialize();
$win->show();
$html->finalize();
?>

*al final de cada label e colocado un número.

lo que intento lograr.
HIDE/SHOW
considerando file_format="active,folder,public,write,users";
si label 2 (public-> yes) => hide label 4 y show label 3
si label 2 (public-> no) => hide label 3 y show label 4

special_listbox
En label 4 pueda usar la información de usuario /etc/brazilfw/samba/user.cfg para agregar usuarios.

muy agradecido.
Avatar do usuário
xtanctp
BFW Add-on Developer
BFW Beneméritos
BFW Team
BFW WebServer
 
Mensagens: 656
Registrado em: Sex Mar 19, 2010 11:13 am
Localização: Tacna - Perú
BrazilFW Box: Máquina Física
CPU i3
RAM 4 Gb / 2 Link
Versión BFW 3.0.262 64 bits
Servicios Activos: MAC, QoS, Cache, MySQL.
Addons en uso: TempLock, SqStat, eBackup, Watchdog Mail, Sis Block, ArpCAT, Squid 3.4.14.

Re: Implementar hide/show label y special_listbox.

Mensagempor xtanctp » Ter Mai 20, 2014 4:05 pm

estimado ya he solucionado hide/show

denme una manito con lo de special_listbox

Agregar usuarios desde /etc/brazilfw/samba/user.cfg
Código: Selecionar todos
usuario01 clave01 #primer usuario
usuario03 clave3 #otro usuario


sambashare.php
File: 
<?php
include_once("/var/htdocs/framework/framework.php");
$SAMBALNG = language("/var/language/samba/samba");

$html = new html();
$win = new window_simple_config();
$win->reload_command="/etc/init.d/samba restart";
$win->icon="../samba/icons/share.png";
$win->widths=array(35,85,85,85,140);
$win->file="/etc/brazilfw/samba/share.cfg";
$win->file_format="active,folder,public,write,users";
$win->caption="Samba ".$SAMBALNG["SAMBA08"];
$win->headers=array($BFWLNG["BFW0092"],$SAMBALNG["SAMBA08"],$SAMBALNG["SAMBA11"],$SAMBALNG["SAMBA05"],$BFWLNG['BFW0366']);
$win->label($BFWLNG["BFW0092"],yesno("active"),$SAMBALNG["SAMBA09"],0);
$win->label($SAMBALNG["SAMBA08"],text("folder",160,NULL,30,true),$SAMBALNG["SAMBA10"],1);
$win->label($SAMBALNG["SAMBA21"],combobox("public",100,array("yes","no"),array($SAMBALNG["SAMBA23"],$SAMBALNG["SAMBA24"]),null,"publi(this.value);"),$SAMBALNG["SAMBA12"],2);
$win->label($SAMBALNG["SAMBA22"],combobox("write",130,array("yes","no"),array($SAMBALNG["SAMBA25"],$SAMBALNG["SAMBA26"])),$SAMBALNG["SAMBA13"],3);
$win->label($SAMBALNG["SAMBA22"],$SAMBALNG["SAMBA26"].text("write",0,NULL,30,true,true,'no'),$SAMBALNG["SAMBA13"],4);
$win->label($BFWLNG['BFW0366'],special_listbox("users",160,null,null),$SAMBALNG["SAMBA14"]."<br>Ej1: 'user1,user3,user4'<br>Ej2: 'user7'",5);
$html->choose("publi",array("no"=>"hidelabel(3),showlabel(4),showlabel(5);","yes"=>"hidelabel(4),hidelabel(5),showlabel(3);"));
$html->initialize();
$win->show();
$html->finalize();
?>


saludos
Avatar do usuário
xtanctp
BFW Add-on Developer
BFW Beneméritos
BFW Team
BFW WebServer
 
Mensagens: 656
Registrado em: Sex Mar 19, 2010 11:13 am
Localização: Tacna - Perú
BrazilFW Box: Máquina Física
CPU i3
RAM 4 Gb / 2 Link
Versión BFW 3.0.262 64 bits
Servicios Activos: MAC, QoS, Cache, MySQL.
Addons en uso: TempLock, SqStat, eBackup, Watchdog Mail, Sis Block, ArpCAT, Squid 3.4.14.

Re: Implementar hide/show label y special_listbox.

Mensagempor xtanctp » Qua Mai 21, 2014 12:55 am

bueno ya voy avanzando...

como saco de un archivo como por ejemplo

archivo.cfg
nomx apex telx comentario
Código: Selecionar todos
nom1 ape1 tel1 #
nom2 ape2 tel2 #
nom3 ape3 tel3 #


lo quiero tener como lista en combobox de solo los 'nomx' en un archivox.php e intentado con:
include( );
array_column
array
list
edit
foriech
y varios de esos ya aun no me sale, un apoyo pss

saludos.
Avatar do usuário
xtanctp
BFW Add-on Developer
BFW Beneméritos
BFW Team
BFW WebServer
 
Mensagens: 656
Registrado em: Sex Mar 19, 2010 11:13 am
Localização: Tacna - Perú
BrazilFW Box: Máquina Física
CPU i3
RAM 4 Gb / 2 Link
Versión BFW 3.0.262 64 bits
Servicios Activos: MAC, QoS, Cache, MySQL.
Addons en uso: TempLock, SqStat, eBackup, Watchdog Mail, Sis Block, ArpCAT, Squid 3.4.14.

Re: Implementar hide/show label y special_listbox.

Mensagempor xtanctp » Qua Mai 21, 2014 11:02 am

vale tengo esto hasta aquí como seria la variable?



Código: Selecionar todos
$fichero = fopen("/etc/brazilfw/samba/user.cfg", "r");
if ($fichero) {
while (($linea = fgets($fichero, 4096)) !== false) {
$palabra = strtok($linea, " ");
// Código para la variable, salida para el combobox
}
fclose();


saludos.
Avatar do usuário
xtanctp
BFW Add-on Developer
BFW Beneméritos
BFW Team
BFW WebServer
 
Mensagens: 656
Registrado em: Sex Mar 19, 2010 11:13 am
Localização: Tacna - Perú
BrazilFW Box: Máquina Física
CPU i3
RAM 4 Gb / 2 Link
Versión BFW 3.0.262 64 bits
Servicios Activos: MAC, QoS, Cache, MySQL.
Addons en uso: TempLock, SqStat, eBackup, Watchdog Mail, Sis Block, ArpCAT, Squid 3.4.14.

Re: Implementar hide/show label y special_listbox.  TOPIC_SOLVED

Mensagempor xtanctp » Qui Mai 22, 2014 1:28 pm

hide/show label y special_listbox, Solucionado.

asi queda sambashare.php
ahora empaquetar samba.

File: 
<?php
include_once("/var/htdocs/framework/framework.php");
$SAMBALNG = language("/var/language/samba/samba");

$fichero = fopen("/etc/brazilfw/samba/users.cfg", "r");
if ($fichero) { while (($linea = fgets($fichero, 4096)) !== false) { $user[$i++]= strtok($linea, " "); } }

$html = new html();
$win = new window_simple_config();
$win->reload_command="/etc/init.d/samba restart";
$win->icon="../samba/icons/share.png";
$win->widths=array(35,85,85,85,140);
$win->file="/etc/brazilfw/samba/share.cfg";
$win->file_format="active,folder,public,write,users";
$win->caption="Samba ".$SAMBALNG["SAMBA08"];
$win->headers=array($BFWLNG["BFW0092"],$SAMBALNG["SAMBA08"],$SAMBALNG["SAMBA11"],$SAMBALNG["SAMBA05"],$BFWLNG['BFW0366']);
$win->label($BFWLNG["BFW0092"],yesno("active"),$SAMBALNG["SAMBA09"],0);
$win->label($SAMBALNG["SAMBA08"],text("folder",160,NULL,30,true),$SAMBALNG["SAMBA10"],1);
$win->label($SAMBALNG["SAMBA21"],combobox("public",100,array("yes","no"),array($SAMBALNG["SAMBA23"],$SAMBALNG["SAMBA24"]),null,"publi(this.value);"),$SAMBALNG["SAMBA12"],2);
$win->label($SAMBALNG["SAMBA22"],combobox("write",130,array("yes","no"),array($SAMBALNG["SAMBA25"],$SAMBALNG["SAMBA26"])),$SAMBALNG["SAMBA13"],3);
$win->label($SAMBALNG["SAMBA22"],$SAMBALNG["SAMBA26"].text("write",0,NULL,30,true,true,'no'),$SAMBALNG["SAMBA13"],4);
$win->label($BFWLNG['BFW0366'],special_listbox("users",160,$user,array(),true),$SAMBALNG["SAMBA14"],5);
$html->choose("publi",array("no"=>"hidelabel(3),showlabel(4),showlabel(5);","yes"=>"hidelabel(4),hidelabel(5),showlabel(3);"));
$html->initialize();
$win->show();
$html->finalize();
?>


saludos.
Avatar do usuário
xtanctp
BFW Add-on Developer
BFW Beneméritos
BFW Team
BFW WebServer
 
Mensagens: 656
Registrado em: Sex Mar 19, 2010 11:13 am
Localização: Tacna - Perú
BrazilFW Box: Máquina Física
CPU i3
RAM 4 Gb / 2 Link
Versión BFW 3.0.262 64 bits
Servicios Activos: MAC, QoS, Cache, MySQL.
Addons en uso: TempLock, SqStat, eBackup, Watchdog Mail, Sis Block, ArpCAT, Squid 3.4.14.


Voltar para Programming

Quem está online

Usuários navegando neste fórum: Nenhum usuário registrado e 2 visitantes

cron