本文整理汇总了PHP中Entry::AddEvent方法的典型用法代码示例。如果您正苦于以下问题:PHP Entry::AddEvent方法的具体用法?PHP Entry::AddEvent怎么用?PHP Entry::AddEvent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Entry
的用法示例。
在下文中一共展示了Entry::AddEvent方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addEvent
/**
* Adds an event
*
* The difference between this AddEvent and the
* one in Bin:: is that it support jscalendar events ;-)
*/
function addEvent($event)
{
if (is_string($event) && func_num_args() == 2) {
$action = func_get_arg(1);
if (is_array($this->_availableEvents) && count($this->_availableEvents) > 0) {
if (in_array($event, $this->_availableEvents)) {
switch ($event) {
case ON_CHANGE:
$this->_entry->AddEvent(ON_CHANGE, $action);
break;
case ON_UPDATE:
$this->_onUpdateEvent = $action;
break;
case ON_CLOSE:
$this->_onCloseEvent = $action;
break;
case ON_SELECT:
$this->_onSelectEvent = $action;
break;
}
} else {
die('[PIWI] - Sorry but you are not permitted to use ' . $event . ' in this widget');
}
} else {
$this->_Events[] = new JSEvent($event, $action);
}
} elseif (is_object($event) && strtolower(get_class($event)) == 'jsevent') {
if (is_array($this->_availableEvents) && count($this->_availableEvents) > 0) {
if (in_array($event->getID(), $this->_availableEvents)) {
$id = $event->getID();
switch ($id) {
case ON_UPDATE:
$this->_onUpdateEvent = $event->getCode();
break;
case ON_CLOSE:
$this->_onCloseEvent = $event->getCode();
break;
case ON_SELECT:
$this->_onSelectEvent = $event->getCode();
break;
}
} else {
die('[PIWI] - Sorry but you are not permitted to use ' . $event->getID() . ' in this widget');
}
}
} else {
die('[PIWI] - Events should be objects');
}
}
示例2: Button
<meta name="Keywords" content="XML,tutorial,HTML,DHTML,CSS,XSL,XHTML,JavaScript,ASP,ADO,VBScript,DOM,authoring,programming,training,learning,beginner's guide,primer,lessons,school,howto,reference,examples,samples,source code,tags,demos,tips,links,FAQ,tag list,forms,frames,color table,W3C,Cascading Style Sheets,Active Server Pages,Dynamic HTML,Internet,database,development,Webbuilder,Sitebuilder,Webmaster,HTMLGuide,SiteExpert,iis" />
<meta name="Description" content="HTML,CSS,JavaScript,DHTML,XML,XHTML,ASP,ADO and VBScript tutorial from W3Schools." />
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="cache-control" content="no-cache" />
<link rel="stylesheet" href="piwidata/css/default.css" type="text/css" />
</head>
<body>
<?php
include_once "Piwi.php";
$button = new Button("boton", "Boton");
$button->SetSubmit();
$button->SetStock(STOCK_CANCEL);
$button->AddEvent(new JSEvent(ON_CLICK, "javascript:alert('huevudisimo');"));
//$button->Show ();
$entry = new Entry("cajita", "Una cosa");
$entry->AddEvent(new JSEvent(ON_CHANGE, "javascript:alert(this.value)"));
$entry->AddEvent(new JSEvent(ON_CHANGE, "javascript:alert(calcMD5(this.value));", "http://jaws.com.mx/templates/controlpanel/md5.js"));
//$entry->Show ();
$combo = new Combo("opciones");
$combo->AddOption("Jaws Proyect", "jawsproject");
$combo->AddOption("Piwi Proyect", "piwiproject");
$combo->AddOption("mBloggy", "mbloggy");
$combo->SetDefault("mbloggy");
//$combo->Show ();
$combogroup = new ComboGroup("opciones2");
$pares = array();
$impares = array();
for ($i = 0; $i < 20; $i++) {
if ($i % 2 == 0) {
$pares[] = new ComboOption("numero {$i}", "N�mero {$i}");
} else {