-
Notifications
You must be signed in to change notification settings - Fork 0
/
class.commonshelper.php
599 lines (522 loc) · 19.2 KB
/
class.commonshelper.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
<?PHP
class CommonsHelper {
public $language , $project , $file ;
public $used_templates ;
public $meta_tl , $meta_cat , $meta_info ;
public $namespaces ;
public $errors ;
public $namespace_prefix ;
public $seen_good_template ;
public $seen_bad_template ;
public $seen_bad_category ;
function __construct ( $l , $p , $f ) {
$this->language = $l ;
$this->project = $p ;
$this->file = $f ;
$this->meta_tl = Array () ;
$this->meta_cat = Array () ;
$this->meta_info = Array () ;
$this->errors = Array () ;
$this->namespaces = Array () ;
$this->namespace_prefix = "File:" ;
$this->seen_good_template = false ;
$this->seen_bad_template = false ;
$this->seen_bad_category = false ;
}
function get_original_wikitext () {
$url = "http://{$this->language}.{$this->project}.org/w/index.php?action=raw&title=" . urlencode ( $this->namespace_prefix . $this->file ) ;
return file_get_contents ( $url ) ;
}
function get_xml_url () {
$url = "http://toolserver.org/~jan/wiki2xml/w2x.php?doit=1&whatsthis=articlelist&site={$this->language}.{$this->project}.org/w&output_format=xml&use_templates=none&text=" . urlencode ( $this->namespace_prefix . $this->file ) ;
return $url ;
}
function get_xml ( $url = '' ) {
if ( $url == '' ) $url = $this->get_xml_url() ;
$xml = file_get_contents( $url ) ;
$cnt = 0 ;
$t = '' ;
$xml_array = explode ( '<' , $xml ) ;
$ret = $this->parse_xml ( $xml_array , $cnt , $t , false ) ;
while ( count ( $ret ) == 1 && $ret[0]['?'] == 'x' && ( $ret[0]['n'] == 'ARTICLES' || $ret[0]['n'] == 'ARTICLE' ) ) $ret = $ret[0]['s'] ;
return $ret ;
}
function parse_xml_attributes ( $attrs ) {
$ret = Array () ;
$attrs = trim ( $attrs ) ;
if ( $attrs == '' ) return $ret ;
$attrs .= ' ' ;
$parts = Array () ;
$q = '' ;
$last_was_backslash = false ;
$p = 0 ;
while ( $attrs != '' ) {
$n = substr ( $attrs , $p , 1 ) ;
if ( $n == ' ' && $q == '' ) {
$parts[] = substr ( $attrs , 0 , $p ) ;
$attrs = trim ( substr ( $attrs , $p ) ) ;
if ( $attrs != '' ) $attrs .= ' ' ;
$p = 0 ;
continue ;
}
$p++ ;
if ( ( $n == '"' || $n == "'" ) && !$last_was_backslash ) {
if ( $q == '' ) $q = $n ;
elseif ( $q == $n ) $q = '' ;
continue ;
}
if ( $n == '\\' ) {
if ( $last_was_backslash ) $last_was_backslash = false ;
else $last_was_backslash = true ;
continue ;
}
}
foreach ( $parts AS $p ) {
$n = explode ( '=' , $p , 2 ) ;
$key = trim ( strtolower ( $n[0] ) ) ;
if ( count ( $n ) == 1 ) {
$ret[$key] = '\\' ; # Impossible value to indicate missing value
} else {
$value = trim ( $n[1] ) ;
$ret[$key] = $value ;
}
}
return $ret ;
}
function parse_xml ( $xml_array , &$count , &$outer_text , $in_template ) {
$ret = Array () ;
if ( $outer_text != '' ) {
$ret[] = Array (
'?' => 't' ,
't' => $outer_text
) ;
$outer_text = '' ;
}
while ( $count < count ( $xml_array ) ) {
$x = $xml_array[$count++] ;
$y = explode ( '>' , $x , 2 ) ;
if ( count ( $y ) == 0 ) { $y[0] = '' ; $y[1] = '' ; }
if ( count ( $y ) == 1 ) { $y[1] = '' ; }
$tag = trim ( $y[0] ) ;
$text = $y[1] ;
if ( $tag == '' && $text == '' ) continue ; # Nothing for you to see here, please move along
if ( substr ( $tag , 0 , 4 ) == '?xml' ) continue ; # Don't care
$is_closing = false ;
if ( substr ( $tag , 0 , 1 ) == '/' ) {
$is_closing = true ;
$tag = trim ( substr ( $tag , 1 ) ) ;
}
if ( $is_closing ) { # My work here is done
$outer_text = $text ;
break ;
}
$is_self_closing = false ;
if ( substr ( $tag , -1 , 1 ) == '/' ) {
$is_self_closing = true ;
$tag = trim ( substr ( $tag , 0 , -1 ) ) ;
}
$y = explode ( ' ' , $tag , 2 ) ;
if ( count ( $y ) == 1 ) $y[] = '' ;
$tag = strtoupper ( $y[0] ) ;
$attrs = $y[1] ;
if ( $tag != '' ) {
$n = Array (
'?' => 'x' ,
'n' => $tag ,
'a' => $this->parse_xml_attributes ( $attrs ) ,
'sc' => $is_self_closing
) ;
if ( !$is_closing && !$is_self_closing ) {
$n['s'] = $this->parse_xml ( $xml_array , $count , $text , $tag == 'TEMPLATE' ) ;
}
$ret[] = $n ;
}
if ( $text != '' ) {
$ret[] = Array (
'?' => 't' ,
't' => $text
) ;
}
}
$ret2 = Array () ;
foreach ( $ret AS $r ) {
if ( $r['?'] == 'x' && $r['sc'] && $r['n'] == 'SPACE' ) {
$r = Array (
'?' => 't' ,
't' => ' '
) ;
}
$cr = count ( $ret2 ) ;
if ( $cr > 0 && $ret2[$cr-1]['?'] == 't' && $r['?'] == 't' ) {
$ret2[$cr-1]['t'] .= $r['t'] ;
} else $ret2[] = $r ;
}
// Expand template arguments
if ( $in_template ) {
foreach ( $ret2 AS $k => $v ) {
if ( $v['?'] != 'x' ) continue ;
if ( $v['n'] == 'TARGET' ) {
$tn = ucfirst ( $v['s'][0]['t'] ) ;
$v['s'][0]['t'] = $tn ; // Alters tree to enforce ufcirst template names
$this->used_templates[$tn] = $tn ;
}
if ( $v['n'] != 'ARG' ) continue ;
if ( !isset ( $v['s'] ) ) continue ;
if ( count ( $v['s'] ) != 1 ) continue ;
$n = $v['s'][0] ;
if ( $n['?'] != 't' ) continue ;
$text = trim ( $n['t'] ) ;
if ( $text == '' ) continue ; // No need to parse this...
$n = $this->fix_template_parameter ( $text ) ;
if ( count ( $n ) == 1 && $n[0]['?'] == 'x' && $n[0]['n'] == 'PARAGRAPH' && isset ( $n[0]['s'] ) ) $n = $n[0]['s'] ;
$ret2[$k]['s'] = $n ;
}
}
return $ret2 ;
}
function is_information_template ( $name ) {
return false ;
}
function fix_template_parameter ( $s ) {
$s = urlencode ( $s ) ;
$url = "http://toolserver.org/~magnus/wiki2xml/w2x.php?doit=1&whatsthis=wikitext&site={$this->language}.{$this->project}.org/w&output_format=xml&use_templates=none&text=" . $s ;
return $this->get_xml ( $url ) ;
}
function read_meta_data () {
if( $this->language == 'commons' && $this->project == 'wikimedia' ) return array( 'return' => true );
$this->get_namespaces() ;
$url = "http://meta.wikipedia.org/w/index.php?action=raw&title=CommonsHelper2/Data_" . $this->language . "." . $this->project ;
$lines = explode ( "\n" , file_get_contents ( $url ) ) ;
$h = Array ( 2 => '' , 3 => '' ) ;
foreach ( $lines AS $l ) {
if ( substr ( $l , 0 , 2 ) == '==' ) {
$k = 2 ;
if ( substr ( $l , 0 , 3 ) == '===' ) $k = 3 ;
else $h[3] = '' ;
$l = strtolower ( trim ( str_replace ( '=' , '' , $l ) ) ) ;
$h[$k] = $l ;
if ( $h[3] != '' ) {
if ( $h[2] == 'categories' ) $this->meta_cat[$h[3]] = Array () ;
else if ( $h[2] == 'templates' ) {
$this->meta_tl[$h[3]] = Array () ;
$this->meta_tl['add'] = Array () ;
}
}
continue ;
}
if ( $h[3] == '' ) continue ;
if ( $h[2] == 'categories' ) {
if ( substr ( $l , 0 , 1 ) != '*' ) continue ;
$l = ucfirst ( trim ( str_replace ( '_' , ' ' , substr ( $l , 1 ) ) ) ) ;
$this->meta_cat[$h[3]][$l] = $l ;
// print $h[2] . ':' . $h[3] . ":: " . $this->meta_cat[$h[3]][$l] . "<br/>" ;
} else if ( $h[2] == 'templates' ) {
if ( $h[3] == 'transfer' ) {
if ( substr ( $l , 0 , 1 ) != ';' ) continue ;
$l = explode ( ':' , substr ( $l , 1 ) , 2 ) ;
if ( count ( $l ) != 2 ) continue ;
$tn_local = ucfirst ( trim ( $l[0] ) ) ;
$parts = explode ( '|' , $l[1] ) ;
$tn_commons = ucfirst ( trim ( array_shift ( $parts ) ) ) ;
$a = Array () ;
$add = array();
$a['|'] = $tn_commons ; // Commons template name
foreach ( $parts AS $p ) {
$p_tr = trim( $p );
if( substr( $p_tr, 0, 1 ) == "+" ) {
$p = substr( $p_tr, 1 );
$p = explode( '=' , $p );
if( count( $p ) != 2 ) continue ;
$p_arg = trim( $p[0] );
$p_add = trim( $p[1] );
$add[$p_arg] = $p_add;
} else {
$p = explode ( '=' , $p ) ;
if ( count ( $p ) != 2 ) continue ;
$p_commons = trim ( $p[0] ) ;
$p_local = trim ( $p[1] ) ;
$a[$p_local] = $p_commons ;
}
}
$this->meta_tl[$h[3]][$this->unify_template_name($tn_local)] = $a ;
$this->meta_tl['add'][$this->unify_template_name($tn_local)] = $add;
} else {
if ( substr ( $l , 0 , 1 ) != '*' ) continue ;
$l = ucfirst ( trim ( substr ( $l , 1 ) ) ) ;
$this->meta_tl[$h[3]][$this->unify_template_name($l)] = $l ;
}
} else if ( $h[2] == 'information' ) {
if ( $h[3] == 'template' ) {
if ( substr ( $l , 0 , 1 ) != '*' ) continue ;
$template = trim ( substr ( $l , 1 ) );
$this->meta_info['information']['template'] = $template;
} else if ( $h[3] == 'description' ) {
if ( substr ( $l , 0 , 1 ) != '*' ) continue ;
$description = trim ( substr ( $l , 1 ) );
$this->meta_info['information']['description'] = $description;
} else if ( $h[3] == 'licensing' ) {
if ( substr ( $l , 0 , 1 ) != '*' ) continue ;
$licensing = trim ( substr ( $l , 1 ) );
$this->meta_info['information']['licensing'] = $licensing;
}
}
}
if ( ( count( $this->meta_cat ) < 1 ) && ( count( $this->meta_tl ) < 1 ) ) return array( 'return' => false, 'url' => str_replace( 'action=raw&', '', $url ) );
else if ( ( count( $this->meta_cat ) >= 1 ) && ( count( $this->meta_tl ) >= 1 ) ) return array( 'return' => true, 'url' => str_replace( 'action=raw&', '', $url ) );
}
function strip_attr_quotes ( $attr ) {
if ( substr ( $attr , 0 , 1 ) != '"' && substr ( $attr , 0 , 1 ) != "'" ) return $attr ;
if ( substr ( $attr , -1 , 1 ) != '"' && substr ( $attr , -1 , 1 ) != "'" ) return $attr ;
if ( substr ( $attr , 0 , 1 ) != substr ( $attr , -1 , 1 ) ) return $attr ;
return substr ( $attr , 1 , -1 ) ;
}
function get_namespaces () {
$url = "http://{$this->language}.{$this->project}.org/w/api.php?action=query&meta=siteinfo&siprop=namespaces|namespacealiases&format=php" ;
$d = unserialize ( file_get_contents ( $url ) ) ;
$d = $d['query'] ;
foreach ( $d['namespaces'] AS $n ) {
$id = $n['id'] ;
if ( !isset ( $this->namespaces[$id] ) ) $this->namespaces[$id] = Array () ;
$ns = strtolower ( $n['*'] ) ;
$this->namespaces[$id][$ns] = $ns ;
$ns = strtolower ( $n['canonical'] ) ;
$this->namespaces[$id][$ns] = $ns ;
}
foreach ( $d['namespacealiases'] AS $n ) {
$id = $n['id'] ;
if ( !isset ( $this->namespaces[$id] ) ) $this->namespaces[$id] = Array () ;
$ns = strtolower ( $n['*'] ) ;
$this->namespaces[$id][$ns] = $ns ;
}
}
function unify_template_name ( $t ) {
$t = strtolower ( $t ) ;
$t = str_replace ( '_' , ' ' , $t ) ;
return $t ;
}
function check_template_list ( $tl ) {
foreach ( $tl AS $t ) {
$t = $this->unify_template_name ( $t ) ;
if ( isset ( $this->meta_tl['good'][$t] ) ) $this->seen_good_template = true ;
if ( isset ( $this->meta_tl['bad'][$t] ) ) $this->seen_bad_template = true ;
}
}
function check_category_list ( $cl ) {
foreach ( $cl AS $c ) {
if ( !isset ( $this->meta_cat['bad'][$c] ) ) continue ;
$this->seen_bad_category = true ;
}
}
function iterate_tree ( &$xml , $name , $fn ) {
foreach ( $xml AS $k => $x ) {
if ( isset ( $x['s'] ) ) $this->iterate_tree ( $xml[$k]['s'] , $name , $fn ) ;
}
foreach ( $xml AS $k => $x ) {
if ( $x['?'] != 'x' ) continue ;
if ( $x['n'] != $name ) continue ;
$this->$fn ( $xml[$k] ) ;
}
}
function iterate_link ( &$xml ) {
/* print "<pre>" ;
print_r ( $this->namespaces ) ;
print "</pre>" ;
print "<hr/>" ;*/
global $remove_existing_categories ;
if ( isset ( $xml['a']['type'] ) and $this->strip_attr_quotes($xml['a']['type']) == 'external' ) return ; // Don't touch external links
if ( $remove_existing_categories ) {
$x2w = new XML2wiki () ;
$target = $x2w->convert ( $xml['s'][0]['s'] ) ;
$n = explode ( ':' , $target , 2 ) ;
if ( count ( $n ) == 2 and isset ( $this->namespaces[14] ) ) {
$ns = strtolower ( $n[0] ) ;
if ( isset ( $this->namespaces[14][$ns] ) ) {
$xml = Array ( '?' => 't' , 't' => '' ) ;
return ;
}
}
}
$x2w = new XML2wiki () ;
$target = strtolower ( $x2w->convert ( $xml['s'][0]['s'] ) ) ;
$lp = ':' . $this->language . ':' ;
if ( $this->project != 'wikipedia' ) $lp = ':' . $this->project . $lp ;
$language_prefix = array ( '?' => 't' , 't' => $lp ) ;
array_unshift ( $xml['s'][0]['s'] , $language_prefix ) ;
}
function iterate_template ( &$xml ) {
global $ii_local, $transfer_user;
$in_list = false;
if ( !isset ( $xml['s'] ) ) return ;
$argcnt = 0 ;
$is_information = false;
foreach ( $xml['s'] AS $k => $x ) {
if ( $x['n'] == 'TARGET' ) {
$tn = $x['s'][0]['t'] ;
if ( $x['n'] == 'TARGET' && isset ( $this->meta_tl['transfer'][$tn]['|'] ) && $this->meta_tl['transfer'][$tn]['|'] == "Information" ) {
$is_information = true;
} else {
$is_information = false;
}
// print "!$tn<br/>" ;
if ( isset ( $this->meta_tl['bad'][$this->unify_template_name($tn)] ) ) {
$in_list = true;
$this->errors[] = "Template \"$tn\" is present in original description, preventing transfer to Commons." ;
$this->seen_bad_template = true ;
return ;
} else if ( isset ( $this->meta_tl['good'][$this->unify_template_name($tn)] ) ) {
$in_list = true;
$this->seen_good_template = true ;
} else if ( isset ( $this->meta_tl['remove'][$this->unify_template_name($tn)] ) ) {
$in_list = true;
$xml = array ( '?' => 't' , 't' => '' ) ; // Replacing template with empty text
return ;
}
if ( isset ( $this->meta_tl['transfer'][$this->unify_template_name($tn)] ) ) {
$in_list = true;
$newname = $this->meta_tl['transfer'][$this->unify_template_name($tn)]['|'] ;
$xml['s'][$k]['s'][0]['t'] = $newname ;
}
if( isset( $this->meta_tl['add'][$this->unify_template_name($tn)] ) ) {
$info_data = $ii_local->get_information_data();
foreach( $this->meta_tl['add'][$this->unify_template_name($tn)] AS $add_name => $add_value ) {
$add_value = str_replace( '%AUTHOR%', $info_data['user_wp'], $add_value );
$add_value = str_replace( '%TRANSFERUSER%', $transfer_user, $add_value );
$xml['s'][] = Array(
"?" => "x",
"n" => "ARG",
"a" => Array ( 'name' => $add_name ),
"sc" => false,
"s" => Array( Array ( "?" => "t", "t" => $add_value ) )
);
}
continue;
}
if( !$in_list ) return ; // This template is in no list, and will be kept as-is
} else if ( $x['n'] == 'ARG' ) {
if ( count ( $x['a'] ) == 0 ) $argname = ++$argcnt ;
else $argname = $this->strip_attr_quotes ( $x['a']['name'] ) ;
// print "Argument : $argname<br/>" ;
if ( !isset ( $this->meta_tl['transfer'][$tn][$argname] ) ) continue ;
$newname = $this->meta_tl['transfer'][$tn][$argname] ;
$translate = false ;
if ( substr ( $newname , 0 , 1 ) == '@' ) {
$translate = true ;
$newname = trim ( substr ( $newname , 1 ) ) ;
}
$xml['s'][$k]['a']['name'] = "'$newname'" ;
if ( $translate ) {
$ns = Array ( Array (
'?' => 'x' ,
'n' => 'TEMPLATE' ,
'a' => Array () ,
'sc' => false ,
's' => Array (
Array (
'?' => 'x' ,
'n' => 'TARGET' ,
'a' => Array () ,
'sc' => false ,
's' => Array ( Array ( '?' => 't' , 't' => $this->language ) )
) ,
Array (
'?' => 'x' ,
'n' => 'ARG' ,
'a' => Array () ,
'sc' => false ,
's' => $xml['s'][$k]['s']
)
)
) ) ;
$x2w = new XML2wiki () ;
$wiki = trim ( $x2w->convert ( $xml['s'][$k]['s'] ) ) ;
// FIXME don't do that if parameter is empty
if ( $wiki != '' ) $xml['s'][$k]['s'] = $ns ;
}
if ( $is_information ) {
$info_template_arg = $xml['s'][$k];
$info_template_arg_name = $info_template_arg['a']['name'];
$info_template_arg_name = str_replace( "'", "", $info_template_arg_name );
$info_template_data = $ii_local->get_information_data();
$tz = date_default_timezone_get();
date_default_timezone_set('UTC');
$date = 'Uploaded on Commons at '.date( 'Y-m-d H:i:s' ).' (UTC)';
date_default_timezone_set($tz);
$orignal_date = 'Originally uploaded at '.$info_template_data['date'];
$orignal_user = 'Originally uploaded by ';
$transfer = 'Transferred by ';
$text = "";
if ( $info_template_arg_name == "source" OR $info_template_arg_name == "Source" ) {
$text = ' (Originally uploaded on '.$info_template_data['lang'].'.'.$info_template_data['project'].')';
$xml['s'][$k]['s'][] = Array( "?" => "t",
"t" => $text );
} elseif ( $info_template_arg_name == "date" OR $info_template_arg_name == "Date" ) {
$text = $text.' ('.$date.'/'.$orignal_date.')';
$xml['s'][$k]['s'][] = Array( "?" => "t",
"t" => $text );
} elseif ( $info_template_arg_name == "author" OR $info_template_arg_name == "Author" ) {
$text = ' ('.$transfer;
$xml['s'][$k]['s'][] = Array( "?" => "t",
"t" => $text );
$xml['s'][$k]['s'][] = Array( "?" => "x",
"n" => "TEMPLATE",
"a" => Array ( ),
"sc" => false,
"s" => Array (
Array(
"?" => "x",
"n" => "TARGET",
"a" => Array ( ),
"sc" => false,
"s" => Array( Array ( "?" => "t", "t" => "subst:CommonsHelper2/Link" ) )
),
Array(
"?" => "x",
"n" => "ARG",
"a" => Array ( ),
"sc" => false,
"s" => Array( Array ( "?" => "t", "t" => "User:".$transfer_user ) )
),
Array(
"?" => "x",
"n" => "ARG",
"a" => Array ( ),
"sc" => false,
"s" => Array( Array ( "?" => "t", "t" => $transfer_user ) )
)
)
);
$text = '/'.$orignal_user;
$xml['s'][$k]['s'][] = Array( "?" => "t", "t" => $text );
$xml['s'][$k]['s'][] = Array( "?" => "x",
"n" => "LINK",
"sc" => false,
"s" => Array (
Array(
"?" => "x",
"n" => "TARGET",
"a" => Array ( ),
"sc" => false,
"s" => Array( Array ( "?" => "t", "t" => $info_template_data['user_wp'] ) )
),
Array(
"?" => "x",
"n" => "PART",
"a" => Array ( ),
"sc" => false,
"s" => Array( Array ( "?" => "t", "t" => $info_template_data['user_wp'] ) )
)
)
);
$text = ')';
$xml['s'][$k]['s'][] = Array( "?" => "t", "t" => $text );
}
}
// print "Translating argument $argname into $newname.<br/>" ;
} else print "BAD NAME : " . $x['n'] . "<br/>" ;
}
}
public function get_information() {
return array( 'template' => $this->meta_info['information']['template'], 'description' => $this->meta_info['information']['description'] );
}
}
?>