Changeset 20192


Ignore:
Timestamp:
Jan 16, 2013, 9:28:42 PM (11 years ago)
Author:
mistic100
Message:

update triggers_list, use DataTables and same design as Webservices explorer

Location:
trunk/tools
Files:
1 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/triggers_list.php

    r18926 r20192  
    11<?php
    2 // +-----------------------------------------------------------------------+
    3 // | Piwigo - a PHP based photo gallery                                    |
    4 // +-----------------------------------------------------------------------+
    5 // | Copyright(C) 2008-2009 Piwigo Team                  http://piwigo.org |
    6 // | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
    7 // | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
    8 // +-----------------------------------------------------------------------+
    9 // | This program is free software; you can redistribute it and/or modify  |
    10 // | it under the terms of the GNU General Public License as published by  |
    11 // | the Free Software Foundation                                          |
    12 // |                                                                       |
    13 // | This program is distributed in the hope that it will be useful, but   |
    14 // | WITHOUT ANY WARRANTY; without even the implied warranty of            |
    15 // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
    16 // | General Public License for more details.                              |
    17 // |                                                                       |
    18 // | You should have received a copy of the GNU General Public License     |
    19 // | along with this program; if not, write to the Free Software           |
    20 // | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
    21 // | USA.                                                                  |
    22 // +-----------------------------------------------------------------------+
    23 
    242$core = array(
    253array(
     
    816794);
    817795?>
    818 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
    819    "http://www.w3.org/TR/html4/strict.dtd">
     796<!DOCTYPE html>
    820797<html xmlns="http://www.w3.org/1999/xhtml" lang="en" dir="ltr">
    821798<head>
     
    823800  <title>Piwigo Core Triggers</title>
    824801 
    825   <link type="text/css" rel="stylesheet" media="screen" href="tablesorter/jquery.tablesorter.css">
    826   <script type="text/javascript" src="../themes/default/js/jquery.min.js"></script>
    827   <script type="text/javascript" src="tablesorter/jquery.tablesorter.min.js"></script>
    828 
     802  <link rel="stylesheet" type="text/css" href="http://code.jquery.com/ui/1.9.2/themes/base/jquery-ui.css">
     803  <link rel="stylesheet" type="text/css" href="http://ajax.aspnetcdn.com/ajax/jquery.dataTables/1.9.4/css/jquery.dataTables_themeroller.css">
     804  <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
     805  <script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jquery.dataTables/1.9.4/jquery.dataTables.min.js"></script>
    829806 
    830   <script type="text/javascript">
    831   $(document).ready(function() {
    832         $('#triggers').tablesorter({
    833           sortList: [[0,0]]
    834         });
    835   }); 
    836   </script>
     807  <style type="text/css">
     808  /* BEGIN CSS RESET
     809    http://meyerweb.com/eric/tools/css/reset
     810    v2.0 | 20110126 | License: none (public domain) */
     811  html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code,
     812  del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li,
     813  fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed,
     814  figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video
     815  {margin:0;padding:0;border:0;font-size:100%;vertical-align:baseline;}
     816
     817  article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section {display:block;}
     818  body {line-height:1.1;}
     819  blockquote, q {quotes:none;}
     820  blockquote:before, blockquote:after, q:before, q:after {content:'';content:none;}
     821  table {border-collapse:collapse;border-spacing:0;}
     822  /* END CSS RESET */
     823 
     824  html {font-family:"Corbel","Lucida Grande","Verdana",sans-serif;color:#222;font-size:13px;}
     825
     826  a {color:#247EBF;text-decoration:none;}
     827  a:hover {color:#EB9C39;border-bottom-width:1px;border-style:dotted;
     828    text-shadow:1px 1px 0 #ddd;-moz-text-shadow:1px 1px 0 #ddd;-webkit-text-shadow:1px 1px 0 #ddd;
     829  }
     830
     831  h1 {color:#fff;font-size:26px;padding:10px 15px;
     832    text-shadow:1px 1px 0 #999;-moz-text-shadow:1px 1px 0 #999;-webkit-text-shadow:1px 1px 0 #999;
     833    background:#45484d;background:-moz-linear-gradient(top, #45484d 0%, #333333 100%);background:-webkit-gradient(linear, left top, left bottom, color-stop(0%,#45484d), color-stop(100%,#333333));background:-webkit-linear-gradient(top, #45484d 0%,#333333 100%);background:-o-linear-gradient(top, #45484d 0%,#333333 100%);background:-ms-linear-gradient(top, #45484d 0%,#333333 100%);background:linear-gradient(to bottom, #45484d 0%,#333333 100%);filter:progid:DXImageTransform.Microsoft.gradient( startColorstr='#45484d', endColorstr='#333333',GradientType=0 );
     834  }
     835
     836  #the_header {border-bottom:1px solid #cdcdcd;margin-bottom:1px;}
     837  #the_footer {background:#EAEAEA;border-top:1px solid #cdcdcd;padding:10px;clear:both;}
     838
     839  #the_page {padding:20px;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAADCAIAAADZSiLoAAAAH0lEQVQImSXHMQEAMAwCMOrfK0jIjuVL2gLBzyHJtgd7wBdU3Vt/7AAAAABJRU5ErkJggg==);}
     840 
     841  tfoot input {width:80%;}
     842  tfoot .search_input {color:#999;}
     843  tfoot select.search_input option:not(:first-child) {color:#222;}
     844  </style>
    837845</head>
    838846
    839 <body style="font-family:arial;">
    840 <h2>Piwigo Core Triggers</h2>
    841 
    842 <a href="http://piwigo.org/doc/doku.php?id=dev:plugins">For more infos about triggers</a>
    843 
    844 <table id="triggers" class="tablesorter">
    845 <thead>
    846 <tr>
    847   <th>Name</th>
    848   <th>Type</th>
    849   <th>Vars</th>
    850   <th>Usage in the core <span style="font-weight:normal !important;">file (<i>function</i>)</span></th>
    851   <th>Commentary</th>
    852 </tr>
    853 </thead>
    854 <tbody>
    855 
    856 <?php 
    857   foreach ($core as $trigger)
    858   {
    859     echo '
    860   <tr>
    861     <td>'.$trigger['name'].'</td>
    862     <td>'.$trigger['type'].'</td>
    863     <td>';
    864     for ($i=0; $i<count($trigger['vars']); $i+=2)
     847<body>
     848
     849<div id="the_header">
     850  <h1>Piwigo Core Triggers</h1>
     851</div> <!-- the_header -->
     852
     853<div id="the_page">
     854  <table id="list">
     855  <thead>
     856    <tr>
     857      <th>Name</th>
     858      <th>Type</th>
     859      <th>Variables</th>
     860      <th>Usage in the core</th>
     861      <th>Commentary</th>
     862    </tr>
     863  </thead>
     864  <tbody>
     865
     866  <?php 
     867    foreach ($core as $trigger)
    865868    {
    866       if ($i>0) echo ', ';
    867       echo $trigger['vars'][$i].' '.(!empty($trigger['vars'][$i+1])?'<i>$'.$trigger['vars'][$i+1].'</i>':null);
     869      echo '
     870    <tr>
     871      <td>'.$trigger['name'].'</td>
     872      <td>'.$trigger['type'].'</td>
     873      <td>';
     874      for ($i=0; $i<count($trigger['vars']); $i+=2)
     875      {
     876        if ($i>0) echo ', ';
     877        echo $trigger['vars'][$i].' '.(!empty($trigger['vars'][$i+1])?'<i>$'.$trigger['vars'][$i+1].'</i>':null);
     878      }
     879      echo '
     880      </td>
     881      <td>';
     882      $f=1;
     883      foreach ($trigger['files'] as $file)
     884      {
     885        if (!$f) echo '<br>'; $f=0;
     886        echo preg_replace('#\((.+)\)#', '(<i>$1</i>)', $file);
     887      }
     888      echo '
     889      </td>
     890      <td>'.@$trigger['infos'].'</td>
     891    </tr>';
    868892    }
    869     echo '
    870     </td>
    871     <td>';
    872     $f=1;
    873     foreach ($trigger['files'] as $file)
    874     {
    875       if (!$f) echo '<br>'; $f=0;
    876       echo preg_replace('#\((.+)\)#', '(<i>$1</i>)', $file);
    877     }
    878     echo '
    879     </td>
    880     <td>'.@$trigger['infos'].'</td>
    881   </tr>';
     893  ?>
     894
     895  </tbody>
     896  <tfoot>
     897    <tr>
     898      <td><input type="text" value="Name" class="search_input"></td>
     899      <td>
     900        <select class="search_input">
     901          <option value="">Type</option>
     902          <option value="trigger_action">trigger_action</option>
     903          <option value="trigger_event">trigger_event</option>
     904        </select>
     905      </td>
     906      <td><input type="text" value="Variables" class="search_input"></td>
     907      <td><input type="text" value="Usage" class="search_input"></td>
     908      <td><input type="text" value="Commentary" class="search_input"></td>
     909    </tr>
     910  </tfoot>
     911  </table>
     912</div> <!-- the_page -->
     913
     914<div id="the_footer">
     915  Copyright &copy; 2002-2013 <a href="http://piwigo.org">Piwigo Team</a>
     916</div> <!-- the_footer -->
     917
     918 
     919<script type="text/javascript">
     920var oTable = $('#list').dataTable({
     921  "bJQueryUI": true,
     922  "aaSorting": [ [0,'asc'] ],
     923  "sPaginationType": "full_numbers",
     924  "aLengthMenu": [[10, 30, 50, 70, 90, -1], [10, 30, 50, 70, 90, "All"]],
     925  "iDisplayLength": 30,
     926  "oLanguage": {
     927      "sSearch": "Search all columns :"
    882928  }
    883 ?>
    884 
    885 </tbody>
    886 </table>
     929});
     930
     931// search input
     932$("tfoot td").each(function (i) {
     933  $('select', this).change(function () {
     934    oTable.fnFilter($(this).val(), i);
     935  });
     936  $('input', this).keyup(function () {
     937    oTable.fnFilter($(this).val(), i);
     938  });
     939});
     940
     941// search helpers
     942var asInitVals = new Array();
     943$("tfoot input").each(function (i) {
     944  asInitVals[i] = $(this).val();
     945});
     946 
     947$("tfoot input").focus(function () {
     948  if (this.className == "search_input") {
     949    $(this).removeClass("search_input");
     950    $(this).val("");
     951  }
     952});
     953 
     954$("tfoot input").blur(function (i) {
     955  if ($(this).val() == "") {
     956    $(this).addClass("search_input");
     957    $(this).val(asInitVals[$("tfoot input").index(this)]);
     958  }
     959});
     960
     961$("tfoot select").change(function () {
     962  if ($(this).val() == "") {
     963    $(this).addClass("search_input");
     964  }
     965  else {
     966    $(this).removeClass("search_input");
     967  }
     968});
     969</script>
    887970
    888971</body>
  • trunk/tools/ws.htm

    r18957 r20192  
    1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
    2    "http://www.w3.org/TR/html4/strict.dtd">
     1<!DOCTYPE html>
    32<html xmlns="http://www.w3.org/1999/xhtml" lang="en" dir="ltr">
    43<head>
     
    65  <title>Piwigo web API (web-services) explorer</title>
    76 
    8   <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
     7  <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
    98 
    109  <style type="text/css">
     
    229228
    230229<div id="the_footer">
    231   Copyright © 2002-2012 <a href="http://piwigo.org">Piwigo Team</a>
     230  Copyright &copy; 2002-2013 <a href="http://piwigo.org">Piwigo Team</a>
    232231</div> <!-- the_footer -->
    233232
Note: See TracChangeset for help on using the changeset viewer.