X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=planetlab%2Fincludes%2Fplc_visibletags.php;fp=planetlab%2Fincludes%2Fplc_visibletags.php;h=0000000000000000000000000000000000000000;hb=f0fda226610166bcb313f6d1c6a963d9b9e1f94c;hp=0d45bb89070cef573ca204379274619022ae1b70;hpb=53fb202a0ed1ef1df5c9c292de2fc410b782e5bb;p=plewww.git diff --git a/planetlab/includes/plc_visibletags.php b/planetlab/includes/plc_visibletags.php deleted file mode 100644 index 0d45bb8..0000000 --- a/planetlab/includes/plc_visibletags.php +++ /dev/null @@ -1,84 +0,0 @@ -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; - } - -} -?>