News:

Please note these forums are mostly a testing ground for my SMF work and I don't really use them otherwise.

Main Menu

Paste-1209013232:v:use_geshi-1:v:type-php

Started by SleePy, Apr 24, 2008, 05:00 AM

Previous topic - Next topic

0 Members and 3 Guests are viewing this topic.

SleePy

function PackFields($t, $u)
{
   global $scout;

global $scTxt;
   //  We like being short.
   @$edit = $_POST['mod'][$t];
   @$numfields = $_POST['numfields'];

   if (!isset($scout['packfields']))
      $scout['packfields'] = array();

   $scout['packfields'] = array(
      't_id' => $t,
      's_id' => $s,
      's_id_updated' => $s + 1,
      'num_fields' => !empty($numfields[$t]) ? $numfields[$t] : 1,
      'selected' => !empty($edit['change']) && $edit['change'] == 'upgrade' ? 'upgrade' : (!empty($edit['change']) && $edit['change'] == 'uninstall' ? 'uninstall' : 'install'),
      'work_for' => isset($edit['workfor']) ? $edit['workfor'] : '2.0 Beta 3 Public, 2.0 Beta 4, 2.0-2.0.99',
      'modify' => array(),
   );

   echo '<li><div id="editplace', $scout['packfields']['t_id'], '">';
   echo '
   <div id="instalholder', $scout['packfields']['t_id'], '">
      <ol class="no_bullet">
         <li class="installholder"><input type="hidden" name="numfields[', $scout['packfields']['t_id'], ']" id="installplace', $scout['packfields']['t_id'], '" value="', $scout['packfields']['num_fields'], '" /><h4 style="font-size: large;">', sprintf($scTxt['packmaker']['change_number'], $scout['packfields']['t_id']), '</h4>
            <ol class="no_bullet_pad">
               <li><label>', $scTxt['packmaker']['change_type'], '<select name="mod[' . $scout['packfields']['t_id'] . '][change]" id="select">
                  <option value="install"', $scout['packfields']['selected'] == 'install' ? 'selected="selected"' : '', '>', $scTxt['packmaker']['change_install'], '</option>
                  <option value="uninstall" ', $scout['packfields']['selected'] == 'uninstall' ? 'selected="selected"' : '', '>', $scTxt['packmaker']['change_uninstall'], '</option>
                  <option value="upgrade" ', $scout['packfields']['selected']  == 'upgrade' ? 'selected="selected"' : '', '>', $scTxt['packmaker']['change_upgrade'], '</option></select></label></li>
               <li><label>', $scTxt['packmaker']['work_for'], '<input type="text" name="mod[' . $scout['packfields']['t_id'] . '][workfor]" id="textfield" value="', $scout['packfields']['work_for'], '"/>', $scTxt['packmaker']['work_for_example'], '</label></li>';

   $s = 0;
   $r = !empty($u) ? $u : 1;
   while($s < $r)
   {
      ++$s;
      PackFieldModify($s, $t);
   }

   echo '
            <li><div id="modifyplace' . $scout['packfields']['t_id'] . 'x' . $scout['packfields']['s_id_updated'] . '"></div></li>
               <li><label><input name="add[modify][' . $scout['packfields']['t_id'] . ']" type="button" onclick="PackAddModify(' . $$scout['packfields']['s_id'] . ', ' . $scout['packfields']['t_id'] . ');" value="', $scTxt['packmaker']['add_another_mod'], '"/></label></li>
            </ol>
         </li>
         <li>


</li>
      </ol>
   </div>';
   echo '</div></li>';
}
No siggy! :D