本文整理汇总了PHP中mosHTML::yesnoRadioList方法的典型用法代码示例。如果您正苦于以下问题:PHP mosHTML::yesnoRadioList方法的具体用法?PHP mosHTML::yesnoRadioList怎么用?PHP mosHTML::yesnoRadioList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mosHTML
的用法示例。
在下文中一共展示了mosHTML::yesnoRadioList方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: yesnoRadioList
public static function yesnoRadioList($tag_name, $tag_attribs, $selected, $yes = 'yes', $no = 'no', $id = false)
{
if (JCOMMENTS_JVERSION == '1.0') {
return mosHTML::yesnoRadioList($tag_name, $tag_attribs, $selected, $yes, $no);
}
return JHTML::_('select.booleanlist', $tag_name, $tag_attribs, $selected, $yes, $no, $id);
}
示例2: ALF_editItem
function ALF_editItem($id, $option)
{
global $JLMS_CONFIG;
$db =& JFactory::getDbo();
$row = new JLMS_forum_item($db);
$row->load($id);
if (isset($row->id) && $row->id || !$id) {
if (!$row->parent_forum) {
$row->parent_forum = 0;
}
if (!$row->forum_access) {
$row->forum_access = 0;
}
if (!$row->published) {
$row->published = 0;
}
if (!$row->forum_level) {
$row->forum_level = 0;
}
if (!$row->user_level) {
$row->user_level = 0;
}
if (!$row->moderated) {
$row->moderated = 0;
}
$parent_forums =& ALF_get_forums_list('id as value, forum_name as text, parent_forum');
for ($j = 1, $n = count($parent_forums); $j < $n; $j++) {
if ($parent_forums[$j]->parent_forum) {
$parent_forums[$j]->text = ' - ' . $parent_forums[$j]->text;
}
}
array_unshift($parent_forums, mosHTML::makeOption('0', ' '));
$lists['parent_forums'] = mosHTML::selectList($parent_forums, 'parent_forum', 'class="text_area" style="width:266px" ', 'value', 'text', $row->parent_forum);
$lists['custom_access'] = mosHTML::yesnoRadioList('forum_access', 'class="text_area" ', $row->forum_access);
$lists['published'] = mosHTML::yesnoRadioList('published', 'class="text_area" ', $row->published);
$lists['moderated'] = mosHTML::yesnoRadioList('moderated', 'class="text_area" ', $row->moderated);
$query = "SELECT id as value, lms_usertype as text, roletype_id, IF(roletype_id = 4, 1, IF(roletype_id = 2, 2, 3)) as ordering FROM #__lms_usertypes WHERE roletype_id IN (2,4,5) ORDER BY ordering, lms_usertype";
$db->SetQuery($query);
$roles = $db->LoadObjectList('value');
//TODO: check if this loadobjectlist('value') work in Joomla15 and Joomla16
$forum_types = array();
$forum_types[] = mosHTML::makeOption('0', 'Regular board');
$forum_types[] = mosHTML::makeOption('1', 'LearningPath specific board ');
$forum_types[] = mosHTML::makeOption('2', 'Usergroup (course) specific board');
$forum_types[] = mosHTML::makeOption('3', 'Usergroup (system) specific board');
$forum_type = 0;
if ($row->forum_level == 1) {
$forum_type = 1;
} elseif ($row->user_level == 1) {
$forum_type = 2;
} elseif ($row->user_level == 2) {
$forum_type = 3;
}
$lists['forum_type'] = mosHTML::selectList($forum_types, 'forum_type', 'class="text_area" style="width:266px" ', 'value', 'text', $forum_type);
ALF_html::editItem($row, $lists, $roles, $option);
} else {
mosRedirect("index.php?option={$option}&task=lms_forums");
}
}
示例3: editSubscriber
function editSubscriber($subscriber, $listings, $queues, $forms, $access = false, $frontEnd = false, $cb = false)
{
global $my, $mainframe;
mosCommonHTML::loadOverlib();
$lists['receive_html'] = mosHTML::yesnoRadioList('receive_html', 'class="inputbox"', $subscriber->receive_html);
$lists['confirmed'] = mosHTML::yesnoRadioList('confirmed', 'class="inputbox"', $subscriber->confirmed);
$lists['blacklist'] = mosHTML::yesnoRadioList('blacklist', 'class="inputbox"', $subscriber->blacklist);
$br = "\n\r";
$html = $forms['main'];
$html .= '<div style="width:100%; align:left;">' . $br;
$html .= '<fieldset class="acajoomcss" style="padding: 10px; text-align: left">' . $br;
$html .= '<legend><strong>' . _ACA_SUB_INFO . '</strong></legend>' . $br;
$html .= '<table cellpadding="0" cellspacing="0" align="center">' . $br;
$text = str_replace('"', '"', $subscriber->name);
if (function_exists('htmlspecialchars_decode')) {
$text = htmlspecialchars_decode($text, ENT_NOQUOTES);
} elseif (function_exists('html_entity_decode')) {
$text = html_entity_decode($text, ENT_NOQUOTES);
}
if (!$cb) {
$html .= acajoom::miseEnHTML(_ACA_INPUT_NAME, _ACA_INPUT_NAME_TIPS, '<input type="text" name="name" size="30" value="' . $text . '" class="inputbox" />');
$html .= acajoom::miseEnHTML(_ACA_INPUT_EMAIL, _ACA_INPUT_EMAIL_TIPS, '<input type="text" name="email" size="30" class="inputbox" value="' . $subscriber->email . ' " />');
} else {
$html .= '<input type="hidden" name="cb_integration" value="1" />';
}
$html .= acajoom::miseEnHTML(_ACA_RECEIVE_HTML, _ACA_RECEIVE_HTML_TIPS, $lists['receive_html']);
if ($GLOBALS[ACA . 'time_zone'] == 1) {
$html .= acajoom::miseEnHTML(_ACA_TIME_ZONE_ASK, _ACA_TIME_ZONE_ASK_TIPS, ' <input type="text" name="timezone" size="30" class="inputbox" value="' . $subscriber->timezone . '" />');
} else {
$html .= '<input type="hidden" name="timezone" value="' . $subscriber->timezone . '" />';
}
if ($access) {
if ($subscriber->user_id == 0) {
$html .= acajoom::miseEnHTML(_ACA_CONFIRMED, '', $lists['confirmed']);
} else {
if (!$cb or !$mainframe->isAdmin()) {
$html .= '<input type="hidden" name="confirmed" value="' . $subscriber->confirmed . '" />';
}
}
$html .= acajoom::miseEnHTML(_ACA_BLACK_LIST, '', $lists['blacklist']);
$html .= acajoom::miseEnHTML(_ACA_REGISTRATION_DATE, '', $subscriber->subscribe_date);
$html .= acajoom::miseEnHTML(_ACA_USER_ID, '', $subscriber->user_id);
} else {
$html .= '<input type="hidden" name="confirmed" value="' . $subscriber->confirmed . '" />';
$html .= '<input type="hidden" name="blacklist" value="' . $subscriber->blacklist . '" />';
}
$html .= '</table>';
$html .= '</fieldset></div>';
$html .= subscribersHTML::showSubscriberLists($subscriber, $listings, $queues, $frontEnd, $access);
return $html;
}
示例4: edit
function edit($id)
{
global $my, $mainframe, $database, $option, $priTask, $subTask;
global $WBG_CONFIG, $wbGalleryDB_cat;
$row = new wbGalleryDB_cat($database);
$row->load($id);
if (!$row->id) {
$row->published = 1;
}
$lists = array();
$catTree = $wbGalleryDB_cat->getCategoryTree();
$tList = array(mosHTML::makeOption('0', 'No Parent...', 'id', 'name'));
$tList = array_merge($tList, $catTree);
$lists['parent_id'] = mosHTML::selectList($tList, 'parent_id', '', 'id', 'name', (int) $row->parent_id);
$lists['published'] = mosHTML::yesnoRadioList('published', '', (int) $row->published);
$lists['access'] = mosAdminMenus::Access($row);
wbGallery_cat_html::edit($row, $lists);
}
示例5: jlms_booking_edit
//.........这里部分代码省略.........
</table>
<table cellpadding="1" <?php
if ($row->p_id) {
echo 'style="display:none;"';
}
?>
cellspacing="0" border="0" width="100%">
<tr>
<td width="170">
Select Date
</td>
<td>
<input type="radio" name="sel_option" checked value="0" onchange="Choose_option(1);" />
</td>
</tr>
<tr>
<td>
Select period
</td>
<td>
<input type="radio" name="sel_option" value="1" onchange="Choose_option(0);" />
</td>
</tr>
</table>
<table cellpadding="1" cellspacing="0" border="0" id="sel_date" width="100%">
<tr>
<td width="170"> Choose Date </td>
<td valign="middle" style="vertical-align:middle ">
<?php
echo JLMS_HTML::_('calendar.calendar', $row->cur_date, 'start', 'start');
?>
</td>
</tr>
</table>
<table cellpadding="1" cellspacing="0" border="0" id="sel_period" style="display:none;" width="100%">
<tr>
<td width="170"> Select days of week </td>
<td valign="top">
<?php
$weekday = array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
for ($i = 0; $i < 7; $i++) {
echo '<br /><input type="checkbox" name="weekday[]" value="' . $i . '" />' . $weekday[$i];
}
?>
</td>
</tr>
<tr>
<td width="170"> Select months </td>
<td valign="top">
<?php
for ($i = 0; $i < 7; $i++) {
$month_num = date("m_Y", mktime(0, 0, 0, date("m") + $i, 1, date("Y")));
$month_text = date("F Y", mktime(0, 0, 0, date("m") + $i, 1, date("Y")));
echo '<br /><input type="checkbox" name="monthday[]" value="' . $month_num . '" />' . $month_text;
}
?>
</td>
</tr>
</table>
<table cellpadding="1" cellspacing="0" border="0" width="100%">
<tr>
<td width="170">Public</td>
<td>
<?php
echo mosHTML::yesnoRadioList('c_public', 'class="inputbox" ', $row->public);
?>
</td>
</tr>
</table>
</table>
<input type="hidden" name="task" value="conference" />
<input type="hidden" name="mode" value="" />
<input type="hidden" name="boxchecked" value="0" />
<input type="hidden" name="p_id" value="<?php
echo $row->p_id;
?>
" />
<input type="hidden" name="id" value="<?php
echo $course_id;
?>
" />
<input type="hidden" name="state" value="0" />
</form>
<?php
JLMS_TMPL::CloseTS();
/*$controls = array();
$controls[] = array('href' => "javascript:submitbutton('period_cancel');", 'title' => _JLMS_CANCEL_ALT_TITLE, 'img' => 'cancel');
$controls[] = array('href' => "javascript:submitbutton('save_period');", 'title' => _JLMS_SAVE_ALT_TITLE, 'img' => 'save');
JLMS_TMPL::ShowControlsFooter($controls, sefRelToAbs("index.php?option=$option&Itemid=$Itemid&task=conference&mode=booking&id=$course_id"));
*/
JLMS_TMPL::CloseMT();
}
示例6: editMailing
function editMailing($mailingEdit, $new, $listId, $forms, $show)
{
$lists = array();
$folders = array();
if (ACA_CMSTYPE) {
$my =& JFactory::getUser();
$folders[] = JHTML::_('select.option', '/');
$lists['published'] = JHTML::_('select.booleanlist', 'published', 'class="inputbox"', $mailingEdit->published);
$lists['visible'] = JHTML::_('select.booleanlist', 'visible', 'class="inputbox"', $mailingEdit->visible);
} else {
global $my;
$folders[] = mosHTML::makeOption('/');
$lists['published'] = mosHTML::yesnoRadioList('published', 'class="inputbox"', $mailingEdit->published);
$lists['visible'] = mosHTML::yesnoRadioList('visible', 'class="inputbox"', $mailingEdit->visible);
}
//endif
$images = $mailingEdit->images;
if (!isset($mailingEdit->list_id)) {
$mailingEdit->list_id = $listId;
}
$pathA = ACA_JPATH_ROOT_NO_ADMIN . '/images/stories';
$pathL = ACA_JPATH_LIVE . '/images/stories';
$images = array();
if (ACA_CMSTYPE) {
mailingsHTML::ReadImages($pathA, '/', $folders, $images);
if (!isset($images['/'])) {
$images['/'][] = JHTML::_('select.option', '');
}
$javascript = "onchange=\"previewImage( 'imagefiles', 'view_imagefiles', '{$pathL}/' )\"";
$lists['imagefiles'] = JHTML::_('select.genericlist', $images['/'], 'imagefiles', 'class="inputbox" size="10" multiple="multiple" ' . $javascript, 'value', 'text', null);
$javascript = "onchange=\"changeDynaList( 'imagefiles', folderimages, document.adminForm.folders.options[document.adminForm.folders.selectedIndex].value, 0, 0); previewImage( 'imagefiles', 'view_imagefiles', '{$pathL}/' );\"";
$lists['folders'] = JHTML::_('select.genericlist', $folders, 'folders', 'class="inputbox" size="1" ' . $javascript, 'value', 'text', '/');
$images2 = array();
foreach ($mailingEdit->images as $file) {
$temp = explode('|', $file);
if (strrchr($temp[0], '/')) {
$filename = substr(strrchr($temp[0], '/'), 1);
} else {
$filename = $temp[0];
}
$images2[] = JHTML::_('select.option', $file, $filename);
}
//$javascript = "onchange=\"previewImage( 'imagelist', 'view_imagelist', '$path/' ); showImageProps( '$path/' ); \" onfocus=\"previewImage( 'imagelist', 'view_imagelist', '$path/' )\"";
$javascript = "onchange=\"previewImage( 'imagelist', 'view_imagelist', '{$pathL}/' ); showImageProps( '{$pathL}/' ); \"";
$lists['imagelist'] = JHTML::_('select.genericlist', $images2, 'imagelist', 'class="inputbox" size="10" ' . $javascript, 'value', 'text');
$lists['_align'] = JHTML::_('list.positions', '_align');
$lists['_caption_align'] = JHTML::_('list.positions', '_caption_align');
} else {
mosAdminMenus::ReadImages($pathA, '/', $folders, $images);
$lists['folders'] = mosAdminMenus::GetImageFolders($folders, $pathL);
$lists['imagefiles'] = mosAdminMenus::GetImages($images, $pathL);
$lists['imagelist'] = mosAdminMenus::GetSavedImages($mailingEdit, $pathL);
$lists['_align'] = mosAdminMenus::Positions('_align');
$lists['_caption_align'] = mosAdminMenus::Positions('_caption_align');
}
//endif
if (ACA_CMSTYPE) {
// joomla 15
$pos[] = JHTML::_('select.option', 'bottom', _CMN_BOTTOM);
$pos[] = JHTML::_('select.option', 'top', _CMN_TOP);
$lists['_caption_position'] = JHTML::_('select.genericlist', $pos, '_caption_position', 'class="inputbox" size="1"', 'value', 'text');
} else {
//joomla 1x
$pos[] = mosHTML::makeOption('bottom', _CMN_BOTTOM);
$pos[] = mosHTML::makeOption('top', _CMN_TOP);
$lists['_caption_position'] = mosHTML::selectList($pos, '_caption_position', 'class="inputbox" size="1"', 'value', 'text');
}
//endif
backHTML::formStart('edit_mailing', $mailingEdit->html, $images);
echo $forms['main'];
if ($new and $mailingEdit->list_type == 7) {
$mailingEdit->issue_nb = 0;
}
mailingsHTML::layout($mailingEdit, $lists, $show);
?>
<input type="hidden" name="images" value="" />
<input type="hidden" name="html" value="<?php
echo $mailingEdit->html;
?>
" />
<input type="hidden" name="new_list" value="<?php
echo $new;
?>
" />
<input type="hidden" name="listid" value="<?php
echo $listId;
?>
" />
<input type="hidden" name="listype" value="<?php
echo $mailingEdit->list_type;
?>
" />
<input type="hidden" name="mailingid" value="<?php
echo $mailingEdit->id;
?>
" />
<input type="hidden" name="issue_nb" value="<?php
echo $mailingEdit->issue_nb;
?>
" />
//.........这里部分代码省略.........
示例7: editWeblink
/**
* Compiles information to add or edit
* @param integer The unique id of the record to edit (0 if new)
*/
function editWeblink($option, $id)
{
global $database, $my, $mosConfig_absolute_path;
$lists = array();
$row = new mosWeblink($database);
// load the row from the db table
$row->load((int) $id);
// fail if checked out not by 'me'
if ($row->isCheckedOut($my->id)) {
mosRedirect('index2.php?option=' . $option, 'The module $row->title is currently being edited by another administrator.');
}
if ($id) {
$row->checkout($my->id);
} else {
// initialise new record
$row->published = 1;
$row->approved = 1;
$row->order = 0;
$row->catid = intval(mosGetParam($_POST, 'catid', 0));
}
// build the html select list for ordering
$query = "SELECT ordering AS value, title AS text" . "\n FROM #__weblinks" . "\n WHERE catid = " . (int) $row->catid . "\n ORDER BY ordering";
$lists['ordering'] = mosAdminMenus::SpecificOrdering($row, $id, $query, 1);
// build list of categories
$lists['catid'] = mosAdminMenus::ComponentCategory('catid', $option, intval($row->catid));
// build the html select list
$lists['published'] = mosHTML::yesnoRadioList('published', 'class="inputbox"', $row->published);
$file = $mosConfig_absolute_path . '/administrator/components/com_weblinks/weblinks_item.xml';
$params = new mosParameters($row->params, $file, 'component');
HTML_weblinks::editWeblink($row, $lists, $params, $option);
}
示例8: editModule
/**
* Compiles information to add or edit a module
* @param string The current GET/POST option
* @param integer The unique id of the record to edit
*/
function editModule($option, $uid, $client)
{
global $database, $my, $mainframe;
global $mosConfig_absolute_path;
$lists = array();
$row = new mosModule($database);
// load the row from the db table
$row->load($uid);
// fail if checked out not by 'me'
if ($row->checked_out && $row->checked_out != $my->id) {
echo "<script>alert('" . sprintf(T_('The module %s is currently being edited by another administrator'), $row->title) . "'); document.location.href='index2.php?option={$option}'</script>\n";
exit(0);
}
$row->title = htmlspecialchars(str_replace('&', '&', $row->title));
$row->content = htmlspecialchars(str_replace('&', '&', $row->content));
if ($uid) {
$row->checkout($my->id);
}
// if a new record we must still prime the mosModule object with a default
// position and the order; also add an extra item to the order list to
// place the 'new' record in last position if desired
if ($uid == 0) {
$row->position = 'left';
$row->showtitle = true;
//$row->ordering = $l;
$row->published = 1;
}
if ($client == 'admin') {
$where = "client_id='1'";
$lists['client_id'] = 1;
$path = 'mod1_xml';
} else {
$where = "client_id='0'";
$lists['client_id'] = 0;
$path = 'mod0_xml';
}
$query = "SELECT position, ordering, showtitle, title" . "\n FROM #__modules" . "\n WHERE " . $where . "\n ORDER BY ordering";
$database->setQuery($query);
if (!($orders = $database->loadObjectList())) {
echo $database->stderr();
return false;
}
$query = "SELECT position, description" . "\n FROM #__template_positions" . "\n WHERE position <> ''";
$database->setQuery($query);
// hard code options for now
$positions = $database->loadObjectList();
$orders2 = array();
$pos = array();
foreach ($positions as $position) {
$orders2[$position->position] = array();
$pos[] = mosHTML::makeOption($position->position, $position->description);
}
$l = 0;
$r = 0;
for ($i = 0, $n = count($orders); $i < $n; $i++) {
$ord = 0;
if (array_key_exists($orders[$i]->position, $orders2)) {
$ord = count(array_keys($orders2[$orders[$i]->position])) + 1;
}
$orders2[$orders[$i]->position][] = mosHTML::makeOption($ord, $ord . '::' . addslashes($orders[$i]->title));
}
// build the html select list
$pos_select = 'onchange="changeDynaList(\'ordering\',orders,document.adminForm.position.options[document.adminForm.position.selectedIndex].value, originalPos, originalOrder)"';
$active = $row->position ? $row->position : 'left';
$lists['position'] = mosHTML::selectList($pos, 'position', 'class="inputbox" size="1" ' . $pos_select, 'value', 'text', $active);
// get selected pages for $lists['selections']
if ($uid) {
$query = 'SELECT menuid AS value FROM #__modules_menu WHERE moduleid=' . $row->id;
$database->setQuery($query);
$lookup = $database->loadObjectList();
} else {
$lookup = array(mosHTML::makeOption(0, 'All'));
}
if ($row->access == 99 || $row->client_id == 1 || $lists['client_id']) {
$lists['access'] = T_('Administrator') . '<input type="hidden" name="access" value="99" />';
$lists['showtitle'] = T_('N/A') . ' <input type="hidden" name="showtitle" value="1" />';
$lists['selections'] = T_('N/A');
} else {
if ($client == 'admin') {
$lists['access'] = T_('N/A');
$lists['selections'] = T_('N/A');
} else {
$lists['access'] = mosAdminMenus::Access($row);
$lists['groups'] = mosAdminMenus::groupAccess($row);
$lists['selections'] = mosAdminMenus::MenuLinks($lookup, 1, 1);
}
$lists['showtitle'] = mosHTML::yesnoRadioList('showtitle', 'class="inputbox"', $row->showtitle);
}
// build the html select list for published
$lists['published'] = mosAdminMenus::Published($row);
// xml file for module
$xmlfile = $mainframe->getPath($path, $row->module);
if ($xmlfile) {
$xmlparser =& new mosXMLDescription($xmlfile);
$row->description = $xmlparser->getDescription('module');
//.........这里部分代码省略.........
示例9: showConfig
/**
* @param option
* @return builds admin configuration options
*/
function showConfig($option)
{
global $mosConfig_absolute_path, $database, $mosConfig_mailfrom;
require $mosConfig_absolute_path . "/administrator/components/com_comment/config.comment.php";
?>
<script language="javascript" type="text/javascript">
function submitbutton(pressbutton) {
var form = document.adminForm;
if (pressbutton == 'cancel') {
submitform( pressbutton );
return;
}
submitform( pressbutton );
}
</script>
<form action="index2.php" method="POST" name="adminForm">
<?php
$gbtabs = new mosTabs(0);
$gbtabs->startPane("_comment");
$gbtabs->startTab("General", "General-page");
?>
<table width="100%" border="0" cellpadding="4" cellspacing="2" class="adminForm">
<tr align="center" valign="middle">
<td align="left" valign="top"><strong><?php
echo T_('Sections available');
?>
:</strong></td>
<td align="left" valign="top"><select size="5" name="mcselections[]" class="inputbox" multiple="multiple">
<?php
$seclistarray = explode(",", $allow_comments_in_sections);
$database->setQuery("SELECT id,title FROM #__sections ORDER BY title ASC");
$dbsectionlist = $database->loadObjectList();
echo "<option value='0' ";
if (in_array(0, $seclistarray)) {
echo "selected";
}
echo ">Static Content</option>";
foreach ($dbsectionlist as $slrow) {
echo "<option value='{$slrow->id}' ";
if (in_array($slrow->id, $seclistarray)) {
echo "selected";
}
echo ">{$slrow->title}</option>";
}
?>
</select>
</td>
<td width="50%" align="left" valign="top">Choose which section(s) should
use the comment system. Hold down [CTRL] to make multiple selections.</td>
</tr>
<tr align="center" valign="middle">
<td align="left" valign="top"><strong><?php
echo T_('Autopublish Comments');
?>
:</strong></td>
<td align="left" valign="top">
<?php
echo mosHTML::yesnoRadioList('auto_publish_comments', 'class="inputbox"', $auto_publish_comments);
?>
</td>
<td align="left" valign="top"><?php
echo T_('Automatically publish new comments');
?>
</td>
</tr>
<tr align="center" valign="middle">
<td align="left" valign="top"><strong><?php
echo T_('Anonymous Comments');
?>
:</strong></td>
<td align="left" valign="top">
<?php
echo mosHTML::yesnoRadioList('allow_anonymous_entries', 'class="inputbox"', $allow_anonymous_entries);
?>
</td>
<td align="left" valign="top"><?php
echo T_('Allow unregistered users to post comments');
?>
</td>
</tr>
<tr align="center" valign="middle">
<td align="left" valign="top"><strong><?php
echo T_('Comments Per Page');
?>
:</strong></td>
<td align="left" valign="top">
<?php
$pp = array(mosHTML::makeOption(5, 5), mosHTML::makeOption(10, 10), mosHTML::makeOption(15, 15), mosHTML::makeOption(20, 20), mosHTML::makeOption(25, 25), mosHTML::makeOption(30, 30), mosHTML::makeOption(50, 50));
echo mosHTML::selectList($pp, 'comments_per_page', 'class="inputbox" size="1"', 'value', 'text', $comments_per_page);
?>
</td>
<td align="left" valign="top"><?php
echo T_('When comments exceed the set level the page will automatically paginate');
?>
</td>
</tr>
//.........这里部分代码省略.........
示例10: editCategory
/**
* Compiles information to add or edit a category
* @param string The name of the category section
* @param integer The unique id of the category to edit (0 if new)
* @param string The name of the current user
*/
function editCategory($uid = 0, $section = '')
{
global $database, $my, $adminLanguage;
global $mosConfig_absolute_path, $mosConfig_live_site;
$type = mosGetParam($_REQUEST, 'type', '');
$redirect = mosGetParam($_POST, 'section', '');
$row = new mosCategory($database);
// load the row from the db table
$row->load($uid);
// fail if checked out not by 'me'
if ($row->checked_out && $row->checked_out != $my->id) {
mosRedirect('index2.php?option=categories§ion=' . $row->section, $adminLanguage->A_COMP_CATEG_MESSAGE . " " . $row->title . " " . $adminLanguage->A_COMP_CATEG_MESSAGE2);
}
if ($uid) {
// existing record
$row->checkout($my->id);
// code for Link Menu
if ($row->section > 0) {
$query = "SELECT *" . "\n FROM #__menu" . "\n WHERE componentid = " . $row->id . "\n AND ( type = 'content_archive_category' OR type = 'content_blog_category' OR type = 'content_category' )";
$database->setQuery($query);
$menus = $database->loadObjectList();
$count = count($menus);
for ($i = 0; $i < $count; $i++) {
switch ($menus[$i]->type) {
case 'content_category':
$menus[$i]->type = $adminLanguage->A_COMP_CATEG_TABLE;
break;
case 'content_blog_category':
$menus[$i]->type = $adminLanguage->A_COMP_CATEG_BLOG;
break;
case 'content_archive_category':
$menus[$i]->type = $adminLanguage->A_COMP_CATEG_BLOG_ARCHIVE;
break;
}
}
} else {
$menus = array();
}
} else {
// new record
$row->section = $section;
$row->published = 1;
$menus = NULL;
}
// make order list
$order = array();
$database->setQuery("SELECT COUNT(*) FROM #__categories WHERE section='{$row->section}'");
$max = intval($database->loadResult()) + 1;
for ($i = 1; $i < $max; $i++) {
$order[] = mosHTML::makeOption($i);
}
// build the html select list for sections
if ($section == 'content') {
$query = "SELECT s.id AS value, s.title AS text" . "\n FROM #__sections AS s" . "\n ORDER BY s.ordering";
$database->setQuery($query);
$sections = $database->loadObjectList();
$lists['section'] = mosHTML::selectList($sections, 'section', 'class="inputbox" size="1"', 'value', 'text');
} else {
if ($type == 'other') {
$section_name = 'N/A';
} else {
$temp = new mosSection($database);
$temp->load($row->section);
$section_name = $temp->name;
}
$lists['section'] = '<input type="hidden" name="section" value="' . $row->section . '" />' . $section_name;
}
// build the html select list for category types
$types[] = mosHTML::makeOption('', $adminLanguage->A_COMP_CATEG_SELECT_TYPE);
$types[] = mosHTML::makeOption('content_category', $adminLanguage->A_COMP_CATEG_TABLE);
$types[] = mosHTML::makeOption('content_blog_category', $adminLanguage->A_COMP_CATEG_BLOG);
$types[] = mosHTML::makeOption('content_archive_category', $adminLanguage->A_COMP_CATEG_BLOG_ARCHIVE);
$lists['link_type'] = mosHTML::selectList($types, 'link_type', 'class="inputbox" size="1"', 'value', 'text');
// build the html select list for ordering
$query = "SELECT ordering AS value, title AS text" . "\n FROM #__categories" . "\n WHERE section = '{$row->section}'" . "\n ORDER BY ordering";
$lists['ordering'] = mosAdminMenus::SpecificOrdering($row, $uid, $query);
// build the select list for the image positions
$active = $row->image_position ? $row->image_position : 'left';
$lists['image_position'] = mosAdminMenus::Positions('image_position', $active, NULL, 0, 0);
// Imagelist
$lists['image'] = mosAdminMenus::Images('image', $row->image);
// build the html select list for the group access
$lists['access'] = mosAdminMenus::Access($row);
// build the html radio buttons for published
$lists['published'] = mosHTML::yesnoRadioList('published', 'class="inputbox"', $row->published);
// build the html select list for menu selection
$lists['menuselect'] = mosAdminMenus::MenuSelect();
categories_html::edit($row, $section, $lists, $redirect, $menus);
}
示例11: editNewsFeed
/**
* Creates a new or edits and existing user record
* @param int The id of the user, 0 if a new entry
* @param string The current GET/POST option
*/
function editNewsFeed($id, $option)
{
global $database, $my;
$catid = intval(mosGetParam($_REQUEST, 'catid', 0));
$row = new mosNewsFeed($database);
// load the row from the db table
$row->load((int) $id);
if ($id) {
// do stuff for existing records
$row->checkout($my->id);
} else {
// do stuff for new records
$row->ordering = 0;
$row->numarticles = 5;
$row->cache_time = 3600;
$row->published = 1;
}
// build the html select list for ordering
$query = "SELECT a.ordering AS value, a.name AS text" . "\n FROM #__newsfeeds AS a" . "\n ORDER BY a.ordering";
$lists['ordering'] = mosAdminMenus::SpecificOrdering($row, $id, $query, 1);
// build list of categories
$lists['category'] = mosAdminMenus::ComponentCategory('catid', $option, intval($row->catid));
// build the html select list
$lists['published'] = mosHTML::yesnoRadioList('published', 'class="inputbox"', $row->published);
HTML_newsfeeds::editNewsFeed($row, $lists, $option);
}
示例12: showConfig
function showConfig($option)
{
global $mosConfig_absolute_path, $_DOCMAN;
// disable the main menu to force user to use buttons
$_REQUEST['hidemainmenu'] = 1;
$std_inp = 'style="width: 125px" size="2"';
$std_opt = 'size="2"';
// Create the 'yes-no' radio options
foreach (array('isDown', 'display_license', 'log', 'emailgroups', 'user_all', 'fname_lc', 'overwrite', 'security_anti_leech', 'trimwhitespace', 'process_bots', 'individual_perm', 'hide_remote') as $field) {
$lists[$field] = mosHTML::yesnoRadioList($field, $std_opt, $_DOCMAN->getCfg($field, 0));
}
$guest[] = mosHTML::makeOption(_DM_GRANT_NO, _DML_CFG_GUEST_NO);
$guest[] = mosHTML::makeOption(_DM_GRANT_X, _DML_CFG_GUEST_X);
$guest[] = mosHTML::makeOption(_DM_GRANT_RX, _DML_CFG_GUEST_RX);
$lists['guest'] = mosHTML::selectList($guest, 'registered', '', 'value', 'text', $_DOCMAN->getCfg('registered', _DM_GRANT_RX));
$upload =& new dmHTML_UserSelect('user_upload', 1);
$upload->addOption(_DML_CFG_USER_UPLOAD, _DM_PERMIT_NOOWNER);
$upload->addGeneral(_DML_NO_USER_ACCESS, 'all');
$upload->addMamboGroups();
$upload->addDocmanGroups();
$upload->addUsers();
$upload->setSelectedValues(array($_DOCMAN->getCfg('user_upload', 0)));
$lists['user_upload'] = $upload;
$publish =& new dmHTML_UserSelect('user_publish', 1);
$publish->addOption(_DML_CFG_USER_PUBLISH, _DM_PERMIT_NOOWNER);
$publish->addGeneral(_DML_AUTO_PUBLISH, 'all');
$publish->addMamboGroups();
$publish->addDocmanGroups();
$publish->addUsers();
$publish->setSelectedValues(array($_DOCMAN->getCfg('user_publish', 0)));
$lists['user_publish'] = $publish;
$approve =& new dmHTML_UserSelect('user_approve', 1);
$approve->addOption(_DML_CFG_USER_APPROVE, _DM_PERMIT_NOOWNER);
$approve->addGeneral(_DML_AUTO_APPROVE, 'all');
$approve->addMamboGroups();
$approve->addDocmanGroups();
$approve->addUsers();
$approve->setSelectedValues(array($_DOCMAN->getCfg('user_approve', 0)));
$lists['user_approve'] = $approve;
$viewer =& new dmHTML_UserSelect('default_viewer', 1);
$viewer->addOption(_DML_SELECT_USER, _DM_PERMIT_NOOWNER);
$viewer->addGeneral(_DML_EVERYBODY);
$viewer->addMamboGroups();
$viewer->addDocmanGroups();
$viewer->addUsers();
$viewer->setSelectedValues(array($_DOCMAN->getCfg('default_viewer', 0)));
$lists['default_viewer'] = $viewer;
$maintainer =& new dmHTML_UserSelect('default_editor', 1);
$maintainer->addOption(_DML_SELECT_USER, _DM_PERMIT_NOOWNER);
$maintainer->addGeneral(_DML_NO_USER_ACCESS);
$maintainer->addMamboGroups();
$maintainer->addDocmanGroups();
$maintainer->addUsers();
$maintainer->setSelectedValues(array($_DOCMAN->getCfg('default_editor', 0)));
$lists['default_maintainer'] = $maintainer;
$author_can = array();
$author_can[] = mosHTML::makeOption(_DM_AUTHOR_NONE, _DML_CFG_AUTHOR_NONE);
$author_can[] = mosHTML::makeOption(_DM_AUTHOR_CAN_READ, _DML_CFG_AUTHOR_READ);
$author_can[] = mosHTML::makeOption(_DM_AUTHOR_CAN_EDIT, _DML_CFG_AUTHOR_BOTH);
$lists['creator_can'] = mosHTML::selectList($author_can, 'author_can', '', 'value', 'text', $_DOCMAN->getCfg('author_can', _DM_AUTHOR_CAN_EDIT));
// Special compatibility mode
/** REMOVED 1.4.0RC2
$specialcompat = array();
$specialcompat[] = mosHTML::makeOption(_DM_SPECIALCOMPAT_DM13, _DML_CFG_SPECIALCOMPAT_DM13);
$specialcompat[] = mosHTML::makeOption(_DM_SPECIALCOMPAT_J10, _DML_CFG_SPECIALCOMPAT_J10);
$lists['specialcompat'] = mosHTML::selectList($specialcompat, 'specialcompat',
'', 'value', 'text',
$_DOCMAN->getCfg('specialcompat', _DM_SPECIALCOMPAT_DM13));
*/
// Blank handling for filenames
$blanks[] = mosHTML::makeOption('0', _DML_CFG_ALLOWBLANKS);
$blanks[] = mosHTML::makeOption('1', _DML_CFG_REJECT);
$blanks[] = mosHTML::makeOption('2', _DML_CFG_CONVERTUNDER);
$blanks[] = mosHTML::makeOption('3', _DML_CFG_CONVERTDASH);
$blanks[] = mosHTML::makeOption('4', _DML_CFG_REMOVEBLANKS);
$lists['fname_blank'] = mosHTML::selectList($blanks, 'fname_blank', '', 'value', 'text', $_DOCMAN->getCfg('fname_blank', 0));
// assemble icon sizes
$size[] = mosHTML::makeOption('0', '16x16 pixel');
$size[] = mosHTML::makeOption('1', '32x32 pixel');
$lists['icon_size'] = mosHTML::selectList($size, 'icon_size', $std_inp, 'value', 'text', $_DOCMAN->getCfg('icon_size', 0));
// assemble icon themes
/** REMOVED 1.4.0RC2
$docsFiles = DOCMAN_Compat::mosReadDirectory("$mosConfig_absolute_path/components/com_docman/themes/");
$docs = array(mosHTML::makeOption('', ''));
foreach($docsFiles as $file) {
if ($file <> "index.html")
$docs[] = mosHTML::makeOption($file);
}
**/
// assemble displaying order
$order[] = mosHTML::makeOption('name', _DML_NAME);
$order[] = mosHTML::makeOption('date', _DML_DATE);
$order[] = mosHTML::makeOption('hits', _DML_HITS);
$lists['default_order'] = mosHTML::selectList($order, 'default_order', 'style="width: 125px"', 'value', 'text', $_DOCMAN->getCfg('default_order', 'name'));
$order2[] = mosHTML::makeOption('ASC', _DML_ASCENDENT);
$order2[] = mosHTML::makeOption('DESC', _DML_DESCENDENT);
$lists['default_order2'] = mosHTML::selectList($order2, 'default_order2', 'style="width: 125px"', 'value', 'text', $_DOCMAN->getCfg('default_order2', 'DESC'));
// Assemble the methods we allow
$methods = array();
//.........这里部分代码省略.........
示例13: editSection
/**
* Compiles information to add or edit a section
* @param database A database connector object
* @param string The name of the category section
* @param integer The unique id of the category to edit (0 if new)
* @param string The name of the current user
*/
function editSection($uid = 0, $scope = '', $option)
{
global $database, $my, $adminLanguage;
global $mosConfig_absolute_path, $mosConfig_live_site;
$row = new mosSection($database);
// load the row from the db table
$row->load($uid);
// fail if checked out not by 'me'
if ($row->checked_out && $row->checked_out != $my->id) {
$msg = $adminLanguage->A_COMP_SECT_THE . " " . $row->title . " " . $adminLanguage->A_COMP_ANOTHER_ADMIN;
mosRedirect('index2.php?option=' . $option . '&scope=' . $row->scope . '&mosmsg=' . $msg);
}
if ($uid) {
$row->checkout($my->id);
if ($row->id > 0) {
$query = "SELECT *" . "\n FROM #__menu" . "\n WHERE componentid = " . $row->id . "\n AND ( type = 'content_archive_section' OR type = 'content_blog_section' OR type = 'content_section' )";
$database->setQuery($query);
$menus = $database->loadObjectList();
$count = count($menus);
for ($i = 0; $i < $count; $i++) {
switch ($menus[$i]->type) {
case 'content_section':
$menus[$i]->type = 'Section Table';
break;
case 'content_blog_section':
$menus[$i]->type = 'Section Blog';
break;
case 'content_archive_section':
$menus[$i]->type = 'Section Blog Archive';
break;
}
}
} else {
$menus = array();
}
} else {
$row->scope = $scope;
$row->published = 1;
$menus = array();
}
// build the html select list for section types
$types[] = mosHTML::makeOption('', $adminLanguage->A_COMP_CATEG_SELECT_TYPE);
$types[] = mosHTML::makeOption('content_section', $adminLanguage->A_COMP_SECT_LIST);
$types[] = mosHTML::makeOption('content_blog_section', $adminLanguage->A_COMP_SECT_BLOG);
$types[] = mosHTML::makeOption('content_archive_section', $adminLanguage->A_COMP_SECT_ARCHIVE_BLOG);
$lists['link_type'] = mosHTML::selectList($types, 'link_type', 'class="inputbox" size="1"', 'value', 'text');
// build the html select list for ordering
$query = "SELECT ordering AS value, title AS text" . "\n FROM #__sections" . "\n WHERE scope='{$row->scope}' ORDER BY ordering";
$lists['ordering'] = mosAdminMenus::SpecificOrdering($row, $uid, $query);
// build the select list for the image positions
$active = $row->image_position ? $row->image_position : 'left';
$lists['image_position'] = mosAdminMenus::Positions('image_position', $active, NULL, 0);
// build the html select list for images
$lists['image'] = mosAdminMenus::Images('image', $row->image);
// build the html select list for the group access
$lists['access'] = mosAdminMenus::Access($row);
// build the html radio buttons for published
$lists['published'] = mosHTML::yesnoRadioList('published', 'class="inputbox"', $row->published);
// build the html select list for menu selection
$lists['menuselect'] = mosAdminMenus::MenuSelect();
sections_html::edit($row, $option, $lists, $menus);
}
示例14: editUser
function editUser($uid = '0', $option = 'users')
{
global $database, $my, $acl;
$row = new mosUser($database);
// load the row from the db table
$row->load($uid);
if ($uid) {
$query = "SELECT * FROM #__contact_details WHERE user_id='" . $row->id . "'";
$database->setQuery($query);
$contact = $database->loadObjectList();
} else {
$contact = NULL;
$row->block = 0;
}
// check to ensure only super admins can edit super admin info
if ($my->gid < 25 && $row->gid == 25) {
mosRedirect('index2.php?option=com_users', T_('You are not authorized to view this resource.'));
}
$my_group = strtolower($acl->get_group_name($row->gid, 'ARO'));
if ($my_group == 'super administrator') {
$lists['gid'] = '<input type="hidden" name="gid" value="' . $my->gid . '" /><strong>' . T_('Super Administrator') . '</strong>';
} else {
if ($my->gid == 24 && $row->gid == 24) {
$lists['gid'] = '<input type="hidden" name="gid" value="' . $my->gid . '" /><strong>' . T_('Administrator') . '</strong>';
} else {
// ensure user can't add group higher than themselves
$my_groups = $acl->get_object_groups('users', $my->id, 'ARO');
if (is_array($my_groups) && count($my_groups) > 0) {
$ex_groups = $acl->get_group_children($my_groups[0], 'ARO', 'RECURSE');
if (!$ex_groups) {
$ex_groups = array();
}
} else {
$ex_groups = array();
}
$gtree = $acl->get_group_children_tree(null, 'USERS', false);
// remove users 'above' me
$i = 0;
while ($i < count($gtree)) {
if (in_array($gtree[$i]->value, $ex_groups)) {
array_splice($gtree, $i, 1);
} else {
$i++;
}
}
$lists['gid'] = mosHTML::selectList($gtree, 'gid', 'size="10"', 'value', 'text', $row->gid);
}
}
// build the html select list
$lists['block'] = mosHTML::yesnoRadioList('block', 'class="inputbox" size="1"', $row->block);
// build the html select list
$lists['sendEmail'] = mosHTML::yesnoRadioList('sendEmail', 'class="inputbox" size="1"', $row->sendEmail);
HTML_users::edituser($row, $contact, $lists, $option, $uid);
}
示例15: JQ_editCategoryGQP
function JQ_editCategoryGQP($uid, $option, $page, $course_id)
{
global $JLMS_DB, $my;
$menu = new mos_Joomla_LMS_GQPCategories($JLMS_DB);
$menu->load((int) $uid);
$menu->name = $menu->c_category;
if (!isset($menu->lesson_type) || !$menu->lesson_type) {
$menu->lesson_type = 1;
}
// build the html select list for paraent item
$lists['parent'] = JLMS_quiz_admin_class::GQP_parent($menu->id, $menu->parent);
$list = array();
$javascript = '';
// onchange="javascript:view_fields(this,0);"';
if ($menu->parent) {
$disabled = 'disabled="disabled"';
} else {
$disabled = '';
}
$lists['restricted_category'] = mosHTML::yesnoRadioList('restricted', $disabled . 'class="inputbox" id="restricted_radio"' . $javascript, $menu->restricted);
$query = "SELECT groups FROM #__lms_gqp_cats WHERE id = '" . $uid . "'";
$JLMS_DB->setQuery($query);
$JLMS_DB->query();
$groups = $JLMS_DB->loadResult();
$groups = substr($groups, 1, strlen($groups) - 2);
$groups_arr = explode('|', $groups);
$query = "SELECT * FROM #__lms_usergroups WHERE course_id = 0";
$JLMS_DB->setQuery($query);
$JLMS_DB->query();
$rows = $JLMS_DB->loadObjectList();
if ($menu->restricted && !$menu->parent) {
$disabled = '';
} else {
$disabled = 'disabled="disabled"';
}
// assemble menu items to the array
$select_list = '<select ' . $disabled . ' class="inputbox" style="width: 272px;" size="12" multiple="multiple" name="groups[]" id="restricted_groups">';
for ($i = 0; $i < count($rows); $i++) {
$selected = '';
for ($j = 0; $j < count($groups_arr); $j++) {
if ($groups_arr[$j] == $rows[$i]->id) {
$selected = 'selected="selected"';
break;
}
}
$select_list .= '<option value="' . $rows[$i]->id . '" ' . $selected . '>' . $rows[$i]->ug_name . '</option>';
}
$select_list .= '</select>';
$lists['restricted_groups'] = $select_list;
JLMS_quiz_admin_html_class::JQ_showeditCategoryGQP($menu, $lists, $rows, $option);
}