2010-12-02 23:34:41 +00:00
|
|
|
<?php
|
2012-10-22 15:45:47 -04:00
|
|
|
|
2010-12-02 23:34:41 +00:00
|
|
|
/**
|
2017-08-11 13:29:22 -04:00
|
|
|
* PopupMenu - PopupMenu
|
2010-12-02 23:34:41 +00:00
|
|
|
/**
|
2017-08-11 13:29:22 -04:00
|
|
|
* PopupMenu - PopupMenu class
|
2012-10-22 15:45:47 -04:00
|
|
|
*
|
2011-02-01 12:49:40 +00:00
|
|
|
* @package workflow.engine.ProcessMaker
|
2010-12-02 23:34:41 +00:00
|
|
|
* @copyright COLOSA
|
2017-08-11 13:29:22 -04:00
|
|
|
*/
|
2017-08-14 15:53:48 -04:00
|
|
|
class PopupMenu extends Form
|
2010-12-02 23:34:41 +00:00
|
|
|
{
|
2017-08-11 13:29:22 -04:00
|
|
|
var $type = 'PopupMenu';
|
2012-10-22 15:45:47 -04:00
|
|
|
var $theme = 'processmaker';
|
2010-12-02 23:34:41 +00:00
|
|
|
|
2012-10-22 15:45:47 -04:00
|
|
|
/**
|
|
|
|
|
* Print the popup
|
|
|
|
|
*
|
|
|
|
|
* @param string $tableId
|
|
|
|
|
* @param array $tableFields
|
|
|
|
|
* @return array
|
|
|
|
|
*/
|
|
|
|
|
function renderPopup ($tableId, $tableFields)
|
|
|
|
|
{
|
|
|
|
|
$this->name = $tableId;
|
|
|
|
|
$fields = array_keys( $tableFields );
|
|
|
|
|
foreach ($fields as $f) {
|
|
|
|
|
switch (strtolower( $tableFields[$f]['Type'] )) {
|
|
|
|
|
case 'javascript':
|
|
|
|
|
case 'button':
|
|
|
|
|
case 'private':
|
|
|
|
|
case 'hidden':
|
|
|
|
|
case 'cellmark':
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
$label = ($tableFields[$f]['Label'] != '') ? $tableFields[$f]['Label'] : $f;
|
|
|
|
|
$label = str_replace( "\n", ' ', $label );
|
|
|
|
|
$pmXmlNode = new Xml_Node( $f, 'complete', '', array ('label' => $label,'type' => 'popupOption','launch' => $tableId . '.showHideField("' . $f . '")'
|
|
|
|
|
) );
|
2017-08-14 15:53:48 -04:00
|
|
|
$this->fields[$f] = new XmlFormFieldPopupOption( $pmXmlNode );
|
2012-10-22 15:45:47 -04:00
|
|
|
$this->values[$f] = '';
|
|
|
|
|
}
|
2010-12-02 23:34:41 +00:00
|
|
|
}
|
2012-10-22 15:45:47 -04:00
|
|
|
$scTemp = '';
|
|
|
|
|
$this->values['PAGED_TABLE_ID'] = $tableId;
|
|
|
|
|
print (parent::render( PATH_CORE . 'templates/popupMenu.html', $scTemp )) ;
|
|
|
|
|
$sc = "<script type=\"text/javascript\">\n$scTemp\n loadPopupMenu_$tableId(); \n</script>";
|
|
|
|
|
return $sc;
|
|
|
|
|
}
|
2010-12-02 23:34:41 +00:00
|
|
|
}
|