本文整理汇总了PHP中Pieform::include_plugin方法的典型用法代码示例。如果您正苦于以下问题:PHP Pieform::include_plugin方法的具体用法?PHP Pieform::include_plugin怎么用?PHP Pieform::include_plugin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pieform
的用法示例。
在下文中一共展示了Pieform::include_plugin方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: pieform_element_submitcancel
/**
* Renders a submit and cancel button
*
* @param Pieform $form The form to render the element for
* @param array $element The element to render
* @return string The HTML for the element
*/
function pieform_element_submitcancel(Pieform $form, $element)
{
/*{{{*/
if (!isset($element['value']) || !is_array($element['value']) || count($element['value']) != 2) {
throw new PieformException('The submitcancel element "' . $element['name'] . '" must have a two element array for its value');
}
$form->include_plugin('element', 'submit');
$form->include_plugin('element', 'cancel');
$submitelement = $element;
$submitelement['class'] = isset($submitelement['class']) ? $submitelement['class'] . ' submit' : 'submit';
$submitelement['value'] = $element['value'][0];
$cancelelement = $element;
$cancelelement['class'] = isset($cancelelement['class']) ? $cancelelement['class'] . ' cancel' : 'cancel';
$cancelelement['value'] = $element['value'][1];
if (isset($element['confirm']) && isset($element['confirm'][0])) {
$submitelement['confirm'] = $element['confirm'][0];
} else {
unset($submitelement['confirm']);
}
if (isset($element['confirm']) && isset($element['confirm'][1])) {
$cancelelement['confirm'] = $element['confirm'][1];
} else {
unset($cancelelement['confirm']);
}
return pieform_element_submit($form, $submitelement) . ' ' . pieform_element_cancel($form, $cancelelement);
}
示例2: pieform_element_cancelbackcreate
/**
* Renders a submit and cancel button
*
* @param array $element The element to render
* @param Pieform $form The form to render the element for
* @return string The HTML for the element
*/
function pieform_element_cancelbackcreate(Pieform $form, $element)
{
$form->include_plugin('element', 'submit');
$form->include_plugin('element', 'cancel');
$cancelelement = $element;
$cancelelement['value'] = $element['value'][0];
$backelement = $element;
$backelement['name'] = 'back';
$backelement['id'] = 'back';
$backelement['value'] = $element['value'][1];
$submitelement = $element;
$submitelement['value'] = $element['value'][2];
if (isset($element['confirm']) && isset($element['confirm'][0])) {
$cancelelement['confirm'] = $element['confirm'][0];
} else {
unset($cancelelement['confirm']);
}
if (isset($element['confirm']) && isset($element['confirm'][1])) {
$backelement['confirm'] = $element['confirm'][1];
} else {
unset($backelement['confirm']);
}
if (isset($element['confirm']) && isset($element['confirm'][2])) {
$submitelement['confirm'] = $element['confirm'][2];
} else {
unset($submitelement['confirm']);
}
return pieform_element_cancel($form, $cancelelement) . ' ' . pieform_element_submit($form, $backelement) . ' ' . pieform_element_submit($form, $submitelement);
}
示例3: pieform_element_submitcancel
/**
* Renders a submit and cancel button
*
* @param Pieform $form The form to render the element for
* @param array $element The element to render
* @return string The HTML for the element
*/
function pieform_element_submitcancel(Pieform $form, $element)
{
/*{{{*/
if (!isset($element['value']) || !is_array($element['value']) || count($element['value']) != 2) {
throw new PieformException('The submitcancel element "' . $element['name'] . '" must have a two element array for its value');
}
$form->include_plugin('element', 'button');
$form->include_plugin('element', 'cancel');
// first try for string indices
$plugins = array('button', 'cancel');
$elems = '';
foreach ($element['value'] as $key => $value) {
if (!is_numeric($key) && in_array($key, $plugins)) {
$function = 'pieform_element_' . $key;
if (function_exists($function)) {
$item = $element;
$item['class'] = isset($element['class']) ? $element['class'] . ' ' . $key : $key;
$item['usebuttontag'] = $key == 'button' ? true : false;
$item['value'] = $element['value'][$key];
if (isset($element['confirm']) && isset($element['confirm'][$key])) {
$item['confirm'] = $element['confirm'][$key];
} else {
unset($item['confirm']);
}
$elems .= $function($form, $item);
$elems .= ' ';
}
}
}
if (!empty($elems)) {
return $elems;
} else {
if (isset($element['value'][0]) && isset($element['value'][1])) {
// ensure default numeric indices exist
$submitelement = $element;
$submitelement['class'] = isset($submitelement['class']) ? $submitelement['class'] . ' submit' : 'submit';
$submitelement['value'] = $element['value'][0];
$submitelement['usebuttontag'] = true;
$cancelelement = $element;
$cancelelement['class'] = isset($cancelelement['class']) ? $cancelelement['class'] . ' cancel' : 'cancel';
$cancelelement['value'] = $element['value'][1];
if (isset($element['confirm']) && isset($element['confirm'][0])) {
$submitelement['confirm'] = $element['confirm'][0];
} else {
unset($submitelement['confirm']);
}
if (isset($element['confirm']) && isset($element['confirm'][1])) {
$cancelelement['confirm'] = $element['confirm'][1];
} else {
unset($cancelelement['confirm']);
}
return pieform_element_button($form, $submitelement) . ' ' . pieform_element_cancel($form, $cancelelement);
}
}
}
示例4: IN
if ($USER->get('admin') || $USER->get('staff')) {
$institutions = get_records_array('institution', '', '', 'displayname');
$search->institution = param_alphanum('institution', 'all');
} else {
$institutionnames = array_keys(array_merge($USER->get('admininstitutions'), $USER->get('staffinstitutions')));
$institutions = get_records_select_array('institution', 'name IN (' . join(',', array_fill(0, count($institutionnames), '?')) . ')', $institutionnames, 'displayname');
}
$loggedintypes = array();
$loggedintypes[] = array('name' => 'any', 'string' => get_string('anyuser', 'admin'));
$loggedintypes[] = array('name' => 'ever', 'string' => get_string('usershaveloggedin', 'admin'));
$loggedintypes[] = array('name' => 'never', 'string' => get_string('usershaveneverloggedin', 'admin'));
$loggedintypes[] = array('name' => 'since', 'string' => get_string('usershaveloggedinsince', 'admin'));
$loggedintypes[] = array('name' => 'notsince', 'string' => get_string('usershavenotloggedinsince', 'admin'));
$calendar = array('name' => 'loggedindate', 'id' => 'loggedindate', 'tabindex' => false, 'class' => 'form-control', 'type' => 'calendar', 'title' => get_string('date'), 'imagefile' => $THEME->get_image_url('calendar'), 'defaultvalue' => strtotime($search->loggedindate), 'caloptions' => array('showsTime' => true));
$calendarform = new Pieform(array('name' => 'loggedinform', 'elements' => array('loggedindate' => $calendar)));
$calendarform->include_plugin('element', 'calendar');
$loggedindate = pieform_element_calendar($calendarform, $calendar);
$searchParams = $search;
//store search as it's about to change
list($html, $columns, $pagination, $search) = build_admin_user_search_results($search, $offset, $limit);
$js = <<<EOF
addLoadEvent(function() {
var p = {$pagination['javascript']}
new UserSearch(p);
})
EOF;
$smarty = smarty(array('adminusersearch', 'paginator'), array(), array('ascending' => 'mahara', 'descending' => 'mahara'));
setpageicon($smarty, 'icon-user');
$smarty->assign('search', $searchParams);
$smarty->assign('limit', $limit);