本文整理汇总了PHP中Html::select方法的典型用法代码示例。如果您正苦于以下问题:PHP Html::select方法的具体用法?PHP Html::select怎么用?PHP Html::select使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Html
的用法示例。
在下文中一共展示了Html::select方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Html
function _before_add()
{
$html = new Html();
$fields_type = $this->_mod->site_model_fields();
$this->assign('fields_type', $html->select($fields_type, 'formtype'));
$regexp = $this->_mod->regexp();
$this->assign('verification_select', $html->select($regexp, 'verification_select', '', 'id="J_verification_select" style="width:100px"'));
}
示例2: display
/**
* Display the view
*
* @return void
*/
public function display($tpl = null)
{
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
$this->state = $this->get('State');
$this->authors = $this->get('Authors');
// Check for errors.
if (count($errors = $this->get('Errors'))) {
throw new Exception(implode("\n", $errors), 500);
}
// Levels filter.
$options = array();
$options[] = Html::select('option', '1', Lang::txt('J1'));
$options[] = Html::select('option', '2', Lang::txt('J2'));
$options[] = Html::select('option', '3', Lang::txt('J3'));
$options[] = Html::select('option', '4', Lang::txt('J4'));
$options[] = Html::select('option', '5', Lang::txt('J5'));
$options[] = Html::select('option', '6', Lang::txt('J6'));
$options[] = Html::select('option', '7', Lang::txt('J7'));
$options[] = Html::select('option', '8', Lang::txt('J8'));
$options[] = Html::select('option', '9', Lang::txt('J9'));
$options[] = Html::select('option', '10', Lang::txt('J10'));
$this->f_levels = $options;
// We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal') {
$this->addToolbar();
}
parent::display($tpl);
}
示例3: reportAjaxCategorytoType_ALL
function reportAjaxCategorytoType_ALL(Web $w)
{
$type = array();
list($category, $module) = preg_split('/_/', $w->request('id'));
// organise criteria
$who = $w->session('user_id');
$where = array();
if (!empty($module)) {
$where['report.module'] = $module;
}
if (!empty($category)) {
$where['report.category'] = $category;
}
// get report categories from available report list
$reports = $w->Report->getReportsbyUserWhere($who, $where);
if ($reports) {
foreach ($reports as $report) {
$arrtype = preg_split("/,/", $report->sqltype);
foreach ($arrtype as $rtype) {
$rtype = trim($rtype);
if (!array_key_exists(strtolower($rtype), $type)) {
$type[strtolower($rtype)] = array(strtolower($rtype), strtolower($rtype));
}
}
}
}
if (empty($type)) {
$type = array(array("No Reports", ""));
}
$w->setLayout(null);
$w->out(json_encode(Html::select("type", $type)));
}
示例4: lookup_ALL
function lookup_ALL(Web &$w)
{
$w->Admin->navigation($w, "Lookup");
$types = $w->Admin->getLookupTypes();
$typelist = Html::select("type", $types, $w->request('type'));
$w->ctx("typelist", $typelist);
// tab: Lookup List
$where = array();
if (NULL == $w->request('reset')) {
if ($w->request('type') != "") {
$where['type'] = $w->request('type');
}
} else {
// Reset called, unset vars
if ($w->request("type") !== null) {
unset($_REQUEST["type"]);
}
var_dump($_REQUEST);
}
$lookup = $w->Admin->getAllLookup($where);
$line[] = array("Type", "Code", "Title", "Actions");
if ($lookup) {
foreach ($lookup as $look) {
$line[] = array($look->type, $look->code, $look->title, Html::box($w->localUrl("/admin/editlookup/" . $look->id . "/" . urlencode($w->request('type'))), " Edit ", true) . " " . Html::b($w->webroot() . "/admin/deletelookup/" . $look->id . "/" . urlencode($w->request('type')), " Delete ", "Are you sure you wish to DELETE this Lookup item?"));
}
} else {
$line[] = array("No Lookup items to list", null, null, null);
}
// display list of items, if any
$w->ctx("listitem", Html::table($line, null, "tablesorter", true));
// tab: new lookup item
$types = $w->Admin->getLookupTypes();
$f = Html::form(array(array("Create a New Entry", "section"), array("Type", "select", "type", null, $types), array("or Add New Type", "text", "ntype"), array("Key", "text", "code"), array("Value", "text", "title")), $w->localUrl("/admin/newlookup/"), "POST", " Save ");
$w->ctx("newitem", $f);
}
示例5: fetchElement
public function fetchElement($name, $value, &$node, $control_name)
{
require_once dirname(__DIR__) . DS . 'models' . DS . 'poll.php';
$options = \Components\Poll\Models\Poll::all()->whereEquals('published', 1)->rows()->raw();
array_unshift($options, \Html::select('option', '0', '- ' . \Lang::txt('Select Poll') . ' -', 'id', 'title'));
return \Html::select('genericlist', $options, $control_name . '[' . $name . ']', 'class="inputbox"', 'id', 'title', $value, $control_name . $name);
}
示例6: taskAjaxSelectbyTaskGroup_ALL
function taskAjaxSelectbyTaskGroup_ALL(Web $w)
{
$p = $w->pathMatch("taskgroup_id");
$taskgroup = $w->Task->getTaskGroup($p['taskgroup_id']);
if (empty($taskgroup->id)) {
return;
}
$tasktypes = $taskgroup != "" ? $w->Task->getTaskTypes($taskgroup->task_group_type) : array();
$priority = $taskgroup != "" ? $w->Task->getTaskPriority($taskgroup->task_group_type) : array();
$members = $taskgroup != "" ? $w->Task->getMembersBeAssigned($taskgroup->id) : array();
sort($members);
$typetitle = $taskgroup != "" ? $taskgroup->getTypeTitle() : "";
$typedesc = $taskgroup != "" ? $taskgroup->getTypeDescription() : "";
// if user cannot assign tasks in this group, leave 'first_assignee' blank for owner/member to delegate
$members = $taskgroup->getCanIAssign() ? $members : array(array("Default", ""));
// create dropdowns loaded with respective data
$ttype = Html::select("task_type", $tasktypes, null);
$prior = Html::select("priority", $priority, null);
$mem = Html::select("assignee_id", $members, null);
// first_
$taskgroup_link = $taskgroup->isOwner($w->Auth->user()) ? "<a href=\"" . $w->localUrl("task-group/viewmembergroup/" . $taskgroup->id) . "\">" . $taskgroup->title . "</a>" : $taskgroup->title;
$tasktext = "<table style='width: 100%;'>" . "<tr><td class=section colspan=2>Task Group Description</td></tr>" . "<tr><td><b>Task Group</td><td>" . $taskgroup_link . "</td></tr>" . "<tr><td><b>Task Type</b></td><td>" . $typetitle . "</td></tr>" . "<tr valign=top><td><b>Description</b></td><td>" . $typedesc . "</td></tr>" . "</table>";
// return as array of arrays
$result = array($ttype, $prior, $mem, $tasktext, Html::select("status", $taskgroup->getTypeStatus(), null, null, null, null));
$w->setLayout(null);
$w->out(json_encode($result));
}
示例7: taskAjaxGrouptoType_ALL
function taskAjaxGrouptoType_ALL(Web &$w)
{
$types = array();
// split query string into group and assignee
list($group, $assignee) = preg_split('/_/', $w->request('id'));
// organise criteria
$who = $assignee != "" ? $assignee : null;
$where = "";
if ($group != "") {
$where .= "task_group_id = " . $group . " and ";
}
$where .= "is_closed = 0";
// get task types from available task list
$tasks = $w->Task->getTasks($who, $where);
if ($tasks) {
foreach ($tasks as $task) {
if (!array_key_exists($task->task_type, $types)) {
$types[$task->task_type] = array($task->getTypeTitle(), $task->task_type);
}
}
}
if (!$types) {
$types = array(array("No assigned Tasks", ""));
}
// load type dropdown and return
$tasktypes = Html::select("tasktypes", $types, null);
$w->setLayout(null);
$w->out(json_encode($tasktypes));
}
示例8: display
function display($tpl = null)
{
$app = JFactory::getApplication();
$state = $this->get('State');
$items = $this->get('Items');
$pagination = $this->get('Pagination');
// Get the page/component configuration
$params =& $state->params;
foreach ($items as $item) {
$item->catslug = $item->category_alias ? $item->catid . ':' . $item->category_alias : $item->catid;
$item->parent_slug = $item->parent_alias ? $item->parent_id . ':' . $item->parent_alias : $item->parent_id;
}
$form = new stdClass();
// Month Field
$months = array('' => Lang::txt('COM_CONTENT_MONTH'), '01' => Lang::txt('JANUARY_SHORT'), '02' => Lang::txt('FEBRUARY_SHORT'), '03' => Lang::txt('MARCH_SHORT'), '04' => Lang::txt('APRIL_SHORT'), '05' => Lang::txt('MAY_SHORT'), '06' => Lang::txt('JUNE_SHORT'), '07' => Lang::txt('JULY_SHORT'), '08' => Lang::txt('AUGUST_SHORT'), '09' => Lang::txt('SEPTEMBER_SHORT'), '10' => Lang::txt('OCTOBER_SHORT'), '11' => Lang::txt('NOVEMBER_SHORT'), '12' => Lang::txt('DECEMBER_SHORT'));
$form->monthField = Html::select('genericlist', $months, 'month', array('list.attr' => 'size="1" class="inputbox"', 'list.select' => $state->get('filter.month'), 'option.key' => null));
// Year Field
$years = array();
$years[] = Html::select('option', null, Lang::txt('JYEAR'));
for ($i = 2000; $i <= 2020; $i++) {
$years[] = Html::select('option', $i, $i);
}
$form->yearField = Html::select('genericlist', $years, 'year', array('list.attr' => 'size="1" class="inputbox"', 'list.select' => $state->get('filter.year')));
$form->limitField = $pagination->getLimitBox();
//Escape strings for HTML output
$this->pageclass_sfx = htmlspecialchars($params->get('pageclass_sfx'));
$this->filter = $state->get('list.filter');
$this->assignRef('form', $form);
$this->assignRef('items', $items);
$this->assignRef('params', $params);
$this->assignRef('user', User::getInstance());
$this->assignRef('pagination', $pagination);
$this->_prepareDocument();
parent::display($tpl);
}
示例9: fetchElement
function fetchElement($name, $value, &$node, $control_name)
{
$access = JFactory::getACL();
// Include user in groups that have access to edit their articles, other articles, or manage content.
$action = array('com_content.article.edit_own', 'com_content.article.edit_article', 'com_content.manage');
$groups = $access->getAuthorisedUsergroups($action, true);
// Check the results of the access check.
if (!$groups) {
return false;
}
// Clean up and serialize.
\Hubzero\Utility\Arr::toInteger($groups);
$groups = implode(',', $groups);
// Build the query to get the users.
$db = App::get('db');
$query = $db->getQuery(true);
$query->select('u.id AS value');
$query->select('u.name AS text');
$query->from('#__users AS u');
$query->join('INNER', '#__user_usergroup_map AS m ON m.user_id = u.id');
$query->where('u.block = 0');
$query->where('m.group_id IN (' . $groups . ')');
// Get the users.
$db->setQuery((string) $query);
$users = $db->loadObjectList();
// Check for a database error.
if ($db->getErrorNum()) {
throw new Exception($db->getErrorMsg(), 500);
return false;
}
return Html::select('genericlist', $users, $name, 'class="inputbox" size="1"', 'value', 'text', $value);
}
示例10: reportAjaxModuletoCategory_ALL
function reportAjaxModuletoCategory_ALL(Web $w)
{
$category = array();
$module = $w->request('id');
// organise criteria
$who = $w->session('user_id');
$where = array();
if ($module != "") {
$where['report.module'] = $module;
}
// get report categories from available report list
$reports = $w->Report->getReportsbyUserWhere($who, $where);
if ($reports) {
foreach ($reports as $report) {
if (!array_key_exists($report->category, $category)) {
$category[$report->category] = array($report->getCategoryTitle(), $report->category);
}
}
}
if (!$category) {
$category = array(array("No Reports", ""));
}
// load Category dropdown and return
$category = Html::select("category", $category);
$w->setLayout(null);
$w->out(json_encode($category));
}
示例11: getFolderList
/**
* Image Manager Popup
*
* @param string $listFolder The image directory to display
* @since 1.5
*/
function getFolderList($base = null)
{
// Get some paths from the request
if (empty($base)) {
$base = COM_MEDIA_BASE;
}
//corrections for windows paths
$base = str_replace(DIRECTORY_SEPARATOR, '/', $base);
$com_media_base_uni = str_replace(DIRECTORY_SEPARATOR, '/', COM_MEDIA_BASE);
// Get the list of folders
$folders = Filesystem::directories($base, '.', true, true);
Document::setTitle(Lang::txt('COM_MEDIA_INSERT_IMAGE'));
// Build the array of select options for the folder list
$options[] = Html::select('option', "", "/");
foreach ($folders as $folder) {
$folder = str_replace($com_media_base_uni, "", str_replace(DIRECTORY_SEPARATOR, '/', $folder));
$value = substr($folder, 1);
$text = str_replace(DIRECTORY_SEPARATOR, "/", $folder);
$options[] = Html::select('option', $value, $text);
}
// Sort the folder list array
if (is_array($options)) {
sort($options);
}
// Get asset and author id (use integer filter)
$asset = Request::getInt('asset', 0);
$author = Request::get('author', 0);
// Create the drop-down folder select list
$list = Html::select('genericlist', $options, 'folderlist', 'class="inputbox" size="1" onchange="ImageManager.setFolder(this.options[this.selectedIndex].value, ' . $asset . ', ' . $author . ')" ', 'value', 'text', $base);
return $list;
}
示例12: taskAjaxPrioritytoStatus_ALL
function taskAjaxPrioritytoStatus_ALL(Web &$w)
{
$status = array();
// split query string into proirity, type, group and assignee
list($priority, $type, $group, $assignee) = preg_split('/_/', $w->request('id'));
// organise criteria
$who = $assignee != "" ? $assignee : null;
$where = "";
if ($group != "") {
$where .= "task_group_id = " . $group . " and ";
}
if ($type != "") {
$where .= "task_type = '" . $type . "' and ";
}
if ($priority != "") {
$where .= "priority = '" . $priority . "' and ";
}
$where .= "is_closed = 0";
// get statuses from available tasks
$tasks = $w->Task->getTasks($who, $where);
if ($tasks) {
foreach ($tasks as $task) {
if (!array_key_exists($task->status, $status)) {
$status[$task->status] = array($task->status, $task->status);
}
}
}
if (!$status) {
$status = array(array("No assigned Tasks", ""));
}
// load status dropdown and return
$status = Html::select("status", $status, null);
$w->setLayout(null);
$w->out(json_encode($status));
}
示例13: taskAjaxTypetoPriority_ALL
function taskAjaxTypetoPriority_ALL(Web &$w)
{
$priority = array();
// split the query string into type, group and assignee
list($type, $group, $assignee) = preg_split('/_/', $w->request('id'));
// organise criteria
$who = $assignee != "" ? $assignee : null;
$where = "";
if ($group != "") {
$where .= "task_group_id = " . $group . " and ";
}
if ($type != "") {
$where .= "task_type = '" . $type . "' and ";
}
$where .= "is_closed = 0";
// get priorities from available task list
$tasks = $w->Task->getTasks($who, $where);
if ($tasks) {
foreach ($tasks as $task) {
if (!array_key_exists($task->priority, $priority)) {
$priority[$task->priority] = array($task->priority, $task->priority);
}
}
}
if (!$priority) {
$priority = array(array("No assigned Tasks", ""));
}
// load priority dropdown and return
$priority = Html::select("tpriority", $priority, null);
$w->setLayout(null);
$w->out(json_encode($priority));
}
示例14: positions
/**
* Display a batch widget for the module position selector.
*
* @param integer $clientId The client ID
*
* @return string The necessary HTML for the widget.
*
* @since 2.5
*/
public static function positions($clientId)
{
// Create the copy/move options.
$options = array(Html::select('option', 'c', Lang::txt('JLIB_HTML_BATCH_COPY')), Html::select('option', 'm', Lang::txt('JLIB_HTML_BATCH_MOVE')));
// Create the batch selector to change select the category by which to move or copy.
$lines = array('<label id="batch-choose-action-lbl" for="batch-choose-action">', Lang::txt('COM_MODULES_BATCH_POSITION_LABEL'), '</label>', '<fieldset id="batch-choose-action" class="combo">', '<select name="batch[position_id]" class="inputbox" id="batch-position-id">', '<option value="">' . Lang::txt('JSELECT') . '</option>', '<option value="nochange">' . Lang::txt('COM_MODULES_BATCH_POSITION_NOCHANGE') . '</option>', '<option value="noposition">' . Lang::txt('COM_MODULES_BATCH_POSITION_NOPOSITION') . '</option>', Html::select('options', self::positionList($clientId)), '</select>', Html::select('radiolist', $options, 'batch[move_copy]', '', 'value', 'text', 'm'), '</fieldset>');
return implode("\n", $lines);
}
示例15: getClientOptions
/**
* Get a list of filter options for the application clients.
*
* @return array An array of JHtmlOption elements.
*/
public static function getClientOptions()
{
// Build the filter options.
$options = array();
$options[] = Html::select('option', '0', Lang::txt('JSITE'));
$options[] = Html::select('option', '1', Lang::txt('JADMINISTRATOR'));
return $options;
}