phpcompta  Version-6
 All Data Structures Namespaces Files Functions Variables Pages
Public Member Functions | Static Public Member Functions | Data Fields
IPopup Class Reference
Inheritance diagram for IPopup:
HtmlInput

Public Member Functions

 __construct ($p_name)
 
 input ()
 
 set_attribute ($p_name, $p_val)
 set the attribute thanks javascript as the width, the position ...
 
 set_block ($p_block)
 set or not a blocking fond
 
 set_dragguable ($p_value)
 
 set_height ($p_val)
 
 set_title ($p_title)
 set the title of a ipopup thanks javascript and php mode
 
 set_width ($p_val)
 
 set_zindex ($p_val)
 
- Public Member Functions inherited from HtmlInput
 __construct ($p_name="", $p_value="", $p_id="")
 
 debug ()
 
 get_js_attr ()
 you can add attribute to this in javascript this function is a wrapper and create a script (in js) to modify "this" (in javascript) with the value of obj->attribute from PHP
 
 make_object ($p_name=null)
 Make a JSON object, this method create a javascript object with the attribute set, it returns a javascript string with the object.
 
 set_attribute ($p_name, $p_value)
 set the extra javascript property for the INPUT field
 
 setReadOnly ($p_read)
 

Static Public Member Functions

static test_me ()
 
- Static Public Member Functions inherited from HtmlInput
static anchor ($p_text, $p_url="", $p_js="")
 *Return a simple anchor with a url or a javascript if $p_js is not null then p_url will be javascript:void(0) we don't add the event onclick.
 
static anchor_close ($div)
 Return a html string with an anchor which close the inside popup.
 
static anchor_hide ($action, $javascript)
 Return a html string with an anchor to hide a div, put it in the right corner.
 
static array_to_hidden ($array, $global_array)
 *transform request data to hidden
 
static array_to_string ($array, $global_array, $start="?")
 *transform request data to string
 
static button ($p_name, $p_value, $p_javascript="")
 
static button_action ($action, $javascript, $id="xx")
 button Html
 
static button_anchor ($p_label, $p_value, $p_name="", $p_javascript="")
 create a button with a ref
 
static button_close ($div_name)
 *close button for the HTML popup
 
static card_detail ($p_qcode, $pname='', $p_style="")
 *show the detail of a card
 
static default_value ($ind, $default, $array)
 return default if the value if the value doesn't exist in the array
 
static default_value_get ($ind, $default)
 return default if the value if the value doesn't exist in $_GET
 
static default_value_post ($ind, $default)
 return default if the value if the value doesn't exist in $_POST
 
static default_value_request ($ind, $default)
 return default if the value if the value doesn't exist in $_REQUEST
 
static detail_action ($ag_id, $p_mesg, $p_modify=1)
 return an anchor to view the detail of an action
 
static detail_modele_document ($p_id, $p_mesg)
 return a string containing the html code for calling the modifyModeleDocument
 
static detail_op ($p_jr_id, $p_mesg)
 return a string containing the html code for calling the modifyOperation
 
static display_periode ($p_id)
 
static extension ()
 
static generate_id ($p_prefix)
 generate an unique id for a widget,
 
static get_to_hidden ($array)
 *transform $_GET data to hidden
 
static get_to_string ($array, $start="?")
 *transform $_GET data to string
 
static hidden ($p_name, $p_value, $p_id="")
 
static history_account ($p_account, $p_mesg, $p_style="")
 display a div with the history of the account
 
static history_card ($f_id, $p_mesg, $p_style="")
 display a div with the history of the card
 
static history_card_button ($f_id, $p_mesg)
 display a div with the history of the card
 
static infobulle ($p_comment)
 
static post_to_hidden ($array)
 *transform $_POST data to hidden
 
static post_to_string ($array)
 *transform $_POST data to string
 
static print_window ()
 Javascript to print the current window.
 
static remove_stock ($p_id, $p_mesg)
 return a string containing the html code for calling the removeStock
 
static request_to_hidden ($array)
 *transform $_REQUEST data to hidden
 
static request_to_string ($array, $start="?")
 *transform $_REQUEST data to string
 
static reset ($p_value)
 
static select_cat ($array_cat)
 *create a hidden plus button to select the cat of ledger
 
static select_ledger ($p_array, $p_selected, $div='')
 return the html code to create an hidden div and a button to show this DIV.
 
static select_stock ($p_cn, $p_name, $p_mode)
 *Create an ISelect object containing the available repository for reading or writing $g_user
 
static submit ($p_name, $p_value, $p_javascript="")
 
static title_box ($name, $div, $mod="close")
 
static warnbulle ($p_comment)
 

Data Fields

 $name
 
- Data Fields inherited from HtmlInput
 $ctrl
 
 $disabled
 
 $extra
 
 $extra2
 
 $javascript
 
 $label
 
 $name
 
 $readOnly
 
 $selected
 
 $size
 
 $tabindex
 
 $table
 
 $type
 
 $value
 

Detailed Description

Definition at line 31 of file class_ipopup.php.

Constructor & Destructor Documentation

IPopup::__construct (   $p_name)

Definition at line 34 of file class_ipopup.php.

References name.

{
$this->name=$p_name;
$this->parameter='';
$this->attribute=array();
$this->drag=false;
$this->blocking=true;
}

Member Function Documentation

IPopup::input ( )

Definition at line 98 of file class_ipopup.php.

References $i, HtmlInput\$javascript, $name, $r, HtmlInput\$value, create_script(), name, title, trim(), and value.

{
$r="";
if ($this->blocking)
{
$r.=sprintf('<div id="%s_fond" name="fond" class="popup_back">',$this->name);
$r.="</div>";
}
$javascript=sprintf("javascript:hideIPopup('%s')",
$this->name);
if ( isset($this->title) && trim($this->title) != "" )
{
$r.=sprintf('<div name ="%s_border" id="%s_border" class="popup_border_title">',
$this->name,
$this->name);
$r.=sprintf('<span id="%s_">%s</span>',$this->name,$this->title);
}
else
{
$r.=sprintf('<div name ="%s_border" id="%s_border" class="popup_border_notitle">',
$this->name,
$this->name);
}
$r.='<div style="position:absolute;top:0px;right:10px;font-weight:normal;font-size:9px;color:black;text-align:right">';
$r.=sprintf('<a style="background-color:blue;color:white;text-decoration:none" href="%s">'._('Fermer').'</a></div>',
$r.=sprintf('<div name ="%s_content" id="%s_content" class="popup_content"> %s </div></div>',
$this->name,
$this->name,
$this->value);
/* Add properties at the widget */
$attr=$this->parameter;
for ($i=0;$i< count($this->attribute);$i++)
{
list($name,$value)=$this->attribute[$i];
$tmp1=sprintf("$('%s').%s='%s';",
$this->name,
$attr.=$tmp1;
}
$draggable='';
if ($this->drag==true)
{
/* add draggable possibility */
$draggable=sprintf(" new Draggable('%s_border',{starteffect:function(){
new Effect.Highlight('%s_border',{scroll:window,queue:'end'}); } });"
,$this->name
,$this->name);
}
$attr=create_script($attr.$draggable);
$r.=$attr;
return $r;
}
IPopup::set_attribute (   $p_name,
  $p_val 
)

set the attribute thanks javascript as the width, the position ...

Parameters
$p_nameattribute name
$p_valval of the attribute
Note
add to the this->attribut, it will be used in input()

Definition at line 83 of file class_ipopup.php.

{
$this->attribute[]=array($p_name,$p_val);
}
IPopup::set_block (   $p_block)

set or not a blocking fond

Parameters
$p_blockif true if you want to avoid access to background, *accept true or false

Definition at line 61 of file class_ipopup.php.

{
$this->blocking=$p_block;
}
IPopup::set_dragguable (   $p_value)

Definition at line 74 of file class_ipopup.php.

{
$this->drag=$p_value;
}
IPopup::set_height (   $p_val)

Definition at line 49 of file class_ipopup.php.

References $js, and name.

{
$js=sprintf('$("%s'.'_border").style.height="%s";',
$this->name,$p_val);
$this->parameter.=$js;
}
IPopup::set_title (   $p_title)

set the title of a ipopup thanks javascript and php mode

Parameters
titleof the IPopup
Returns
html string with js script

Definition at line 91 of file class_ipopup.php.

References $s, create_script(), name, and title.

{
$this->title=$p_title;
$s=sprintf('$("%s_"+"title")="%s"',
$this->name,$this->title);
return create_script($s);
}
IPopup::set_width (   $p_val)

Definition at line 42 of file class_ipopup.php.

References $js, and name.

{
$js=sprintf('$("%s'.'_border").style.width="%s";',
$this->name,$p_val);
$this->parameter.=$js;
}
IPopup::set_zindex (   $p_val)

Definition at line 66 of file class_ipopup.php.

References $js, and name.

{
$js=sprintf('$("%s'.'_border").style.zIndex=%d;',
$this->name,$p_val);
$js=sprintf('$("%s'.'_content").style.zIndex=%d;',
$this->name,$p_val);
$this->parameter.=$js;
}
static IPopup::test_me ( )
static

Definition at line 159 of file class_ipopup.php.

References $a, $e, and js_include().

{
echo js_include('js/scripts.js');
require_once('class_iselect.php');
$select=new ISelect('a');
$select->value=array(array ('value'=>0,'label'=>'Première valeur'),
array ('value'=>0,'label'=>'Première valeur'),
array ('value'=>0,'label'=>'Première valeur'));
for ($e=0;$e<50;$e++)
{
echo $select->input();
if ($e%10 == 0 ) echo '<hr>';
}
$a=new IPopup('pop1');
$a->value="";
for ($e=0;$e<500;$e++)
{
$a->value.="<p>Il etait une fois dans un pays vraiment lointain où même plus loin que ça</p>";
}
echo $a->input();
echo '
<input type="button" onclick="hide(\'pop1\');hide(\'pop1_border\')" value="cacher">
<input type="button" onclick="showIPopup(\'pop1\')" value="montrer">
',
$a=new IPopup('pop2');
$a->value='';
$a->title="Retrouvez une saucisse";
echo $a->input();
echo '
<input type="button" onclick="hide(\'pop2\');hide(\'pop2_border\')" value="cacher">
<input type="button" onclick="showIPopup(\'pop2\')" value="montrer">
';
}

Field Documentation

IPopup::$name

name name and id of the div

Definition at line 33 of file class_ipopup.php.

Referenced by input().


The documentation for this class was generated from the following file: