Improve scenario test
This commit is contained in:
parent
1ca321a1b5
commit
2ce39d8d7f
4 changed files with 25 additions and 17 deletions
|
|
@ -38,12 +38,12 @@ require_once('lib/icon_action.class.php');
|
|||
require_once ('lib/function_javascript.php');
|
||||
require_once 'class/user.class.php';
|
||||
require_once NOALYSS_INCLUDE.'/lib/http_input.class.php';
|
||||
|
||||
html_page_start();
|
||||
global $http;
|
||||
|
||||
$http=new HttpInput();
|
||||
|
||||
load_all_script();
|
||||
|
||||
$gDossier=$http->request('gDossier',"number", -1);
|
||||
if ($gDossier==-1)
|
||||
{
|
||||
|
|
@ -64,7 +64,7 @@ if (!file_exists('authorized_debug'))
|
|||
exit();
|
||||
}
|
||||
define('ALLOWED', 1);
|
||||
html_page_start("Classic");
|
||||
load_all_script();
|
||||
/******************************************************************************************************************/
|
||||
/* Utilities
|
||||
/******************************************************************************************************************/
|
||||
|
|
|
|||
|
|
@ -368,27 +368,28 @@ class Icon_Action
|
|||
if ( $p_value == 0 ) { return \Icon_Action::iconoff($p_id, $p_javascript,$p_style);}
|
||||
}
|
||||
|
||||
static function checked ($p_id,$p_javascript="") {
|
||||
static function checked ($p_id,$p_javascript="",$p_classrange="") {
|
||||
$lock_cur="";
|
||||
|
||||
$r=sprintf( '<span id="%s" onclick="%s" class="icon smallicon">%s</span>',
|
||||
$r=sprintf( '<span id="%s" onclick="%s" class="icon smallicon %s" >%s</span>',
|
||||
$p_id,
|
||||
$p_javascript,
|
||||
$p_classrange,
|
||||
$lock_cur);
|
||||
return $r;
|
||||
}
|
||||
static function unchecked ($p_id,$p_javascript="") {
|
||||
static function unchecked ($p_id,$p_javascript="",$p_classrange="") {
|
||||
$lock_cur="";
|
||||
|
||||
$r=sprintf( '<span id="%s" onclick="%s" class="icon smallicon" >%s</span>',
|
||||
$r=sprintf( '<span id="%s" onclick="%s" class="icon smallicon %s" >%s</span>',
|
||||
$p_id,
|
||||
$p_javascript,
|
||||
$p_classrange,
|
||||
$lock_cur);
|
||||
return $r;
|
||||
}
|
||||
static function checkbox ($p_id,$p_javascript="",$p_value=0) {
|
||||
if ( $p_value == 0 ) { return \Icon_Action::checked($p_id, $p_javascript); }
|
||||
if ( $p_value == 1 ) { return \Icon_Action::unchecked($p_id, $p_javascript);}
|
||||
static function checkbox ($p_id,$p_javascript="",$p_value=0,$p_classrange="") {
|
||||
if ( $p_value == 0 ) { return \Icon_Action::checked($p_id, $p_javascript,$p_classrange); }
|
||||
if ( $p_value == 1 ) { return \Icon_Action::unchecked($p_id, $p_javascript,$p_classrange);}
|
||||
}
|
||||
static function full_size($p_div) {
|
||||
$js=sprintf("full_size('%s')",$p_div);
|
||||
|
|
|
|||
|
|
@ -50,6 +50,7 @@ class InputCheckBox extends HtmlInput
|
|||
$this->id_hidden=$p_id;
|
||||
$this->id_icon=uniqid($p_id);
|
||||
$this->javascript="";
|
||||
$this->classrange="";
|
||||
}
|
||||
|
||||
function input($p_name=NULL, $p_value=0)
|
||||
|
|
@ -75,9 +76,9 @@ class InputCheckBox extends HtmlInput
|
|||
$this->javascript);
|
||||
|
||||
if ($this->value=='1') {
|
||||
$r.=Icon_Action::checked($this->id_icon,$this->javascript);
|
||||
$r.=Icon_Action::checked($this->id_icon,$this->javascript,$this->classrange);
|
||||
} else {
|
||||
$r.=Icon_Action::unchecked($this->id_icon,$this->javascript);
|
||||
$r.=Icon_Action::unchecked($this->id_icon,$this->javascript,$this->classrange);
|
||||
}
|
||||
return $r;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -92,12 +92,15 @@ $http=new HttpInput();
|
|||
for ($i = 0 ; $i < 10 ; $i ++) :
|
||||
echo '<li>';
|
||||
$check[$i]=new InputCheckBox("check[]",1,"checkid".$i);
|
||||
$check[$i]->classrange="improvechkbox";
|
||||
echo $i, " - name = ",$check[$i]->value_container,",id = " , $check[$i]->id_icon,$check[$i]->input();
|
||||
|
||||
echo '</li>';
|
||||
endfor;
|
||||
?>
|
||||
</ul>
|
||||
|
||||
<aside>les selections par plage ne fonctionnent pas encore avec les CHECKBOX améliorés</aside>
|
||||
<script> activate_checkbox_range("improvechkbox")</script>
|
||||
<h1>Submit</h1>
|
||||
<pre>
|
||||
echo HtmlInput::submit("submit", _("Envoi"));
|
||||
|
|
@ -129,7 +132,7 @@ $http=new HttpInput();
|
|||
Fichier - IFile
|
||||
</h2>
|
||||
<form method="POST" enctype="application/x-www-form-urlencoded" onsubmit="check_size();return false;">
|
||||
|
||||
<span id="file-info"></span>
|
||||
<?php
|
||||
|
||||
$file=new IFILE("file_to_upload");
|
||||
|
|
@ -147,10 +150,13 @@ $http=new HttpInput();
|
|||
var aFile=document.getElementsByTagName("input");
|
||||
console.debug("afile");
|
||||
console.debug(aFile);
|
||||
|
||||
var info=document.getElementById("file-info");
|
||||
for (var i = 0;i < aFile.length;i++) {
|
||||
if ( aFile[i].getAttribute("type")=="file" ) {
|
||||
if ( aFile[i].getAttribute("type")==="file" ) {
|
||||
|
||||
console.debug("file"+aFile[i].files[0].size);
|
||||
info.innerHTML+="file : "+aFile[i].files[0].name+":"+aFile[i].files[0].size+" bytes <br>";
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue