📄 admin.poll.html.php
字号:
<?php
/**
* @version $Id: admin.poll.html.php,v 1.7 2005/02/15 14:49:42 kochp Exp $
* @package Mambo
* @subpackage Polls
* @copyright (C) 2000 - 2005 Miro International Pty Ltd
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
* Mambo is Free Software
*/
/** ensure this file is being included by a parent file */
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
/**
* @package Mambo
* @subpackage Polls
*/
class HTML_poll {
function showPolls( &$rows, &$pageNav, $option ) {
global $my, $adminLanguage;
mosCommonHTML::loadOverlib();
?>
<form action="index2.php" method="post" name="adminForm">
<table class="adminheading">
<tr>
<th><?php echo $adminLanguage->A_COMP_POLL_MANAGER;?></th>
</tr>
</table>
<table class="adminlist">
<tr>
<th width="5">
<?php echo $adminLanguage->A_COMP_NB;?>
</th>
<th width="20">
<input type="checkbox" name="toggle" value="" onClick="checkAll(<?php echo count( $rows ); ?>);" />
</th>
<th align="left">
<?php echo $adminLanguage->A_COMP_POLL_TITLE;?>
</th>
<th width="10%" align="center">
<?php echo $adminLanguage->A_COMP_PUBLISHED;?>
</th>
<th width="10%" align="center">
<?php echo $adminLanguage->A_COMP_POLL_OPTIONS;?>
</th>
<th width="10%" align="center">
<?php echo $adminLanguage->A_COMP_POLL_LAG;?>
</th>
</tr>
<?php
$k = 0;
for ($i=0, $n=count( $rows ); $i < $n; $i++) {
$row = &$rows[$i];
$link = 'index2.php?option=com_poll&task=editA&hidemainmenu=1&id='. $row->id;
$task = $row->published ? 'unpublish' : 'publish';
$img = $row->published ? 'publish_g.png' : 'publish_x.png';
$alt = $row->published ? $adminLanguage->A_COMP_PUBLISHED : $adminLanguage->A_COMP_UNPUBLISHED;
$checked = mosCommonHTML::CheckedOutProcessing( $row, $i );
?>
<tr class="<?php echo "row$k"; ?>">
<td>
<?php echo $pageNav->rowNumber( $i ); ?>
</td>
<td>
<?php echo $checked; ?>
</td>
<td>
<a href="<?php echo $link; ?>" title="<?php echo $adminLanguage->A_COMP_POLL_EDIT;?>">
<?php echo $row->title; ?>
</a>
</td>
<td align="center">
<a href="javascript: void(0);" onclick="return listItemTask('cb<?php echo $i;?>','<?php echo $task;?>')">
<img src="images/<?php echo $img;?>" width="12" height="12" border="0" alt="<?php echo $alt; ?>" />
</a>
</td>
<td align="center">
<?php echo $row->numoptions; ?>
</td>
<td align="center">
<?php echo $row->lag; ?>
</td>
</tr>
<?php
$k = 1 - $k;
}
?>
</table>
<?php echo $pageNav->getListFooter(); ?>
<input type="hidden" name="option" value="<?php echo $option;?>" />
<input type="hidden" name="task" value="" />
<input type="hidden" name="boxchecked" value="0" />
<input type="hidden" name="hidemainmenu" value="0">
</form>
<?php
}
function editPoll( &$row, &$options, &$lists ) {
global $adminLanguage;
mosMakeHtmlSafe( $row, ENT_QUOTES );
?>
<script language="javascript" type="text/javascript">
function submitbutton(pressbutton) {
var form = document.adminForm;
if (pressbutton == 'cancel') {
submitform( pressbutton );
return;
}
// do field validation
if (form.title.value == "") {
alert( "<?php echo $adminLanguage->A_COMP_POLL_MUST_TITLE;?>" );
} else if( isNaN( parseInt( form.lag.value ) ) ) {
alert( "<?php echo $adminLanguage->A_COMP_POLL_NON_ZERO;?>" );
//} else if (form.menu.options.value == ""){
// alert( "Poll must have pages." );
//} else if (form.adminForm.textfieldcheck.value == 0){
// alert( "Poll must have options." );
} else {
submitform( pressbutton );
}
}
</script>
<form action="index2.php" method="post" name="adminForm">
<table class="adminheading">
<tr>
<th>
<?php echo $adminLanguage->A_COMP_POLL_POLL;?>:
<small>
<?php echo $row->id ? $adminLanguage->A_COMP_EDIT : $adminLanguage->A_COMP_NEW;?>
</small>
</th>
</tr>
</table>
<table class="adminform">
<tr>
<th colspan="4">
<?php echo $adminLanguage->A_DETAILS;?>
</th>
</tr>
<tr>
<td width="10%">
<?php echo $adminLanguage->A_COMP_TITLE;?>:
</td>
<td>
<input class="inputbox" type="text" name="title" size="60" value="<?php echo $row->title; ?>" />
</td>
<td width="20px">
</td>
<td width="100%" rowspan="20" valign="top">
<?php echo $adminLanguage->A_COMP_POLL_SHOW;?>:
<br />
<?php echo $lists['select']; ?>
</td>
</tr>
<tr>
<td>
<?php echo $adminLanguage->A_COMP_POLL_LAG;?>:
</td>
<td>
<input class="inputbox" type="text" name="lag" size="10" value="<?php echo $row->lag; ?>" /> <?php echo $adminLanguage->A_COMP_POLL_BETWEEN;?>
</td>
</tr>
<tr>
<td colspan="3">
<br /><br />
<?php echo $adminLanguage->A_COMP_POLL_OPTIONS;?>:
</td>
</tr>
<?php
for ($i=0, $n=count( $options ); $i < $n; $i++ ) {
?>
<tr>
<td>
<?php echo ($i+1); ?>
</td>
<td>
<input class="inputbox" type="text" name="polloption[<?php echo $options[$i]->id; ?>]" value="<?php echo htmlspecialchars( $options[$i]->text, ENT_QUOTES ); ?>" size="60" />
</td>
</tr>
<?php
}
for (; $i < 12; $i++) {
?>
<tr>
<td>
<?php echo ($i+1); ?>
</td>
<td>
<input class="inputbox" type="text" name="polloption[]" value="" size="60"/>
</td>
</tr>
<?php
}
?>
</table>
<input type="hidden" name="task" value="">
<input type="hidden" name="option" value="com_poll" />
<input type="hidden" name="id" value="<?php echo $row->id; ?>" />
<input type="hidden" name="textfieldcheck" value="<?php echo $n; ?>" />
</form>
<?php
}
}
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -