?> %</td> <td>78</td> <td>3</td> <td align="right"><?php echo $total_size; ?> KB</td> </tr> </table> <?php $bar->setCurrPoint($total_size); $bar->setStrBeforeBar("0MB "); $bar->setStrAfterBar(" 2MB"); ?> <p><b>Storage space usage</b> <table border="0" width="100%" cellspacing="0" cellpadding="4"> <tr> <td bgcolor="#e5e5e5" class="medium">Info about your available and used storage space</td> <td bgcolor="#e5e5e5" class="medium"> </td> <td bgcolor="#e5e5e5" align="right" class="medium">INFO</td> </tr> </table> <table border="0" width="100%" cellspacing="1" cellpadding="2"> <tr bgcolor="#c5c5c5"> <td> <table border="0" width="100%" cellspacing="0" cellpadding="1"> <tr>
/** * Get Vote Form HTML for convert plugin * * @static * @param array $votes * @param integer $vote_id vote form id * @global $vars * @global $vars['page'] * @global $defaultpage * @global $digest * @var $options 'readonly' * @var $options 'addchoice' * @var $options 'barchart' * @uses get_script_uri() * @return string */ function get_vote_form_convert($votes, $vote_id) { $choice_label = _('Selection'); $vote_label = _('Vote'); $vote_button = _('Vote'); $add_button = _('Vote'); // _('Add'); // Initilization global $vars, $defaultpage; global $digest; $page = isset($vars['page']) ? $vars['page'] : $defaultpage; $s_page = htmlspecialchars($page); $s_digest = htmlspecialchars($digest); $script = $this->options['readonly'] ? '' : get_script_uri(); $submit = $this->options['readonly'] ? 'hidden' : 'submit'; $choicestyle = 'padding-left:1em;padding-right:1em;'; $countstyle = ($this->options['barchart'] ? 'width:120px;' : '') . 'padding-right:1em;'; $buttonstyle = $this->options['readonly'] ? 'display:none;' : ''; $anchor = $this->get_anchor('convert', $vote_id); // Init barchart if ($this->options['barchart']) { $barchart = new BARCHART(0, 0, 100); $barchart->setColorCompound($this->CONF['BARCHART_COLOR_BAR']); $barchart->setColorBg($this->CONF['BARCHART_COLOR_BG']); $barchart->setColorBorder($this->CONF['BARCHART_COLOR_BORDER']); $sum = 0; $max = 0; $argmax = 0; foreach ($votes as $choice_id => $vote) { list($choice, $count) = $vote; $sum += $count; if ($max < $count) { $max = $count; $argmax = $choice_id; } } } // Header $form = ''; $form .= '<form class="votex" action="' . $script . '" method="post">' . "\n"; $form .= '<table cellspacing="0" cellpadding="2" class="style_table" summary="vote">' . "\n"; $form .= ' <tr>' . "\n"; $form .= ' <td align="left" class="vote_label" style="' . $choicestyle . '"><strong>' . $choice_label . '</strong>' . "\n"; $form .= ' <a name="' . $anchor . '" id="' . $anchor . '"></a>' . "\n"; $form .= ' <input type="hidden" name="cmd" value="votex" />' . "\n"; $form .= ' <input type="hidden" name="pcmd" value="convert" />' . "\n"; $form .= ' <input type="hidden" name="refer" value="' . $s_page . '" />' . "\n"; $form .= ' <input type="hidden" name="vote_id" value="' . $vote_id . '" />' . "\n"; $form .= ' <input type="hidden" name="digest" value="' . $s_digest . '" />' . "\n"; $form .= ' </td>' . "\n"; $form .= ' <td align="right" class="vote_label" style="' . $countstyle . '"><strong>' . $vote_label . '</strong></td>' . "\n"; $form .= ' <td align="right" class="vote_label" style="' . $buttonstyle . '"></td>' . "\n"; $form .= ' </tr>' . "\n"; // Body foreach ($votes as $choice_id => $vote) { list($choice, $count) = $vote; $class = $choice_id % 2 ? 'vote_td1' : 'vote_td2'; $s_choice = make_link($choice); $s_count = htmlspecialchars($count); $choice_key = $this->encode_choice($choice_id); if ($this->options['barchart']) { $percent = (int) ($count / $max * 100); // / $sum $barchart->setCurrPoint($percent); $barchart->setStrAfterBar(' ' . $s_count); $s_count = $barchart->getBar(); } $form .= ' <tr>' . "\n"; $form .= ' <td align="left" class="' . $class . '" style="' . $choicestyle . '">' . $s_choice . '</td>' . "\n"; $form .= ' <td align="right" class="' . $class . '" style="' . $countstyle . '">' . $s_count . '</td>' . "\n"; $form .= ' <td align="right" class="' . $class . '" style="' . $buttonstyle . '">' . "\n"; $form .= ' <input type="' . $submit . '" name="' . $choice_key . '" value="' . $vote_button . '" class="submit" />' . "\n"; $form .= ' </td>' . "\n"; $form .= ' </tr>' . "\n"; } // add choice if ($this->options['addchoice']) { $choice_id++; $class = $choice_id % 2 ? 'vote_td1' : 'vote_td2'; $choice_key = $this->encode_choice($choice_id); $form .= ' <tr>' . "\n"; $form .= ' <td colspan="2" align="left" class="' . $class . '" style="' . $choicestyle . '">' . "\n"; $form .= ' <input type="text" size="40" name="addchoice" value="" />' . "\n"; $form .= ' </td>' . "\n"; $form .= ' <td align="right" class="' . $class . '" style="' . $buttonstyle . '">' . "\n"; $form .= ' <input type="' . $submit . '" name="' . $choice_key . '" value="' . $add_button . '" class="submit" />' . "\n"; $form .= ' </td>' . "\n"; $form .= ' </tr>' . "\n"; } // Footer $form .= '</table>' . "\n"; $form .= '</form>' . "\n"; return $form; }