Beispiel #1
0
 function printForm()
 {
     $table = '';
     if (self::isNeeded($this->_dir)) {
         if ($this->_loggedIn) {
             $display = "style='display:none'";
             $table = "<div><h4 style='display:inline'>FTP is in Use</h4>&nbsp; <a id='showFtp' class='btn-sm btn-primary' title='See FTP Details' data-trigger='hover' data-placement='top' data-toggle='popover' data-content='<p>FTP is needed to update your application. Your credentials and serer details are already stored, and are being used. If you would like to inspect or modify them, please click here.</p>'><i class='glyphicon glyphicon-zoom-in icon-white'></i> See FTP Details</a></div>";
         } else {
             $display = '';
         }
         if (empty($this->status)) {
             $btn = "<a href='' class='btn-sm btn-success' title='Your FTP credentials look fine and are saved in your database. If you modify them below, click on this button to check again.' data-toggle='tooltip'><i class='glyphicon glyphicon-thumbs-up'></i> All Okay</a>";
         } else {
             $btn = "<a href='' class='btn-sm btn-warning' title='Your FTP credentials do not look right. Please re-enter them and click on this button to check again.' data-toggle='tooltip'><i class='glyphicon glyphicon-thumbs-down'></i> Check Again</a>";
         }
         $options = array();
         $options['ftp_server'] = array('name' => __('FTP Server', 'easy-paypal'), 'value' => 'localhost', 'validator' => 'notNull', 'help' => __('Enter your FPT server name.', 'easy-paypal'), 'dataTpl' => 'none', 'dataMode' => '');
         if (defined('FTP_HOST')) {
             $options['ftp_server']['value'] = FTP_HOST;
         }
         $options['ftp_user'] = array('name' => __('FTP User Name', 'easy-paypal'), 'value' => '', 'validator' => 'notNull', 'help' => __('Enter your FPT user name.', 'easy-paypal'), 'dataTpl' => 'none', 'dataMode' => '');
         if (defined('FTP_USER')) {
             $options['ftp_user']['value'] = FTP_USER;
         }
         $options['ftp_password'] = array('name' => __('FTP Password', 'easy-paypal'), 'value' => '', 'validator' => 'notNull', 'help' => __('Enter your FPT password.', 'easy-paypal'), 'dataTpl' => 'none', 'dataMode' => '');
         if (defined('FTP_PASS')) {
             $options['ftp_password']['value'] = FTP_PASS;
             if (!$this->isReady) {
                 $this->status .= " (Click on Check Again to verify.)";
             }
         }
         if ($this->_showRootDir) {
             $options['ftp_rootdir'] = array('name' => __('FTP Root Directory', 'easy-paypal'), 'value' => '', 'help' => __('When you logon to your server using FTP, it puts you in a folder. In most cases, we can discover this folder automatically. So you can start by leaving this option empty, but may have to come back and enter the value if prompted later.', 'easy-paypal'), 'dataTpl' => 'none', 'dataMode' => '');
         }
         $table .= "<div id='ftp' {$display}><h4>FTP Details</h4><p>Looks like FTP is needed to update your application. Please provide or verify the FTP details below. Note that FTP details will be stored in your database in plain text.</p><p class='red'><strong>{$this->status}</strong>&nbsp;&nbsp;{$btn}</p><table class='table table-striped table-bordered responsive'><tbody>";
         foreach ($options as $pk => $option) {
             $dbVal = EzGA::getGenOption($pk);
             if (empty($dbVal)) {
                 EzGA::putGenOption($pk, $option['value']);
             }
             $table .= EzGA::renderOption($pk, $option);
         }
         $table .= "</tbody></table></div>";
         $table .= "<script>var xeditHanlder = 'ajax/options.php'; var xparams ={}; \$('#showFtp').click(function() { \$(this).parent().hide();\$('#ftp').fadeIn();});</script>";
     }
     return $table;
 }
Beispiel #2
0
</div>
        <div>Your version is up-to-date</div>
      </a>
    </div>
    <?php 
    }
} else {
    $allow_updates = array('name' => 'Allow Update Check', 'value' => 0, 'help' => __("Enable this option to allow automatic update checks. Note that checking for updates requires your server to connect to that of the author. No data is collected from your server during update check; it is a read-only process. If you are okay with connecting to an extenral server, please enable this option to opt in. <b>Click on the Updates button again to reload the page</b>", 'easy-common'), 'type' => 'checkbox');
    $updateBox = '<div id="updateBox" class="col-md-3 col-sm-3 col-xs-6" style="display:none"><table class="table table-striped table-bordered responsive">
      <thead>
        <tr>
          <th style="width:50%;min-width:150px">Option</th>
          <th style="width:55%;min-width:80px">Value</th>
          <th class="center-text" style="width:15%;min-width:50px">Help</th>
        </tr>
      </thead>' . EzGA::renderOption('allow_updates', $allow_updates) . '</tbody>
    </table>
  </div>';
    ?>
  <div class="col-md-3 col-sm-3 col-xs-6">
    <a data-toggle="tooltip" title="Click to enable update check so that you can connect to the author server to get the current version." class="well top-block" href="#" id='allowUpdates'>
      <i class="glyphicon glyphicon-exclamation-sign red"></i>
      <div>Update Check is Disabled</div>
      <div>Enable it</div>
    </a>
  </div>
  <?php 
}
if (EzGA::$isPro) {
    ?>
  <div class="col-md-3 col-sm-3 col-xs-6">