本文整理汇总了PHP中mosHTML::makeOption方法的典型用法代码示例。如果您正苦于以下问题:PHP mosHTML::makeOption方法的具体用法?PHP mosHTML::makeOption怎么用?PHP mosHTML::makeOption使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mosHTML
的用法示例。
在下文中一共展示了mosHTML::makeOption方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: showInstalledModules
/**
* @param string The URL option
*/
function showInstalledModules($_option)
{
global $database, $mosConfig_absolute_path, $adminLanguage;
$filter = mosGetParam($_POST, 'filter', '');
$select[] = mosHTML::makeOption('', $adminLanguage->A_COMP_MOD_ALL);
$select[] = mosHTML::makeOption('0', $adminLanguage->A_MENU_SITE_MOD);
$select[] = mosHTML::makeOption('1', $adminLanguage->A_INSTALL_MOD_ADMIN_MOD);
$lists['filter'] = mosHTML::selectList($select, 'filter', 'class="inputbox" size="1" onchange="document.adminForm.submit();"', 'value', 'text', $filter);
if ($filter == NULL) {
$and = '';
} else {
if (!$filter) {
$and = "\n AND client_id = '0'";
} else {
if ($filter) {
$and = "\n AND client_id = '1'";
}
}
}
$database->setQuery("SELECT id, module, client_id" . "\n FROM #__modules" . "\n WHERE module LIKE 'mod_%' AND iscore='0'" . $and . "\n GROUP BY module, client_id" . "\n ORDER BY client_id, module");
$rows = $database->loadObjectList();
$id = 0;
foreach ($rows as $row) {
// path to module directory
if ($row->client_id == "1") {
$moduleBaseDir = mosPathName(mosPathName($mosConfig_absolute_path) . "administrator/modules");
} else {
$moduleBaseDir = mosPathName(mosPathName($mosConfig_absolute_path) . "modules");
}
// xml file for module
$xmlfile = $moduleBaseDir . "/" . $row->module . ".xml";
$xmlDoc =& new DOMIT_Lite_Document();
$xmlDoc->resolveErrors(true);
if (!$xmlDoc->loadXML($xmlfile, false, true)) {
continue;
}
$element =& $xmlDoc->documentElement;
if ($element->getTagName() != 'mosinstall') {
continue;
}
if ($element->getAttribute("type") != "module") {
continue;
}
$element =& $xmlDoc->getElementsByPath('creationDate', 1);
$row->creationdate = $element ? $element->getText() : '';
$element =& $xmlDoc->getElementsByPath('author', 1);
$row->author = $element ? $element->getText() : '';
$element =& $xmlDoc->getElementsByPath('copyright', 1);
$row->copyright = $element ? $element->getText() : '';
$element =& $xmlDoc->getElementsByPath('authorEmail', 1);
$row->authorEmail = $element ? $element->getText() : '';
$element =& $xmlDoc->getElementsByPath('authorUrl', 1);
$row->authorUrl = $element ? $element->getText() : '';
$element =& $xmlDoc->getElementsByPath('version', 1);
$row->version = $element ? $element->getText() : '';
$rows[$id] = $row;
$id++;
}
HTML_module::showInstalledModules($rows, $_option, $id, $xmlfile, $lists);
}
示例2: makeOption
public static function makeOption($value, $text = '', $value_name = 'value', $text_name = 'text')
{
if (JCOMMENTS_JVERSION == '1.0') {
return mosHTML::makeOption($value, $text, $value_name, $text_name);
}
return JHTML::_('select.option', $value, $text, $value_name, $text_name);
}
示例3: fetchSearchForm
function fetchSearchForm($gid, $itemid)
{
global $search_mode, $ordering, $invert_search, $reverse_order, $search_where, $search_phrase, $search_catid;
// category select list
$options = array(mosHTML::makeOption('0', _DML_ALLCATS));
$lists['catid'] = dmHTML::categoryList($search_catid, "", $options);
$mode = array();
$mode[] = mosHTML::makeOption('any', _DML_SEARCH_ANYWORDS);
$mode[] = mosHTML::makeOption('all', _DML_SEARCH_ALLWORDS);
$mode[] = mosHTML::makeOption('exact', _DML_SEARCH_PHRASE);
$mode[] = mosHTML::makeOption('regex', _DML_SEARCH_REGEX);
$lists['search_mode'] = mosHTML::selectList($mode, 'search_mode', 'id="search_mode" class="inputbox"', 'value', 'text', $search_mode);
$orders = array();
$orders[] = mosHTML::makeOption('newest', _DML_SEARCH_NEWEST);
$orders[] = mosHTML::makeOption('oldest', _DML_SEARCH_OLDEST);
$orders[] = mosHTML::makeOption('popular', _DML_SEARCH_POPULAR);
$orders[] = mosHTML::makeOption('alpha', _DML_SEARCH_ALPHABETICAL);
$orders[] = mosHTML::makeOption('category', _DML_SEARCH_CATEGORY);
$lists['ordering'] = mosHTML::selectList($orders, 'ordering', 'id="ordering" class="inputbox"', 'value', 'text', $ordering);
$lists['invert_search'] = '<input type="checkbox" class="inputbox" name="invert_search" ' . ($invert_search ? ' checked ' : '') . '/>';
$lists['reverse_order'] = '<input type="checkbox" class="inputbox" name="reverse_order" ' . ($reverse_order ? ' checked ' : '') . '/>';
$matches = array();
if ($search_where && count($search_where) > 0) {
foreach ($search_where as $val) {
$matches[] = mosHTML::makeOption($val, $val);
}
} else {
$matches[] = mosHTML::makeOption('search_description', 'search_description');
}
$where = array();
$where[] = mosHTML::makeOption('search_name', _DML_NAME);
$where[] = mosHTML::makeOption('search_description', _DML_DESCRIPTION);
$lists['search_where'] = mosHTML::selectList($where, 'search_where[]', 'id="search_where" class="inputbox" multiple="multiple" size="2"', 'value', 'text', $where);
return HTML_DMSearch::searchForm($lists, $search_phrase);
}
示例4: editGroup
function editGroup($option, $uid)
{
global $database;
// disable the main menu to force user to use buttons
$_REQUEST['hidemainmenu'] = 1;
$row = new mosDMGroups($database);
$row->load($uid);
$musers = array();
$toAddUsers = array();
// get selected members
if ($row->groups_members) {
$database->setQuery("SELECT id,name,username, block " . "\n FROM #__users " . "\n WHERE id IN (" . $row->groups_members . ")" . "\n ORDER BY block ASC, name ASC");
$usersInGroup = $database->loadObjectList();
foreach ($usersInGroup as $user) {
$musers[] = mosHTML::makeOption($user->id, $user->id . "-" . $user->name . " (" . $user->username . ")" . ($user->block ? ' - [' . _DML_USER_BLOCKED . ']' : ''));
}
}
// get non selected members
$query = "SELECT id,name,username, block FROM #__users ";
if ($row->groups_members) {
$query .= "\n WHERE id NOT IN (" . $row->groups_members . ")";
}
$query .= "\n ORDER BY block ASC, name ASC";
$database->setQuery($query);
$usersToAdd = $database->loadObjectList();
foreach ($usersToAdd as $user) {
$toAddUsers[] = mosHTML::makeOption($user->id, $user->id . "-" . $user->name . " (" . $user->username . ")" . ($user->block ? ' - [' . _DML_USER_BLOCKED . ']' : ''));
}
$usersList = mosHTML::selectList($musers, 'users_selected[]', 'class="inputbox" size="20" onDblClick="moveOptions(document.adminForm[\'users_selected[]\'], document.adminForm.users_not_selected)" multiple="multiple"', 'value', 'text', null);
$toAddUsersList = mosHTML::selectList($toAddUsers, 'users_not_selected', 'class="inputbox" size="20" onDblClick="moveOptions(document.adminForm.users_not_selected, document.adminForm[\'users_selected[]\'])" multiple="multiple"', 'value', 'text', null);
HTML_DMGroups::editGroup($option, $row, $usersList, $toAddUsersList);
}
示例5: messageForm
function messageForm($option)
{
global $database, $acl;
$gtree = array(mosHTML::makeOption(0, $adminLanguage->A_COMP_MASS_ALL));
// get list of groups
$lists = array();
$gtree = array_merge($gtree, $acl->get_group_children_tree(null, 'USERS', false));
$lists['gid'] = mosHTML::selectList($gtree, 'mm_group', 'size="10"', 'value', 'text', 0);
HTML_massmail::messageForm($lists, $option);
}
示例6: _form_editor_list
/**
* @param string The name of the form element
* @param string The value of the element
* @param object The xml element for the parameter
* @param string The control name
* @return string The html for the element
*/
function _form_editor_list($name, $value, &$node, $control_name)
{
global $database;
// compile list of the editors
$query = "SELECT element AS value, name AS text" . "\n FROM #__mambots" . "\n WHERE folder = 'editors'" . "\n AND published = 1" . "\n ORDER BY ordering, name";
$database->setQuery($query);
$editors = $database->loadObjectList();
array_unshift($editors, mosHTML::makeOption('', '- Selecionar Editor -'));
return mosHTML::selectList($editors, '' . $control_name . '[' . $name . ']', 'class="inputbox"', 'value', 'text', $value);
}
示例7: messageForm
function messageForm($option)
{
global $acl;
$gtree = array(mosHTML::makeOption(0, '- All User Groups -'));
// get list of groups
$lists = array();
$gtree = array_merge($gtree, $acl->get_group_children_tree(null, 'USERS', false));
$lists['gid'] = mosHTML::selectList($gtree, 'mm_group', 'size="10"', 'value', 'text', 0);
HTML_massmail::messageForm($lists, $option);
}
示例8: getLimitBox
/**
* Returns the html limit # input box
* @param string The basic link to include in the href
* @return string
*/
function getLimitBox($link)
{
$limits = array();
for ($i = 5; $i <= 30; $i += 5) {
$limits[] = mosHTML::makeOption("{$i}");
}
$limits[] = mosHTML::makeOption("50");
// build the html select list
$link = sefRelToAbs($link . '&limit=\' + this.options[selectedIndex].value + \'&limitstart=' . $this->limitstart);
return mosHTML::selectList($limits, 'limit', 'class="inputbox" size="1" onchange="document.location.href=\'' . $link . '\';"', 'value', 'text', $this->limit);
}
示例9: edit
/**
* @param database A database connector object
* @param integer The unique id of the category to edit (0 if new)
*/
function edit(&$uid, $menutype, $option)
{
global $database, $my, $mainframe;
$menu = new mosMenu($database);
$menu->load((int) $uid);
// fail if checked out not by 'me'
if ($menu->checked_out && $menu->checked_out != $my->id) {
mosErrorAlert("The module " . $menu->title . " is currently being edited by another administrator");
}
if ($uid) {
$menu->checkout($my->id);
// get previously selected Categories
$params = new mosParameters($menu->params);
$catids = $params->def('categoryid', '');
if ($catids) {
$catidsArray = explode(',', $catids);
mosArrayToInts($catidsArray);
$catids = 'c.id=' . implode(' OR c.id=', $catidsArray);
$query = "SELECT c.id AS `value`, c.section AS `id`, CONCAT_WS( ' / ', s.title, c.title) AS `text`" . "\n FROM #__sections AS s" . "\n INNER JOIN #__categories AS c ON c.section = s.id" . "\n WHERE s.scope = 'content'" . "\n AND ( {$catids} )" . "\n ORDER BY s.name,c.name";
$database->setQuery($query);
$lookup = $database->loadObjectList();
} else {
$lookup = '';
}
} else {
$menu->type = 'content_blog_category';
$menu->menutype = $menutype;
$menu->ordering = 9999;
$menu->parent = intval(mosGetParam($_POST, 'parent', 0));
$menu->published = 1;
$lookup = '';
}
// build the html select list for category
$rows[] = mosHTML::makeOption('', 'All Categories');
$query = "SELECT c.id AS `value`, c.section AS `id`, CONCAT_WS( ' / ', s.title, c.title) AS `text`" . "\n FROM #__sections AS s" . "\n INNER JOIN #__categories AS c ON c.section = s.id" . "\n WHERE s.scope = 'content'" . "\n ORDER BY s.name,c.name";
$database->setQuery($query);
$rows = array_merge($rows, $database->loadObjectList());
$category = mosHTML::selectList($rows, 'catid[]', 'class="inputbox" size="10" multiple="multiple"', 'value', 'text', $lookup);
$lists['categoryid'] = $category;
// build the html select list for ordering
$lists['ordering'] = mosAdminMenus::Ordering($menu, $uid);
// build the html select list for the group access
$lists['access'] = mosAdminMenus::Access($menu);
// build the html select list for paraent item
$lists['parent'] = mosAdminMenus::Parent($menu);
// build published button option
$lists['published'] = mosAdminMenus::Published($menu);
// build the url link output
$lists['link'] = mosAdminMenus::Link($menu, $uid);
// get params definitions
$params = new mosParameters($menu->params, $mainframe->getPath('menu_xml', $menu->type), 'menu');
/* chipjack: passing $sectCatList (categories) instead of $slist (sections) */
content_blog_category_html::edit($menu, $lists, $params, $option);
}
示例10: edit
/**
* @param database A database connector object
* @param integer The unique id of the section to edit (0 if new)
*/
function edit($uid, $menutype, $option)
{
global $database, $my, $mainframe;
$menu = new mosMenu($database);
$menu->load((int) $uid);
// fail if checked out not by 'me'
if ($menu->checked_out && $menu->checked_out != $my->id) {
mosErrorAlert("O módulo " . $menu->title . " está sendo editado atualmente por outro administrador");
}
if ($uid) {
$menu->checkout($my->id);
// get previously selected Categories
$params = new mosParameters($menu->params);
$secids = $params->def('sectionid', '');
if ($secids) {
$secidsArray = explode(',', $secids);
mosArrayToInts($secidsArray);
$secids = 's.id=' . implode(' OR s.id=', $secidsArray);
$query = "SELECT s.id AS `value`, s.id AS `id`, s.title AS `text`" . "\n FROM #__sections AS s" . "\n WHERE s.scope = 'content'" . "\n AND ( {$secids} )" . "\n ORDER BY s.name";
$database->setQuery($query);
$lookup = $database->loadObjectList();
} else {
$lookup = '';
}
} else {
$menu->type = 'content_blog_section';
$menu->menutype = $menutype;
$menu->ordering = 9999;
$menu->parent = intval(mosGetParam($_POST, 'parent', 0));
$menu->published = 1;
$lookup = '';
}
// build the html select list for section
$rows[] = mosHTML::makeOption('', 'Todas as Seções');
$query = "SELECT s.id AS `value`, s.id AS `id`, s.title AS `text`" . "\n FROM #__sections AS s" . "\n WHERE s.scope = 'content'" . "\n ORDER BY s.name";
$database->setQuery($query);
$rows = array_merge($rows, $database->loadObjectList());
$section = mosHTML::selectList($rows, 'secid[]', 'class="inputbox" size="10" multiple="multiple"', 'value', 'text', $lookup);
$lists['sectionid'] = $section;
// build the html select list for ordering
$lists['ordering'] = mosAdminMenus::Ordering($menu, $uid);
// build the html select list for the group access
$lists['access'] = mosAdminMenus::Access($menu);
// build the html select list for paraent item
$lists['parent'] = mosAdminMenus::Parent($menu);
// build published button option
$lists['published'] = mosAdminMenus::Published($menu);
// build the url link output
$lists['link'] = mosAdminMenus::Link($menu, $uid);
// get params definitions
$params = new mosParameters($menu->params, $mainframe->getPath('menu_xml', $menu->type), 'menu');
content_blog_section_html::edit($menu, $lists, $params, $option);
}
示例11: dbBackup
function dbBackup($p_option)
{
global $database;
$database->setQuery("SHOW tables");
$tables = $database->loadResultArray();
$tables2 = array(mosHTML::makeOption('all', T_('All Mambo Tables')));
foreach ($tables as $table) {
$tables2[] = mosHTML::makeOption($table);
}
$tablelist = mosHTML::selectList($tables2, 'tables[]', 'class="inputbox" size="5" multiple="multiple"', 'value', 'text', 'all');
HTML_dbadmin::backupIntro($tablelist, $p_option);
}
示例12: edit
/**
* @param database A database connector object
* @param integer The unique id of the section to edit (0 if new)
*/
function edit(&$uid, $menutype, $option)
{
global $database, $my, $mainframe;
global $mosConfig_absolute_path;
$menu = new mosMenu($database);
$menu->load($uid);
// fail if checked out not by 'me'
if ($menu->checked_out && $menu->checked_out != $my->id) {
echo "<script>alert('The module {$menu->title} is currently being edited by another administrator'); document.location.href='index2.php?option={$option}'</script>\n";
exit(0);
}
if ($uid) {
$menu->checkout($my->id);
// get previously selected Categories
$params =& new mosParameters($menu->params);
$secids = $params->def('sectionid', '');
if ($secids) {
$query = "SELECT s.id AS `value`, s.id AS `id`, s.title AS `text`" . "\n FROM #__sections AS s" . "\n WHERE s.scope = 'content'" . "\n AND s.id IN ( " . $secids . ")" . "\n ORDER BY s.name";
$database->setQuery($query);
$lookup = $database->loadObjectList();
} else {
$lookup = '';
}
} else {
$menu->type = 'content_blog_section';
$menu->menutype = $menutype;
$menu->ordering = 9999;
$menu->parent = intval(mosGetParam($_POST, 'parent', 0));
$menu->published = 1;
$lookup = '';
}
// build the html select list for section
$rows[] = mosHTML::makeOption('', 'All Sections');
$query = "SELECT s.id AS `value`, s.id AS `id`, s.title AS `text`" . "\n FROM #__sections AS s" . "\n WHERE s.scope = 'content'" . "\n ORDER BY s.name";
$database->setQuery($query);
$rows = array_merge($rows, $database->loadObjectList());
$section = mosHTML::selectList($rows, 'secid[]', 'class="inputbox" size="10" multiple="multiple"', 'value', 'text', $lookup);
$lists['sectionid'] = $section;
// build the html select list for ordering
$lists['ordering'] = mosAdminMenus::Ordering($menu, $uid);
// build the html select list for the group access
$lists['access'] = mosAdminMenus::Access($menu);
// build the html select list for paraent item
$lists['parent'] = mosAdminMenus::Parent($menu);
// build published button option
$lists['published'] = mosAdminMenus::Published($menu);
// build the url link output
$lists['link'] = mosAdminMenus::Link($menu, $uid);
// get params definitions
$params =& new mosParameters($menu->params, $mainframe->getPath('menu_xml', $menu->type), 'component');
/* chipjack: passing $sectCatList (categories) instead of $slist (sections) */
content_blog_section_html::edit($menu, $lists, $params, $option);
}
示例13: getLimitBox
/**
* @return string The html for the limit # input box
*/
function getLimitBox()
{
$limits = array();
for ($i = 5; $i <= 30; $i += 5) {
$limits[] = mosHTML::makeOption("{$i}");
}
$limits[] = mosHTML::makeOption("50");
// build the html select list
$html = mosHTML::selectList($limits, 'limit', 'class="inputbox" size="1" onchange="document.adminForm.submit();"', 'value', 'text', $this->limit);
$html .= "\n<input type=\"hidden\" name=\"limitstart\" value=\"{$this->limitstart}\" />";
return $html;
}
示例14: newMessage
function newMessage($option, $user, $subject)
{
global $database, $mainframe, $my, $acl;
// get available backend user groups
$gid = $acl->get_group_id('Public Backend', 'ARO');
$gids = $acl->get_group_children($gid, 'ARO', 'RECURSE');
$gids = implode(',', $gids);
// get list of usernames
$recipients = array(mosHTML::makeOption('0', '- Select User -'));
$database->setQuery("SELECT id AS value, username AS text FROM #__users" . "\n WHERE gid IN ({$gids})" . "\n ORDER BY name");
$recipients = array_merge($recipients, $database->loadObjectList());
$recipientslist = mosHTML::selectList($recipients, 'user_id_to', 'class="inputbox" size="1"', 'value', 'text', $user);
HTML_messages::newMessage($option, $recipientslist, $subject);
}
示例15: viewTrash
/**
* Compiles a list of trash items
*/
function viewTrash($option)
{
global $database, $mainframe, $mosConfig_list_limit;
$catid = $mainframe->getUserStateFromRequest("catid{$option}", 'catid', 'content');
$limit = intval($mainframe->getUserStateFromRequest("viewlistlimit", 'limit', $mosConfig_list_limit));
$limitstart = intval($mainframe->getUserStateFromRequest("view{$option}limitstart", 'limitstart', 0));
require_once $GLOBALS['mosConfig_absolute_path'] . '/administrator/includes/pageNavigation.php';
if ($catid == "content") {
// get the total number of content
$query = "SELECT count(*)" . "\n FROM #__content AS c" . "\n LEFT JOIN #__categories AS cc ON cc.id = c.catid" . "\n LEFT JOIN #__sections AS s ON s.id = cc.section AND s.scope = 'content'" . "\n WHERE c.state = -2";
$database->setQuery($query);
$total = $database->loadResult();
$pageNav = new mosPageNav($total, $limitstart, $limit);
// Query content items
$query = "SELECT c.*, g.name AS groupname, cc.name AS catname, s.name AS sectname" . "\n FROM #__content AS c" . "\n LEFT JOIN #__categories AS cc ON cc.id = c.catid" . "\n LEFT JOIN #__sections AS s ON s.id = cc.section AND s.scope='content'" . "\n INNER JOIN #__groups AS g ON g.id = c.access" . "\n LEFT JOIN #__users AS u ON u.id = c.checked_out" . "\n WHERE c.state = -2" . "\n ORDER BY s.name, cc.name, c.title";
$database->setQuery($query, $pageNav->limitstart, $pageNav->limit);
$content = $database->loadObjectList();
$num = $total;
if ($limit < $total) {
$num = $limit;
}
for ($i = 0; $i < $num - 1; $i++) {
if ($content[$i]->sectionid == 0 && $content[$i]->catid == 0) {
$content[$i]->sectname = 'Static Content';
}
}
} else {
// get the total number of menu
$query = "SELECT count(*)" . "\n FROM #__menu AS m" . "\n LEFT JOIN #__users AS u ON u.id = m.checked_out" . "\n WHERE m.published = -2";
$database->setQuery($query);
$total = $database->loadResult();
$pageNav = new mosPageNav($total, $limitstart, $limit);
// Query menu items
$query = "SELECT m.name AS title, m.menutype AS sectname, m.type AS catname, m.id AS id" . "\n FROM #__menu AS m" . "\n LEFT JOIN #__users AS u ON u.id = m.checked_out" . "\n WHERE m.published = -2" . "\n ORDER BY m.menutype, m.ordering, m.ordering, m.name";
$database->setQuery($query, $pageNav->limitstart, $pageNav->limit);
$content = $database->loadObjectList();
}
// Build the select list
$listselect = array();
$listselect[] = mosHTML::makeOption('content', 'Content Items');
$listselect[] = mosHTML::makeOption('menu', 'Menu Items');
$selected = "all";
$list = mosHTML::selectList($listselect, 'catid', 'class="inputbox" size="1" ' . 'onchange="document.adminForm.submit();"', 'value', 'text', $catid);
HTML_trash::showList($option, $content, $pageNav, $list, $catid);
}