var $email;
var $enabled;
- function Person($person) {
+ function __construct($person) {
$this->roles = $person['role_ids'];
$this->person_id = $person['person_id'];
$this->first_name = $person['first_name'];
class PCU {
var $data;
- function PCU($pcu) {
+ function __construct($pcu) {
$this->data = $pcu;
}
class Address {
var $data;
- function Address($address) {
+ function __construct($address) {
$this->data = $address;
}
var $pcu_ids;
var $data;
- function Node($node) {
+ function __construct($node) {
global $plc, $api, $adm;
$this->data = $node;
$this->node_type = $node['node_type'];
class Slice {
var $data;
- function Slice($val) {
+ function __construct($val) {
$this->data = $val;
}
var $site_id;
var $data;
- function Site($site_id) {
+ function __construct($site_id) {
global $plc, $api, $adm;
$site_info= $adm->GetSites( array( intval($site_id) ) );
$this->data = $site_info[0];
// all known peers hashed on peer_id
class Peers {
var $hash;
-
- function Peers ($api) {
+
+ function __construct ($api) {
$hash=array();
// fake entry fot the local myplc
$local_fake_peer = array ('peername' => PLC_NAME,
var $filter;
var $label;
- function PeerScope ($api, $peerscope) {
+ function __construct ($api, $peerscope) {
switch ($peerscope) {
case '':
$this->filter=array();
var $alt_person;
var $alt_auth;
- function PLCSession($name = NULL, $pass = NULL)
+ function __construct($name = NULL, $pass = NULL)
{
$name= strtolower( $name );
// User API access
+++ /dev/null
-<?php
-
- // $Id: plc_functions.php 15734 2009-11-13 10:52:31Z thierry $
-
- // utility function for displaying extra columns based on tags and categories
- // expected type is e.g. 'node'
-
-class VisibleTags {
- var $api;
- var $type;
-
- function VisibleTags ($api,$type) {
- $this->api=$api;
- $this->type=$type;
- $this->columns=NULL;
- }
-
- // returns an ordered set of columns - compute only once
- function columns () {
- # if cached
- if ($this->columns != NULL)
- return $this->columns;
-
- // scan tag types to find relevant additional columns
- $tag_types = $this->api->GetTagTypes(array('category'=>"$type*/ui*"));
-
- $columns = array();
- foreach ($tag_types as $tag_type) {
- $tagname=$tag_type['tagname'];
- $column=array();
- $column['tagname']=$tagname;
- // defaults
- $column['header']=$tagname;
- $column['rank']=$tagname;
- $column['type']='string';
- $column['description']=$tag_type['description'];
- // split category and parse any setting
- $category_tokens=explode('/',$tag_type['category']);
- foreach ($category_tokens as $token) {
- $assign=explode('=',$token);
- if (count($assign)==2)
- $column[$assign[0]]=$assign[1];
- }
- $columns []= $column;
- }
-
- // sort upon 'rank'
- usort ($columns, create_function('$col1,$col2','return strcmp($col1["rank"],$col2["rank"]);'));
-
- # cache for next time
- $this->columns=$columns;
-// plc_debug('columns',$columns);
- return $columns;
- }
-
- // extract tagname
- function column_names () {
- return array_map(create_function('$tt','return $tt["tagname"];'),$this->columns());
- }
-
- // to add with array_merge to the headers part of the Plekit Table
- function headers () {
- $headers=array();
- $columns=$this->columns();
- foreach ($columns as $column)
- if ($column['header'] == $column['tagname'])
- $headers[$column['header']]=$column['type'];
- else
- $headers[$column['header']]=array('type'=>$column['type'],'title'=>$column['description']);
- return $headers;
- }
-
- // to add with array_merge to the notes part of the Plekit Table
- function notes () {
- $notes=array();
- $columns=$this->columns();
- foreach ($columns as $column)
- if ($column['header'] != $column['tagname'])
- $notes []= strtoupper($column['header']) . ' = ' . $column['description'];
- return $notes;
- }
-
-}
-?>
class VisibleTags {
var $api;
var $type;
-
- function VisibleTags ($api,$type) {
+
+ function __construct ($api,$type) {
$this->api=$api;
$this->type=$type;
$this->columns=NULL;
var $HopCount = array();
var $RTT = array();
-function PlekitColumns ($column_configuration, $fix_columns, $tag_columns, $extra_columns=NULL, $this_table_headers=NULL) {
+function __construct ($column_configuration, $fix_columns, $tag_columns, $extra_columns=NULL, $this_table_headers=NULL) {
if ($column_configuration != NULL) {
$this->fix_columns = $fix_columns;
var $id;
- function PlekitDatepicker ($id,$display,$options=NULL) {
- $datepicker_default_options =
+ function __construct ($id,$display,$options=NULL) {
+ $datepicker_default_options =
array ('inline'=>true,
'format'=>'Y-sl-M-sl-d',
'value'=>'');
var $height;
var $input_type;
- function PlekitDetails ($editable) {
+ function __construct ($editable) {
$this->editable=$editable;
$this->form=NULL;
$this->width="";
var $onSubmit; // can be set with options
var $onReset; // can be set with options
- function PlekitForm ($full_url, $values, $options=NULL) {
+ function __construct ($full_url, $values, $options=NULL) {
// so we can use the various l_* functions:
// we parse the url to extract var-values pairs,
// and add them to the 'values' argument if any
var $button_id;
var $button_text;
- function PlekitFormButton ($full_url, $button_id, $button_text, $method="POST") {
+ function __construct ($full_url, $button_id, $button_text, $method="POST") {
$this->PlekitForm($full_url,array(),$method);
$this->button_id=$button_id;
$this->button_text=$button_text;
// internal
var $has_tfoot;
- function PlekitTable ($table_id,$headers,$sort_column,$options=NULL) {
+ function __construct ($table_id,$headers,$sort_column,$options=NULL) {
$this->table_id = $table_id;
$this->headers = $headers;
$this->sort_column = $sort_column;
// internal
var $has_tfoot;
- function PlekitTable ($table_id,$headers,$sort_column,$options=NULL) {
+ function __construct ($table_id,$headers,$sort_column,$options=NULL) {
$this->table_id = $table_id;
$this->headers = $headers;
$this->sort_column = $sort_column;
var $id;
var $nifty;
- function PlekitToggle ($id,$trigger,$options=NULL) {
+ function __construct ($id,$trigger,$options=NULL) {
$this->id = $id;
$this->trigger=$trigger;
if ( ! $options ) $options = array();
var $calls;
var $multicall;
- function TopHatAPI($auth = NULL,
+ function __construct($auth = NULL,
$server = TOPHAT_API_HOST,
$port = TOPHAT_API_PORT,
$path = TOPHAT_API_PATH,