ActionApps PHP Cross Reference Groupware Applications

Source: /admin/aarsstest.php3 - 176 lines - 7478 bytes - Summary - Text - Print

Description: PHP versions 4 and 5

   1  <?php
   2  /**
   3   * PHP versions 4 and 5
   4   *
   5   * LICENSE: This program is free software; you can redistribute it and/or modify
   6   * it under the terms of the GNU General Public License as published by
   7   * the Free Software Foundation; either version 2 of the License, or
   8   * (at your option) any later version.
   9   *
  10   * This program is distributed in the hope that it will be useful,
  11   * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13   * GNU General Public License for more details.
  14   *
  15   * You should have received a copy of the GNU General Public License
  16   * along with this program (LICENSE); if not, write to the Free Software
  17   * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  18   *
  19   * @version   $Id: aarsstest.php3 2404 2007-05-09 15:10:58Z honzam $
  20   * @author    Honza Malik <honza.malik@ecn.cz>
  21   * @license   http://opensource.org/licenses/gpl-license.php GNU Public License
  22   * @copyright Copyright (C) 1999, 2000 Association for Progressive Communications
  23   * @link      http://www.apc.org/ APC
  24  */
  25  
  26  require_once  "../include/init_page.php3";
  27  require_once  AA_INC_PATH."tabledit.php3";
  28  require_once  AA_INC_PATH."tv_common.php3";
  29  require_once menu_include();   //show navigation column depending on $show
  30  
  31  // ----------------------------------------------------------------------------------------
  32  /** TV_PageBegin function
  33   * @param array $config_arr
  34   * @return prints beginning of page
  35   */
  36  function TV_PageBegin(&$config_arr) {
  37      if (! $config_arr["cond"] ) {
  38          MsgPage($sess->url(self_base()."index.php3"), _m("You have not permissions to this page"), "standalone");
  39          exit;
  40      }
  41  
  42      HtmlPageBegin();   // Print HTML start page tags (html begin, encoding, style sheet, but no title)
  43      echo '<link rel="StyleSheet" href="'.AA_INSTAL_PATH.'tabledit.css" type="text/css"  title="TableEditCSS">';
  44      echo "<title>".$config_arr["title"]."</title></head>";
  45      showMenu($GLOBALS['aamenus'], $config_arr["mainmenu"], $config_arr["submenu"]);
  46      echo "<h1><b>" . $config_arr["caption"] . "</b></h1>";
  47  }
  48  /** tv_field_value function
  49   * @param $feed_id
  50   * @param $param
  51   * @param $var
  52   * @return string
  53   */
  54  function tv_field_value($feed_id,$param,$var) {
  55      return "+'&$param='+escape(document.tv_aarsstest.elements['val[$feed_id][$var]'].value)";
  56  }
  57  /** showFeedActions function
  58   * @param $feed_id
  59   * @return string - set of links
  60   */
  61  function showFeedActions($feed_id) {
  62      $url = "'".AA_INSTAL_URL ."admin/xmlclient.php3?feed_id=$feed_id'".
  63                 tv_field_value($feed_id,'fill','fire').
  64                 tv_field_value($feed_id,'time','newest_item').
  65                 tv_field_value($feed_id,'debugfeed','debug');
  66      $out  = "<a href=\"javascript:OpenWindowTop($url)\" title=\"downloads remote items from the feed and possibly store it to the desired slice (if \"write\" checkbox is checked\">"._m('feed')."</a>&nbsp;";
  67      $out .= "<a href=\"javascript:OpenWindowTop('http://feedvalidator.org/check.cgi?url='+escape($url+'&display=1'))\" title=\"checks the validity of the feed by feedvalidator.org\">"._m('validate')."</a>&nbsp;";
  68      $out .= "<a href=\"javascript:OpenWindowTop($url+'&display=1')\" title=\"displays the source data in new window\">"._m('show')."</a>";
  69      return $out;
  70  }
  71  
  72  $sess->register("tview");
  73  $tview = 'aarss_tv';
  74  
  75  
  76  /// this must be function
  77  /** GetAARSS_tv function
  78   * @param $viewID
  79   * @param $processForm
  80   * @return array
  81   */
  82  function GetAARSS_tv($viewID, $processForm = false) {
  83  
  84      $debug_params = array( 0 => '0 - none', 1 => '1', 2 => '2', 3 => '3', 4 => '4', 5 => '5', 6 => '6', 7 => '7', 8 => '8', 9 => '9 - maximum');
  85      return array (
  86          "table" => "external_feeds",
  87          "join"    => array (
  88              "nodes" => array (
  89                  "joinfields" => array (
  90                      "node_name" => "name"),
  91                  "jointype" => "1 to 1")),
  92          "type"      => "browse",
  93          "search"    => false,
  94          "mainmenu"  => "aaadmin",
  95          "submenu"   => "aarsstest",
  96          "readonly"  => false,
  97          "addrecord" => false,
  98          "listlen"   => 50,
  99          "cond"      => IsSuperadmin(),
 100          "attrs"     => $GLOBALS['attrs_browse'],
 101          "title"     => _m ("ActionApps RSS Content Exchange"),
 102          "caption"   => _m("ActionApps RSS Content Exchange"),
 103          "help"      => _m("RSS feeds testing page."),
 104          "messages"  => array (
 105              "no_item"  => _m("No ActionApps RSS Exchange is set.")),
 106          "buttons_down" => array( 'update_all'=> false, 'delete_all' => false ),
 107          "buttons_left" => array( 'edit'=> false, 'delete_checkbox' => false ),
 108          "fields"       => array (
 109              "feed_id"     => array (  // actions
 110                  "view"    => array ( "type"=>"userdef", "function" => 'showFeedActions', "html" => true ),
 111                  "caption" => _m('Actions')),
 112              "newest_item" => array (
 113                  "view"    => array ("type" => 'text', "size" => array("cols"=>15)),
 114                  "caption" => _m('Newest Item'),
 115                  "hint"    => _m('change this value if you want to get older items')),
 116              "debug"       => array (
 117                  "view"    => array ( "type"=>"select", "source"=>$debug_params ),
 118                  "caption" => _m('Messages'),
 119                  "table"   => 'aa_notable',
 120                  "default" => 4),
 121              "fire"        => array (
 122                  "view"    => array ( "type"=>"checkbox" ),
 123                  "caption" => _m('Write'),
 124                  "hint"    => _m('update database'),
 125                  "table"   => 'aa_notable',
 126                  "default" => 1),
 127              "node_name"   => array (
 128                  "view"    => array ("readonly" => true),
 129                  "caption" => _m('Node')),
 130              "remote_slice_name" => array (
 131                  "view"    => array ("readonly" => true),
 132                  "caption" => _m('Remote slice')),
 133              "remote_slice_id" => array (
 134                  "view"    => array ("readonly" => true, "type"=>"userdef", "function" => 'unpack_id'),
 135                  "caption" => _m('Remote slice ID')),
 136              "slice_id"    => array (
 137                  "view"    => array ("readonly" => true, "type"=>"userdef", "function" => 'unpack_id'),
 138                  "caption" => _m('Local slice ID')),
 139              "feed_mode"   => array (
 140                  "view"    => array ("readonly" => true),
 141                  "caption" => _m('Feed mode')),
 142              "_server_url_" => array (
 143                  "table"   => "nodes",
 144                  "field"   => "server_url",
 145                  "view"    => array ("readonly" => true),
 146                  "caption" => _m("Feed url")),
 147              "_password_"  => array (
 148                  "table"   => "nodes",
 149                  "field"   => "password",
 150                  "view"    => array ("readonly" => true),
 151                  "caption" => _m("Password")),
 152              "user_id"     => array(
 153                  "view"    => array ("readonly" => true),
 154                  "caption" => _m('User'))
 155          ));
 156  }
 157  
 158  $aarss_tv = GetAARSS_tv('aarss_tv');
 159  
 160  TV_PageBegin($aarss_tv);
 161  FrmJavascriptFile('javascript/js_lib.js');
 162  ProcessFormData('GetAARSS_tv', $val, $cmd);
 163  
 164  PrintArray($Err);
 165  echo $Msg;
 166  
 167  $script = $sess->url("aarsstest.php3");
 168  
 169  $tabledit = new tabledit('aarsstest', $script, $cmd, $aarss_tv, AA_INSTAL_PATH."images/", $sess, $func);
 170  $err = $tabledit->view($where);
 171  if ($err) echo "<b>$err</b>";
 172  
 173  HTMLPageEnd();
 174  page_close();
 175  
 176  ?>

title

Description

title

Description

title

Description

title

title

Body