Plugin Directory

Changeset 1582701


Ignore:
Timestamp:
01/26/2017 03:30:23 PM (9 years ago)
Author:
selectyco
Message:

2.1.4

New function added to display all articles

Location:
selectyco/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • selectyco/trunk/README.txt

    r1580328 r1582701  
    7575== Changelog ==
    7676
    77 = 2.1.2 =
    78 New settings for teaser-length, price-classes and validto date
     77= 2.1.4 =
     78New function added to display all articles
    7979
    8080= 2.1.3 =
     
    8282Changed future-date from 10 to 45 days
    8383
     84= 2.1.2 =
     85New settings for teaser-length, price-classes and validto date
     86
    8487
    8588== Upgrade Notice ==
    8689
    87 = 2.1.3
     90= 2.1.4
  • selectyco/trunk/inc/selectycoAjax.js

    r1555320 r1582701  
    3131          $('#licenceStatus').html(response.data.error).show();
    3232        }
     33        if(response.data.sycReqType == "apiGetItems") {
     34          $('#apiGetItemsList').removeClass("sycSuccess").addClass("sycError");
     35          $('#apiGetItemsList').html(response.data.error).show();
     36        }
    3337        else {
    3438          $('#sycItemStatus').removeClass("sycSuccess").addClass("sycError");     
     
    3741      }
    3842      else {
    39         if(response.data.sycReqType == "send_licenceRequest") {
     43        if(response.data.sycReqType == "apiGetItems") {
     44          $('#apiGetItemsList').removeClass("sycError").addClass("sycSuccess");
     45          $('#apiGetItemsList').html(JSON.stringify(response.data.items,null,2)).show();
     46        }
     47        else if(response.data.sycReqType == "send_licenceRequest") {
    4048          $('#licenceStatus').removeClass("sycError").addClass("sycSuccess");
    4149          $('#licenceStatus').html(response.data.success).show();
     
    5967          $('#sycItemStatus2').html(response.data.success).show();
    6068        }
    61        
    6269      }
    6370      return;
     
    120127   
    121128
     129    // Show ItemList
     130    $('#sycGetItems').click( function(event) {
     131      event.preventDefault();
     132      var data = {
     133         action: 'sycApiGetItems',
     134         ajaxnonce: wp_ajax.ajaxnonce,
     135         sycItemsOfYear: $('#sycItemsOfYear').val(),
     136      };
     137
     138      $.post( wp_ajax.ajaxurl, data, itemResponse );
     139    });
     140   
    122141    // Send LicenceRequest
    123142    $('#sendLicenceRequest').click( function(event) {
  • selectyco/trunk/languages/selectyco-de_DE.po

    r1555541 r1582701  
    4141msgstr "Kontaktperson"
    4242
     43msgid "show itemlist"
     44msgstr "Liste anzeigen"
     45
    4346msgid "send mail"
    4447msgstr "E-Mail senden"
     
    7073msgid "Choose the selectyco button size (Please note: the displayed button text changes depending on the content type, i.e. if it is a video: \"Dieses Video um € 0,60 ansehen\")"
    7174msgstr "Wählen Sie die selectyco Buttongröße aus (Hinweis: der angezeigte Buttontext passt sich der Art des Inhalts an - z.B. Bei selectyco Button für ein Video wird folgender Text angezeigt: „Dieses Video um € 0,60 ansehen“)."
     75
     76msgid "Show all items from one year."
     77msgstr "Liste aller Artikel aus einem Jahr anzeigen."
    7278
    7379msgid "Item data"
  • selectyco/trunk/selectyco-general-settings.php

    r1495626 r1582701  
    3939            <br /><input type="text" id="sycId_cPerson" name="cPerson" placeholder="<?php _e('firstname, lastname'); ?>" />
    4040          </div>
    41           <div class="right"><span id="licenceStatus"></span><br /><br /><br /><input type="button" id="sendLicenceRequest" class="button button-primary" value="<?php _e('send mail','selectyco')?>" /></div>
     41          <div class="right">
     42            <span id="licenceStatus"></span><br /><br /><br />
     43            <input type="button" id="sendLicenceRequest" class="button button-primary" value="<?php _e('send mail','selectyco')?>" />
     44          </div>
    4245          <div class="clr"></div>
    4346        </div>
     
    5457      </div>
    5558
    56       <div id="sycStep4" class="steps">
     59      <div id="sycStep3" class="steps">
    5760        <span class="step"><?php _e('Step','selectyco'); ?> 3:</span> <?php _e('Choose the selectyco button size (Please note: the displayed button text changes depending on the content type, i.e. if it is a video: "Dieses Video um € 0,60 ansehen")','selectyco'); ?>
    5861        <div class="stepContainer">
     
    6669        </div>
    6770      </div>
     71     
     72      <div id="sycStep4" class="steps">
     73        <span class="step">
     74        <?php _e('Show all items from one year.','selectyco'); ?>
     75        </span>
     76        <div class="right">
     77          <select style="width:65px" id="sycItemsOfYear" >
     78              <?php
     79                  for($i=date('Y'); $i>=2015; $i--)
     80                  {
     81                      echo '<option value='.$i.'>'.$i.'</option>';
     82                  }
     83              ?>
     84          </select>
     85          <input type="button" id="sycGetItems" class="button button-primary" value="<?php _e('show itemlist','selectyco')?>" />
     86        </div>
     87        <pre id="apiGetItemsList"></pre>
     88      </div>
    6889    </form>
    6990  </div>
  • selectyco/trunk/selectyco.php

    r1580328 r1582701  
    55  Plugin URI:  https://plugins.svn.wordpress.org/selectyco/
    66  Description: Single digital content sales via selectyco. Users register once and can purchase single content across multiple platforms.
    7   Version:     2.1.3
     7  Version:     2.1.4
    88  Author:      selectyco Media Solutions GmbH
    99  Author URI:  https://www.selectyco.com
     
    1414  define("SELECTYCO_DIR", plugin_dir_path( __FILE__ ));
    1515  define("SELECTYCO_HOST", "https://api.selectyco.com");
    16 
     16 
    1717  if(!class_exists('syc_class')) {
    1818    class syc_class {
     
    4343          add_action( 'wp_ajax_send_licenceRequest', array(&$this, 'send_licenceRequest') );
    4444          add_action( 'wp_ajax_nopriv_send_licenceRequest', array(&$this, 'send_licenceRequest') );
     45         
     46          add_action( 'wp_ajax_sycApiGetItems', array(&$this, 'sycApiGetItems') );
     47          add_action( 'wp_ajax_nopriv_sycApiGetItems', array(&$this, 'sycApiGetItems') );
    4548        }
    4649        else {
     
    267270      }
    268271     
     272     
     273      public function sycApiGetItems() {
     274        $sycOptions = get_option('selectyco_options');
     275        $verificationKey = $sycOptions['authKey'];
     276       
     277        $ch = curl_init(SELECTYCO_HOST.'/items?year='.$_POST['sycItemsOfYear']);
     278         
     279        curl_setopt_array($ch, array(
     280          CURLOPT_SSL_VERIFYPEER => FALSE,
     281          CURLOPT_RETURNTRANSFER => TRUE,
     282          CURLOPT_HTTPHEADER => array(
     283          'X-SELECTYCO-AUTH: '.$verificationKey,
     284          'Content-Type: application/json'
     285          )
     286        ));
     287
     288        $response = curl_exec($ch);
     289        $info = curl_getinfo($ch);
     290        curl_close($ch);
     291
     292        if($info['http_code'] === 200) {
     293          $responseData = json_decode($response);
     294          wp_send_json_success( array('sycReqType' => 'apiGetItems', 'success' => __( 'alles ok', 'selectyco' ), 'items' => $responseData) );
     295          return $responseData;
     296        }
     297        else {
     298          wp_send_json_error( array('sycReqType' => 'apiGetItems', 'error' => __( 'an error occured', 'selectyco' )) );
     299        }
     300      }
     301     
     302     
    269303   
    270304      public function sycApiGetItem($sycItem, $referrer) {
Note: See TracChangeset for help on using the changeset viewer.