| [ Index ] |
PHP Cross Reference of Joomla 1.5.26 DE |
[Summary view] [Print] [Text view]
1 <?php defined('_JEXEC') or die('Restricted access'); ?> 2 3 <?php 4 $cid = JRequest::getVar( 'cid', array(0), '', 'array' ); 5 $edit=JRequest::getVar( 'edit', true ); 6 JArrayHelper::toInteger($cid, array(0)); 7 8 $text = ( $edit ? JText::_( 'Edit' ) : JText::_( 'New' ) ); 9 10 JToolBarHelper::title( JText::_( 'Poll' ).': <small><small>[ ' . $text.' ]</small></small>' ); 11 JToolBarHelper::Preview('index.php?option=com_poll&controller=poll&cid[]='.$cid[0]); 12 JToolBarHelper::save(); 13 JToolBarHelper::apply(); 14 if ($edit) { 15 // for existing items the button is renamed `close` 16 JToolBarHelper::cancel( 'cancel', 'Close' ); 17 } else { 18 JToolBarHelper::cancel(); 19 } 20 JToolBarHelper::help( 'screen.polls.edit' ); 21 ?> 22 23 <?php 24 JFilterOutput::objectHTMLSafe( $this->poll, ENT_QUOTES ); 25 ?> 26 27 <script language="javascript" type="text/javascript"> 28 function submitbutton(pressbutton) { 29 var form = document.adminForm; 30 if (pressbutton == 'cancel') { 31 submitform( pressbutton ); 32 return; 33 } 34 // do field validation 35 if (form.title.value == "") { 36 alert( "<?php echo JText::_( 'Poll must have a title', true ); ?>" ); 37 } else if (isNaN(parseInt( form.lag.value ) ) || parseInt(form.lag.value) < 1) { 38 alert( "<?php echo JText::_( 'Poll must have a non-zero lag time', true ); ?>" ); 39 //} else if (form.menu.options.value == ""){ 40 // alert( "Poll must have pages." ); 41 //} else if (form.adminForm.textfieldcheck.value == 0){ 42 // alert( "Poll must have options." ); 43 } else { 44 submitform( pressbutton ); 45 } 46 } 47 </script> 48 <form action="index.php" method="post" name="adminForm"> 49 <div class="col width-45"> 50 <fieldset class="adminform"> 51 <legend><?php echo JText::_( 'Details' ); ?></legend> 52 <table class="admintable"> 53 <tr> 54 <td width="110" class="key"> 55 <label for="title"> 56 <?php echo JText::_( 'Title' ); ?>: 57 </label> 58 </td> 59 <td> 60 <input class="inputbox" type="text" name="title" id="title" size="60" value="<?php echo $this->poll->title; ?>" /> 61 </td> 62 </tr> 63 <tr> 64 <td width="110" class="key"> 65 <label for="alias"> 66 <?php echo JText::_( 'Alias' ); ?>: 67 </label> 68 </td> 69 <td> 70 <input class="inputbox" type="text" name="alias" id="alias" size="60" value="<?php echo $this->poll->alias; ?>" /> 71 </td> 72 </tr> 73 <tr> 74 <td class="key"> 75 <label for="lag"> 76 <?php echo JText::_( 'Lag' ); ?>: 77 </label> 78 </td> 79 <td> 80 <input class="inputbox" type="text" name="lag" id="lag" size="10" value="<?php echo $this->poll->lag; ?>" /> 81 <?php echo JText::_( '(seconds between votes)' ); ?> 82 </td> 83 </tr> 84 <tr> 85 <td width="120" class="key"> 86 <?php echo JText::_( 'Published' ); ?>: 87 </td> 88 <td> 89 <?php echo JHTML::_( 'select.booleanlist', 'published', 'class="inputbox"', $this->poll->published ); ?> 90 </td> 91 </tr> 92 </table> 93 </fieldset> 94 </div> 95 <div class="col width-45"> 96 <fieldset class="adminform"> 97 <legend><?php echo JText::_( 'Options' ); ?></legend> 98 <table class="admintable"> 99 <?php for ($i=0, $n=count( $this->options ); $i < $n; $i++ ) { ?> 100 <tr> 101 <td class="key"> 102 <label for="polloption<?php echo $this->options[$i]->id; ?>"> 103 <?php echo JText::_( 'Option' ); ?> <?php echo ($i+1); ?> 104 </label> 105 </td> 106 <td> 107 <input class="inputbox" type="text" name="polloption[<?php echo $this->options[$i]->id; ?>]" id="polloption<?php echo $this->options[$i]->id; ?>" value="<?php echo $this->options[$i]->text; ?>" size="60" /> 108 </td> 109 </tr> 110 <?php } for (; $i < 12; $i++) { ?> 111 <tr> 112 <td class="key"> 113 <label for="polloption<?php echo $i + 1; ?>"> 114 <?php echo JText::_( 'Option' ); ?> <?php echo $i + 1; ?> 115 </label> 116 </td> 117 <td> 118 <input class="inputbox" type="text" name="polloption[]" id="polloption<?php echo $i + 1; ?>" value="" size="60" /> 119 </td> 120 </tr> 121 <?php } ?> 122 </table> 123 </fieldset> 124 </div> 125 <div class="clr"></div> 126 127 <input type="hidden" name="task" value="" /> 128 <input type="hidden" name="option" value="com_poll" /> 129 <input type="hidden" name="id" value="<?php echo $this->poll->id; ?>" /> 130 <input type="hidden" name="cid[]" value="<?php echo $this->poll->id; ?>" /> 131 <input type="hidden" name="textfieldcheck" value="<?php echo $n; ?>" /> 132 <?php echo JHTML::_( 'form.token' ); ?> 133 </form>
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated: Wed Mar 28 15:54:07 2012 | Cross-referenced by PHPXref 0.7.1 |