/home/coolpkct/www/websites/cake3.cool.rocks/admin/classes/pluploadscreen.php
<?php
/**
 * Part of Showkase web site management package
 *
 * @package Showkase
 * @author Jack Hardie {@link http://www.jhardie.com}
 * @copyright Copyright (c) 2013, SimpleViewer Inc.
 */
defined('SK_ACCESS')||die('<h1>403: Forbidden</h1>');
 
/**
 * Upload screen
 *
 * @package Showkase
 */
class PluploadScreen extends Screen
{

    /**
     * @var string overrides some of head content in Screen
     */
    protected $customHeadHtml = '
      <script src="plupload/js/plupload.full.min.js"></script>
      <script src="plupload/js/jquery.plupload.queue.min.js"></script>
      <script src="scripts/plupload/log.js"></script>
      <script src="scripts/plupload/queue.js"></script>
      <script src="scripts/plupload/submit.js"></script>
  ';
    /**
     * @var string to pass as command in url
     */
    private $cmd;
  

 /**
  * constructor
  * @param string page type
  */
  function __construct($bbClass, $htmlTitle, $bodyId='', $bodyClass='')
  {
      parent::__construct($htmlTitle, $bodyId, $bodyClass);
      $bb = new $bbClass();
      $this->subNavHtml = $bb->getHtml();
  }

   /**
    * get html for upload screen
    *
    * @access public
    * @return string html
    * @param array context variables
    */
    public function getContentHtml($context)
    {
        $sidString = SID
            ? '&'.htmlspecialchars(SID)
            : '';
        $url = 'index.php?cmd=pluploader'.$sidString;
        $headerHtml = '
      <h2><a href="#" class="popper"  data-placement="right" title="Image Upload" data-content="Up to three upload options are available &ndash; HTML5, Flash and Basic. Some browsers may not support HTML5 or Flash. If the features you need are not supported, try a different browser or another upload option." >'.$context['h2'].'</a></h2>
      '.$context['h3'].'
      ';
        if (!$context['supportedPageType']) return $headerHtml;
        $resizeChecked = $context['resize']
            ? 'checked'
            : '';
        $chunkSize = UPLOADER_CHUNK_SIZE;
        $phpSettings = "{
            runtimes : '{$context['runtimes']}',
            url : '{$url}',
            chunk_size : '{$chunkSize}',
            multipart_params : {
                skAbsImagePath : '{$context['absImagePath']}',
                skPagePath     : '{$context['pagePath']}',
                skPageRef      : '{$context['pageRef']}',
                skPageType     : '{$context['pageType']}'
            }
        }";
        $html = <<<EOD
<div class="subhead">
  <div class="hgroup">
    {$headerHtml}
  </div>
  <ul class="buttons">
    <li><button type="button" onclick="window.location='index.php';" class="btn btn-danger">Cancel</button></li>
  </ul>
</div>
<div class="primary">
  <script>
    var cmd                = '{$context['cmd']}';
    var sid                = '{$sidString}';
    var maxMBytes          = '{$context['maxUploadMBytes']}';
    var phpSettings        =  {$phpSettings};
  </script>
  <form method="POST" id="uploadform">
    	<div id="uploader">
    		<p>Checking for html5, Flash or html4 support</p>
    	</div>
  </form>
</div>
<div class="secondary">
  <form method="POST" id="resize-form" class="form-horizontal" action="index.php?cmd={$context['cmd']}">
    <div class="control-group">
      <label for="resizeOn">Resize images</label>
      <div class="input"><input type="checkbox" id="resizeOn" name="resizeOn" {$resizeChecked}></div>
    </div>
    <div class="control-group">
      <label for="maxImageWidth">Max width</label>
      <div class="input"><input type="text" id="maxImageWidth" name="maxImageWidth" value={$context['maxImageWidth']} /></div>
    </div>
    <div class="control-group">
      <label for="maxImageHeight">Max height</label>
      <div class="input"><input type="text" id="maxImageHeight" name="maxImageHeight" value={$context['maxImageHeight']} /></div>
    </div>
    <div class="control-group">
      <label for="compressionQuality">Quality (1&ndash;100)</label>
      <div class="input"><input type="text" id="compressionQuality" name="compressionQuality" value={$context['compressionQuality']} /></div>
    </div>
    <div class="control-group">
      <label>Save resize settings</label>
      <div class="input"><input type="hidden" name="submitResize" value="Set"><button type="submit" id="submit" class="btn" >Save</button></div>
    </div>
  </form>
  <div class="prompt">
    <ul class="features">
    </ul>
  </div>
  <div id="swaps">
  </div>
</div>
EOD;
    return $html;
  }
}