示例#1
0
    function contentForThisStep()
    {
        ?>

    <script type="text/javascript" charset="utf-8">
	    $(document).ready(function() {
		    $('#widget-end-date').datepicker({ dateFormat: 'yy-mm-dd', minDate: +1 });
      });
    </script>

    <?php 
        echo $this->javascriptValidation(1);
        ?>

    <div id="step-1">
      <h3>Step 1: Basic Information</h3>
      <?php 
        if ($this->form && $this->form->hasErrors()) {
            ?>
        <?php 
            foreach ($this->form->getErrors() as $e) {
                ?>
          <div class="alert alert-error"><?php 
                echo $e;
                ?>
</div>
        <?php 
            }
            ?>
      <?php 
        }
        ?>
      <br />
      <div class="row-fluid">
        <div class="span6" style="width: 100%;">
          <div class="control-group">
            <label class="control-label" for="widget-title">Title of Widget</label>
            <div class="controls">
              <input type="text" class="input-large" id="widget-title" name="title" maxlength="30"
                     value="<?php 
        echo htmlspecialchars($this->widget->title);
        ?>
" />
              <span class="help-inline error-msg">Please provide a title.</span>
            </div>
          </div>
          <div class="control-group" id="widget-goal">
            <label class="control-label" for="widget-want-to-raise">Amount to Raise</label>
            <div class="controls">
              <?php 
        $goal = isset($this->widget->goalAmnt) ? Currency\trimZeros($this->widget->goalAmnt->numUnits) : "";
        ?>
              <input type="text" class="input-small" id="widget-want-to-raise"
                     name="goal" value="<?php 
        echo $goal;
        ?>
"/>
              &nbsp;
              <?php 
        $s = new SelectField('currency', 'Currency', array('USD' => 'USD', 'EUR' => 'EUR', 'GBP' => 'GBP', 'CNY' => 'CNY', 'CAD' => 'CAD', 'JPY' => 'JPY', 'BTC' => 'BTC'));
        $s->setID('currency')->setAttribute('style', 'width: 6em;');
        $s->setValue(empty($this->widget->currency) ? 'USD' : $this->widget->currency);
        ?>
              <?php 
        echo $s->renderInputHtml();
        ?>
              <span class="help-inline error-msg">Please enter a valid (numeric) amount.</span>
            </div>
          </div>
          <div class="control-group">
            <label class="control-label" for="widget-end-date">End Date</label>
            <div class="controls">
              <input type="text" class="input-small" id="widget-end-date" name="ending"
                     value="<?php 
        echo $this->widget->endingDateAsString();
        ?>
"/>
              <span class="help-inline error-msg">Please correct the error.</span>
            </div>
          </div>
          <div class="control-group" id="bitcoin-addr-control-group">
            <label class="control-label" for="widget-bitcoin-address">Bitcoin Address</label>
            <div class="controls">
              <input type="text" class="input-large bitcoin-address" id="widget-bitcoin-address"
                     name="bitcoinAddress" value="<?php 
        echo $this->widget->bitcoinAddress;
        ?>
" />
              <span class="help-inline error-msg">Please provide a valid Bitcoin address.</span>
              <span class="help-inline not-error">
                Please use a new, dedicated Bitcoin address for each
                widget. In this way, we are able to measure the amount that has been donated
                to your cause.</span>
            </div>
          </div>
        </div> <!-- /span6 -->
        <div class="span5 offset1">
          <!--
          <div class="well">

          </div>
          -->
        </div> <!-- /span5 -->
      </div> <!-- /row-fluid -->
    </div> <!-- /step-1 -->

  <?php 
    }
示例#2
0
    function contentForThisStep()
    {
        ?>

    <?php 
        echo $this->updatePreviewJavascript();
        ?>

    <div id="step-2">
      <h3>Step 2: Customize Widget</h3>
      <div>
        <div style="float: left;"> <!-- div for form inputs -->
          <div class="control-group">
            <label class="control-label" for="widget-about">
              About the widget
            </label>
            <div class="controls">
              <textarea class="input-large" id="widget-about" rows="3" maxlength="1000"
                        name="about" style="height: 100px; width: 260px;"
                        ><?php 
        echo htmlspecialchars($this->widget->about);
        ?>
</textarea>
            </div>
          </div>
          <div class="control-group">
            <label class="control-label" for="userlanguage">
              Color Theme
            </label>
            <div class="controls" style="margin-top: 6px;">
              <?php 
        $color = new SelectField('color', 'Color', array("white" => "Plain & Pleasant", "silver" => "Silvery Servant", "blue" => "Baby-Blue Winter", "dark" => "Dark & Dastardly"));
        $color->setID('widget-color');
        if ($this->widget->color) {
            $color->setValue($this->widget->color);
        }
        ?>
              <?php 
        echo $color->renderInputHtml();
        ?>
            </div>
          </div>
          <div class="control-group">
            <label class="control-label" for="userlanguage">Size</label>
            <div class="controls" style="margin-top: 6px;">
              <?php 
        $size = new SelectField('size', 'Size', array("350x310" => "350 x 310", "200x300" => "200 x 300", "200x200" => "200 x 200"));
        $size->setID('widget-size');
        if ($this->widget->width) {
            $size->setValue($this->widget->width . 'x' . $this->widget->height);
        }
        ?>
              <?php 
        echo $size->renderInputHtml();
        ?>
            </div>
          </div>
        </div> <!-- END div for form inputs -->
        <div style="float: left; margin: 0 0 25px 75px;">
          <div style="text-align: center;">
            <?php 
        echo $this->widgetIframe($this->widget, $src = '/widget-wiz/preview-current', $id = 'widget-preview');
        ?>
          </div>
        </div> <!-- END div for preview -->
        <div class="clearfix"> </div>
      </div> <!-- / XXX -->
    </div> <!-- /step -->

  <?php 
    }