[ Index ]

PHP Cross Reference of Textpattern 4.0.8

title

Body

[close]

/textpattern/include/ -> txp_tag.php (source)

   1  <?php
   2  
   3  /*
   4      This is Textpattern
   5  
   6      Copyright 2005 by Dean Allen
   7      www.textpattern.com
   8      All rights reserved
   9  
  10      Use of this software indicates acceptance of the Textpattern license agreement
  11  
  12  $HeadURL: https://textpattern.googlecode.com/svn/releases/4.0.8/source/textpattern/include/txp_tag.php $
  13  $LastChangedRevision: 2868 $
  14  
  15  */
  16  
  17  if (!defined('txpinterface'))
  18  {
  19      die('txpinterface is undefined.');
  20  }
  21  
  22  // -------------------------------------------------------------
  23  
  24  ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  25  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  26  <head>
  27      <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  28      <title>Txp &#8250; <?php echo gTxt('build'); ?></title>
  29      <link rel="stylesheet" type="text/css" href="textpattern.css" />
  30  </head>
  31  <body id="tag-event">
  32  <?php
  33  
  34      $tag_name = gps('tag_name');
  35  
  36      $functname = 'tag_'.$tag_name;
  37  
  38      if (function_exists($functname))
  39      {
  40          $endform = n.tr(
  41              td().
  42              td(
  43                  fInput('submit', '', gTxt('build'), 'smallerbox')
  44              )
  45          ).
  46          n.endTable().
  47          n.eInput('tag').
  48          n.sInput('build').
  49          n.hInput('tag_name', $tag_name);
  50  
  51          echo $functname($tag_name);
  52      }
  53  
  54  ?>
  55  
  56  </body>
  57  </html>
  58  <?php
  59  
  60  /*
  61  
  62  begin generic functions
  63  
  64  */
  65  
  66  // -------------------------------------------------------------
  67  
  68  	function tagRow($label, $thing)
  69      {
  70          return n.n.tr(
  71              n.fLabelCell($label).
  72              n.td($thing)
  73          );
  74      }
  75  
  76  // -------------------------------------------------------------
  77  
  78      function tb($tag, $atts_list = array(), $thing = '')
  79      {
  80          $atts = array();
  81  
  82          foreach ($atts_list as $att => $val)
  83          {
  84              if ($val or $val === '0')
  85              {
  86                  $atts[] = ' '.$att.'="'.$val.'"';
  87              }
  88          }
  89  
  90          $atts = ($atts) ? join('', $atts) : '';
  91  
  92          return !empty($thing) ?
  93              '<txp:'.$tag.$atts.'>'.$thing.'</txp:'.$tag.'>' :
  94              '<txp:'.$tag.$atts.' />';
  95      }
  96  
  97  // -------------------------------------------------------------
  98  
  99  	function tbd($tag, $thing)
 100      {
 101          return '<txp:'.$tag.'>'.$thing.'</txp:'.$tag.'>';
 102      }
 103  
 104  // -------------------------------------------------------------
 105  
 106  	function tdb($thing)
 107      {
 108          return n.graf(text_area('tag', '100', '300', $thing), ' id="tagbuilder-output"');
 109      }
 110  
 111  //--------------------------------------------------------------
 112  
 113  	function key_input($name, $var)
 114      {
 115          return '<textarea name="'.$name.'" style="width: 120px; height: 50px;">'.$var.'</textarea>';
 116      }
 117  
 118  //--------------------------------------------------------------
 119  
 120  	function input_id($id)
 121      {
 122          return fInput('text', 'id', $id, 'edit', '', '', 6);
 123      }
 124  
 125  //--------------------------------------------------------------
 126  
 127  	function time_pop($time)
 128      {
 129          $vals = array(
 130              'past'   => gTxt('time_past'),
 131              'future' => gTxt('time_future'),
 132              'any'    => gTxt('time_any')
 133          );
 134  
 135          return ' '.selectInput('time', $vals, $time, true);
 136      }
 137  
 138  //--------------------------------------------------------------
 139  
 140  	function input_limit($limit)
 141      {
 142          return fInput('text', 'limit', $limit, 'edit', '', '', 2);
 143      }
 144  
 145  //--------------------------------------------------------------
 146  
 147  	function input_offset($offset)
 148      {
 149          return fInput('text', 'offset', $offset, 'edit', '', '', 2);
 150      }
 151  
 152  //--------------------------------------------------------------
 153  
 154  	function input_tag($name, $val)
 155      {
 156          return fInput('text', $name, $val, 'edit', '', '', 6);
 157      }
 158  
 159  //--------------------------------------------------------------
 160  
 161  	function yesno_pop($select_name, $val) {
 162          $vals = array(
 163              1 => gTxt('yes'),
 164              0 => gTxt('no'),
 165          );
 166  
 167          if (is_numeric($val)) {
 168              $val = (int) $val;
 169          }
 170  
 171          return ' '.selectInput($select_name, $vals, $val, true, '', '', true);
 172      }
 173  
 174  //--------------------------------------------------------------
 175  
 176  	function status_pop($val)
 177      {
 178          $vals = array(
 179              4 => gTxt('live'),
 180              5 => gTxt('sticky'),
 181              3 => gTxt('pending'),
 182              1 => gTxt('draft'),
 183              2 => gTxt('hidden'),
 184          );
 185  
 186          return ' '.selectInput('status', $vals, $val, true);
 187      }
 188  
 189  //--------------------------------------------------------------
 190  
 191  	function section_pop($select_name, $val)
 192      {
 193          $vals = array();
 194  
 195          $rs = safe_rows_start('name, title', 'txp_section', "name != 'default' order by name");
 196  
 197          if ($rs and numRows($rs) > 0)
 198          {
 199              while ($a = nextRow($rs))
 200              {
 201                  extract($a);
 202  
 203                  $vals[$name] = $title;
 204              }
 205  
 206              return ' '.selectInput($select_name, $vals, $val, true);
 207          }
 208  
 209          return gTxt('no_sections_available');
 210      }
 211  
 212  //--------------------------------------------------------------
 213  
 214  	function type_pop($val)
 215      {
 216          $vals = array(
 217              'article' => gTxt('article'),
 218              'link'        => gTxt('link'),
 219              'image'        => gTxt('image'),
 220              'file'        => gTxt('file'),
 221          );
 222  
 223          return ' '.selectInput('type', $vals, $val, true);
 224      }
 225  
 226  //--------------------------------------------------------------
 227  
 228  	function feed_flavor_pop($val)
 229      {
 230          $vals = array(
 231              'atom' => 'Atom 1.0',
 232              'rss'     => 'RSS 2.0'
 233          );
 234  
 235          return ' '.selectInput('flavor', $vals, $val, true);
 236      }
 237  
 238  //--------------------------------------------------------------
 239  
 240  	function feed_format_pop($val)
 241      {
 242          $vals = array(
 243              'a'         => '<a href...',
 244              'link' => '<link rel...',
 245          );
 246  
 247          return ' '.selectInput('format', $vals, $val, true);
 248      }
 249  
 250  //--------------------------------------------------------------
 251  
 252  	function article_category_pop($val)
 253      {
 254          $vals = getTree('root','article');
 255  
 256          if ($vals)
 257          {
 258              return ' '.treeSelectInput('category', $vals, $val);
 259          }
 260  
 261          return gTxt('no_categories_available');
 262      }
 263  
 264  //--------------------------------------------------------------
 265  
 266  	function link_category_pop($val)
 267      {
 268          $vals = getTree('root','link');
 269  
 270          if ($vals)
 271          {
 272              return ' '.treeSelectInput('category', $vals, $val);
 273          }
 274  
 275          return gTxt('no_categories_available');
 276      }
 277  
 278  //--------------------------------------------------------------
 279  
 280  	function file_category_pop($val)
 281      {
 282          $vals = getTree('root','file');
 283  
 284          if ($vals)
 285          {
 286              return ' '.treeSelectInput('category', $vals, $val);
 287          }
 288  
 289          return gTxt('no_categories_available');
 290      }
 291  
 292  //--------------------------------------------------------------
 293  
 294  	function match_pop($val)
 295      {
 296          $vals = array(
 297              'Category1,Category2'    => gTxt('category1').' '.gTxt('and').' '.gTxt('category2'),
 298              'Category1'                        => gTxt('category1'),
 299              'Category2'                        => gTxt('category2')
 300          );
 301  
 302          return ' '.selectInput('match', $vals, $val, true);
 303      }
 304  
 305  //--------------------------------------------------------------
 306  
 307  	function author_pop($val)
 308      {
 309          $vals = array();
 310  
 311          $rs = safe_rows_start('name', 'txp_users', '1 = 1 order by name');
 312  
 313          if ($rs)
 314          {
 315              while ($a = nextRow($rs))
 316              {
 317                  extract($a);
 318  
 319                  $vals[$name] = $name;
 320              }
 321  
 322              return ' '.selectInput('author', $vals, $val, true);
 323          }
 324      }
 325  
 326  //--------------------------------------------------------------
 327  
 328  	function sort_pop($val)
 329      {
 330          $asc = ' ('.gTxt('ascending').')';
 331          $desc = ' ('.gTxt('descending').')';
 332  
 333          $vals = array(
 334              'Title asc'             => gTxt('tag_title').$asc,
 335              'Title desc'         => gTxt('tag_title').$desc,
 336              'Posted asc'         => gTxt('tag_posted').$asc,
 337              'Posted desc'         => gTxt('tag_posted').$desc,
 338              'LastMod asc'         => gTxt('last_modification').$asc,
 339              'LastMod desc'     => gTxt('last_modification').$desc,
 340              'Section asc'         => gTxt('section').$asc,
 341              'Section desc'     => gTxt('section').$desc,
 342              'Category1 asc'     => gTxt('category1').$asc,
 343              'Category1 desc' => gTxt('category1').$desc,
 344              'Category2 asc'     => gTxt('category2').$asc,
 345              'Category2 desc' => gTxt('category2').$desc,
 346              'rand()'                 => gTxt('random')
 347          );
 348  
 349          return ' '.selectInput('sort', $vals, $val, true);
 350      }
 351  
 352  //--------------------------------------------------------------
 353  
 354  	function discuss_sort_pop($val)
 355      {
 356          $asc = ' ('.gTxt('ascending').')';
 357          $desc = ' ('.gTxt('descending').')';
 358  
 359          $vals = array(
 360              'posted asc'    => gTxt('posted').$asc,
 361              'posted desc'    => gTxt('posted').$desc,
 362          );
 363  
 364          return ' '.selectInput('sort', $vals, $val, true);
 365      }
 366  
 367  	function list_sort_pop($val)
 368      {
 369          $asc = ' ('.gTxt('ascending').')';
 370          $desc = ' ('.gTxt('descending').')';
 371  
 372          $vals = array(
 373              'title asc'        => gTxt('tag_title').$asc,
 374              'title desc'    => gTxt('tag_title').$desc,
 375              'name asc'        => gTxt('name').$asc,
 376              'name desc'        => gTxt('name').$desc,
 377          );
 378  
 379          return ' '.selectInput('sort', $vals, $val, true);
 380      }
 381  
 382  //--------------------------------------------------------------
 383  
 384  	function pgonly_pop($val)
 385      {
 386          $vals = array(
 387              '1' => gTxt('yes'),
 388              '0' => gTxt('no')
 389          );
 390  
 391          return ' '.selectInput('pgonly', $vals, $val, true);
 392      }
 393  
 394  //--------------------------------------------------------------
 395  
 396  	function form_pop($select_name, $type = '', $val)
 397      {
 398          $vals = array();
 399  
 400          $type = ($type) ? "type = '".doSlash($type)."'" : '1 = 1';
 401  
 402          $rs = safe_rows_start('name', 'txp_form', "$type order by name");
 403  
 404          if ($rs and numRows($rs) > 0)
 405          {
 406              while ($a = nextRow($rs))
 407              {
 408                  extract($a);
 409  
 410                  $vals[$name] = $name;
 411              }
 412  
 413              return ' '.selectInput($select_name, $vals, $val, true);
 414          }
 415  
 416          return gTxt('no_forms_available');
 417      }
 418  
 419  //--------------------------------------------------------------
 420  
 421  	function css_pop($val)
 422      {
 423          $vals = array();
 424  
 425          $rs = safe_rows_start('name', 'txp_css', "1 = 1 order by name");
 426  
 427          if ($rs)
 428          {
 429              while ($a = nextRow($rs))
 430              {
 431                  extract($a);
 432  
 433                  $vals[$name] = $name;
 434              }
 435  
 436              return ' '.selectInput('n', $vals, $val, true);
 437          }
 438  
 439          return false;
 440      }
 441  
 442  //--------------------------------------------------------------
 443  
 444  	function css_format_pop($val)
 445      {
 446          $vals = array(
 447              'link' => '<link rel...',
 448              'url'     => 'css.php?...'
 449          );
 450  
 451          return ' '.selectInput('format', $vals, $val, true);
 452      }
 453  
 454  //--------------------------------------------------------------
 455  
 456  	function escape_pop($val)
 457      {
 458          $vals = array(
 459              'html' => 'html',
 460          );
 461  
 462          return ' '.selectInput('escape', $vals, $val, true);
 463      }
 464  
 465  //--------------------------------------------------------------
 466  
 467  /*
 468  
 469  begin tag builder functions
 470  
 471  */
 472  
 473  // -------------------------------------------------------------
 474  
 475  	function tag_article()
 476      {
 477          global $step, $endform, $tag_name;
 478  
 479          $atts = gpsa(array(
 480              'allowoverride',
 481              'form',
 482              'limit',
 483              'listform',
 484              'offset',
 485              'pageby',
 486              'pgonly',
 487              'searchall',
 488              'searchsticky',
 489              'sort',
 490              'status',
 491              'time'
 492          ));
 493  
 494          extract($atts);
 495  
 496          $out = form(
 497              startTable('tagbuilder').
 498  
 499              tr(
 500                  tdcs(
 501                      hed(gTxt('tag_'.$tag_name), 3)
 502                  , 2)
 503              ).
 504  
 505              tagRow('status',
 506                  status_pop($status)).
 507  
 508              tagRow('time',
 509                  time_pop($time)).
 510  
 511              tagRow('searchall',
 512                  yesno_pop('searchall', $searchall)).
 513  
 514              tagRow('searchsticky',
 515                  yesno_pop('searchsticky', $searchsticky)).
 516  
 517              tagRow('limit',
 518                  input_limit($limit)).
 519  
 520              tagRow('offset',
 521                  input_offset($offset)).
 522  
 523              tagRow('pageby',
 524                  fInput('text', 'pageby', $pageby, 'edit', '', '', 2)).
 525  
 526              tagRow('sort',
 527                  sort_pop($sort)).
 528  
 529              tagRow('pgonly',
 530                  pgonly_pop($pgonly)).
 531  
 532              tagRow('allowoverride',
 533                  yesno_pop('allowoverride', $allowoverride)).
 534  
 535              tagRow('form',
 536                  form_pop('form', 'article', $form)).
 537  
 538              tagRow('listform',
 539                  form_pop('listform', 'article', $listform)).
 540  
 541              $endform
 542          );
 543  
 544          if ($step == 'build')
 545          {
 546              $out .= tdb(tb($tag_name, $atts));
 547          }
 548  
 549          return $out;
 550      }
 551  
 552  // -------------------------------------------------------------
 553  
 554  	function tag_article_custom()
 555      {
 556          global $step, $endform, $tag_name;
 557  
 558          $atts = gpsa(array(
 559              'allowoverride',
 560              'author',
 561              'category',
 562              'excerpted',
 563              'form',
 564              'id',
 565              'keywords',
 566              'limit',
 567              'listform',
 568              'month',
 569              'offset',
 570              'pgonly',
 571              'section',
 572              'sort',
 573              'status',
 574              'time'
 575          ));
 576  
 577          extract($atts);
 578  
 579          $out = form(
 580              startTable('tagbuilder').
 581  
 582              tr(
 583                  tdcs(
 584                      hed(gTxt('tag_'.$tag_name), 3)
 585                  , 2)
 586              ).
 587  
 588              tagRow('id',
 589                  input_id($id)).
 590  
 591              tagRow('status',
 592                  status_pop($status)).
 593  
 594              tagRow('section',
 595                  section_pop('section', $section)).
 596  
 597              tagRow('category',
 598                  article_category_pop($category)).
 599  
 600              tagRow('time',
 601                  time_pop($time)).
 602  
 603              tagRow('month',
 604                  fInput('text', 'month', $month, 'edit', '', '', 7). ' ('.gTxt('yyyy-mm').')') .
 605  
 606              tagRow('keywords',
 607                  key_input('keywords', $keywords)).
 608  
 609              tagRow('has_excerpt',
 610                  yesno_pop('excerpted', $excerpted)).
 611  
 612              tagRow('author',
 613                  author_pop($author)).
 614  
 615              tagRow('sort',
 616                  sort_pop($sort)).
 617  
 618              tagRow('limit',
 619                  input_limit($limit)).
 620  
 621              tagRow('offset',
 622                  input_offset($offset)).
 623  
 624              tagRow('pgonly',
 625                  pgonly_pop($pgonly)).
 626  
 627              tagRow('allowoverride',
 628                  yesno_pop('allowoverride', $allowoverride)).
 629  
 630              tagRow('form',
 631                  form_pop('form', 'article', $form)).
 632              $endform
 633          );
 634  
 635          if ($step == 'build')
 636          {
 637              $out .= tdb(tb($tag_name, $atts));
 638          }
 639  
 640          return $out;
 641      }
 642  
 643  // -------------------------------------------------------------
 644  
 645  	function tag_email()
 646      {
 647          global $step, $endform, $tag_name;
 648  
 649          $atts = gpsa(array(
 650              'email',
 651              'linktext',
 652              'title'
 653          ));
 654  
 655          extract($atts);
 656  
 657          $out = form(
 658              startTable('tagbuilder').
 659  
 660              tr(
 661                  tdcs(
 662                      hed(gTxt('tag_'.$tag_name), 3)
 663                  , 2)
 664              ).
 665  
 666              tagRow('email_address',
 667                  fInput('text', 'email', $email, 'edit', '', '', 20)).
 668  
 669              tagRow('tooltip',
 670                  fInput('text', 'title', $title, 'edit', '', '', 20)).
 671  
 672              tagRow('link_text',
 673                  fInput('text', 'linktext', $linktext, 'edit', '', '', 20)).
 674  
 675              $endform
 676          );
 677  
 678          if ($step == 'build')
 679          {
 680              $out .= tdb(tb($tag_name, $atts));
 681          }
 682  
 683          return $out;
 684      }
 685  
 686  // -------------------------------------------------------------
 687  
 688  	function tag_page_title()
 689      {
 690          global $step, $endform, $tag_name;
 691  
 692          $atts = gpsa(array('separator'));
 693  
 694          extract($atts);
 695  
 696          $out = form(
 697              startTable('tagbuilder').
 698  
 699              tr(
 700                  tdcs(
 701                      hed(gTxt('tag_'.$tag_name), 3)
 702                  , 2)
 703              ).
 704  
 705              tagRow('title_separator',
 706                  fInput('text', 'separator', $separator, 'edit', '', '', 4)).
 707  
 708              $endform
 709          );
 710  
 711          if ($step == 'build')
 712          {
 713              $out .= tdb(tb($tag_name, $atts));
 714          }
 715  
 716          return $out;
 717      }
 718  
 719  // -------------------------------------------------------------
 720  
 721  	function tag_linklist()
 722      {
 723          global $step, $endform, $tag_name;
 724  
 725          $atts = gpsa(array(
 726              'break',
 727              'category',
 728              'form',
 729              'label',
 730              'labeltag',
 731              'limit',
 732              'sort',
 733              'wraptag',
 734          ));
 735  
 736          $asc = ' ('.gTxt('ascending').')';
 737          $desc = ' ('.gTxt('descending').')';
 738  
 739          $sorts = array(
 740              'linksort asc'    => gTxt('name').$asc,
 741              'linksort desc' => gTxt('name').$desc,
 742              'category asc'    => gTxt('category').$asc,
 743              'category desc' => gTxt('category').$desc,
 744              'date asc'            => gTxt('date').$asc,
 745              'date desc'            => gTxt('date').$desc,
 746              'rand()'                => gTxt('random')
 747          );
 748  
 749          extract($atts);
 750  
 751          $out = form(
 752              startTable('tagbuilder').
 753  
 754              tr(
 755                  tdcs(
 756                      hed(gTxt('tag_'.$tag_name), 3)
 757                  , 2)
 758              ).
 759  
 760              tagRow('category',
 761                  link_category_pop($category)).
 762  
 763              tagRow('limit',
 764                  input_limit($limit)).
 765  
 766              tagRow('sort',
 767                  ' '.selectInput('sort', $sorts, $sort)).
 768  
 769              tagRow('label',
 770                  fInput('text', 'label', $label, 'edit', '', '', 20)).
 771  
 772              tagRow('labeltag',
 773                  input_tag('labeltag', $labeltag)).
 774  
 775              tagRow('form',
 776                  form_pop('form', 'link', $form)).
 777  
 778              tagRow('wraptag',
 779                  input_tag('wraptag', $wraptag)).
 780  
 781              tagRow('break',
 782                  input_tag('break', $break)).
 783  
 784              $endform
 785          );
 786  
 787          if ($step == 'build')
 788          {
 789              $out .= tdb(tb($tag_name, $atts));
 790          }
 791  
 792          echo $out;
 793      }
 794  
 795  // -------------------------------------------------------------
 796  
 797  	function tag_section_list()
 798      {
 799          global $step, $endform, $tag_name;
 800  
 801          $atts = gpsa(array(
 802              'active_class',
 803              'break',
 804              'class',
 805              'default_title',
 806              'exclude',
 807              'include_default',
 808              'label',
 809              'labeltag',
 810              'sections',
 811              'sort',
 812              'wraptag'
 813          ));
 814  
 815          extract($atts);
 816  
 817          $out = form(
 818              startTable('tagbuilder').
 819  
 820              tr(
 821                  tdcs(
 822                      hed(gTxt('tag_'.$tag_name), 3)
 823                  , 2)
 824              ).
 825  
 826              tagRow('include_default',
 827                  yesno_pop('include_default', $include_default)).
 828  
 829              tagRow('sort',
 830                  list_sort_pop($sort)).
 831  
 832              tagRow('default_title',
 833                  fInput('text', 'default_title', $default_title, 'edit', '', '', 20)).
 834  
 835              tagRow('sections',
 836                  fInput('text', 'sections', $sections, 'edit', '', '', 20)).
 837  
 838              tagRow('exclude',
 839                  fInput('text', 'exclude', $exclude, 'edit', '', '', 20)).
 840  
 841              tagRow('label',
 842                  fInput('text', 'label', $label, 'edit', '', '', 20)).
 843  
 844              tagRow('labeltag',
 845                  input_tag('labeltag', $labeltag)).
 846  
 847              tagRow('wraptag',
 848                  input_tag('wraptag', $wraptag)).
 849  
 850              tagRow('class',
 851                  fInput('text', 'class', $class, 'edit', '', '', 14)).
 852  
 853              tagRow('active_class',
 854                  fInput('text', 'active_class', $active_class, 'edit', '', '', 14)).
 855  
 856              tagRow('break',
 857                  input_tag('break', $break)).
 858  
 859              $endform
 860          );
 861  
 862          if ($step == 'build')
 863          {
 864              $out .= tdb(tb($tag_name, $atts));
 865          }
 866  
 867          echo $out;
 868  
 869      }
 870  
 871  // -------------------------------------------------------------
 872  
 873  	function tag_category_list()
 874      {
 875          global $step, $endform, $tag_name;
 876  
 877          $atts = gpsa(array(
 878              'active_class',
 879              'break',
 880              'categories',
 881              'class',
 882              'exclude',
 883              'label',
 884              'labeltag',
 885              'parent',
 886              'section',
 887              'sort',
 888              'this_section',
 889              'type',
 890              'wraptag',
 891          ));
 892  
 893          extract($atts);
 894  
 895          $out = form(
 896              startTable('tagbuilder').
 897  
 898              tr(
 899                  tdcs(
 900                      hed(gTxt('tag_'.$tag_name), 3)
 901                  , 2)
 902              ).
 903  
 904              tagRow('type',
 905                  type_pop($type)).
 906  
 907              tagRow('parent',
 908                  fInput('text', 'parent', $parent, 'edit', '', '', 20)).
 909  
 910              tagRow('categories',
 911                  fInput('text', 'categories', $categories, 'edit', '', '', 20)).
 912  
 913              tagRow('exclude',
 914                  fInput('text', 'exclude', $exclude, 'edit', '', '', 20)).
 915  
 916              tagRow('this_section',
 917                  yesno_pop('this_section', $this_section)).
 918  
 919              tagRow('category_list_section',
 920                  section_pop('section', $section)).
 921  
 922              tagRow('sort',
 923                  list_sort_pop($sort)).
 924  
 925              tagRow('label',
 926                  fInput('text', 'label', ($label ? $label : gTxt('categories')), 'edit', '', '', 20)).
 927  
 928              tagRow('labeltag',
 929                  input_tag('labeltag', $labeltag)).
 930  
 931              tagRow('wraptag',
 932                  input_tag('wraptag', $wraptag)).
 933  
 934              tagRow('class',
 935                  fInput('text', 'class', $class, 'edit', '', '', 14)).
 936  
 937              tagRow('active_class',
 938                  fInput('text', 'active_class', $active_class, 'edit', '', '', 14)).
 939  
 940              tagRow('break',
 941                  input_tag('break', $break)).
 942  
 943              $endform
 944          );
 945  
 946          if ($step == 'build')
 947          {
 948              $out .= tdb(tb($tag_name, $atts));
 949          }
 950  
 951          echo $out;
 952      }
 953  
 954  // -------------------------------------------------------------
 955  
 956  	function tag_recent_articles()
 957      {
 958          global $step, $endform, $tag_name;
 959  
 960          $atts = gpsa(array(
 961              'break',
 962              'category',
 963              'label',
 964              'labeltag',
 965              'limit',
 966              'section',
 967              'sort',
 968              'wraptag',
 969          ));
 970  
 971          extract($atts);
 972  
 973          $out = form(
 974              startTable('tagbuilder').
 975  
 976              tr(
 977                  tdcs(
 978                      hed(gTxt('tag_'.$tag_name), 3)
 979                  , 2)
 980              ).
 981  
 982              tagRow('section',
 983                  section_pop('section', $section)).
 984  
 985              tagRow('category',
 986                  article_category_pop($category)).
 987  
 988              tagRow('sort',
 989                  sort_pop($sort)).
 990  
 991              tagRow('limit',
 992                  fInput('text', 'limit', $limit, 'edit', '', '', 2)).
 993  
 994              tagRow('label',
 995                  fInput('text', 'label', ($label ? $label : gTxt('recent_articles')), 'edit', '', '', 20)).
 996  
 997              tagRow('labeltag',
 998                  input_tag('labeltag', $labeltag)).
 999  
1000              tagRow('wraptag',
1001                  input_tag('wraptag', $wraptag)).
1002  
1003              tagRow('break',
1004                  input_tag('break', $break)).
1005  
1006              $endform
1007          );
1008  
1009          if ($step == 'build')
1010          {
1011              $out .= tdb(tb($tag_name, $atts));
1012          }
1013  
1014          return $out;
1015      }
1016  
1017  // -------------------------------------------------------------
1018  
1019  	function tag_related_articles()
1020      {
1021          global $step, $endform, $tag_name;
1022  
1023          $atts = gpsa(array(
1024              'break',
1025              'class',
1026              'label',
1027              'labeltag',
1028              'limit',
1029              'match',
1030              'section',
1031              'sort',
1032              'wraptag',
1033          ));
1034  
1035          extract($atts);
1036  
1037          $label = (!$label) ? 'Related Articles' : $label;
1038  
1039          $out = form(
1040              startTable('tagbuilder').
1041  
1042              tr(
1043                  tdcs(
1044                      hed(gTxt('tag_'.$tag_name), 3)
1045                  , 2)
1046              ).
1047  
1048              tagRow('section',
1049                  section_pop('section', $section)).
1050  
1051              tagRow('match',
1052                  match_pop($match)).
1053  
1054              tagRow('sort',
1055                  sort_pop($sort)).
1056  
1057              tagRow('limit',
1058                  fInput('text', 'limit', $limit, 'edit', '', '', 2)).
1059  
1060              tagRow('label',
1061                  fInput('text', 'label', $label, 'edit', '', '', 20)).
1062  
1063              tagRow('labeltag',
1064                  input_tag('labeltag', $labeltag)).
1065  
1066              tagRow('wraptag',
1067                  input_tag('wraptag', $wraptag)).
1068  
1069              tagRow('class',
1070                  fInput('text', 'class', $class, 'edit', '', '', 20)).
1071  
1072              tagRow('break',
1073                  input_tag('break', $break)).
1074  
1075              $endform
1076          );
1077  
1078          if ($step == 'build')
1079          {
1080              $out .= tdb(tb($tag_name, $atts));
1081          }
1082  
1083          return $out;
1084      }
1085  
1086  // -------------------------------------------------------------
1087  
1088  	function tag_recent_comments()
1089      {
1090          global $step, $endform, $tag_name;
1091  
1092          $atts = gpsa(array(
1093              'break',
1094              'class',
1095              'label',
1096              'labeltag',
1097              'limit',
1098              'sort',
1099              'wraptag',
1100          ));
1101  
1102          extract($atts);
1103  
1104          $out = form(
1105              startTable('tagbuilder').
1106  
1107              tr(
1108                  tdcs(
1109                      hed(gTxt('tag_'.$tag_name), 3)
1110                  , 2)
1111              ).
1112  
1113              tagRow('sort',
1114                  discuss_sort_pop($sort)).
1115  
1116              tagRow('limit',
1117                  fInput('text', 'limit', $limit, 'edit', '', '', 2)).
1118  
1119              tagRow('label',
1120                  fInput('text', 'label', ($label ? $label : gTxt('recent_comments')), 'edit', '', '', 20)).
1121  
1122              tagRow('labeltag',
1123                  input_tag('labeltag', $labeltag)).
1124  
1125              tagRow('wraptag',
1126                  input_tag('wraptag', $wraptag)).
1127  
1128              tagRow('class',
1129                  fInput('text', 'class', $class, 'edit', '', '', 5)).
1130  
1131              tagRow('break',
1132                  input_tag('break', $break)).
1133  
1134          $endform
1135          );
1136  
1137          if ($step == 'build')
1138          {
1139              $out .= tdb(tb($tag_name, $atts));
1140          }
1141  
1142          return $out;
1143      }
1144  
1145  // -------------------------------------------------------------
1146  
1147  	function tag_output_form()
1148      {
1149          global $step, $endform, $tag_name;
1150  
1151          $atts = gpsa(array(
1152              'form'
1153          ));
1154  
1155          extract($atts);
1156  
1157          $out = form(
1158              startTable('tagbuilder').
1159  
1160              tr(
1161                  tdcs(
1162                      hed(gTxt('tag_'.$tag_name), 3)
1163                  , 2)
1164              ).
1165  
1166              tagRow('form',
1167                  form_pop('form', 'misc', $form)).
1168  
1169              $endform
1170          );
1171  
1172          if ($step == 'build')
1173          {
1174              $out .= tdb(tb($tag_name, $atts));
1175          }
1176  
1177          return $out;
1178      }
1179  
1180  // -------------------------------------------------------------
1181  
1182  	function tag_popup()
1183      {
1184          global $step, $endform, $tag_name;
1185  
1186          $atts = gpsa(array(
1187              'label',
1188              'section',
1189              'this_section',
1190              'type',
1191              'wraptag'
1192          ));
1193  
1194          extract($atts);
1195  
1196          $types = array(
1197              'c' => gTxt('Category'),
1198              's' => gTxt('Section')
1199          );
1200  
1201          $out = form(
1202              startTable('tagbuilder').
1203  
1204              tr(
1205                  tdcs(
1206                      hed(gTxt('tag_'.$tag_name), 3)
1207                  , 2)
1208              ).
1209  
1210              tagRow('type',
1211                  ' '.selectInput('type', $types, $type, true)).
1212  
1213              tagRow('section',
1214                  section_pop('section', $section)).
1215  
1216              tagRow('this_section',
1217                  yesno_pop('this_section', $this_section)).
1218  
1219              tagRow('label',
1220                  fInput('text', 'label', ($label ? $label : gTxt('browse')), 'edit', '', '', 25)).
1221  
1222              tagRow('wraptag',
1223                  input_tag('wraptag', $wraptag)).
1224  
1225              $endform
1226          );
1227  
1228          if ($step == 'build')
1229          {
1230              $out .= tdb(tb($tag_name, $atts));
1231          }
1232  
1233          return $out;
1234      }
1235  
1236  // -------------------------------------------------------------
1237  
1238  	function tag_password_protect()
1239      {
1240          global $step, $endform, $tag_name;
1241  
1242          $atts = gpsa(array(
1243              'login',
1244              'pass'
1245          ));
1246  
1247          extract($atts);
1248  
1249          $out = form(
1250              startTable('tagbuilder').
1251  
1252              tr(
1253                  tdcs(
1254                      hed(gTxt('tag_'.$tag_name), 3)
1255                  , 2)
1256              ).
1257  
1258              tagRow('login',
1259                  fInput('text', 'login', $login, 'edit', '', '', 25)).
1260  
1261              tagRow('password',
1262                  fInput('text', 'pass', $pass, 'edit', '', '', 25)).
1263  
1264              $endform
1265          );
1266  
1267          if ($step == 'build')
1268          {
1269              $out .= tdb(tb($tag_name, $atts));
1270          }
1271  
1272          return $out;
1273      }
1274  
1275  // -------------------------------------------------------------
1276  
1277  	function tag_search_input()
1278      {
1279          global $step, $endform, $tag_name;
1280  
1281          $atts = gpsa(array(
1282              'button',
1283              'form',
1284              'label',
1285              'section',
1286              'size',
1287              'wraptag'
1288          ));
1289  
1290          extract($atts);
1291  
1292          $out = form(
1293              startTable('tagbuilder').
1294  
1295              tr(
1296                  tdcs(
1297                      hed(gTxt('tag_'.$tag_name), 3)
1298                  , 2)
1299              ).
1300  
1301              tagRow('section',
1302                  section_pop('section', $section)).
1303  
1304              tagRow('button_text',
1305                  fInput('text', 'button', $button, 'edit', '', '', 25)).
1306  
1307              tagRow('input_size',
1308                  fInput('text', 'size', $size, 'edit', '', '', 2)).
1309  
1310              tagRow('label',
1311                  fInput('text', 'label', ($label ? $label : gTxt('search')), 'edit', '', '', 25)).
1312  
1313              tagRow('wraptag',
1314                  input_tag('wraptag', $wraptag)).
1315  
1316              tagRow('form',
1317                  form_pop('form', 'misc', $form)).
1318  
1319              $endform
1320          );
1321  
1322          if ($step == 'build')
1323          {
1324              $out .= tdb(tb($tag_name, $atts));
1325          }
1326  
1327          return $out;
1328      }
1329  
1330  // -------------------------------------------------------------
1331  
1332  	function tag_category1()
1333      {
1334          global $step, $endform, $tag_name;
1335  
1336          $atts = gpsa(array(
1337              'class',
1338              'link',
1339              'title',
1340              'section',
1341              'this_section',
1342              'wraptag'
1343          ));
1344  
1345          extract($atts);
1346  
1347          $out = form(
1348              startTable('tagbuilder').
1349              tr(
1350                  tdcs(
1351                      hed(gTxt('tag_'.$tag_name), 3)
1352                  , 2)
1353              ).
1354  
1355              tagRow('title',
1356                  yesno_pop('title', $title)).
1357  
1358              tagRow('link_to_this_category',
1359                  yesno_pop('link', $link)).
1360  
1361              tagRow('section',
1362                  section_pop('section', $section)).
1363  
1364              tagRow('this_section',
1365                  yesno_pop('this_section', $this_section)).
1366  
1367              tagRow('wraptag',
1368                  input_tag('wraptag', $wraptag)).
1369  
1370              tagRow('class',
1371                  fInput('text', 'class', $class, 'edit', '', '', 25)).
1372  
1373              $endform
1374          );
1375  
1376          if ($step == 'build')
1377          {
1378              $out .= tdb(tb($tag_name, $atts));
1379          }
1380  
1381          return $out;
1382      }
1383  
1384  // -------------------------------------------------------------
1385  
1386  	function tag_category2()
1387      {
1388          global $step, $endform, $tag_name;
1389  
1390          $atts = gpsa(array(
1391              'class',
1392              'link',
1393              'title',
1394              'section',
1395              'this_section',
1396              'wraptag'
1397          ));
1398  
1399          extract($atts);
1400  
1401          $out = form(
1402              startTable('tagbuilder').
1403              tr(
1404                  tdcs(
1405                      hed(gTxt('tag_'.$tag_name), 3)
1406                  , 2)
1407              ).
1408  
1409              tagRow('title',
1410                  yesno_pop('title', $title)).
1411  
1412              tagRow('link_to_this_category',
1413                  yesno_pop('link', $link)).
1414  
1415              tagRow('section',
1416                  section_pop('section', $section)).
1417  
1418              tagRow('this_section',
1419                  yesno_pop('this_section', $this_section)).
1420  
1421              tagRow('wraptag',
1422                  input_tag('wraptag', $wraptag)).
1423  
1424              tagRow('class',
1425                  fInput('text', 'class', $class, 'edit', '', '', 25)).
1426  
1427              $endform
1428          );
1429  
1430          if ($step == 'build')
1431          {
1432              $out .= tdb(tb($tag_name, $atts));
1433          }
1434  
1435          return $out;
1436      }
1437  
1438  // -------------------------------------------------------------
1439  
1440  	function tag_category()
1441      {
1442          global $step, $endform, $tag_name;
1443  
1444          $atts = gpsa(array(
1445              'class',
1446              'link',
1447              'name',
1448              'this_section',
1449              'title',
1450              'type',
1451              'url',
1452              'wraptag'
1453          ));
1454  
1455          extract($atts);
1456  
1457          $out = form(
1458              startTable('tagbuilder').
1459  
1460              tr(
1461                  tdcs(
1462                      hed(gTxt('tag_'.$tag_name), 3)
1463                  , 2)
1464              ).
1465  
1466              tagRow('name',
1467                  fInput('text', 'name', $name, 'edit', '', '', 25)).
1468  
1469              tagRow('link_to_this_category',
1470                  yesno_pop('link', $link)).
1471  
1472              tagRow('title',
1473                  yesno_pop('link', $link)).
1474  
1475              tagRow('type',
1476                  type_pop('type', $link)).
1477  
1478              tagRow('url_only',
1479                  yesno_pop('url', $link)).
1480  
1481              tagRow('wraptag',
1482                  input_tag('wraptag', $wraptag)).
1483  
1484              tagRow('class',
1485                  fInput('text', 'class', $class, 'edit', '', '', 25)).
1486  
1487              $endform
1488          );
1489  
1490          if ($step == 'build')
1491          {
1492              $out .= tdb(tb($tag_name, $atts));
1493          }
1494  
1495          return $out;
1496      }
1497  
1498  // -------------------------------------------------------------
1499  
1500  	function tag_if_category()
1501      {
1502          global $step, $endform, $tag_name;
1503  
1504          $atts = gpsa(array(
1505              'name'
1506          ));
1507  
1508          extract($atts);
1509  
1510          $out = form(
1511              startTable('tagbuilder').
1512  
1513              tr(
1514                  tdcs(
1515                      hed(gTxt('tag_'.$tag_name), 3)
1516                  , 2)
1517              ).
1518  
1519              tagRow('name',
1520                  fInput('text', 'name', $name, 'edit', '', '', 25)).
1521  
1522              $endform
1523          );
1524  
1525          if ($step == 'build')
1526          {
1527              $out .= tdb(tb($tag_name, $atts, gTxt('...')));
1528          }
1529  
1530          return $out;
1531      }
1532  
1533  // -------------------------------------------------------------
1534  
1535  	function tag_section()
1536      {
1537          global $step, $endform, $tag_name;
1538  
1539          $atts = gpsa(array(
1540              'class',
1541              'link',
1542              'name',
1543              'title',
1544              'url',
1545              'wraptag'
1546          ));
1547  
1548          extract($atts);
1549  
1550          $out = form(
1551              startTable('tagbuilder').
1552  
1553              tr(
1554                  tdcs(
1555                      hed(gTxt('tag_'.$tag_name), 3)
1556                  , 2)
1557              ).
1558  
1559              tagRow('name',
1560                  section_pop('name', $tag_name)).
1561  
1562              tagRow('link_to_this_section',
1563                  yesno_pop('link', $link)).
1564  
1565              tagRow('url_only',
1566                  yesno_pop('url', $link)).
1567  
1568              tagRow('wraptag',
1569                  input_tag('wraptag', $wraptag)).
1570  
1571              tagRow('class',
1572                  fInput('text', 'class', $class, 'edit', '', '', 25)).
1573  
1574              $endform
1575          );
1576  
1577          if ($step == 'build')
1578          {
1579              $out .= tdb(tb($tag_name, $atts));
1580          }
1581  
1582          return $out;
1583      }
1584  
1585  // -------------------------------------------------------------
1586  
1587  	function tag_if_section()
1588      {
1589          global $step, $endform, $tag_name;
1590  
1591          $atts = gpsa(array(
1592              'name'
1593          ));
1594  
1595          extract($atts);
1596  
1597          $out = form(
1598              startTable('tagbuilder').
1599  
1600              tr(
1601                  tdcs(
1602                      hed(gTxt('tag_'.$tag_name), 3)
1603                  , 2)
1604              ).
1605  
1606              tagRow('name',
1607                  section_pop('name', $tag_name)).
1608  
1609              $endform
1610          );
1611  
1612          if ($step == 'build')
1613          {
1614              $out .= tdb(tb($tag_name, $atts, gTxt('...')));
1615          }
1616  
1617          return $out;
1618      }
1619  
1620  // -------------------------------------------------------------
1621  
1622  	function tag_author()
1623      {
1624          global $step, $endform, $tag_name;
1625  
1626          $atts = gpsa(array(
1627              'link',
1628              'section',
1629              'this_section'
1630          ));
1631  
1632          extract($atts);
1633  
1634          $out = form(
1635              startTable('tagbuilder').
1636  
1637              tr(
1638                  tdcs(
1639                      hed(gTxt('tag_'.$tag_name), 3)
1640                  , 2)
1641              ).
1642  
1643              tagRow('link_to_this_author',
1644                  yesno_pop('link', $link)).
1645  
1646              tagRow('section',
1647                  section_pop('section', $section)).
1648  
1649              tagRow('this_section',
1650                  yesno_pop('this_section', $this_section)).
1651  
1652              $endform
1653          );
1654  
1655          if ($step == 'build')
1656          {
1657              $out .= tdb(tb($tag_name, $atts));
1658          }
1659  
1660          return $out;
1661      }
1662  
1663  // -------------------------------------------------------------
1664  
1665  	function tag_link_to_home()
1666      {
1667          global $step, $endform, $tag_name;
1668  
1669          $atts = gpsa(array(
1670              'class',
1671          ));
1672  
1673          extract($atts);
1674  
1675          $thing = gps('thing');
1676  
1677          $out = form(
1678              startTable('tagbuilder').
1679  
1680              tr(
1681                  tdcs(
1682                      hed(gTxt('tag_'.$tag_name), 3)
1683                  , 2)
1684              ).
1685  
1686              tagRow('link_text',
1687                  fInput('text', 'thing', ($thing ? $thing : gTxt('tag_home')), 'edit', '', '', 25)).
1688  
1689              tagRow('class',
1690                  fInput('text', 'class', $class, 'edit', '', '', 25)).
1691  
1692              $endform
1693          );
1694  
1695          if ($step == 'build')
1696          {
1697              $out .= tdb(tb($tag_name, $atts));
1698          }
1699  
1700          return $out;
1701      }
1702  
1703  // -------------------------------------------------------------
1704  
1705  	function tag_link_to_prev()
1706      {
1707          global $step, $endform, $tag_name;
1708  
1709          $atts = gpsa(array(
1710              'showalways',
1711          ));
1712  
1713          extract($atts);
1714  
1715          $thing = gps('thing');
1716  
1717          $out = form(
1718              startTable('tagbuilder').
1719  
1720              tr(
1721                  tdcs(
1722                      hed(gTxt('tag_'.$tag_name), 3)
1723                  , 2)
1724              ).
1725  
1726              tagRow('link_text',
1727                  fInput('text', 'thing', ($thing ? $thing : '<txp:prev_title />'), 'edit', '', '', 25)).
1728  
1729              tagRow('showalways',
1730                  yesno_pop('showalways', $showalways)).
1731  
1732              $endform
1733          );
1734  
1735          if ($step == 'build')
1736          {
1737              $out .= tdb(tb($tag_name, $atts, $thing));
1738          }
1739  
1740          return $out;
1741      }
1742  
1743  // -------------------------------------------------------------
1744  
1745  	function tag_link_to_next()
1746      {
1747          global $step, $endform, $tag_name;
1748  
1749          $atts = gpsa(array(
1750              'showalways',
1751          ));
1752  
1753          extract($atts);
1754  
1755          $thing = gps('thing');
1756  
1757          $out = form(
1758              startTable('tagbuilder').
1759  
1760              tr(
1761                  tdcs(
1762                      hed(gTxt('tag_'.$tag_name), 3)
1763                  , 2)
1764              ).
1765  
1766              tagRow('link_text',
1767                  fInput('text', 'thing', ($thing ? $thing : '<txp:next_title />'), 'edit', '', '', 25)).
1768  
1769              tagRow('showalways',
1770                  yesno_pop('showalways', $showalways)).
1771  
1772              $endform
1773          );
1774  
1775          if ($step == 'build')
1776          {
1777              $out .= tdb(tb($tag_name, $atts, $thing));
1778          }
1779  
1780          return $out;
1781      }
1782  
1783  // -------------------------------------------------------------
1784  
1785  	function tag_feed_link()
1786      {
1787          global $step, $endform, $tag_name;
1788  
1789          $atts = gpsa(array(
1790              'category',
1791              'flavor',
1792              'format',
1793              'label',
1794              'limit',
1795              'section',
1796              'title',
1797              'wraptag',
1798          ));
1799  
1800          extract($atts);
1801  
1802          $label = $label ? $label : 'XML';
1803  
1804          $out = form(
1805              startTable('tagbuilder').
1806  
1807              tr(
1808                  tdcs(
1809                      hed(gTxt('tag_'.$tag_name), 3)
1810                  , 2)
1811              ).
1812  
1813              tagRow('flavor',
1814                  feed_flavor_pop($flavor)).
1815  
1816              tagRow('format',
1817                  feed_format_pop($format)).
1818  
1819              tagRow('section',
1820                  section_pop('section', $section)).
1821  
1822              tagRow('category',
1823                  article_category_pop($section)).
1824  
1825              tagRow('limit',
1826                  input_limit($limit)).
1827  
1828              tagRow('label',
1829                  fInput('text', 'label', $label, 'edit', '', '', 25)).
1830  
1831              tagRow('title',
1832                  fInput('text', 'title', $title, 'edit', '', '', 25)).
1833  
1834              tagRow('wraptag',
1835                  input_tag('wraptag', $wraptag)).
1836  
1837              $endform
1838          );
1839  
1840          if ($step == 'build')
1841          {
1842              $out .= tdb(tb($tag_name, $atts));
1843          }
1844  
1845          return $out;
1846      }
1847  
1848  // -------------------------------------------------------------
1849  
1850  	function tag_link_feed_link()
1851      {
1852          global $step, $endform, $tag_name;
1853  
1854          $atts = gpsa(array(
1855              'category',
1856              'flavor',
1857              'format',
1858              'label',
1859              'limit',
1860              'title',
1861              'wraptag'
1862          ));
1863  
1864          extract($atts);
1865  
1866          $label = (!$label) ? 'XML' : $label;
1867  
1868          $out = form(
1869              startTable('tagbuilder').
1870  
1871              tr(
1872                  tdcs(
1873                      hed(gTxt('tag_'.$tag_name), 3)
1874                  , 2)
1875              ).
1876  
1877              tagRow('flavor',
1878                  feed_flavor_pop($flavor)).
1879  
1880              tagRow('format',
1881                  feed_format_pop($format)).
1882  
1883              tagRow('category',
1884                  link_category_pop($category)).
1885  
1886              tagRow('limit',
1887                  fInput('text', 'limit', $limit, 'edit', '', '', 2)).
1888  
1889              tagRow('label',
1890                  fInput('text', 'label', $label, 'edit', '', '', 25)).
1891  
1892              tagRow('title',
1893                  fInput('text', 'title', $title, 'edit', '', '', 25)).
1894  
1895              tagRow('wraptag',
1896                  input_tag('wraptag', $wraptag)).
1897  
1898              $endform
1899          );
1900  
1901          if ($step == 'build')
1902          {
1903              $out .= tdb(tb($tag_name, $atts));
1904          }
1905  
1906          return $out;
1907      }
1908  
1909  // -------------------------------------------------------------
1910  
1911  	function tag_permlink()
1912      {
1913          global $step, $endform, $tag_name;
1914  
1915          $atts = gpsa(array(
1916              'class',
1917              'id',
1918              'style',
1919              'title'
1920          ));
1921  
1922          extract($atts);
1923  
1924          $thing = gps('thing');
1925  
1926          $out = form(
1927              startTable('tagbuilder').
1928  
1929              tr(
1930                  tdcs(
1931                      hed(gTxt('tag_'.$tag_name), 3)
1932                  , 2)
1933              ).
1934  
1935              tagRow('id',
1936                  input_id($id)).
1937  
1938              tagRow('link_text',
1939                  fInput('text', 'thing', ($thing ? $thing : '<txp:title />'), 'edit', '', '', 25)).
1940  
1941              tagRow('title',
1942                  fInput('text', 'title', $title, 'edit', '', '', 25)).
1943  
1944              tagRow('class',
1945                  fInput('text', 'class', $class, 'edit', '', '', 25)).
1946  
1947              tagRow('inline_style',
1948                  fInput('text', 'style', $style, 'edit', '', '', 25)).
1949  
1950              $endform
1951          );
1952  
1953          if ($step == 'build')
1954          {
1955              $out .= tdb(tb($tag_name, $atts, $thing));
1956          }
1957  
1958          return $out;
1959      }
1960  
1961  // -------------------------------------------------------------
1962  
1963  	function tag_newer()
1964      {
1965          global $step, $endform, $tag_name;
1966  
1967          $thing = gps('thing');
1968  
1969          $out = form(
1970              startTable('tagbuilder').
1971  
1972              tr(
1973                  tdcs(
1974                      hed(gTxt('tag_'.$tag_name), 3)
1975                  , 2)
1976              ).
1977  
1978              tagRow('link_text',
1979                  fInput('text', 'thing', ($thing ? $thing : '<txp:text item="newer" />'), 'edit', '', '', 25)).
1980  
1981              $endform
1982          );
1983  
1984          if ($step == 'build')
1985          {
1986              $out .= tdb(tb($tag_name, array(), $thing));
1987          }
1988  
1989          return $out;
1990      }
1991  
1992  // -------------------------------------------------------------
1993  
1994  	function tag_older()
1995      {
1996          global $step, $endform, $tag_name;
1997  
1998          $thing = gps('thing');
1999  
2000          $out = form(
2001              startTable('tagbuilder').
2002  
2003              tr(
2004                  tdcs(
2005                      hed(gTxt('tag_'.$tag_name), 3)
2006                  , 2)
2007              ).
2008  
2009              tagRow('link_text',
2010                  fInput('text', 'thing', ($thing ? $thing : '<txp:text item="older" />'), 'edit', '', '', 25)).
2011  
2012              $endform
2013          );
2014  
2015          if ($step == 'build')
2016          {
2017              $out .= tdb(tb($tag_name, array(), $thing));
2018          }
2019  
2020          return $out;
2021      }
2022  
2023  // -------------------------------------------------------------
2024  
2025  	function tag_next_title()
2026      {
2027          global $step, $endform, $tag_name;
2028  
2029          return form(
2030              startTable('tagbuilder').
2031  
2032              tr(
2033                  tdcs(
2034                      hed(gTxt('tag_'.$tag_name), 3)
2035                  , 2)
2036              ).
2037  
2038              n.endTable()
2039          ).
2040  
2041          tdb(tb($tag_name));
2042      }
2043  
2044  // -------------------------------------------------------------
2045  
2046  	function tag_site_name()
2047      {
2048          global $step, $endform, $tag_name;
2049  
2050          return form(
2051              startTable('tagbuilder').
2052  
2053              tr(
2054                  tdcs(
2055                      hed(gTxt('tag_'.$tag_name), 3)
2056                  , 2)
2057              ).
2058  
2059              n.endTable()
2060          ).
2061  
2062          tdb(tb($tag_name));
2063      }
2064  
2065  // -------------------------------------------------------------
2066  
2067  	function tag_site_slogan()
2068      {
2069          global $step, $endform, $tag_name;
2070  
2071          return form(
2072              startTable('tagbuilder').
2073  
2074              tr(
2075                  tdcs(
2076                      hed(gTxt('tag_'.$tag_name), 3)
2077                  , 2)
2078              ).
2079  
2080              n.endTable()
2081          ).
2082  
2083          tdb(tb($tag_name));
2084      }
2085  
2086  // -------------------------------------------------------------
2087  
2088  	function tag_prev_title()
2089      {
2090          global $step, $endform, $tag_name;
2091  
2092          return form(
2093              startTable('tagbuilder').
2094  
2095              tr(
2096                  tdcs(
2097                      hed(gTxt('tag_'.$tag_name), 3)
2098                  , 2)
2099              ).
2100  
2101              n.endTable()
2102          ).
2103  
2104          tdb(tb($tag_name));
2105      }
2106  
2107  // -------------------------------------------------------------
2108  
2109  	function tag_article_image()
2110      {
2111          global $step, $endform, $tag_name;
2112  
2113          $atts = gpsa(array(
2114              'align',
2115              'class',
2116              'escape',
2117              'html_id',
2118              'style',
2119              'thumbnail',
2120              'wraptag',
2121          ));
2122  
2123          extract($atts);
2124  
2125          $out = form(
2126              startTable('tagbuilder').
2127  
2128              tr(
2129                  tdcs(
2130                      hed(gTxt('tag_'.$tag_name), 3)
2131                  , 2)
2132              ).
2133  
2134              tagRow('use_thumbnail',
2135                  yesno_pop('thumbnail', $thumbnail)).
2136  
2137              tagRow('escape',
2138                  escape_pop($escape)).
2139  
2140              tagRow('html_id',
2141                  fInput('text', 'html_id', $html_id, 'edit', '', '', 25)).
2142  
2143              tagRow('class',
2144                  fInput('text', 'class', $class, 'edit', '', '', 25)).
2145  
2146              tagRow('inline_style',
2147                  fInput('text', 'style', $style, 'edit', '', '', 25)).
2148  
2149              tagRow('align',
2150                  fInput('text', 'align', $align, 'edit', '', '', 25)).
2151  
2152              tagRow('wraptag',
2153                  fInput('text', 'wraptag', $wraptag, 'edit', '', '', 25)).
2154  
2155              $endform
2156          );
2157  
2158          if ($step == 'build')
2159          {
2160              $out .= tdb(tb($tag_name, $atts));
2161          }
2162  
2163          return $out;
2164      }
2165  
2166  // -------------------------------------------------------------
2167  
2168  	function tag_css()
2169      {
2170          global $step, $endform, $tag_name;
2171  
2172          $atts = gpsa(array(
2173              'format',
2174              'media',
2175              'n',
2176              'rel',
2177              'title'
2178          ));
2179  
2180          extract($atts);
2181  
2182          $out = form(
2183              startTable('tagbuilder').
2184  
2185              tr(
2186                  tdcs(
2187                      hed(gTxt('tag_'.$tag_name), 3)
2188                  , 2)
2189              ).
2190  
2191              tagRow('n',
2192                  css_pop($n)).
2193  
2194              tagRow('format',
2195                  css_format_pop($format)).
2196  
2197              tagRow('media',
2198                  fInput('text', 'media', $media, 'edit', '', '', 25)).
2199  
2200              tagRow('rel',
2201                  fInput('text', 'rel', $rel, 'edit', '', '', 25)).
2202  
2203              tagRow('title',
2204                  fInput('text', 'title', $title, 'edit', '', '', 25)).
2205  
2206              $endform
2207          );
2208  
2209          if ($step == 'build')
2210          {
2211              $out .= tdb(tb($tag_name, $atts));
2212          }
2213  
2214          return $out;
2215      }
2216  
2217  // -------------------------------------------------------------
2218  
2219  	function tag_body()
2220      {
2221          global $step, $endform, $tag_name;
2222  
2223          return form(
2224              startTable('tagbuilder').
2225  
2226              tr(
2227                  tdcs(
2228                      hed(gTxt('tag_'.$tag_name), 3)
2229                  , 2)
2230              ).
2231  
2232              n.endTable()
2233          ).
2234  
2235          tdb(tb($tag_name));
2236      }
2237  
2238  // -------------------------------------------------------------
2239  
2240  	function tag_excerpt()
2241      {
2242          global $step, $endform, $tag_name;
2243  
2244          return form(
2245              startTable('tagbuilder').
2246  
2247              tr(
2248                  tdcs(
2249                      hed(gTxt('tag_'.$tag_name), 3)
2250                  , 2)
2251              ).
2252  
2253              n.endTable()
2254          ).
2255  
2256          tdb(tb($tag_name));
2257      }
2258  
2259  // -------------------------------------------------------------
2260  
2261  	function tag_title()
2262      {
2263          global $step, $endform, $tag_name;
2264  
2265          return form(
2266              startTable('tagbuilder').
2267  
2268              tr(
2269                  tdcs(
2270                      hed(gTxt('tag_'.$tag_name), 3)
2271                  , 2)
2272              ).
2273  
2274              n.endTable()
2275          ).
2276  
2277          tdb(tb($tag_name));
2278      }
2279  
2280  // -------------------------------------------------------------
2281  
2282  	function tag_link()
2283      {
2284          global $step, $endform, $tag_name;
2285  
2286          $atts = gpsa(array(
2287              'rel'
2288          ));
2289  
2290          extract($atts);
2291  
2292          $out = form(
2293              startTable('tagbuilder').
2294  
2295              tr(
2296                  tdcs(
2297                      hed(gTxt('tag_'.$tag_name), 3)
2298                  , 2)
2299              ).
2300  
2301              tagRow('rel',
2302                  fInput('text', 'rel', $rel, 'edit', '', '', 25)).
2303  
2304              $endform
2305          );
2306  
2307          if ($step == 'build')
2308          {
2309              $out .= tdb(tb($tag_name, $atts));
2310          }
2311  
2312          return $out;
2313      }
2314  
2315  // -------------------------------------------------------------
2316  
2317  	function tag_linkdesctitle()
2318      {
2319          global $step, $endform, $tag_name;
2320  
2321          $atts = gpsa(array(
2322              'rel'
2323          ));
2324  
2325          extract($atts);
2326  
2327          $out = form(
2328              startTable('tagbuilder').
2329  
2330              tr(
2331                  tdcs(
2332                      hed(gTxt('tag_'.$tag_name), 3)
2333                  , 2)
2334              ).
2335  
2336              tagRow('rel',
2337                  fInput('text', 'rel', $rel, 'edit', '', '', 25)).
2338  
2339              $endform
2340          );
2341  
2342          if ($step == 'build')
2343          {
2344              $out .= tdb(tb($tag_name, $atts));
2345          }
2346  
2347          return $out;
2348      }
2349  
2350  // -------------------------------------------------------------
2351  
2352  	function tag_link_description()
2353      {
2354          global $step, $endform, $tag_name;
2355  
2356          $atts = gpsa(array(
2357              'class',
2358              'escape',
2359              'label',
2360              'labeltag',
2361              'wraptag'
2362          ));
2363  
2364          extract($atts);
2365  
2366          $out = form(
2367              startTable('tagbuilder').
2368  
2369              tr(
2370                  tdcs(
2371                      hed(gTxt('tag_'.$tag_name), 3)
2372                  , 2)
2373              ).
2374  
2375              tagRow('escape',
2376                  escape_pop($escape)).
2377  
2378              tagRow('label',
2379                  fInput('text', 'label', $label, 'edit', '', '', 25)).
2380  
2381              tagRow('labeltag',
2382                  input_tag('labeltag', $labeltag)).
2383  
2384              tagRow('wraptag',
2385                  input_tag('wraptag', $wraptag)).
2386  
2387              tagRow('class',
2388                  fInput('text', 'class', $class, 'edit', '', '', 25)).
2389  
2390              $endform
2391          );
2392  
2393          if ($step == 'build')
2394          {
2395              $out .= tdb(tb($tag_name, $atts));
2396          }
2397  
2398          return $out;
2399      }
2400  
2401  // -------------------------------------------------------------
2402  
2403  	function tag_link_name()
2404      {
2405          global $step, $endform, $tag_name;
2406  
2407          $atts = gpsa(array(
2408              'escape',
2409          ));
2410  
2411          extract($atts);
2412  
2413          $out = form(
2414              startTable('tagbuilder').
2415  
2416              tr(
2417                  tdcs(
2418                      hed(gTxt('tag_'.$tag_name), 3)
2419                  , 2)
2420              ).
2421  
2422              tagRow('escape',
2423                  escape_pop($escape)).
2424  
2425              $endform
2426          );
2427  
2428          if ($step == 'build')
2429          {
2430              $out .= tdb(tb($tag_name, $atts));
2431          }
2432  
2433          return $out;
2434      }
2435  
2436  // -------------------------------------------------------------
2437  
2438  	function tag_link_category()
2439      {
2440          global $step, $endform, $tag_name;
2441  
2442          $atts = gpsa(array(
2443              'class',
2444              'label',
2445              'labeltag',
2446              'title',
2447              'wraptag'
2448          ));
2449  
2450          extract($atts);
2451  
2452          $out = form(
2453              startTable('tagbuilder').
2454  
2455              tr(
2456                  tdcs(
2457                      hed(gTxt('tag_'.$tag_name), 3)
2458                  , 2)
2459              ).
2460  
2461              tagRow('title',
2462                  yesno_pop('title', $title)).
2463  
2464              tagRow('label',
2465                  fInput('text', 'label', $label, 'edit', '', '', 25)).
2466  
2467              tagRow('labeltag',
2468                  input_tag('labeltag', $labeltag)).
2469  
2470              tagRow('wraptag',
2471                  input_tag('wraptag', $wraptag)).
2472  
2473              tagRow('class',
2474                  fInput('text', 'class', $class, 'edit', '', '', 25)).
2475  
2476              $endform
2477          );
2478  
2479          if ($step == 'build')
2480          {
2481              $out .= tdb(tb($tag_name, $atts));
2482          }
2483  
2484          return $out;
2485      }
2486  
2487  // -------------------------------------------------------------
2488  
2489  	function tag_link_date()
2490      {
2491          global $step, $endform, $tag_name;
2492  
2493          $atts = gpsa(array(
2494              'format',
2495              'gmt',
2496              'lang'
2497          ));
2498  
2499          extract($atts);
2500  
2501          $out = form(
2502              startTable('tagbuilder').
2503  
2504              tr(
2505                  tdcs(
2506                      hed(gTxt('tag_'.$tag_name), 3)
2507                  , 2)
2508              ).
2509  
2510              tagRow('time_format',
2511                  fInput('text', 'format', $format, 'edit', '', '', 25)).
2512  
2513              tagRow('gmt',
2514                  yesno_pop('gmt', $gmt)).
2515  
2516              tagRow('locale',
2517                  fInput('text', 'lang', $lang, 'edit', '', '', 25)).
2518  
2519              $endform
2520          );
2521  
2522          if ($step == 'build')
2523          {
2524              $out .= tdb(tb($tag_name, $atts));
2525          }
2526  
2527          return $out;
2528      }
2529  
2530  // -------------------------------------------------------------
2531  
2532  	function tag_posted()
2533      {
2534          global $step, $endform, $tag_name;
2535  
2536          $atts = gpsa(array(
2537              'format',
2538              'gmt',
2539              'lang'
2540          ));
2541  
2542          extract($atts);
2543  
2544          $out = form(
2545              startTable('tagbuilder').
2546  
2547              tr(
2548                  tdcs(
2549                      hed(gTxt('tag_'.$tag_name), 3)
2550                  , 2)
2551              ).
2552  
2553              tagRow('time_format',
2554                  fInput('text', 'format', $format, 'edit', '', '', 25)).
2555  
2556              tagRow('gmt',
2557                  yesno_pop('gmt', $gmt)).
2558  
2559              tagRow('locale',
2560                  fInput('text', 'lang', $lang, 'edit', '', '', 25)).
2561  
2562              $endform
2563          );
2564  
2565          if ($step == 'build')
2566          {
2567              $out .= tdb(tb($tag_name, $atts));
2568          }
2569  
2570          return $out;
2571      }
2572  
2573  // -------------------------------------------------------------
2574  
2575  	function tag_comments_invite()
2576      {
2577          global $step, $endform, $tag_name;
2578  
2579          $atts = gpsa(array(
2580              'class',
2581              'showcount',
2582              'textonly',
2583              'wraptag'
2584          ));
2585  
2586          extract($atts);
2587  
2588          $out = form(
2589              startTable('tagbuilder').
2590  
2591              tr(
2592                  tdcs(
2593                      hed(gTxt('tag_'.$tag_name), 3)
2594                  , 2)
2595              ).
2596  
2597              tagRow('textonly',
2598                  yesno_pop('textonly', $textonly)).
2599  
2600              tagRow('showcount',
2601                  yesno_pop('showcount', $showcount)).
2602  
2603              tagRow('wraptag',
2604                  input_tag('wraptag', $wraptag)).
2605  
2606              tagRow('class',
2607                  fInput('text', 'class', $class, 'edit', '', '', 25)).
2608  
2609              $endform
2610          );
2611  
2612          if ($step == 'build')
2613          {
2614              $out .= tdb(tb($tag_name, $atts));
2615          }
2616  
2617          return $out;
2618      }
2619  
2620  // -------------------------------------------------------------
2621  
2622  	function tag_comment_permlink()
2623      {
2624          global $step, $endform, $tag_name;
2625  
2626          return form(
2627              startTable('tagbuilder').
2628  
2629              tr(
2630                  tdcs(
2631                      hed(gTxt('tag_'.$tag_name), 3)
2632                  , 2)
2633              ).
2634  
2635              n.endTable()
2636          ).
2637  
2638          tdb(tb($tag_name));
2639      }
2640  
2641  // -------------------------------------------------------------
2642  
2643  	function tag_comment_time()
2644      {
2645          global $step, $endform, $tag_name;
2646  
2647          $atts = gpsa(array(
2648              'format',
2649              'gmt',
2650              'lang'
2651          ));
2652  
2653          extract($atts);
2654  
2655          $out = form(
2656              startTable('tagbuilder').
2657  
2658              tr(
2659                  tdcs(
2660                      hed(gTxt('tag_'.$tag_name), 3)
2661                  , 2)
2662              ).
2663  
2664              tagRow('time_format',
2665                  fInput('text', 'format', $format, 'edit', '', '', 25)).
2666  
2667              tagRow('gmt',
2668                  yesno_pop('gmt', $gmt)).
2669  
2670              tagRow('locale',
2671                  fInput('text', 'lang', $lang, 'edit', '', '', 25)).
2672  
2673              $endform
2674          );
2675  
2676          if ($step == 'build')
2677          {
2678              $out .= tdb(tb($tag_name, $atts));
2679          }
2680  
2681          return $out;
2682      }
2683  
2684  // -------------------------------------------------------------
2685  
2686  	function tag_comment_name()
2687      {
2688          global $step, $endform, $tag_name;
2689  
2690          $atts = gpsa(array(
2691              'link'
2692          ));
2693  
2694          extract($atts);
2695  
2696          $out = form(
2697              startTable('tagbuilder').
2698  
2699              tr(
2700                  tdcs(
2701                      hed(gTxt('tag_'.$tag_name), 3)
2702                  , 2)
2703              ).
2704  
2705              tagRow('comment_name_link',
2706                  yesno_pop('link', $link)).
2707  
2708              $endform
2709          );
2710  
2711          if ($step == 'build')
2712          {
2713              $out .= tdb(tb($tag_name, $atts));
2714          }
2715  
2716          return $out;
2717      }
2718  
2719  // -------------------------------------------------------------
2720  
2721  	function tag_comment_email()
2722      {
2723          global $step, $endform, $tag_name;
2724  
2725          return form(
2726              startTable('tagbuilder').
2727  
2728              tr(
2729                  tdcs(
2730                      hed(gTxt('tag_'.$tag_name), 3)
2731                  , 2)
2732              ).
2733  
2734              n.endTable()
2735          ).
2736  
2737          tdb(tb($tag_name));
2738      }
2739  
2740  // -------------------------------------------------------------
2741  
2742  	function tag_comment_web()
2743      {
2744          global $step, $endform, $tag_name;
2745  
2746          return form(
2747              startTable('tagbuilder').
2748  
2749              tr(
2750                  tdcs(
2751                      hed(gTxt('tag_'.$tag_name), 3)
2752                  , 2)
2753              ).
2754  
2755              n.endTable()
2756          ).
2757  
2758          tdb(tb($tag_name));
2759      }
2760  
2761  // -------------------------------------------------------------
2762  
2763  	function tag_comment_message()
2764      {
2765          global $step, $endform, $tag_name;
2766  
2767          return form(
2768              startTable('tagbuilder').
2769  
2770              tr(
2771                  tdcs(
2772                      hed(gTxt('tag_'.$tag_name), 3)
2773                  , 2)
2774              ).
2775  
2776              n.endTable()
2777          ).
2778  
2779          tdb(tb($tag_name));
2780      }
2781  
2782  // -------------------------------------------------------------
2783  
2784  	function tag_comment_email_input()
2785      {
2786          global $step, $endform, $tag_name;
2787  
2788          return form(
2789              startTable('tagbuilder').
2790  
2791              tr(
2792                  tdcs(
2793                      hed(gTxt('tag_'.$tag_name), 3)
2794                  , 2)
2795              ).
2796  
2797              n.endTable()
2798          ).
2799  
2800          tdb(tb($tag_name));
2801      }
2802  
2803  // -------------------------------------------------------------
2804  
2805  	function tag_comment_message_input()
2806      {
2807          global $step, $endform, $tag_name;
2808  
2809          return form(
2810              startTable('tagbuilder').
2811  
2812              tr(
2813                  tdcs(
2814                      hed(gTxt('tag_'.$tag_name), 3)
2815                  , 2)
2816              ).
2817  
2818              n.endTable()
2819          ).
2820  
2821          tdb(tb($tag_name));
2822      }
2823  
2824  // -------------------------------------------------------------
2825  
2826  	function tag_comment_name_input()
2827      {
2828          global $step, $endform, $tag_name;
2829  
2830          return form(
2831              startTable('tagbuilder').
2832  
2833              tr(
2834                  tdcs(
2835                      hed(gTxt('tag_'.$tag_name), 3)
2836                  , 2)
2837              ).
2838  
2839              n.endTable()
2840          ).
2841  
2842          tdb(tb($tag_name));
2843      }
2844  
2845  // -------------------------------------------------------------
2846  
2847  	function tag_comment_preview()
2848      {
2849          global $step, $endform, $tag_name;
2850  
2851          return form(
2852              startTable('tagbuilder').
2853  
2854              tr(
2855                  tdcs(
2856                      hed(gTxt('tag_'.$tag_name), 3)
2857                  , 2)
2858              ).
2859  
2860              n.endTable()
2861          ).
2862  
2863          tdb(tb($tag_name));
2864      }
2865  
2866  // -------------------------------------------------------------
2867  
2868  	function tag_comment_remember()
2869      {
2870          global $step, $endform, $tag_name;
2871  
2872          return form(
2873              startTable('tagbuilder').
2874  
2875              tr(
2876                  tdcs(
2877                      hed(gTxt('tag_'.$tag_name), 3)
2878                  , 2)
2879              ).
2880  
2881              n.endTable()
2882          ).
2883  
2884          tdb(tb($tag_name));
2885      }
2886  
2887  // -------------------------------------------------------------
2888  
2889  	function tag_comment_submit()
2890      {
2891          global $step, $endform, $tag_name;
2892  
2893          return form(
2894              startTable('tagbuilder').
2895  
2896              tr(
2897                  tdcs(
2898                      hed(gTxt('tag_'.$tag_name), 3)
2899                  , 2)
2900              ).
2901  
2902              n.endTable()
2903          ).
2904  
2905          tdb(tb($tag_name));
2906      }
2907  
2908  // -------------------------------------------------------------
2909  
2910  	function tag_comment_web_input()
2911      {
2912          global $step, $endform, $tag_name;
2913  
2914          return form(
2915              startTable('tagbuilder').
2916  
2917              tr(
2918                  tdcs(
2919                      hed(gTxt('tag_'.$tag_name), 3)
2920                  , 2)
2921              ).
2922  
2923              n.endTable()
2924          ).
2925  
2926          tdb(tb($tag_name));
2927      }
2928  
2929  // -------------------------------------------------------------
2930  
2931  	function tag_comments()
2932      {
2933          global $step, $endform, $tag_name;
2934  
2935          $atts = gpsa(array(
2936              'break',
2937              'breakclass',
2938              'class',
2939              'form',
2940              'limit',
2941              'offset',
2942              'sort',
2943              'wraptag'
2944          ));
2945  
2946          extract($atts);
2947  
2948          $out = form(
2949              startTable('tagbuilder').
2950  
2951              tr(
2952                  tdcs(
2953                      hed(gTxt('tag_'.$tag_name), 3)
2954                  , 2)
2955              ).
2956  
2957              tagRow('form',
2958                  form_pop('form', 'comment', $form)).
2959  
2960              tagRow('sort',
2961                  discuss_sort_pop($sort)).
2962  
2963              tagRow('limit',
2964                  input_limit($limit)).
2965  
2966              tagRow('offset',
2967                  input_offset($offset)).
2968  
2969              tagRow('wraptag',
2970                  input_tag('wraptag', $wraptag)).
2971  
2972              tagRow('class',
2973                  fInput('text', 'class', $class, 'edit', '', '', 25)).
2974  
2975              tagRow('break',
2976                  input_tag('break', $break)).
2977  
2978              tagRow('breakclass',
2979                  fInput('text', 'breakclass', $breakclass, 'edit', '', '', 25)).
2980  
2981              $endform
2982          );
2983  
2984          if ($step == 'build')
2985          {
2986              $out .= tdb(tb($tag_name, $atts));
2987          }
2988  
2989          return $out;
2990      }
2991  
2992  // -------------------------------------------------------------
2993  
2994  	function tag_comments_form()
2995      {
2996          global $step, $endform, $tag_name;
2997  
2998          $atts = gpsa(array(
2999              'class',
3000              'id',
3001              'isize',
3002              'form',
3003              'msgcols',
3004              'msgrows',
3005              'wraptag'
3006          ));
3007  
3008          extract($atts);
3009  
3010          $out = form(
3011              startTable('tagbuilder').
3012  
3013              tr(
3014                  tdcs(
3015                      hed(gTxt('tag_'.$tag_name), 3)
3016                  , 2)
3017              ).
3018  
3019              tagRow('id',
3020                  input_id($id)).
3021  
3022              tagRow('isize',
3023                  fInput('text', 'isize', $isize, 'edit', '', '', 2)).
3024  
3025              tagRow('msgcols',
3026                  fInput('text', 'msgcols', $msgcols, 'edit', '', '', 2)).
3027  
3028              tagRow('msgrows',
3029                  fInput('text', 'msgrows', $msgrows, 'edit', '', '', 2)).
3030  
3031              tagRow('form',
3032                  form_pop('form', 'comment', $form)).
3033  
3034              tagRow('wraptag',
3035                  input_tag('wraptag', $wraptag)).
3036  
3037              tagRow('class',
3038                  fInput('text', 'class', $class, 'edit', '', '', 25)).
3039  
3040              $endform
3041          );
3042  
3043          if ($step == 'build')
3044          {
3045              $out .= tdb(tb($tag_name, $atts));
3046          }
3047  
3048          return $out;
3049      }
3050  
3051  // -------------------------------------------------------------
3052  
3053  	function tag_comments_preview()
3054      {
3055          global $step, $endform, $tag_name;
3056  
3057          $atts = gpsa(array(
3058              'class',
3059              'id',
3060              'form',
3061              'wraptag'
3062          ));
3063  
3064          extract($atts);
3065  
3066          $out = form(
3067              startTable('tagbuilder').
3068  
3069              tr(
3070                  tdcs(
3071                      hed(gTxt('tag_'.$tag_name), 3)
3072                  , 2)
3073              ).
3074  
3075              tagRow('id',
3076                  input_id($id)).
3077  
3078              tagRow('form',
3079                  form_pop('form', 'comment', $form)).
3080  
3081              tagRow('wraptag',
3082                  input_tag('wraptag', $wraptag)).
3083  
3084              tagRow('class',
3085                  fInput('text', 'class', $class, 'edit', '', '', 25)).
3086  
3087              $endform
3088          );
3089  
3090          if ($step == 'build')
3091          {
3092              $out .= tdb(tb($tag_name, $atts));
3093          }
3094  
3095          return $out;
3096      }
3097  
3098  // -------------------------------------------------------------
3099  
3100  	function tag_search_result_title()
3101      {
3102          global $step, $endform, $tag_name;
3103  
3104          return form(
3105              startTable('tagbuilder').
3106  
3107              tr(
3108                  tdcs(
3109                      hed(gTxt('tag_'.$tag_name), 3)
3110                  , 2)
3111              ).
3112  
3113              n.endTable()
3114          ).
3115  
3116          tdb(tb($tag_name));
3117      }
3118  
3119  // -------------------------------------------------------------
3120  
3121  	function tag_search_result_excerpt()
3122      {
3123          global $step, $endform, $tag_name;
3124  
3125          $atts = gpsa(array(
3126              'hilight',
3127              'limit'
3128          ));
3129  
3130          extract($atts);
3131  
3132          $out = form(
3133              startTable('tagbuilder').
3134  
3135              tr(
3136                  tdcs(
3137                      hed(gTxt('tag_'.$tag_name), 3)
3138                  , 2)
3139              ).
3140  
3141              tagRow('hilight',
3142                  input_tag('hilight', $hilight)).
3143  
3144              tagRow('hilight_limit',
3145                  input_limit($limit)).
3146  
3147              $endform
3148          );
3149  
3150          if ($step == 'build')
3151          {
3152              $out .= tdb(tb($tag_name, $atts));
3153          }
3154  
3155          return $out;
3156      }
3157  
3158  // -------------------------------------------------------------
3159  
3160  	function tag_search_result_url()
3161      {
3162          global $step, $endform, $tag_name;
3163  
3164          return form(
3165              startTable('tagbuilder').
3166  
3167              tr(
3168                  tdcs(
3169                      hed(gTxt('tag_'.$tag_name), 3)
3170                  , 2)
3171              ).
3172  
3173              n.endTable()
3174          ).
3175  
3176          tdb(tb($tag_name));
3177      }
3178  
3179  // -------------------------------------------------------------
3180  
3181  	function tag_search_result_date()
3182      {
3183          global $step, $endform, $tag_name;
3184  
3185          $atts = gpsa(array(
3186              'format',
3187              'gmt',
3188              'lang'
3189          ));
3190  
3191          extract($atts);
3192  
3193          $out = form(
3194              startTable('tagbuilder').
3195  
3196              tr(
3197                  tdcs(
3198                      hed(gTxt('tag_'.$tag_name), 3)
3199                  , 2)
3200              ).
3201  
3202              tagRow('time_format',
3203                  fInput('text', 'format', $format, 'edit', '', '', 25)).
3204  
3205              tagRow('gmt',
3206                  yesno_pop('gmt', $gmt)).
3207  
3208              tagRow('locale',
3209                  fInput('text', 'lang', $lang, 'edit', '', '', 25)).
3210  
3211              $endform
3212          );
3213  
3214          if ($step == 'build')
3215          {
3216              $out .= tdb(tb($tag_name, $atts));
3217          }
3218  
3219          return $out;
3220      }
3221  
3222  // -------------------------------------------------------------
3223  
3224  	function tag_lang()
3225      {
3226          global $step, $endform, $tag_name;
3227  
3228          return form(
3229              startTable('tagbuilder').
3230  
3231              tr(
3232                  tdcs(
3233                      hed(gTxt('tag_'.$tag_name), 3)
3234                  , 2)
3235              ).
3236  
3237              n.endTable()
3238          ).
3239  
3240          tdb(tb($tag_name));
3241      }
3242  
3243  // -------------------------------------------------------------
3244  
3245  	function tag_breadcrumb()
3246      {
3247          global $step, $endform, $tag_name;
3248  
3249          $atts = gpsa(array(
3250              'class',
3251              'label',
3252              'link',
3253              'linkclass',
3254              'sep',
3255              'title',
3256              'wraptag'
3257          ));
3258  
3259          extract($atts);
3260  
3261          $out = form(
3262              startTable('tagbuilder').
3263  
3264              tr(
3265                  tdcs(
3266                      hed(gTxt('tag_'.$tag_name), 3)
3267                  , 2)
3268              ).
3269  
3270              tagRow('breadcrumb_separator',
3271                  fInput('text', 'sep', $sep, 'edit', '', '', 4)).
3272  
3273              tagRow('breadcrumb_linked',
3274                  yesno_pop('link', $link)).
3275  
3276              tagRow('linkclass',
3277                  fInput('text', 'linkclass', $linkclass, 'edit', '', '', 25)).
3278  
3279              tagRow('label',
3280                  fInput('text', 'label', $label, 'edit', '', '', 25)).
3281  
3282              tagRow('title',
3283                  fInput('text', 'title', $title, 'edit', '', '', 25)).
3284  
3285              tagRow('wraptag',
3286                  input_tag('wraptag', $wraptag)).
3287  
3288              tagRow('class',
3289                  fInput('text', 'class', $class, 'edit', '', '', 25)).
3290  
3291              $endform
3292          );
3293  
3294          if ($step == 'build')
3295          {
3296              $out .= tdb(tb($tag_name, $atts));
3297          }
3298  
3299          return $out;
3300      }
3301  
3302  // -------------------------------------------------------------
3303  
3304  	function tag_image()
3305      {
3306          global $step, $endform, $tag_name, $img_dir;
3307  
3308          $atts = gpsa(array(
3309              'class',
3310              'escape',
3311              'html_id',
3312              'style',
3313              'wraptag',
3314  
3315              'alt',
3316              'caption',
3317              'h',
3318              'id',
3319              'w',
3320          ));
3321  
3322          extract($atts);
3323  
3324          $ext = gps('ext');
3325          $type = gps('type');
3326  
3327          $types = array(
3328              'textile'            => 'Textile',
3329              'textpattern' => 'Textpattern',
3330              'xhtml'                => 'XHTML'
3331          );
3332  
3333          $out = form(
3334              startTable('tagbuilder').
3335  
3336              tr(
3337                  tdcs(
3338                      hed(gTxt('tag_'.$tag_name), 3)
3339                  , 2)
3340              ).
3341  
3342              tagRow('type',
3343                  ''.selectInput('type', $types, ($type ? $type : 'textpattern'), true)).
3344  
3345              tagRow('escape',
3346                  escape_pop($escape)).
3347  
3348              tagRow('html_id',
3349                  fInput('text', 'html_id', $html_id, 'edit', '', '', 25)).
3350  
3351              tagRow('class',
3352                  fInput('text', 'class', $class, 'edit', '', '', 25)).
3353  
3354              tagRow('inline_style',
3355                  fInput('text', 'style', $style, 'edit', '', '', 25)).
3356  
3357              tagRow('wraptag',
3358                  fInput('text', 'wraptag', $wraptag, 'edit', '', '', 25)).
3359  
3360              hInput('id', $id).
3361              hInput('ext', $ext).
3362              hInput('w', $w).
3363              hInput('h', $h).
3364              hInput('alt', $alt).
3365              hInput('caption', $caption).
3366  
3367              $endform
3368          );
3369  
3370          if ($step == 'build')
3371          {
3372              if ($escape == 'html')
3373              {
3374                  $alt = str_replace('&', '&#38;', htmlspecialchars($alt));
3375                  $caption = str_replace('&', '&#38;', htmlspecialchars($caption));
3376              }
3377  
3378              $url = hu.$img_dir.'/'.$id.$ext;
3379  
3380              switch ($type)
3381              {
3382                  case 'textile':
3383                      $alt = ($alt) ? ' ('.$alt.')' : '';
3384  
3385                      if ($wraptag)
3386                      {
3387                          if ($class)
3388                          {
3389                              $wraptag .= '('.$class;
3390  
3391                              if ($html_id)
3392                              {
3393                                  $wraptag .= '#'.$html_id;
3394                              }
3395  
3396                              $wraptag .= ')';
3397                          }
3398  
3399                          elseif ($html_id)
3400                          {
3401                              $wraptag .= "(#$html_id)";
3402                          }
3403  
3404                          if ($style)
3405                          {
3406                              $wraptag .= '{'.$style.'}';
3407                          }
3408  
3409                          $wraptag .= '. ';
3410                      }
3411  
3412                      $out .= tdb(
3413                          $wraptag.'!'.$url.$alt.'!'
3414                      );
3415                  break;
3416  
3417                  case 'xhtml':
3418                      $alt     = ($alt)     ? ' alt="'.$alt.'"' : '';
3419                      $caption = ($caption) ? ' title="'.$caption.'"' : '';
3420                      $class   = ($class)   ? ' class="'.$class.'"' : '';
3421                      $html_id = ($html_id) ? ' id="'.$html_id.'"' : '';
3422                      $style   = ($style)   ? ' style="'.$style.'"' : '';
3423  
3424                      $out .= tdb(
3425                          ($wraptag ? "<$wraptag>" : '').
3426                          '<img src="'.$url.'" width="'.$w.'" height="'.$h.'"'.$alt.$caption.$html_id.$class.$style.' />'.
3427                          ($wraptag ? "</$wraptag>" : '')
3428                      );
3429                  break;
3430  
3431                  case 'textpattern':
3432                  default:
3433  
3434                      $atts = array(
3435                          'class'   => $class,
3436                          'html_id' => $html_id,
3437                          'id'      => $id,
3438                          'style'   => $style,
3439                          'wraptag' => $wraptag
3440                      );
3441  
3442                      $out .= tdb(tb($tag_name, $atts));
3443                  break;
3444              }
3445          }
3446  
3447          return $out;
3448      }
3449  
3450  // -------------------------------------------------------------
3451  
3452  	function tag_file_download()
3453      {
3454          global $step, $endform, $tag_name;
3455  
3456          $atts = gpsa(array(
3457              'form',
3458              'id'
3459          ));
3460  
3461          extract($atts);
3462  
3463          $out = form(
3464              startTable('tagbuilder').
3465  
3466              tr(
3467                  tdcs(
3468                      hed(gTxt('tag_'.$tag_name), 3)
3469                  , 2)
3470              ).
3471  
3472              tagRow('id',
3473                  input_id($id)).
3474  
3475              tagRow('form',
3476                  form_pop('form', 'file', $form)).
3477  
3478              $endform
3479          );
3480  
3481          if ($step == 'build')
3482          {
3483              $out .= tdb(tb($tag_name, $atts));
3484          }
3485  
3486          return $out;
3487      }
3488  
3489  // -------------------------------------------------------------
3490  
3491  	function tag_file_download_list()
3492      {
3493          global $step, $endform, $tag_name;
3494  
3495          $atts = gpsa(array(
3496              'break',
3497              'category',
3498              'form',
3499              'label',
3500              'labeltag',
3501              'limit',
3502              'sort',
3503              'wraptag',
3504          ));
3505  
3506          $asc = ' ('.gTxt('ascending').')';
3507          $desc = ' ('.gTxt('descending').')';
3508  
3509          $sorts = array(
3510              'filename asc'     => gTxt('file_name').$asc,
3511              'filename desc'     => gTxt('file_name').$desc,
3512              'downloads asc'     => gTxt('downloads').$asc,
3513              'downloads desc' => gTxt('downloads').$desc,
3514              'rand()'                 => 'Random'
3515          );
3516  
3517          extract($atts);
3518  
3519          $out = form(
3520              startTable('tagbuilder').
3521  
3522              tr(tdcs(hed(gTxt('tag_'.$tag_name),3),2) ).
3523  
3524              tagRow('category',
3525                  file_category_pop($category)).
3526  
3527              tagRow('sort',
3528                  ' '.selectInput('sort', $sorts, $sort, true)).
3529  
3530              tagRow('limit',
3531                  input_limit($limit)).
3532  
3533              tagRow('label',
3534                  fInput('text', 'label', $label, 'edit', '', '', 25)).
3535  
3536              tagRow('labeltag',
3537                  input_tag('labeltag', $labeltag)).
3538  
3539              tagRow('wraptag',
3540                  input_tag('wraptag',$wraptag)).
3541  
3542              tagRow('break',
3543                  input_tag('break',$break)).
3544  
3545              tagRow('form',
3546                  form_pop('form','file',$form)).
3547  
3548              $endform
3549          );
3550  
3551          if ($step == 'build')
3552          {
3553              $out .= tdb(tb($tag_name, $atts));
3554          }
3555  
3556          echo $out;
3557      }
3558  
3559  // -------------------------------------------------------------
3560  
3561  	function tag_file_download_created()
3562      {
3563          global $step, $endform, $tag_name;
3564  
3565          $atts = gpsa(array(
3566              'format'
3567          ));
3568  
3569          extract($atts);
3570  
3571          $out = form(
3572              startTable('tagbuilder').
3573  
3574              tr(
3575                  tdcs(
3576                      hed(gTxt('tag_'.$tag_name), 3)
3577                  , 2)
3578              ).
3579  
3580              tagRow('time_format',
3581                  fInput('text', 'format', $format, 'edit', '', '', 15)).
3582  
3583              $endform
3584          );
3585  
3586          if ($step == 'build')
3587          {
3588              $out .= tdb(tb($tag_name, $atts));
3589          }
3590  
3591          return $out;
3592      }
3593  
3594  // -------------------------------------------------------------
3595  
3596  	function tag_file_download_modified()
3597      {
3598          global $step, $endform, $tag_name;
3599  
3600          $atts = gpsa(array(
3601              'format'
3602          ));
3603  
3604          extract($atts);
3605  
3606          $out = form(
3607              startTable('tagbuilder').
3608  
3609              tr(
3610                  tdcs(
3611                      hed(gTxt('tag_'.$tag_name), 3)
3612                  , 2)
3613              ).
3614  
3615              tagRow('time_format',
3616                  fInput('text', 'format', $format, 'edit', '', '', 15)).
3617  
3618              $endform
3619          );
3620  
3621          if ($step == 'build')
3622          {
3623              $out .= tdb(tb($tag_name, $atts));
3624          }
3625  
3626          return $out;
3627      }
3628  
3629  // -------------------------------------------------------------
3630  
3631  	function tag_file_download_size()
3632      {
3633          global $step, $endform, $tag_name;
3634  
3635          $atts = gpsa(array(
3636              'decimals',
3637              'format'
3638          ));
3639  
3640          $formats = array(
3641              'b'     => 'Bytes',
3642              'kb' => 'Kilobytes',
3643              'mb' => 'Megabytes',
3644              'gb' => 'Gigabytes',
3645              'tb' => 'Terabytes',
3646              'pb' => 'Petabytes'
3647          );
3648  
3649          extract($atts);
3650  
3651          $out = form(
3652              startTable('tagbuilder').
3653  
3654              tr(
3655                  tdcs(hed(gTxt('tag_'.$tag_name), 3)
3656              , 2)
3657              ).
3658  
3659              tagRow('size_format',
3660                  ' '.selectInput('format', $formats, $format, true)).
3661  
3662              tagRow('decimals',
3663                  fInput('text', 'decimals', $decimals, 'edit', '', '', 4)).
3664  
3665              $endform
3666          );
3667  
3668          if ($step == 'build')
3669          {
3670              $out .= tdb(tb($tag_name, $atts));
3671          }
3672  
3673          return $out;
3674      }
3675  
3676  // -------------------------------------------------------------
3677  
3678  	function tag_file_download_link()
3679      {
3680          global $step, $endform, $tag_name, $permlink_mode;
3681  
3682          $atts = gpsa(array(
3683              'filename',
3684              'id'
3685          ));
3686  
3687          extract($atts);
3688  
3689          $thing = gps('thing');
3690  
3691          $type = gps('type');
3692          $description = gps('description');
3693  
3694          $types = array(
3695              'textile'            => 'Textile',
3696              'textpattern' => 'Textpattern',
3697              'xhtml'                => 'XHTML'
3698          );
3699  
3700          $out = form(
3701              startTable('tagbuilder').
3702  
3703              tr(
3704                  tdcs(
3705                      hed(gTxt('tag_'.$tag_name), 3)
3706                  , 2)
3707              ).
3708  
3709              tagRow('type',
3710                  ''.selectInput('type', $types, ($type ? $type : 'textpattern'), true)).
3711  
3712              tagRow('id',
3713                  input_id($id)).
3714  
3715              tagRow('filename',
3716                  fInput('text', 'filename', $filename, 'edit', '', '', 25)).
3717  
3718              tagRow('link_text',
3719                  fInput('text', 'thing', ($thing ? $thing : $filename), 'edit', '', '', 25)).
3720  
3721              tagRow('description',
3722                  '<textarea name="description" cols="22" rows="3">'.$description.'</textarea>').
3723  
3724              $endform
3725          );
3726  
3727          if ($step == 'build')
3728          {
3729              $description = str_replace('&', '&#38;', htmlspecialchars($description));
3730  
3731              $url = ($permlink_mode == 'messy') ?
3732                  hu.'index.php?s=file_download'.a.'id='.$id:
3733                  hu.gTxt('file_download').'/'.$id.($filename ? '/'.$filename : '');
3734  
3735              switch ($type)
3736              {
3737                  case 'textile':
3738                      $thing = ($thing) ? $thing : $filename;
3739                      $description = ($description) ? ' ('.$description.')' : '';
3740  
3741                      $out .= tdb('"'.$thing.$description.'":'.$url);
3742                  break;
3743  
3744                  case 'xhtml':
3745                      $thing = ($thing) ? $thing : $filename;
3746                      $description = ($description) ? ' title="'.$description.'"' : '';
3747  
3748                      $out .= tdb('<a href="'.$url.'"'.$description.'>'.$thing.'</a>');
3749                  break;
3750  
3751                  case 'textpattern':
3752                  default:
3753                      $atts = array('id' => $id);
3754                      $thing = ($thing) ? $thing : '<txp:file_download_name />';
3755  
3756                      $out .= tdb(tb($tag_name, $atts, $thing));
3757                  break;
3758              }
3759          }
3760  
3761          return $out;
3762      }
3763  
3764  // -------------------------------------------------------------
3765  
3766  	function tag_file_download_name()
3767      {
3768          global $step, $endform, $tag_name;
3769  
3770          return form(
3771              startTable('tagbuilder').
3772  
3773              tr(
3774                  tdcs(
3775                      hed(gTxt('tag_'.$tag_name), 3)
3776                  , 2)
3777              ).
3778  
3779              n.endTable()
3780          ).
3781  
3782          tdb(tb($tag_name));
3783      }
3784  
3785  // -------------------------------------------------------------
3786  
3787  	function tag_file_download_downloads()
3788      {
3789          global $step, $endform, $tag_name;
3790  
3791          return form(
3792              startTable('tagbuilder').
3793  
3794              tr(
3795                  tdcs(
3796                      hed(gTxt('tag_'.$tag_name), 3)
3797                  , 2)
3798              ).
3799  
3800              n.endTable()
3801          ).
3802  
3803          tdb(tb($tag_name));
3804      }
3805  
3806  // -------------------------------------------------------------
3807  
3808  	function tag_file_download_category()
3809      {
3810          global $step, $endform, $tag_name;
3811  
3812          $atts = gpsa(array(
3813              'class',
3814              'escape',
3815              'wraptag'
3816          ));
3817  
3818          extract($atts);
3819  
3820          $out = form(
3821              startTable('tagbuilder').
3822  
3823              tr(
3824                  tdcs(
3825                      hed(gTxt('tag_'.$tag_name), 3)
3826                  , 2)
3827              ).
3828  
3829              tagRow('escape',
3830                  escape_pop($escape)).
3831  
3832              tagRow('wraptag',
3833                  input_tag('wraptag', $wraptag)).
3834  
3835              tagRow('class',
3836                  fInput('text', 'class', $class, 'edit', '', '', 25)).
3837  
3838              $endform
3839          );
3840  
3841          if ($step == 'build')
3842          {
3843              $out .= tdb(tb($tag_name, $atts));
3844          }
3845  
3846          return $out;
3847      }
3848  
3849  // -------------------------------------------------------------
3850  
3851  	function tag_file_download_description()
3852      {
3853          global $step, $endform, $tag_name;
3854  
3855          $atts = gpsa(array(
3856              'class',
3857              'escape',
3858              'wraptag'
3859          ));
3860  
3861          extract($atts);
3862  
3863          $out = form(
3864              startTable('tagbuilder').
3865  
3866              tr(
3867                  tdcs(
3868                      hed(gTxt('tag_'.$tag_name), 3)
3869                  , 2)
3870              ).
3871  
3872              tagRow('escape',
3873                  escape_pop($escape)).
3874  
3875              tagRow('wraptag',
3876                  input_tag('wraptag', $wraptag)).
3877  
3878              tagRow('class',
3879                  fInput('text', 'class', $class, 'edit', '', '', 25)).
3880  
3881              $endform
3882          );
3883  
3884          if ($step == 'build')
3885          {
3886              $out .= tdb(tb($tag_name, $atts));
3887          }
3888  
3889          return $out;
3890      }
3891  
3892  ?>


Generated: Thu May 21 23:03:01 2009 Cross-referenced by PHPXref 0.7